BV pipeline broken ?

41 views
Skip to first unread message

f...@ltec.ch

unread,
Mar 19, 2023, 7:44:13 AM3/19/23
to OpenPnP
Since i update to OpenPNP 2023-03-11 some of my CV pipelines used for bottom visioning seem to be broken.
I am pretty sure they were working up until OpenPNP 2023-02-14.

It looks like either the stage 'FilterContours' or 'MinAreaRect' do not work as they did in in previous releases.

1. Picture #1 shows the FindContours stage named "5" showing 2 contours.
   This is expected and hence okay.

2. Picture #2 shows the FilterContours stage named "9" still showing 2 contours, but reporting only one contour in the text window.
   I would have expected, that only one (the larger) contour would show up. This would correspond to they textual result.

3. Picture #3 shows the DrawContours stage named "7" showing two contours but drawing only one.
   Drawing only the large contour is expected as this corresponds to the textual result presented in the text window of step 2 above. Again: I would have expected that only the larger contour would appear.

4. Picture #4 shows the MinAreaRect stage named "results" showing two contours and a resulting rectangle containing both contours. This rectangle is much too big as it should only contain the larger contour.

5. Picture #5 shows the DrawRotatedRects stage named "8" which corresponds to the previous step 4, hence also showing a rectangle which is much too big.

Why does that small contour still appear after it is supposed to be filtered out in stage FilterContours?
cvp-4.png
cvp-1.png
cvp-5.png
cvp-2.png
cvp-3.png

mark maker

unread,
Mar 19, 2023, 8:23:20 AM3/19/23
to ope...@googlegroups.com

That pipeline will not work, you seem to have moved and disabled the second MaskCircle that is used to blacken the whole image. You seem to have named it "Fix-Bug", so maybe this rings a bell...?

But before you try to fix this outdated pipeline, please just use the stock OpenPnP pipeline.

It exposes the essential parameters so you don't need to edit the pipeline at all:

Parametric-Pipeline

To enable it follow the Wiki:

https://github.com/openpnp/openpnp/wiki/Computer-Vision#using-new-stock-pipelines

Ideally combine it with Background Calibration, although for a black nozzle it is not that important:

https://github.com/openpnp/openpnp/wiki/Nozzle-Tip-Background-Calibration

Issues & Solutions can guide you through it, if the calibration on your nozzle tips is yet disabled (so if you want guidance, disable it, Accept, and press Find Issues & Solutions):

https://youtu.be/Pxg6g3KI5_E?t=188

_Mark

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/67e5b32a-ebb2-4863-b134-e5af6bfefe2en%40googlegroups.com.

f...@ltec.ch

unread,
Mar 19, 2023, 9:27:16 AM3/19/23
to OpenPnP
Hi Mark, many thanks for the quick response!

The second MaskCircle stage named "Fix-Bug" was not moved, I have added it to somehow "fix" the problem, hence its name. Enabling it simply prevents the following stages to show/detect more then exactly one contour (the one I am interested in). One could call enabling "Fix-Bug"  a workaround.
Nevertheless I seem not to understand the result of the FilterContours stage. I think, the visual representation does not match the textual representation of that stage.

I will try to use the stock pipeline then. I will also try again using background calibration for the nozzles but as I do not have those nice green nozzles this might again not work.

regards, Felix

mark maker

unread,
Mar 19, 2023, 10:13:33 AM3/19/23
to ope...@googlegroups.com

> Nevertheless I seem not to understand the result of the FilterContours stage. I think, the visual representation does not match the textual representation of that stage.

The stage does not manipulate the working image, only the list of previously detected contours. Many stages do data-only stuff. The filtered contours are only later drawn on a black frame using DrawContours, which would manifest the filtering. But as I said, your pipeline did not create the black frame, so instead it draws the contours over the camera image. Which obviously does not manifest the filtering at all, so the subsequent detection will be wrong.

_Mark

f...@ltec.ch

unread,
Mar 22, 2023, 7:14:05 AM3/22/23
to OpenPnP
I have removed all my customized pipelines (some probably "very" old) and replaced them with the stock pipeline. Since then detection is working fine - many thanks!
As the default pipeline is so simple to use I really ask myself: how could I miss it? If it is not relatively new then I must have ignored it - shame on me.

regards Felix
Reply all
Reply to author
Forward
0 new messages