04-27-2010 09:07 AM
Using vision assistant 8.2, I have trained a template (Psquare.png) from the GoodPrndl.bmp. Of course, I get a good pattern match for this image. I would expect to get a bad pattern match for BadPrndlClip.bmp. You will notice that a corner of the square is missing. This clipping problem has occured in production and made it to customer. Could an expert look at this problem and give suggestions on best method to detect this clipping problem. Keep in mind that the clipping or void could happen anywhere on the square or 'P'. I also attached pattern matching script.
Thanks
Solved! Go to Solution.
04-27-2010 09:22 AM
04-27-2010 09:33 AM - edited 04-27-2010 09:36 AM
You can do like this. And use a particle filter after this operation. This i feel will give you consistency because the broken part here means the rectangle is not going to get completed. Please see the image attached which shows the processing for the bad image.
04-27-2010 09:36 AM
The reasons I'm using pattern matching are: 1. Each Square and letter is a constant pattern. 2. Since this is a backlit VF display the intensity may be slightly different from part to part and I believe pattern matching should handle this.
My concern with particle anaysis is that backlighting intensity may change and there is a also an associated frequency with this display. The combination of these two things would make a binary tool not the best choice.
04-27-2010 09:40 AM
04-27-2010 10:04 AM
The simplest way to do this is usually the best.
I'm assuming you're controlling the environment - i.e. no external light allowed.
You should then lock the camera down, so that the bright display is at about 200 contrast.
You need to get a number of different "brightness" parts, and see where they lie.
You're trying to do a six sigma on the brightness, this should be pretty narrow, maybe 50 contrast at worse.
The black background is obviously down near 0, lets say less than 50 contrast.
Set thresholding to 100 (approx).
Then undertake pixel counting of the high values.
This is the easiest and in my opinion the best solution for what you are trying to do.
ADL
04-27-2010 10:06 AM
I agree. I've noticed pattern matching doesn't handle differences in intensity as well as I would think. Do you try to shy away from pattern matching whenever possible, because of similar issues?
I tried out your script and like it's simplicity. I see that the "fill holes" is the key to the solution. The only potential problem is if the letter inside the square is clipped but the square is intact. I'm not sure of the probability of this problem. The customer return was a clipped square along with a clipped letter. I will find out from product group.
I have questions on "particle analysis". There are so many types of "select measurements". I have typically always used "area". I notice others such as "equivalent Rect Long Side" etc. What measurement would you use for this problem? or can you point me to documentation explaining each measurement?
04-27-2010 10:19 AM
delphi Dan wrote:I agree. I've noticed pattern matching doesn't handle differences in intensity as well as I would think. Do you try to shy away from pattern matching whenever possible, because of similar issues?
I tried out your script and like it's simplicity. I see that the "fill holes" is the key to the solution. The only potential problem is if the letter inside the square is clipped but the square is intact. I'm not sure of the probability of this problem. The customer return was a clipped square along with a clipped letter. I will find out from product group.
I have questions on "particle analysis". There are so many types of "select measurements". I have typically always used "area". I notice others such as "equivalent Rect Long Side" etc. What measurement would you use for this problem? or can you point me to documentation explaining each measurement?
Personally i do avoid pattern matching as much as possible. In this case area alone can do the trick. One more idea. Use the dilation and then use an erosion just to make sure that the broken parts remain seperated from the border and if you are able to do this then the area of the filled rectangles (with alphabets) are somewhere around 8000+ and without the aplhabets (the top ones) are in the range of 3000+ and the broken ones are somewhere in 2000s and 1000s.
04-27-2010 10:28 AM
I may be misunderstanding the 'dilate' then 'erode' statement. Wouldn't that be the same as doing nothing after the intial threshold? Unless you have different iterations for each.
04-27-2010 05:09 PM
A dilate followed by an erode will first expand the particles and then reduce them. Particles without holes will be uneffected as their borders will expand and then shrink by the same amount. However if there are holes present up to the size of your structuring element, they will be filled in. You can do this in a single call to the morphology function by selecting the Close operation, which will also reduce some calling overhead. The concepts manual details all of the morphology operations.