
Huh? Haven't we discussed all this? See Instructions
here, and the linked discussion...
https://github.com/openpnp/openpnp/pull/1546
Especially this step by step that I wrote for you, and specifically about the diameter!
https://groups.google.com/g/openpnp/c/ucHeolNaPuk/m/LjVC3aX4AwAJ
Please report back this time.
_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 visit https://groups.google.com/d/msgid/openpnp/0b9dbbe8-9743-419f-97b7-6492ed3d514en%40googlegroups.com.

To view this discussion visit https://groups.google.com/d/msgid/openpnp/e9e4d81a-0d23-4676-b483-791f29547ee9n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openpnp/9c17c6fd-53bc-4c51-bf4c-5c7a39b00e9bn%40googlegroups.com.
> I can’t get a bigger screen nor was I able to move the
camera closer for now.
Yes but you can also influence the span with the Max Part
Diameter. Did this not work?
_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/e9e4d81a-0d23-4676-b483-791f29547ee9n%40googlegroups.com.
No manual tweaking should be required. Instead just use the "body" vision settings. And then restrict the area around the corners by using a smaller Max Part Diameter on the Nozzle tip. This will mask the surroundings away.

_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/CAH35urfRyHG09Sf6BGZ9uKH80sEr%2BCJZ49z0Vjyu8yXxgdby5w%40mail.gmail.com.



Please send a native camera image, and your machine.xml
To view this discussion visit https://groups.google.com/d/msgid/openpnp/8fcdaa36-0f7e-4c9f-869f-78ed07dca277n%40googlegroups.com.


Oh, I also need the packages and parts xml.
Sorry.
_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/730b03e4-26e1-4a8e-b290-55804d44a760n%40googlegroups.com.
Hi Fabian,
many problems in deed. I hope you read this carefully, took me
about two hours to figure all out (including fixing a bug in
OpenPnP, see below 😇):
The camera has huge color noise. This makes it very difficult to
mask a key color. Brighter lighting would likely solve it.

You can fight the noise by increasing the Minimum Detail Size
on the nozzle tip background calibration:

But this will be at the expense of
precision. Not okay for finer parts!
The green shade is also not saturated enough, it reaches only saturation 66 out of 255.
NOTE: unfortunately, there was also a
bug in the diagnostics. When the key color is both too
dark and not saturated enough, it will not
find a single pixel that satisfies the criteria. When
that happens, the HSV Minimum/Maximum determination fails.
This will ironically lead to diagnostics saying it is okay when in
fact it is not. I will fix that. Note, the bugfix will not
fix the underlying problem, which is lack of saturation, so even
after I fix that, you will still need to address it, only
OpenPnP is then correctly telling you to.
Better lighting will likely help with saturation too. Or use a more vividly colored shade. If it is a paper, make sure it has no "fuzz" which makes it milky. Also check camera White Balance (follow the Wiki).
https://github.com/openpnp/openpnp/wiki/Camera-White-Balance
If you can't fix the shade saturation problem physically: Exit
OpenPnP, open machine.xml, set worst
acceptable saturation to say 31:
background-worst-saturation="31"
That's a hack, you should really fix the underlying problem.
With that wou should get something like this in background
calibration. In addition, I also had to increase the Tolerance
to 16:

In my simulation with your still image I was able to make it work, using the stock pipeline. You need to select the Whole Part Body vision on the package:

That way I finally got a result. Note the accuracy is not very good, that's due to the high value Minimum Detail Size (blurring):

Unrelated: Why is your camera rotated around Z by 44°? Residual
errors are also huge.

_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/84509dde-61c7-44df-b642-5d7920ee6c7an%40googlegroups.com.
Hi Fabian, all,
the diagnostics fix is now in the OpenPnP test version. So for a
background that is both too dark and not saturated
enough, you should get this diagnostic:

See the PR:
https://github.com/openpnp/openpnp/pull/1709
Download:
_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/67860a3d-97c4-4af8-8fdd-64582bcd8456%40makr.zone.
> 45° turned camera, is an issue that was clearly located
in front of the keyboard / drill press for the mounting holes
need to be offset by 45° to make the camera align.
> Is there an issue with it?
To view this discussion visit https://groups.google.com/d/msgid/openpnp/ff3aae51-f86a-498c-85e1-1bd4ec172ecan%40googlegroups.com.


Hi Fabian,
Your green shade now looks much better!
Now if you changed the background-worst-saturation= in your machine.xml you must exit OpenPnP, then revert it back to the default 63. Otherwise OpenPnPs recommendations will not be good for the nicely saturated shade!
Now for some theory:
There are two scenarios to be distinguished:
In scenario 1 having a black nozzle tip is not a problem. But it
must be really matte black, yours is a bit shiny. If okay, it will
be darker than the contacts, so not a problem. Technically, the
green shade will be converted into black too. The reason we make
it green is just to distinguish it safely, even if there is much
ambient light etc. that would perhaps be hard to "swallow" with a
black matte shade. But technically we could use a black shade too.
In scenario 2 we absolute need a vivid color shade, a black one would not work, because it cannot be distinguished from a body which (unlike the bright contacts) can have many colors including black. In this scenario the green is not converted into black, instead it is directly used as a mask to detect the outline of the part to be aligned. Because of this, you have two valid sub-scenarios:
- You have very large parts (lie your ESP32) that surely cover the whole nozzle tip. So in bottom vision the color of the nozzle tip is of no concern, only the shade matters. As for the background calibration, a sufficiently dark and matte nozzle tip should not bother it.
- You have nozzle tips of roughly the same color as the shade. The color must not be exactly the same, OpenPnP can detect the hue span, as long as both are more or less in the same hue sector (I think it may span about a third of the color wheel). Again it is important that both colors are vivid = high saturation!
_Mark
To view this discussion visit https://groups.google.com/d/msgid/openpnp/654d36b0-68cb-443a-8d65-c2d89e6efccdn%40googlegroups.com.