09-07-2018 01:47 AM
Hi,
I am trying to find a way to recognize the rectangle (or square) pattern in my images, and I tried to do it using NI Vision Assistant. I find a function for shape recognition, but it does not see my rectangle which is quite big (enclosed picture ShapeDetection_Rectangles.png), and it does recognize elipses (enclosed picture ShapeDetection_Elipses.png), which are not even supposed to be there. Can someone help me to understand better the shape recognition function and propose maybe another way to find my squares?
Thank you very much for your help!
Best regards,
Jola
09-07-2018 04:08 AM
Do you want find Match Pattern ?
09-08-2018 06:38 AM
Hi, I am just looking for a way to find a square, so that my program will give information when the square is there on an image... The function which will be used is not important for me..Have you got any idea what could I do?
09-08-2018 08:13 AM
Hi pers,
Before using the Shape Detection Setup function try using other functions to generate more contrast to the square. Have you tried extracting a color plane first (Color Plane Extraction Setup)?
09-09-2018 10:47 PM - edited 09-09-2018 10:52 PM
Hi pers,
It seems to me that your image is not preconditioned carefully which results in low-contrast between your object of interest and the background. Try preconditioning your image using tools such as Color Plane Extraction, Brightness, Filtering, Thresholding, Morphology etc. There are alot of preconditioning tools you can use which should be helpful to you but you should discover it yourself which ones are most suitable for your application.
However based from the image that youve provided, I suggest you might try this sequence Brightness -> Threshold -> Filter/Morphology -> Match Pattern/Geometeric Matching/Shape Detection. Of course its up to you to figure out the correct setting for each step.
09-10-2018 11:33 AM - edited 09-10-2018 11:33 AM
If you are not using it already, I highly recommend using the NI Vision Assistant to discover the right recipe of vision processing for your application. It will also generate LabVIEW code.
09-12-2018 05:40 AM
Hi, thank you very much for the tips!
I used the Brightness, Threshold, Filter functions, in this order. You were right, the rectangle looks much better now, the edges are almost straight. The lines are very easy to be found by the function Shape Detection, but I still cannot find the Rectangle (see the enclosed pictures). The image before processing is enclosed as Erste Marken_5.png. The results of Shape Detection function is to be seen in the other two pictures.
Maybe there is something wrong with my settings in Curve Settings in Shape Detection function. I do not understand all options there (picture below.)
Thank you very much in advance for the next tips.
09-12-2018 10:50 PM
HI Pers,
You can use Geometric Matching/Pattern Matching instead of Shape Detection.