differentiating between cotton and plant

Discussion related to "under the hood" OpenMV topics.
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

differentiating between cotton and plant

Postby krishnakumar77777 » Mon Oct 15, 2018 6:38 am

Hi,
I need to differentiate between the colour of the cotton in the plant and sun light on leaf that also observed by cam as white colour. Please help me to differentiate between the actual cotton white and light reflected by the plant's leaves.

Thanks in advance
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Tue Oct 16, 2018 1:03 am

Hi, please got to our FIle -> Examples -> Color Tracking. Click on the single color tracking RGB565 script. And then open the threshold editor under Tools -> Machine Vision -> Threshold Editor.

Thanks,
Nyamekye,
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Tue Oct 16, 2018 1:46 am

Thank you.
I have done that and taken threshold values from frame buffer. The cam shows both the cotton and leaf as detected white blob. Will the polarizing filter helps us in order to make the leaf appear green by filtering the solar light??
Kindly reply asap.
Thanks again
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Tue Oct 16, 2018 2:08 am

Pic?
Nyamekye,
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Tue Oct 16, 2018 3:02 am

Kindly see the images in which both cotton and leaves are detected as same in sunlight.
Attachments
Screenshot from 2018-10-15 15-35-19.png
Screenshot from 2018-10-15 15-33-39.png
Screenshot from 2018-10-15 15-18-55.png
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Tue Oct 16, 2018 10:15 am

Ah, I see. Okay, go to the sensor examples and lower your exposure drastically. This will increase the color saturation. Finally, call img.compress(quality=90) at the end of your main loop to improve video streaming to the IDE.
Nyamekye,
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Wed Oct 17, 2018 7:24 am

hi,
i had tried by reducing the exposure,but of no use. If i reduce the exposure, the screen of ide gets darker,since the plant is not green in ide.what may be the problem?
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Wed Oct 17, 2018 7:28 am

which lens is best suited for my application??
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Sun Oct 21, 2018 6:10 pm

Hmm, um, how many different exposure values did you try? Note that the scene at which you're pointing the camera isn't particularly suited for vision to have an easy job doing color tracking on. For example, you have way too much going on in the image and you're pointing the camera into the sky.

In this situation there are too many variables and things aren't going to work well. Can you constrain the problem in any way?

Also, note that it's impossible to really ever select one colored object given thresholds. You will get noise, so, given that you're going to want to do filtering on the objects to reduce the noise to make them easier to track. Like, for example, in one of your pictures you've clearly selected the cotton blobs. Given you'd done that the thing to do now would be to toss all blobs with less than a certain number of pixels and area.
Nyamekye,
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Mon Oct 22, 2018 9:15 am

Thanks for the reply.
As i tried by changing the exposure value of different values such as 1000,2000 upto 10000 in another area(on roof of a building). check the images. And i made the test in evening when sun is not much brighter. So, i could find the white coloured blobs(cotton). And the green coloured objects such as trees and leafs are not detected as white blob. If there is any option to find the object by automatically changing the exposure using the program to detect the cotton every time? what about the machine learning in the example?

Note:
And after that we have used a polariser lens of camera. As it too filters the light. The sky made into somewhat dark with polariser lens. Will this help everytime?
Attachments
Screenshot from 2018-10-22 17-44-35.png
Screenshot from 2018-10-22 17-42-21.png
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Mon Oct 22, 2018 12:01 pm

Hi, if you're outside you're going to need to constantly change the exposure in regards to the lighting. I'd focus on making a freedback loop that keeps the colors of the image within the bounds you want given whatever is seen. You can do this buy calling get_stats() and then adjusting the exposure based on that what returns.
Nyamekye,
krishnakumar77777
Posts: 8
Joined: Mon Oct 15, 2018 6:34 am

Re: differentiating between cotton and plant

Postby krishnakumar77777 » Wed Oct 24, 2018 2:39 am

Hi,
For exposure control,is only the L-max and L-min enough??
Thank you
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: differentiating between cotton and plant

Postby kwagyeman » Thu Oct 25, 2018 4:39 pm

See this: http://docs.openmv.io/library/omv.senso ... o_exposure

Also, there are example scripts with the IDE under sensor control.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests