Vision pipeline edit

74 views
Skip to first unread message

Evgenij Rakhno

unread,
Jul 25, 2025, 5:04:40 AM7/25/25
to OpenPnP
Hi everyone
I'm interesting to change "mask" in vision pipeline (4 / 4b at pipeline) to change mask circle diameter, but I can't do this, because it write something like "set by pipiline caller" (or something like this)
How I can set this diameter manually directly in pipeline?

Evgenij Rakhno

unread,
Jul 25, 2025, 5:07:08 AM7/25/25
to OpenPnP
or how I can change this "pipeline caller" value? or how "caller" decide which value pass to "vision pipeline"?

Toby Dickenson

unread,
Jul 25, 2025, 8:03:18 AM7/25/25
to ope...@googlegroups.com
The mask diameter is calculated automatically based on the camera calibration, configuration of the nozzle tip (max part diameter and pick tolerance) and the features of the package being picked, and this automatically adjusts if vision compositing is being used. All these parameters also affect the nozzle tip calibration, for automatic masking of the background image by HSV. In recent versions it is generally not necessary to override the mask diameter.

There are always special circumstances of course, and you can take back manual control by changing the "propertyName" property. But, if you are following a setup guide written for older versions, it would be a mistake to think that this was a normal thing to do.

Toby

--
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/116bb183-58fa-48f7-ac6a-2ef86a84c90bn%40googlegroups.com.

Evgenij Rakhno

unread,
Jul 25, 2025, 10:28:37 AM7/25/25
to OpenPnP
yes, it works in many cases, let's say - 95 cases out of 100, but I still have 5%
real example
I have QFN64 package
I have two options - take two photos for "body" (or something like this) to calculate center
When openpnp take two photos, but it take a lot of "dummy" space in which I have some "flashes" from different surfaces. I can't change that :(
So, huge area with flashes result in mistake in center calculation

Second option - take a photos of 4 corners. To get corners we doesn't need huge area, so, openpnp will not catch "flashes" at image
But, during such photos openpnp masks a too much area, so, in "unmasked" area I have only one or two pins, so, openpnp doesn't catch useful information from this photos and can't calculate "virtual corner" correctly
If I can expand "mask" area by 10-15% photo will contain a much larger numbers of pads and it will help to detect "virtual corner"

So, I can spend hours to avoid this splashes mechanically to make "body" work correctly, or I can expand "mask" manually (if it possible) in a few minutes to use "4 corner" mode
I will prefer easiest way

So, If someone know how to do it, ever if it "a huge mistake" - please let me know

Regards, Evgenij

Toby Dickenson

unread,
Jul 25, 2025, 12:08:10 PM7/25/25
to ope...@googlegroups.com
I agree qfn64 can be tricky, and the automated multishot bottom vision could be better here. You might get a good solution from tuning the "max pick tolerance". But it sounds like you are on the right track.


Evgenij Rakhno

unread,
Jul 25, 2025, 3:40:15 PM7/25/25
to OpenPnP
its weird, that's "max pick tolerance" change mask diameter, but its work.... but I can't found combination for "it will get enough image to work fine and to not grab flashing from led backlight", so, if someone know how to setup mask diameter manually - you are welcome :)

p.s. I removed flashing manually by adding some "anti-flashing coverage", but I'm  sure it will be good, in some cases, to set mask diameter by hand... 

Tao Qu

unread,
Jul 28, 2025, 12:39:32 AM7/28/25
to ope...@googlegroups.com
Hi,
I have two ways to achieve your needs. View the attachment :)
1. Chage the pipeline 4`s propertyName from MaskCirle to other name for example MaskCirle++ or delete it .( I remember seeing this somewhere on the WIKI, but I couldn't find it. )
2. This is what i use: Manually change the size of the mask with a slider. I have provided the pipeline code I used, maybe for your reference. it‘s in Chinese,but the principle is similar.

<cv-pipeline>
  <stages>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ParameterNumeric" name="蒙板参数" enabled="true" parameter-label="1-蒙板大小" parameter-description="元件的落入范围,剔除掉蒙板之外的干扰图像" stage-name="MaskCircle" property-name="diameter" effect-stage-name="MaskCircle" preview-result="true" minimum-value="0.0" maximum-value="30.0" default-value="5.0" numeric-type="MillimetersToPixels"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ParameterNumeric" name="高亮参数" enabled="true" parameter-label="2-高亮筛选" parameter-description="设置亮度阈值,隔离出元件的引脚或外形" stage-name="threshold" property-name="threshold" effect-stage-name="threshold" preview-result="true" minimum-value="1.0" maximum-value="254.0" default-value="100.0" numeric-type="Integer"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ParameterNumeric" name="细节参数" enabled="true" parameter-label="3-细节调整" parameter-description="调整细节尺寸,剔除不属于元件的轮廓特征" stage-name="filterContours" property-name="minArea" effect-stage-name="contours" preview-result="true" minimum-value="0.0" maximum-value="0.25" default-value="0.01" numeric-type="SquareMillimetersToPixels"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="0" enabled="true" default-light="true" settle-option="Settle" count="1"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="MaskCircle" enabled="true" diameter="206" property-name=""/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="高斯模糊" enabled="true" kernel-size="9" property-name="BlurGaussian"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="视觉合成时用" enabled="true" diameter="100000" property-name="partmask"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="BGRtoHSV图像转换" enabled="true" conversion="Bgr2HsvFull"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.MaskHsv" name="用吸嘴背景校准数据滤色" enabled="true" auto="false" fraction-to-mask="0.0" hue-min="-1" hue-max="-1" saturation-min="-1" saturation-max="-1" value-min="-1" value-max="-1" soft-edge="0" soft-factor="1.0" invert="false" binary-mask="false" property-name="MaskHsv"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="HSVtoBGR图像转换" enabled="true" conversion="Hsv2BgrFull"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="BGR转黑白图像" enabled="true" conversion="Bgr2Gray"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="threshold" enabled="true" threshold="100" auto="false" invert="false"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.FindContours" name="findCountours" enabled="true" retrieval-mode="List" approximation-method="None"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.FilterContours" name="filterContours" enabled="true" contours-stage-name="findCountours" min-area="16.938245571712674" max-area="900000.0" property-name="FilterContours"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="轮廓内填充黑色" enabled="true" diameter="0" property-name=""/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.DrawContours" name="contours" enabled="true" contours-stage-name="filterContours" thickness="1" index="-1">
        <color r="255" g="255" b="255" a="255"/>
     </cv-stage>
     <cv-stage class="org.openpnp.vision.pipeline.stages.MinAreaRect" name="results" enabled="true" threshold-min="100" threshold-max="255" expected-angle="0.0" search-angle="45.0" left-edge="true" right-edge="true" top-edge="true" bottom-edge="true" diagnostics="false" property-name="MinAreaRect"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="调用原图像" enabled="true" image-stage-name="0"/>
     <cv-stage class="org.openpnp.vision.pipeline.stages.DrawRotatedRects" name="Draw" enabled="true" rotated-rects-stage-name="results" thickness="2" draw-rect-center="false" rect-center-radius="20" show-orientation="false"/>
  </stages>
</cv-pipeline>


Evgenij Rakhno <evgenij...@gmail.com> 于2025年7月25日周五 17:04写道:
Hi everyone
I'm interesting to change "mask" in vision pipeline (4 / 4b at pipeline) to change mask circle diameter, but I can't do this, because it write something like "set by pipiline caller" (or something like this)
How I can set this diameter manually directly in pipeline?

--
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.
Pipeline.mp4

Tao Qu

unread,
Jul 28, 2025, 12:43:27 AM7/28/25
to ope...@googlegroups.com
This is the attachment that should have been provided.

Tao Qu <kuroky...@gmail.com> 于2025年7月28日周一 12:39写道:
maskcircle.mp4

Evgenij Rakhno

unread,
Jul 28, 2025, 3:39:00 AM7/28/25
to OpenPnP
Thanks a lot! I will try to check it today!
Regards, Evgenij
Reply all
Reply to author
Forward
0 new messages