Hi Jan,
To try the new pipeline with parameters...




_Mark
Hi all,
New Wiki page with instructions:
https://github.com/openpnp/openpnp/wiki/Exposed-Pipeline-Parameters
_Mark
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/928656f9-6d22-5dcf-fbc5-2e93ef608afc%40makr.zone.
Hi all,
A usability improvement:
Exposes the Pipeline Copy & Paste actions directly on the Pipeline Panel.
https://github.com/openpnp/openpnp/pull/1385
Also easier to copy OpenPnP stock pipelines to your pipelines, to
get new features etc.:
https://github.com/openpnp/openpnp/wiki/Computer-Vision#using-new-stock-pipelines
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/12a6367c-ef99-bc44-13a1-01865b24ccf5%40makr.zone.
Hi Jan,
First of all these artifact are inconsequential, as you noticed
yourself.
The parts of your pins seem to exhibit a greenish cast, that
probably lies within the nozzle tip green range, that we can
glimpse through there. You haven't posted a background calibration
screenshot, but I would guess that your camera image (or actually
the LEDs) have a rather strong blueish-greenish cast (which I
guess is typical for such LEDs):

So I recommend following the White-Balance instructions fully, i.e. including the camera device settings:
https://github.com/openpnp/openpnp/wiki/Camera-White-Balance
Once they are properly tested, I will add these calibration steps
to Issues & Solutions, then I will also check if White
Balance is done prior to the background calibration.
_Mark
> Can you suggest any test object to use?
I found brushed/sanded aluminium objects with faces oriented in
different direction, holes, shadows etc to be good. The animation
that you see on the Wiki
page is literally how I did it on my machine, just grabbed a
piece of aluminium lying around. Not rocket science.

Note, we 're not in portrait photography it does not need to be super-duper "true" to reality, we don't need naturally looking skin tones etc. 😎
However, (as you can imagine) if a greenish tint is present all
over, we will never succeed with MaskHsv for green screening. The
HSV model, or rather the bounding box we define on it, then simply
fails to be meaningful.
> even with hueMin/Max set to 0 and 255 something is masked by the MaskHSV stage (see the image with .2 I attached in the previous e-mail)
It does not matter what you set in the MaskHsv stage
properties. It will be overridden by the Background Calibration.
If you do want to test manual stage control, either set the Background Calibration on the nozzle tip to None, press Accept and reopen the Pipeline Editor.
Or change the propertyName on the MaskHsv stage
to something other than "MaskHsv".
But please do not forget to change back
afterwards, or it won't work with Background Calibration
anymore, and we might be searching a long time for why the
heck...!?
_Mark
> ... the procedure always complains that the inner
part is not black enough. This part is never visible for any
bottom vision operation as its used to hold the part. ...
Juki specifies a minim part diameter of 4mm for this
nozzle.
Thanks for testing and the feedback!
First: the problem indication is just for you to optimize
things, i.e. you are free to ignore it! The Key Color (green
range) recognition is not disrupted by these spots and the MaskHsv
bounding box does not include them (that's exactly how they are
indicated, btw.). If what you say is true ("This part is never
visible for any bottom vision operation"), then the pipeline
and the background removal will still work 100% correctly.
But having said that, I know people don't like indicated
problems, even if they are false positives 😁 So let's aim
to eliminate these.
I did not know how this works for the Juki nozzle tips, I only
know the Samsung CP40 I tested, which seem to be entirely
different, i.e. their inner hole is always almost as large as the
outer rim, i.e. we can use the Vision Diameter plus some
margin, to blot out the center part.
The Wiki said:
The background calibration automatically blots out the center piece in the calibration image, where the nozzle tip was detected. This will eliminate any shiny elements that are typically present (needles, scraped off points etc.). OpenPnP assumes this center part to be always covered by the picked part, i.e. there is no need to include its color in the background calibration, nor these shiny elements treated as a problem (see Trouble Shooting). The blotted-out disc has a size of Vision Diameter + 2 x Minimum Detail Size (see Configuration).
So instead of the "Vision Diameter + 2
x Minimum Detail Size" formula, we
need to add a separate new Minimum Part Diameter
field to control the blotting-out diameter.
I was hoping to get away without adding yet another diameter field... 😉
> I'd suggest to add an inner mask to the pipeline to
remove stuff, that's not relevant of the vision operation.
If you say the part "is never visible for any bottom vision
operation", then there is no need to remove inside the
pipeline. However for the calibration (i.e. without any part on
the nozzle tip), the center part is already blotted-out, we only
need to make it larger/controllable via a separate diameter field.
> Or even better, do not complain about stuff, that's
insight of the greenish part to be masked out.
Not sure if that is always a good idea. There are small tips that might show when the part is picked off-center. By specifying the blotting-out diameter, both cases can be covered.
I know the following example is a CP40 nozzle tip (not green) but
couldn't the same happen for a Juki?

> guess it would be a good idea to add some kind of lock
button that signals, that this stage is controlled exernally,
like grayed out or disabled.
Like I wrote before, I don't know how. The used property table is
an external Java class, that appears clunky to me. Plus it would
be quite a huge effort, there are many such built-in property
overrides.
> You could also overwrite the values before the pipeline is opend, so that the user can see the values that are active.
Well, it does in the case of the Exposed
Pipeline Parameters. But not in case of built-in
control.
In case of the Parameters it is involved, because after use, the
pipeline needs to be restored to the default values, otherwise the
Pipeline will be marked as modified. The same restore
operation would be needed for built-in control, so this would not
be trivial to implement (needs a backup).
My first aim is to make Pipeline Editing a thing of the past
for most of the users, which makes this a non-issue.
In the meantime: Pipeline Editing always was and always will be an expert topic. Experts need to know how to deal with such complexities. Finally, it is Open Source, and everybody is very welcome to step in there 😁
_Mark
> Did you missed an attachment/inline image here?
In deed I did, sorry.
> The rubber parts of small nozzle tips like 502 for
0402 is a rather long funnel with a diameter of about 2.7mm at
its largest (upper) end. Due to the length and width, there is
almost no surface, that can reflect anything back into the
camera. This back part is almost invisible.

Yes it seems unproblematic, i.e. it will be included in the
"cutoff" darkness.
> At the upper end of the rubber part comes a green ring,
that is used to hold the spring. This ring is visible behind
small parts on the nozzle and has to be masked out. This ring is
of great importance as its very close to the part (with respect
to the bottom cameras view).
If it is green, it should be unproblematic.
Please send such an image, I do not see it in the ones you sent.
_Mark
> Speaking about vision pipelines: could you suggest any readings about different pipeline types?
I have never studied it formally.
> If I understand the matter correctly, there are three options: rectangular around outer structure (the default), something using the pad geometry one can specify on package level and pattern matching using some kind of reference. I haven't found anything about the later two yet...
Those are options, yes. The pad geometry you can implement in
OpenPnP right now, I believe, but I don't have a ready made
pipeline. The reference snapshot - teaching OpenPnP how the
package looks, and where the center is - would be a cool addition.
But because OpenPnP does not allow GUI interaction from the
machine thread, it would be cumbersome to implement "on demand
teaching" i.e. where OpenPnP would be prompting the user to teach
a new package on first sight, from inside a job. It would have to
interrupt the job and users would then have to restart it
afterwards. Cumbersome.
In addition to these well-known options, I will introduce my own
different idea/stage soon. 😁
_Mark
> Honestly, I have to admit, that I still opened the
pipeline editor to check the results of the MinAreaRect stage
for stability. I personally would like to have statistics on the
alignment (for debugging and adjustments only) to verify the
stability with the new settings.
Of course we could run the pipeline 9 times with the Threshold
and Min.Detail parameters varied by some percentage (?)
around the mid-point in a "sensitivity analysis", i.e. assess
whether the same result will come out in all 9 settings, and if
not, fail the alignment. But that sounds awfully bloated and hard
to justify (and what percentage?).
Other ideas?
_Mark
> I personally would like to have a button like "Test Alignment" that calls the pipeline a few times and represents the results as mean/rms/max for position x/y, size x/y and rotation.
I doubt that true instability of the pipeline is exposed with
that. Pipelines are typically repeatable, both when they're
"right" and when they are "wrong". I would bet any "rms"
that you see out of that comes almost entirely from the motion
system, i.e. backlash & Co.
The true "instability" is in suddenly not "seeing" some portion of the pins on some parts, because they are a bit duller than the threshold (set with a slightly shinier part), which results in the MinAreaRect "slipping" off. Or when the minimum detail size is too small to filter out a specific speck of dirt on the plastic body of the part, pulling the rectangle out.
These are "cliff edge effects", i.e. the detection either "slips off" dramatically, or not at all. They are hard to catch via statistics on one part. Statistics would have to be obtained over many part, but then they would only show how many are faulty, not very useful?
That's also why template image matching is so good. It is not
governed by edges, contours and other "black and white" i.e.
"cliff edge" stuff, but by the full-area probabilistic
measure of the most likely match. They don't care about "slightly
duller", or "specks of dirt" etc. the template still has an
extremely good probability to deliver the best match.
My new stage tries to eat some of that cake... but without having
to teach it templates in the first place.
I will probably present it tomorrow. 😁
_Mark
> If you think the images I've recorded with the job could be
helpful, please let me know. I'm happy to share them.
Absolutely!