In theory comparing components bottom vision image to a predefined reference template would be THE ideal method to recognize and orient any package of any shape or pin layout even with index pins or recognizing labels/prints orientation.
Unfortunately the current MatchTemplate OpenCV functions does not
work when your object is rotated compared to your reference template.
cri-s added some code snippest how this could be improved but currently I do not have the time to dive into the code I am afraid so I want to discuss here what everyone thinks or what pipelines you are currently using with different parts.
Regards Sebastian
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAJ_3Q41-0FktRL3HZWe9AHVUpKgSdH6Pkbj5u3Y_Uns-4wW3og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Never under estimate the power of brute force....Take the reference image rotate one degree at a time and do template match. Take the best match and repeat with fraction of a degree.
Trampas
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/917a82fa-8ecf-439d-ab5a-96c38e7a5a39%40googlegroups.com.
Hi Sebastian,I asked a couple times in the other thread, but didn't get an answer, so I will repeat here: What is the reason that you consider template matching to be ideal, and are you having trouble with the default pipeline?
The default pipeline is designed to work in a variety of lighting and machine configurations, and requires no per part training. Using template matching complicates things in that you would have to train every part before using it.
Template matching is well known for not being rotation invariant. It does have it's uses, but rotation and scale invariant object matching is not really one of them. For this it's better to use contours, as the default pipeline does, or more complex feature matchers like SIFT.So, it goes back to my original question: If you are having trouble with the default pipeline, which does not suffer from the issues described above, what is the trouble? And can we fix it without throwing out the entire thing? What benefits would you get from using template matching?
Jason
On Mon, Mar 27, 2017 at 12:59 PM Sebastian Pichelhofer <sebastian.pichelhofer@gmail.com> wrote:
As my original "issue" report turned into development discussion I want to continue this here:It started with my explaining that the current MatchTemplate pipeline stage isn't very useful:
https://github.com/openpnp/openpnp/issues/476In theory comparing components bottom vision image to a predefined reference template would be THE ideal method to recognize and orient any package of any shape or pin layout even with index pins or recognizing labels/prints orientation.
Unfortunately the current MatchTemplate OpenCV functions does not work when your object is rotated compared to your reference template.
cri-s added some code snippest how this could be improved but currently I do not have the time to dive into the code I am afraid so I want to discuss here what everyone thinks or what pipelines you are currently using with different parts.
Regards Sebastian
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAJ_3Q41-0FktRL3HZWe9AHVUpKgSdH6Pkbj5u3Y_Uns-4wW3og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jxJ6e5yRXAVcuu8HX3tzpktKNFuCBbzFF-QpU%2Bf4qRjTQ%40mail.gmail.com.
Jason
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAJ_3Q41-0FktRL3HZWe9AHVUpKgSdH6Pkbj5u3Y_Uns-4wW3og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CA%2BQw0jxJ6e5yRXAVcuu8HX3tzpktKNFuCBbzFF-QpU%2Bf4qRjTQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAJ_3Q43HMy_Qya7T0NZwuZw%2BoVo-gBqj9J6eGYZeGpoRPzW7zQ%40mail.gmail.com.
Current bottom vision works well. Just want to mention a couple of possible issues and improvements.
1)I am using 503 Juki for 0603 components. The nozzle end is just a little bit smaller than the 0603 width and very often the part is a bit displaced on the tip, and the tip goes out of the part boundaries on bottom vision image and is recognised as a part. Not really a big problem because 0603 allows some displacements, but...
2)In some conditions SOT-23-3 part may be detected wrong, because there are two possible min area rectangles to draw around three legs of the part. One is obvious and the second one is by about 45 degrees of the right one. I solved this problem by using side light, and setting up pipeline not only to detect legs, but also to detect the black case of the part.
3)One great and simple improvement would be min/max thresholds for rectangle size/position/rotation. Say we setup that the rectangle must be between 8x8mm to 10x10mm with max displacement of center 2mm and max rotation 15 degrees. This check will catch 99% of bottom vision and pick possible issues such as:
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8528546d-60af-407c-802e-40fc203e6e9d%40googlegroups.com.
On Mon, Mar 27, 2017 at 5:37 PM alex <al...@sai.msu.ru> wrote:Current bottom vision works well. Just want to mention a couple of possible issues and improvements.
1)I am using 503 Juki for 0603 components. The nozzle end is just a little bit smaller than the 0603 width and very often the part is a bit displaced on the tip, and the tip goes out of the part boundaries on bottom vision image and is recognised as a part. Not really a big problem because 0603 allows some displacements, but...One thing you can do here is add a MaskCircle stage that is the size of the NozzleTip. By making it black you can be sure that there will never be a bright spot from the nozzle, and since the nozzle is always centered above the camera you know the centered mask will cover it.
2)In some conditions SOT-23-3 part may be detected wrong, because there are two possible min area rectangles to draw around three legs of the part. One is obvious and the second one is by about 45 degrees of the right one. I solved this problem by using side light, and setting up pipeline not only to detect legs, but also to detect the black case of the part.I have seen this before but hadn't really taken the time to understand what was happening. Your description makes that clear.
3)One great and simple improvement would be min/max thresholds for rectangle size/position/rotation. Say we setup that the rectangle must be between 8x8mm to 10x10mm with max displacement of center 2mm and max rotation 15 degrees. This check will catch 99% of bottom vision and pick possible issues such as:I had eventually intended to use the package footprint body width and body height values to do the rectangle size part of this, but since you mentioned other factors I think it might make sense to add these to per part configuration for bottom vision. We could use defaults (or just null) for all the values and then people could just fill them in for troublesome parts.
-No part on the nozzle, but nozzletip is detected as part (important for metal nozzles)
-Part picked in a wrong way (sometimes, for example 0603 parts are picked by their side, not top
-Some flares in the camera view that cause wrong rectangle result
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cc2d7507-3b71-4e87-8b74-f10fa70921cb%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/5d51391d-5d12-4998-a374-9f1bda9017b5%40googlegroups.com.
Can you provide pictures from the loose tray feeder ? and the pipeline used (if using a pipeline) probably is easy correct that error.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com.
I have given you two pipelines.
The second (i think) for the resistors.
If adjusting Z works, then adjusting gaussian blur gives the same result.
Have you used the correct algorithm for the resistors ?
2017-04-03 14:44 GMT+02:00, Sebastian Pichelhofer
>> email to openpnp+unsubscribe@googlegroups.com.
>> To post to this group, send email to ope...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com
>> <https://groups.google.com/d/msgid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "OpenPnP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/openpnp/GrlUjVjkESE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> To post to this group, send email to ope...@googlegroups.com.
> To view this discussion on the web visit
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CAJGcfUjGaWN_dSC-cLzSDB4BXenyfX1n%3DbBp5cT376DRZqb_ow%40mail.gmail.com.
On Mon, Apr 3, 2017 at 5:03 PM, Cri S <phon...@gmail.com> wrote:I have given you two pipelines.
The second (i think) for the resistors.Correct, thats the one I used.With a 0402 resistor.If adjusting Z works, then adjusting gaussian blur gives the same result.
Changing z depth is not the same as applying gausian blur. Changing the distance changes the focus plane so the component stays in focus but the nozzle tip in the background becomes more blurred.The biggest issue currently is that the edge detection cant differentiate between the edged of the nozzle tip and the edges of the component.Have you used the correct algorithm for the resistors ?The second one you provided.Feel free to run the source pngs I linked to through the pipeline yourself to see the results.Many thanks for the help, its much appreciated!Regards Sebastian
2017-04-03 14:44 GMT+02:00, Sebastian Pichelhofer
>> email to openpnp+u...@googlegroups.com.
>> To post to this group, send email to ope...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com
>> <https://groups.google.com/d/msgid/openpnp/b5095883-6e82-482c-a98d-703b0e6e3d10%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "OpenPnP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/openpnp/GrlUjVjkESE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> To post to this group, send email to ope...@googlegroups.com.
> To view this discussion on the web visit
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.