$50 camera good for microscopy with machine vision code included

152 views
Skip to first unread message

John Griessen

unread,
Jan 31, 2015, 8:39:04 AM1/31/15
to diy...@googlegroups.com
I was telling Nathan how flex circuits like are used in LCD screens for desktops of a few years ago
are a commodity process of making layers with 50 micron width and space between and might be
repurposed to fabbing microfluidics inexpensively. I took a flatbed scanner photo of the flex circuit
that could not get down to its resolution, and emailed that, and
offered to send him a piece to look at under a microscope,
since I did not have any good digital camera for microscope photos.

I was saying how I'd take the lens off of a Canon powershot for that, but it still has a crummy user interface
for microphotography, which triggered him telling me about this:


https://www.kickstarter.com/projects/botthoughts/openmv-cam-embedded-machine-vision

It's got a perfect user interface for microphotography -- python programmed machine vision
programs that can recognize features in a scene. Just add a little problem-specific
development and you have a cell counter program. Well, add that not-yet-existing, accurate and inexpensive
plastic molded microgrid to drop on your samples then top with a cover slip, *then*
hit the go button of the counting program...

John

Simon Quellen Field

unread,
Jan 31, 2015, 10:55:07 AM1/31/15
to diybio
The software might be nice, but the Canon has higher resolution, lower noise, higher video speeds, and a larger sensor.

That won't matter if all you need is 50 micron (or even 1 micron) resolution. But I've been getting close to 0.2 micron resolution using a Canon T3i (a fairly old camera) and a homemade microscope (I also use an excellent phase-contrast research microscope and get similar resolution but with much less aberration).

When controlled by my computer, I find the Canon to be quite suited to microphotography. You look at the computer monitor, and click on the shutter icon to take the picture. It's pretty friendly.

-----
Get a free science project every week! "http://scitoys.com/newsletter.html"




John

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
--- You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/54CCDBBC.1030100%40industromatic.com.
For more options, visit https://groups.google.com/d/optout.

John Griessen

unread,
Jan 31, 2015, 12:00:13 PM1/31/15
to diy...@googlegroups.com
On 01/31/2015 09:54 AM, Simon Quellen Field wrote:
> When controlled by my computer, I find the Canon to be quite suited to microphotography.

What's the software? Sounds good... FOS SW preferred...

Simon Quellen Field

unread,
Jan 31, 2015, 8:02:31 PM1/31/15
to diybio
The camera comes with software from Canon  for controlling it via USB.
There is also an SDK if you want to design your own interface.
There is also Magic Lantern that adds features to the software in the camera. It is FOSS. If is is anything like CHDK (for the PowerShot cameras), it would give you the ability to run programs inside the camera itself. If not, you could add that capability.

-----
Get a free science project every week! "http://scitoys.com/newsletter.html"


--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
--- You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.

Brian Degger

unread,
Feb 1, 2015, 5:47:22 AM2/1/15
to diy...@googlegroups.com

Thanks.
Magic Lantern looks like a great thing.
Has focus stacking built in....multiple photos at slightly different focus points.

-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en

Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.

To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.

Otto Heringer

unread,
Feb 1, 2015, 6:51:29 PM2/1/15
to diy...@googlegroups.com

This cam on kickstarter seems to be pretty cool.
I was doing a cell counter project last year and was using a homemade webcam microscope with a large microchannel about 150-200 micrometers wide (made of polycarbonate "scratched" by a laser cutter) - my problem was the 3d printed peristaltic pump, but nevermind.
I have friends that coded programs in matlab and later in javascrip (with a crazy library) to detect the individual microalgae cells. This kickstarter thing might be interesting for my project as well.
Thanks for sharing this info!

Cory Geesaman

unread,
Feb 1, 2015, 7:14:20 PM2/1/15
to diy...@googlegroups.com
I picked one of these up for a project the other week - has a bit more resolution and a cheaper pricetag.
They also have one with a smaller form factor and bigger lens at http://www.uctronics.com/mega-pixel-camera-module-ov5642-cs-mount-lens-p-1869.html

Nathan McCorkle

unread,
Feb 1, 2015, 7:16:28 PM2/1/15
to diybio
There's also the 50 FPS (with detection happening at 640x480 res) Pixy
CMUCam5, which also has Python interfaces... from looking at both this
and openMV I'd tend to say the Pixy might be more 'bang for your buck'
(value/$):
http://www.cmucam.org/projects/cmucam5/wiki/Introduction_and_Background

and it's available now, and has generations of development history behind it too
$75
https://www.adafruit.com/product/1906
> https://groups.google.com/d/msgid/diybio/CAB%3DC6ZKp1M4Nwvxx09c638z88UjobCML%3DJLSVxyPf%3DBRaSCzhQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
-Nathan

Nathan McCorkle

unread,
Feb 1, 2015, 7:24:11 PM2/1/15
to diybio
On Sun, Feb 1, 2015 at 4:14 PM, Cory Geesaman <co...@geesaman.com> wrote:
> I picked one of these up for a project the other week - has a bit more
> resolution and a cheaper pricetag.
> http://www.uctronics.com/mega-pixel-camera-module-ov5642-1080p-jpeg-output-p-1420.html
> They also have one with a smaller form factor and bigger lens at
> http://www.uctronics.com/mega-pixel-camera-module-ov5642-cs-mount-lens-p-1869.html
>

Those both look pretty nice, they have the important 8/10-bit RGB
output (meaning it's uncompressed, so you don't get compression noise
if you're doing machine vision).

So how do we mount these properly to microscopes now? The larger lens
version says it has a 'CS' camera mount.

I have two microscopes, one with a film-camera port on it
(fluorescense microscope), and one with just eye oculars. It'd be
great to have cameras on either/both.


With infinity-corrected microscope objective lenses, we should be able
to build our own microscopes too... this is a good howto, but it still
isn't easy enough to understand I think:
http://openlabtools.eng.cam.ac.uk/Instruments/Microscope/Optics/

Cory Geesaman

unread,
Feb 1, 2015, 7:30:07 PM2/1/15
to diy...@googlegroups.com
The one I picked up has two mount holes - the topology of the PCB itself (solder points and such) mean you'll need standoffs or a custom fit piece if you want it mounted on metal.  You could always do it cheaply with epoxy and some kind of scaffold to stick the epoxy to.

Cory Geesaman

unread,
Feb 1, 2015, 7:31:04 PM2/1/15
to diy...@googlegroups.com
The one I picked up has two mount holes - the topology of the PCB itself (solder points and such) mean you'll need standoffs or a custom fit piece if you want it mounted on metal.  You could always do it cheaply with epoxy and some kind of scaffold to stick the epoxy to.

On Sunday, February 1, 2015 at 7:24:11 PM UTC-5, Nathan McCorkle wrote:

Nathan McCorkle

unread,
Feb 1, 2015, 7:54:53 PM2/1/15
to diybio
>
> On Sunday, February 1, 2015 at 7:24:11 PM UTC-5, Nathan McCorkle wrote:
>> So how do we mount these properly to microscopes now? The larger lens
>> version says it has a 'CS' camera mount.

On Sun, Feb 1, 2015 at 4:30 PM, Cory Geesaman <co...@geesaman.com> wrote:
> The one I picked up has two mount holes - the topology of the PCB itself
> (solder points and such) mean you'll need standoffs or a custom fit piece if
> you want it mounted on metal. You could always do it cheaply with epoxy and
> some kind of scaffold to stick the epoxy to.

Hmm, I guess what always has confused me was how to adjust for
non-parallel image and sensor planes, as well as getting the right
height from the sensor relative to the mounting hole on the
microscope. And if a lens is needed, how to figure out which one, and
where to buy it with the most-compatible/easiest-to-modify mount.

Maybe this is something you just have to buy and iteratively
rig-things-up until you figure out a good design.

John Griessen

unread,
Feb 1, 2015, 10:28:54 PM2/1/15
to diy...@googlegroups.com
On 02/01/2015 06:16 PM, Nathan McCorkle wrote:
> Pixy
> CMUCam5, which also has Python interfaces... from looking at both this
> and openMV I'd tend to say the Pixy might be more 'bang for your buck'

There's a big ease of coding and debugging difference in "has python interface"
and "has python command line" while running python internally.
The price of the module is not the BOM cost either. BOM cost of micropython
based on the ARM STM32 mcu is very good.

But... if you want nice micro-photographs right away, I am sure Simon's
recommendations of FOSS on Canon digicams is the way to go.

For machine vision based on python running on a $6 mcu, the
particular image sensor chip is not even the main thing. If OpenMV Cam's chip is
not perfect, a follow on will be closer to perfection since the inexpensive mcu hdwe + FOSS
machine vision code makes a huge value, and the image sensors to go with it can evolve better
over time.

Nathan McCorkle

unread,
Feb 1, 2015, 11:06:53 PM2/1/15
to diybio
On Sun, Feb 1, 2015 at 7:32 PM, John Griessen <jo...@industromatic.com> wrote:
> On 02/01/2015 06:16 PM, Nathan McCorkle wrote:
>>
>> Pixy
>> CMUCam5, which also has Python interfaces... from looking at both this
>> and openMV I'd tend to say the Pixy might be more 'bang for your buck'
>
>
> There's a big ease of coding and debugging difference in "has python
> interface"
> and "has python command line" while running python internally.

True, I do think that 15 FPS could be limiting for some things like
live cell tracking. I wonder how easy it is to interface with the
CMUCam Pixy, I've been tinkering more and more with openCV's Python
library and am super happy to be able to bang out little apps. I don't
know if it would be possible or reasonable to try and get that running
on the MCU of the openMV... in which case I guess you'd just want the
frames getting to something else as fast as possible... so maybe
Cory's cameras then and a USB2/USB3 link... unless real-time
timestamps are required for processing (not sure if those cams would
provide that, but I doubt not, as you'd need an RTC I think).

> The price of the module is not the BOM cost either. BOM cost of micropython
> based on the ARM STM32 mcu is very good.
>
> But... if you want nice micro-photographs right away, I am sure Simon's
> recommendations of FOSS on Canon digicams is the way to go.

Well I looked up that firmware/addon and the camera it seemed to run
on goes for $900-1100 around here on craigslist... I'm mostly
interested in machine vision too, so super high-quality is not as
important I think right now.

> For machine vision based on python running on a $6 mcu, the
> particular image sensor chip is not even the main thing. If OpenMV Cam's
> chip is
> not perfect, a follow on will be closer to perfection since the inexpensive
> mcu hdwe + FOSS
> machine vision code makes a huge value, and the image sensors to go with it
> can evolve better
> over time.

Hmm, I wonder if you can get higher FPS with the openMV if you turn
off all/most on-board vision processing and throw timestamps on with
RTC for a PC to deal with.

I guess I need to look into openMV's available libraries/features.

Simon Quellen Field

unread,
Feb 2, 2015, 2:34:19 PM2/2/15
to diybio
For normal (not infinity corrected) objectives, things are really easy.

Remove the eyepiece from the microscope.

Where the eyepiece was, the light will project onto anything -- a piece of paper, the ceiling, a camera sensor without the camera lens. It is a real image.

The objective lenses are designed to work with a particular microscope tube length -- usually 160 millimeters. At distances above or below this, you get slight distortions that are easily corrected in software, but are often not noticeable anyway.

The farther away the sensor is from the objective, the more magnification you get. For most sensors, the actual resolution is larger than the size of the pixels in the sensor. When you look at the resulting image pixel-for-pixel on a computer screen, it will not look sharp. That is OK -- you just have more pixels than you need. So even a cheap low-resolution camera sensor can get you 250 nanometer resolution, which is close to the limit of your objective lens.

Infinity corrected objectives need another lens in order to form an image.
This is located inside the microscope tube. So even with infinity corrected objectives, you can remove the eyepiece and project a real image onto your sensor, projection screen, or ceiling.

-----
Get a free science project every week! "http://scitoys.com/newsletter.html"


--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.

Simon Quellen Field

unread,
Feb 2, 2015, 2:40:34 PM2/2/15
to diybio

On Sun, Feb 1, 2015 at 8:06 PM, Nathan McCorkle <nmz...@gmail.com> wrote:
Well I looked up that firmware/addon and the camera it seemed to run
on goes for $900-1100 around here on craigslist... I'm mostly
interested in machine vision too, so super high-quality is not as
important I think right now.

​I'm not sure what you were looking at.
The camera I currently use is an old Canon T3i.
Remember, you don't need a lens -- the camera can be purchased "body-only".
Reply all
Reply to author
Forward
0 new messages