Bottom camera pipeline MaskCircle.

581 views
Skip to first unread message

tyee...@gmail.com

unread,
Aug 13, 2022, 11:02:05 PM8/13/22
to OpenPnP
I'm getting some random light reflections around the outer edge of my bottom camera view.  I used to just mask them out with a MaskCircle, but it now says that the diameter is controlled by the pipeline caller.  Who is the caller, or I guess more importantly what parameter is the circle diameter derived from?

Thanks,

Al

mark maker

unread,
Aug 14, 2022, 2:53:38 AM8/14/22
to ope...@googlegroups.com

Hi Al,

It depends.

In normal/legacy operation it takes it from the nozzle tip Max. Part Diameter.

If

  • you have multi-shot enabled (camera Roaming Radius is set)
  • and your part package has a footprint defined,
  • and you do not have Vision Offsets

then it is determined by the vision compositing algorithm, so the shot can isolate the corners.

https://github.com/openpnp/openpnp/wiki/Vision-Compositing

Roaming as a limit

If the corner needs no isolating, I see that in your case this might choose a mask that is too large, i.e. it tends to take as much as possible.

But you can easily edit the pipeline and add a second MaskCircle stage, then drag it to before the one controlled by bottom vision.

Make sure to set the stage propertyName to something other than "MaskCircle", so you can control it inside the pipeline.

https://github.com/openpnp/openpnp/wiki/Computer-Vision#overriding-controlled-stage-properties

I will look into the behavior of multi-shots. Maybe taking the largest possible mask is not ideal. The smallest possible mask is already computed too. Hmmm...

_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/5161327f-76e3-43c4-b904-d4d746b2fecen%40googlegroups.com.

Jim Freeman

unread,
Aug 14, 2022, 8:39:09 AM8/14/22
to ope...@googlegroups.com

I was having this same issue. Mark’s solution looks good. What I did to get around the inability to use Maskcircle (I didn’t think to change it’s name) wa to use maskrectangle.

 

Sent from Mail for Windows

mark maker

unread,
Aug 14, 2022, 11:14:55 AM8/14/22
to ope...@googlegroups.com

Hi Jim, Al,

Note, this is just a temporary work-around. Now that I understand the underlying problem ("some random light reflections around the outer edge of my bottom camera view"), I'll find a better solution that works without editing the pipeline.

Important: This is also related to background calibration, where the nozzle tip Max. Part Diameter is actually taken as the nominal mask, so it calibrates the background just from pixels inside this area. Therefore I will need to change multi-shot, so it still respects Max. Part Diameter in any case.

It actually becomes clear from my own earlier doc 😇:

https://github.com/openpnp/openpnp/wiki/Nozzle-Tip-Background-Calibration#calibration-pipeline-control

_Mark

mark maker

unread,
Aug 14, 2022, 2:45:36 PM8/14/22
to ope...@googlegroups.com

Hi all,

this should now be fixed.

Details here:

https://github.com/openpnp/openpnp/pull/1471

You can upgrade to the newest testing version.

Test Downloads – OpenPnP

Please help me test this in real life !!  🏆 🏆 🏆

(I have only tested in simulation)

@Al, @Jim, thanks again for reporting this.

_Mark

tyee...@gmail.com

unread,
Aug 14, 2022, 8:27:48 PM8/14/22
to OpenPnP
Hi Mark,

I tried to do a test in "real life" but something broke.  My homing fiducial no longer works in the test release.  The Down Cam Light flashes but no image is captured in the pipeline.  If I manually turn on the Down Cam Light, it gets turned off when the camera is done, but still no image.  I then lit up the target with a flashlight and I now get an image and the pipeline works.  So it seems to me that the Down Cam Light is out of sync with the camera.

 I went back to the latest production release and the  the fiducial homing works fine.  Let me know if you want me to check anything.

Al

tyee...@gmail.com

unread,
Aug 14, 2022, 10:58:00 PM8/14/22
to OpenPnP
Mark,

I don't know if this is practical to do .... could we have global mask that is in every pipeline?   In the camera settings, we would provide either a diameter (MaskCircle) or a length/width for a MaskRect.  Then we can mask out any artifacts, light leakage, etc from around the outer edge of the camera view.   

Al

mark maker

unread,
Aug 15, 2022, 2:14:46 AM8/15/22
to ope...@googlegroups.com

Could you please send your machine.xml?

tyee...@gmail.com

unread,
Aug 15, 2022, 1:26:44 PM8/15/22
to OpenPnP
machine.xml

mark maker

unread,
Aug 16, 2022, 3:05:58 AM8/16/22
to ope...@googlegroups.com

Hi Al,

you have a Pick Tolerance of 20mm set. This cannot work, typical max. values are 0.5 ... 1mm.

But it is true that this tolerance is only now properly applied in the the new version, which explains the difference to the old version.

_Mark

tyee...@gmail.com

unread,
Aug 16, 2022, 3:05:11 PM8/16/22
to OpenPnP
Hi Mark,

O/K ... that would do it!  ;-)

I thought I had read somewhere that this was in %, but obviously I had it mixed up with something else.  I've calibrated my machine a number of times using the old method with good results, but am trying to learn the new way of calibrating.  It has been going well but I have to do a lot of reading to understand what the results mean.  

Just as a thought, on parameters where the units aren't obvious, the units should be included.  When I see "Part Diameter" or "Part Height", I know this is in mm.  But "Pick Tolerance" is not so obvious.  If it were to say "Pick Tolerance (mm)" then others trying to learn this may not make the same mistake as I did.

Anyways, I'll trying running the test release again and see if the original problem with the MaskCircle in the pipeline is working properly now.

Al

mark maker

unread,
Aug 16, 2022, 3:28:12 PM8/16/22
to ope...@googlegroups.com

> Just as a thought, on parameters where the units aren't obvious, the units should be included.

As a convention, it is done the other way around: if it is a percentage, it says so, e.g. it would be labelled "Max. Pick Tolerance [%]".

Example:

Wouldn't the GUI be too cluttered if all the countless labels that contain Lengths or Coordinates had units?

Apart from that, it would also be a lot of work to implement because the system units are changeable. 😎

> but am trying to learn the new way of calibrating.  It has been going well but I have to do a lot of reading to understand what the results mean. 

Report if things are not understandable.

_Mark

tyee...@gmail.com

unread,
Aug 16, 2022, 4:29:26 PM8/16/22
to OpenPnP
Mark,

O/K, that makes sense.   I guess I wasn't aware of this convention.  But I do now!  ;-)

Al

ma...@makr.zone

unread,
Aug 16, 2022, 4:54:54 PM8/16/22
to OpenPnP

Issues & Solutions would now tell you when the Pick Tolerance is unreasonable.

https://github.com/openpnp/openpnp/pull/1472

_Mark

Reply all
Reply to author
Forward
0 new messages