10-30-2017 12:01 PM
Hello,
I'm working on a school project which is a resistor sorter. I'm tried to use the color segmentation from the Vision assistant but I couldn't get a match because the clasifier I used was based on a resistor and can't be used if I changed the resistor. I've also tried this VI but I can't determine the color code via the RGB profil .
1/ How can I make a clasifier file to include all possible colors?
2/ How can I modifie my VI to get the RGB values of only the bars?
10-31-2017 09:18 AM
Hi Nezarovsky,
Since Brad already gave you general suggestions on your Idea Exchange post, I'll simply try to answer your specific questions here.
1. Color classifiers should be trained on a data set of as many sample images as you can provide. It's meant to use the "knowledge" of the training set you use to identify the colors, so if you are only training with a specific instance then your application will be biased by that training. Instead, you should be using as many sample images as you can, and include every possible color you wish to identify so that they are properly included in the classifier. Using a single resistor as your sample pool simply isn't going to be enough.
2. To determine the RGB value of the bar, you first need to actually find each bar in your image. There are a large number of ways to do this, using various detection and thresholding methods. Pattern Matching, Edge Detection, Color Thresholding, and many other methods might work for this but you will need to test all of your options to decide what works best. Once you know the location of the bar, you can then use a region of interest in the bar with your color classifier to determine the pre-trained color. You could also pull the pixel value from the image to get the actual RGB values, but that may not be as accurate as the classifier.
What you are describing is absolutely a non-trivial application. There are a number of other things you should consider, such as the orientation of the resistors and ensuring you have consistent lighting conditions.
11-06-2017 06:48 PM
Hi Charlie,
Since I have a biginner's level on LbVIEW I couldn't find out how to actually find the resistor's rings nor to classify every color shade so I can't decide which way to go with and I'm running out of time. Can I have a hint?
11-07-2017 11:27 AM
Do you have sample images that we could take a look at and show all of the different ways the resistor may be oriented or displayed for which we would still need to determine the resistance value?
When it comes to vision software algorithms there are usually many different ways to arrive at the same information and determining which one is the best and most reliable for your specific application really comes down to what assumptions we can make about the incoming image which is why having a broad range of sample images is so helpful.
11-07-2017 12:27 PM
I don't have a specific simple because resistors would be passing by on a convoyer and I have to analyze it. However, if needed, the convoyer can stop during the aqcuisition. I attached a photo of what the resistor would look like (which can be rotated).
11-07-2017 12:41 PM
So what do you have so far and what parts are you stuck on?
11-07-2017 12:51 PM
So far I can manually select a ROI line and extract the RGB value. I can see that there are variations due to the resistor's band but I can't find how to determine only the RGB of the bands in order to determine the resistor's value.
There are many parts I'm stuck on:
1- how to extract the RGB values for only the bands?
2- when that's done, I would like to automatically rotate the resistor's image and draw the ROI line in order to select the RGB profil.
11-08-2017 08:31 AM
Taking this one step at a time, you first need to find where the bands are. You can either take the information you have from the line profiles and interpret those results or look for straight edges to find the bands and then figure out what colors the bands are.
11-12-2017 02:53 PM - edited 11-12-2017 03:20 PM
I suggest that you try to improve the lighting of the resistors. If you can produce a more diffuse illumination you will get rid of specular reflections and reduce shadowing which will give you a better chance of processing the images correctly. I would agree with a previous post - this is not a trivial task.
12-03-2017 05:47 AM