User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Mon Apr 23, 2018 9:56 pm

I fixated two gripper clamps into my workplate, for holding the 16mm plastic tubes with v2 camera on top and 70mm lens at bottom. It is not that easy, but the tube can be moved a bit up or down to find the optimal distance to object for clear picture. This photo shows new longest tube:
Image


Distance from v2 image sensor to lens is 64cm, distance from lens to object is 7.3cm,

I really need to find a better way to light the scene, at least allows the UV light to see enough for measuring.
Two 0.5mm distant pins don't fit anymore on photo when directed vertical.
So I turned the object slightly resulting in one pin showing left bottom, one on top right:
Image


I measure a rectangle between both pins, with one diagonal roughly vertical to top right pin. That rectangle roughly is between middle of both pins. Therefore the distance is sqrt(3168^2+2464^2)=4013 pixels. With 500μm distance that is new best 0.125μm/pixel resolution!

Given that reduction from 8cm to 7.3cm between lens and object again doubled resolution from 0.245μm/pixel to 0.125μm/pixel, there seems to be (much) more potential for v2 camera wrt resolution by using even longer tubes. And the room is 3m high above the gripper clamps, more than 4m at wall of middle of the house. Longest plastic tube I can buy is 2m (<1$), but they can be stacked since one side is wider.
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 7:08 am

Sorry for my late answer!

Very interesting!

Have you thought about telescopic tubes?

The resolution you can achieve is quite good indeed, however, I won't be able to carry a "portable" microscope of two meters or more :D

Did you try to test the resolution with the 20° lens and add the new extension on them to compare with the previous 0.77µm/pixel you add with, I think, two extension rings? Is it better with four?

Regards

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 11:19 am

I forgot about the 20° lens testing with 3rd and 4th extension ring.

So best resolution with maximally screwed out two extension rings and 20° lens was 0.77μm/pixel.

Just did measure with three (0.53μm/pixel) and four (0.40μm/pixel).
Distance from lens to object was 16mm with three, and 15mm with four extension rings.
Did a quick test with small tube, 13cm distance from v2 image sensor to lens has still 9mm distance lens to object for sharp image.

Four extension rings:
Image


Three extension rings:
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 11:36 am

Thanks!

Image seems still quite sharp with three. Do you think you can have a sharper image with 4 than the one you just took, or is it at its limit?

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 2:05 pm

Now sharp enough? ;-)
(Please right click the image, and zoom in, its 8MP photo)
Image


I really like my new 4 arm Realacc, but it is very difficult to change positions in sub-millimeter range with that. So I used my old soldering third hand and with that getting image sharp was no issue:
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 4:27 pm

I tried the 13cm tube again after I realized the difference between my tubes and the M12 extension rings. The extension rings don't let side light in, while the gray plastic tubes do. I taped the plastic tube with black, much better now. This image is not completely sharp, but should demonstrate that unlike the very bright images with tubes before, tubes that (nearly) prevent side light will perform as the extension rings. Here is a single pin end, partially covered by white color from the marker starting at that pin:
Image


With this much better resolution it is a challenge to get image sharp even with old soldering third hand. A better height modification mechanism is needed for such a microscope.
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Fri Apr 27, 2018 4:45 pm

Very impressive!

I hope I can order that soon!

I 'll indeed buy a microscope mount.

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Sat Apr 28, 2018 10:04 am

> I 'll indeed buy a microscope mount.
>
Good idea, I did not think about, found 10$ ones on aliexpress, but ordered aluminum alloy one from Banggood European warehouse for 19$:
https://www.banggood.com/Aluminum-Alloy ... 94155.html

Btw, the previous tube, 13cm v2 image sensor to lens distance image I showed is new record. I did measure same part in previous 0.40μm/pixel image and the new one, slightly new best resolution with 20° lens instead of 3.98° lens is now 0.12μm/pixel:

Code: Select all

0.40/(sqrt(884^2+1736^2)/sqrt(544^2+196^2))
.11872641840742660509
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sat Apr 28, 2018 11:19 am

I was thinking about this one yes!

0.12 µm/px with the 13 cl extension tube and 20° lens, is that right?

Very good!

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Fri Jul 06, 2018 3:22 pm

Dear all, some news from this project:

I finally ordered and received my RPI 3B, and a V2 camera.

I installed Raspbian on it, Picamera, and ImageJ.

Now, I can take these kind of image, after playing with the original lens for a while:

Image

I can also perform my particule analysis on it, using ImageJ to calculate the size and shape of every particule.

Now, I would like to make things more automated, the best thing to do would be:

After starting the RPI, clicking on a GPIO connected button, or better, a small keypad or keyboard: the 3.5 inch screen shows the preview of the camera, another button take an image and ask for its name (then I write it with the keyboard), another button launch the particule analysis of this image on imageJ, and a last button save the result on a txt file for exemple. Then I process another image....

Is it possible?

Regards.

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 7:30 am

Also, We can see a ghost effect on the edges of the image, is there anything I can do?

Image

Many thanks!

gordon77
Posts: 7727
Joined: Sun Aug 05, 2012 3:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 1:12 pm

Looks like chromatic aberration to me. Can you just use the red channel?

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 4:05 pm

I tried, and it's visible on every channel, but my picture is a jpg, maybe it's not supporting the splitting of channel?

I can also work with B&W images, do you think I'll have this issue If it took B&W ones?

gordon77
Posts: 7727
Joined: Sun Aug 05, 2012 3:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 4:55 pm

How do you identify a microfossil? Will this issue give false positives / negatives?

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 6:00 pm

Those images are not for identification, it's done before taking the picture. However, As I perform morphometric analysis on it (basically a binarisation, and shape and size analysis), I'm afraid that the specimens with the ghost effect appear larger than what they truly are.

gordon77
Posts: 7727
Joined: Sun Aug 05, 2012 3:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 6:23 pm

sonof wrote:
Sat Jul 07, 2018 7:30 am
Also, We can see a ghost effect on the edges of the image, is there anything I can do?

Image

Many thanks!
If you filter out the green and blue, then turn to b&w, then increase the contrast is that any use?
You'd have to find a way to automate it.
Attachments
IMG_20180707_192151.jpg
IMG_20180707_192151.jpg (6.9 KiB) Viewed 12649 times

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 8:21 pm

I'm not sure isolating the red channel change anything here:

Here is the red channel only (after B&W, brightness and contrast adjustment):

Image

and here is the original RGB, after the same adjustment:

Image

gordon77
Posts: 7727
Joined: Sun Aug 05, 2012 3:12 pm

Re: Creating a RPI-assisted microscope

Sat Jul 07, 2018 8:33 pm

OK the high contrast is removing the darker aberrations.

sonof
Posts: 21
Joined: Tue Apr 10, 2018 12:12 pm

Re: Creating a RPI-assisted microscope

Sun Jul 08, 2018 8:35 am

Yes, and it doesn't seem to be affecting the binarisation anyway

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Tue Dec 25, 2018 1:58 pm

HermannSW wrote:
Sat Apr 28, 2018 10:04 am
> I 'll indeed buy a microscope mount.
>
Good idea, I did not think about, found 10$ ones on aliexpress, but ordered aluminum alloy one from Banggood European warehouse for 19$:
https://www.banggood.com/Aluminum-Alloy ... 94155.html
That delivery did never arrive, I got it resent and after it arrived I never looked into it again.

Today I looked in how to firmly mount Raspberry v1 camera with 4 M12 distance rings and 20° lens to the microscope holder -- I doubt that they planned for two Lego pieces and M12 distance rings to fit, but it fits firmly. And it is so easy using microscope mount to find position of sharp image!
Image


The photo shows 0.6mm spacing contacts, and I measured 2418-78=2340 pixels for 1.2mm. Therefore resolution of this photo is 1200/2340=0.513µm/pixel:
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Tue Dec 25, 2018 3:27 pm

Until now I always used raspistill for taking microscope images.
Today I recorded a full HD video with v1 camera (0.7µm/pixel resolution).
First I did adjust to FPC to DIP adapter board, then removed that board and adjusted to alloy microscope stand:
https://www.youtube.com/watch?v=FSVwpH3 ... e=youtu.be
Image


P.S:
I did record a second video.
First I did tap repeatedly on microscope stand.
As you can see the view only moves few pixels by that, that is few micrometers only.
Then I did change lighting of the scene, that allowed to better see the 3-dimensional structure of alloy stand:
https://www.youtube.com/watch?v=qMYvwXD ... e=youtu.be
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

User avatar
mikronauts
Posts: 2823
Joined: Sat Jan 05, 2013 7:28 pm

Re: Creating a RPI-assisted microscope

Tue Dec 25, 2018 6:13 pm

REALLY nice work guys!

I will follow this thread and build my own for my smt work.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Tue Dec 25, 2018 7:43 pm

Another video, this time I tried to record something moving/living.
I took a drop of slightly muddy flower water on a small plexiglass piece, and did a sheet of white paper between plexiglass and alloy stand.
The initial video view shows the paper structure at the bottom.
Then then view moves up and up and shows some stuff in the water drop.
Finally a long thin line with very small markers appears.
I moved the plexiglass piece in order to follow that line.
From the full HD video I extracted a frame with totem movie player.
I measured the thickness of the long line as 39.4 pixel or 27.5µm.
The whole horizontal view length is 1920*0.7=1344µm=1.344mm.
No luck this time to find something living, but following the long line is movement as well.
https://www.youtube.com/watch?v=PqOUdYv ... e=youtu.be
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Thu Dec 27, 2018 8:07 pm

This is just for fun, full HD video traversing 65mm of Pi Zero from left to right. With 0.7µm/pixel resolution video view width is 1.344mm, so the travel is more than 48 video width wide:
https://www.youtube.com/watch?v=yM2z0k6 ... e=youtu.be
Image


Looks completely different to what I can see directly with my eyes:
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

User avatar
HermannSW
Posts: 6093
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Re: Creating a RPI-assisted microscope

Thu Dec 27, 2018 10:50 pm

Just read this, translates to 8-12 pixels at 0.7µm/pixel resolution:
A typical human red blood cell has a disk diameter of approximately 6.2–8.2 µm and a thickness at the thickest point of 2–2.5 µm and a minimum thickness in the centre of 0.8–1 µm, being much smaller than most other human cells.

I used raspistill again to take photo of blood drop between two plexiglass pieces, with resolution 0.52µm/pixel:
Image


This is the 2592x1944 photo taken, left side is blood drop, the few dark parts are dirt on image sensor:
Image


Finally I took photo from just the paper, with nothing between it and lens:
Image
https://github.com/Hermann-SW/RSA_numbers_factored
https://stamm-wilbrandt.de/GS_cam_1152x192@304fps
https://hermann-sw.github.io/planar_graph_playground
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/

Return to “Camera board”