Feasibility of using OpenMV in a bean sorter

OpenMV related project discussion.
dZed
Posts: 2
Joined: Fri Sep 15, 2017 9:51 am

Feasibility of using OpenMV in a bean sorter

Postby dZed » Fri Sep 15, 2017 10:26 am

Hello, all!

New to machine vision, but not new to electronics, coding, or electromechanics.

I'm in the early stages of helping my friend build an automated, 'semi-industrial' bean sorter. He grows beans that have a relatively high amount of genetic variability, and would like to separate out the different subtypes, among other sorting needs (such as sorting by size, "non-bean-ness," etc). This 'type sorting' is the first goal. An example of what I'm talking about is attached as a picture. All of those beans come from the same species, and a single bean pod may contain all of these subtypes. I do recognize that there's at least 2 bins in there that look virtually identical to me -- I really need to ask my friend how he differentiated between those two, specifically. But the rest have (I think) pretty distinct differences to human eyes.

The general mechanical design of such a system is well-established (http://www.satake-usa.com/images/princi ... orting.jpg, for example). I do not plan on reinventing the wheel.

Regarding the sensing aspects, however: Using simpler methods, like PIRs or color sensors, I believe will be impossible -- these ain't brightly colored M&Ms or skittles -- though I will be doing some experiments to verify that a simpler, cheaper approach won't work. Assuming it won't, that pretty much leaves me with machine vision. I have not purchased the OpenMV board yet, but I believe it is the best option (out of a camera with a Pi using OpenCV, the JeVois, the HiCat Livera, and the CMUcam5 Pixy -- if anyone knows of others, please let me know).

I plan on sending beans down a chute, either using a gate to trigger the camera or use the camera to look for motion, when the bean is in front of a well-lit background (ie whatever I determine to be appropriate based on guides to machine vision lighting such as this one: http://www.ni.com/white-paper/6901/en/), take a color picture, perform some statistical analysis on the blob that holds the bean to determine what kind of bean it is, and then either trigger a pneumatic/mechanical classifying system with the OpenMV or send some signal to an Arudino to do the same.

My questions are:
1. Do you think this system is up for making the distinction between the types of beans in the picture? I believe this will be the hardest job this system will have to perform. Of course I plan on experimenting, but if the answer is an obvious 'no,' I can save $65.
2. Would an analysis based on color of the RGB channels be enough to distinguish between these beans? That was my initial guess at a process. I assumed I would 'train' the system by putting some n amount of the 'same' bean through and taking means, modes, medians, standard devs of the histograms (need to brush up on the appropriate statistical tools in this case) and determining some boundaries for identifying the different beans. Does this seem like the correct path forward?
3. Is the LED light on the OpenMV intended to light the space being photographed?
4. If I were to send beans down a ramp, take a single picture of each, capture a blob, do a histogram, and classify it, can anyone guess at what speed this could occur? I'm looking for generalities like "more than 5 times a second" or "1-2 seconds" or whatever.

Thanks, all.
Attachments
beans.jpg
beans.jpg (355.64 KiB) Viewed 1040 times
User avatar
kwagyeman
Posts: 2406
Joined: Sun May 24, 2015 2:10 pm

Re: Feasibility of using OpenMV in a bean sorter

Postby kwagyeman » Fri Sep 15, 2017 11:24 am

The OpenMV Cam is excellent at color tracking. Expect frame rates above 60 FPS.

As for doing this, we have a built in get histogram and get statistics methods which will output all the color info you like and more. We also have a find blobs method to find the bean given a set of color thresholds.

So, the OpenMV Cam does everything you want.

...

As for using it, the cameras LEDs are powerful by are just IR LEDs. You should hook up and external led driver to it that it can control. As for scene setup, you should have the OpenMV cam stare at a blank white bankground on startup which is well illuminated. Let autogain and white balance run, and then turn them off.

Beans coming through then will be obvious against the white background.

Note that you'll want to configure the camera optics to zoom in on each bean so you get a lot of detail. Color tracking and stats methods aren't particularly precise with a low pixel count. You'll be able to do this work with a res of 320x240 which will give you a lot of bean to work with.
Nyamekye,
dZed
Posts: 2
Joined: Fri Sep 15, 2017 9:51 am

Re: Feasibility of using OpenMV in a bean sorter

Postby dZed » Fri Sep 15, 2017 11:38 am

Thanks!

When you say "configure the camera optics" are you referring to the physical set up? As in, choosing a lens, how to position the camera physically, adjusting the field of view of the camera? Or are you referring to some type of digital configuration? Or both?

Basically, I would want the bean to take up as much space in the frame being captured as possible. The pushback is that I also want to move a lot of beans through the system, which would mean the bean would be traveling at speed in front of the lens. If I could take a high resolution picture that is "all bean," that's great, but if I have trouble getting the bean in the frame as it flies by, I would need to get a wider field of view. When you say the stats and color tracking aren't precise at a low pixel count, can you give me an estimate of how low is low? Is there a recommended minimum total pixel count in a blob, for instance?

Also, I've noticed that the 'blob' function captures a rectangle, which is fine with me, but does it include the non-colored aspects when calculating a histogram? For instance, if I have a white background, will it include the white background in the histogram? Or just the things it recognizes as a blob?

Thanks so much.
User avatar
kwagyeman
Posts: 2406
Joined: Sun May 24, 2015 2:10 pm

Re: Feasibility of using OpenMV in a bean sorter

Postby kwagyeman » Thu Nov 16, 2017 2:47 am

Woah, sorry, I forgot to answer more on this thread. I'm very sorry. You need to ping me sometimes since I get a little overloaded.

Are you still working on this and do you need help?
Nyamekye,

Return to “Project Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests