11-11-2010 03:29 PM
I need to be able to identify all nine boxes in the first image (0000094718...) and others like it. I've tried shape detection, pattern matching, and geometric pattern matching. I've tried varying all the parameters within these functions. I've tried pre-processing the image (and template, if applicable: usually created from just one of the boxes) with thresholding and/or a muliplier prior to using the detection or matching function, and I still can't get all nine boxes, and just those nine boxes.
Can somebody offer some help? I would ideally like to be able to use shape detection, because it returns the corner coordinates for rectangles, and those are particularly useful to me. What confounds me about this function is that after setting the min/max height/width of rectangles to find, the program seems to ignore these instructions and returns matches out of these bounds.
It would be even better to be able to have a script that will identify all nine boxes in both images attached. The boxes in the second image (X820A32) are more squarish.
Thank you,
Holly
Solved! Go to Solution.
11-11-2010 03:55 PM
Have you tried the Particle Analysis VIs? These may be more appropriate for locating your features since you don't really have rectangles but what could be arbitrary parallelograms. After you've got glob locations, you could create a coordinate system and use edge detects and intersections to find corners.
11-11-2010 04:03 PM
I'll give it a shot and get back to you...Thanks!
11-11-2010 05:39 PM
While the particle analysis vi is very good about picking out all nine boxes (thanks!), it picks out quite a few other particles. I'm trying to use the particle filter to weed them out, but the function doesn't seem to take my input limits on bounding rectangle height/width. Is there a 'commit' button that I'm not seeing or something?
11-11-2010 05:58 PM
Looks like you've got your max and min backwards (i.e. min should be 0 and max should be 200, but I'm guessing you probably want min to be something a bit larger if you're getting additional particles identified due to noisy pixels.). I'm not sure what the default is when that happens. Once you click OK, the settings in the Vision Assistant script should be saved.
11-11-2010 06:06 PM
If I enter the min as 200 and the max as 400 and hit okay, those settings seem to be saved in that if I re-open the filter for editing, those numbers re-appear in the entry fields. But I am still getting matches with bounding rectangles smaller than the requirements.
11-11-2010 06:08 PM
If I lower the threshold point, I can get rid of these nuisance particles, but I'm still concerned about the filter not doing what I want it to do...
11-11-2010 08:17 PM
Try the attached script. I think you may not be using optimal threshold values. You may find that you want to use a smoothing filter before doing the threshold. This should also help with the nuisance particles.
11-11-2010 10:38 PM
Thanks, I'll give it a try tomorrow...
11-12-2010 02:04 PM
This script seems to work fine, the threshold value certainly makes a difference. The particle filter isn't really doing its job, you can tell if you raise the threshold so that smaller particles are present - the filter doesn't weed them out according to the input limits like it should. However, lowering the threshold seems to make the filter non-essential to the process.
I think this will work out for me. Thanks for your help!