Fiducial vision question

117 views
Skip to first unread message

Marshall S. (Alakuu)

unread,
Jan 18, 2025, 1:43:04 AM1/18/25
to OpenPnP
Is it possible to get vision to recognize a through-hole as a fiducial?
I have 1.7mm pad with a 1mm hole in the center that I'd like to use as fiducial markers. Is that possible? I can't seem to get it to recognize the pads.

Mike Menci

unread,
Jan 18, 2025, 2:52:57 AM1/18/25
to OpenPnP
Yes it is possible.   
On some of PCBs I have used vias as fiducials, because there was no fiducial on PCB.  
Can you send a Down camera picture of your trough-hole?

Clemens Koller

unread,
Jan 18, 2025, 9:40:08 AM1/18/25
to ope...@googlegroups.com
Yes, it's possible. Maybe you need to create your own vision pipeline is the
requirements are special, but that's also possible.

Clemens

On 18/01/2025 07.43, Marshall S. (Alakuu) wrote:
> Is it possible to get vision to recognize a through-hole as a fiducial?
> I have 1.7mm pad with a 1mm hole in the center that I'd like to use as fiducial markers. Is that possible? I can't seem to get it to recognize the pads.
>
> --
> 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 <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/openpnp/59370a6e-d837-49b4-92ee-b13b0308a131n%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/59370a6e-d837-49b4-92ee-b13b0308a131n%40googlegroups.com?utm_medium=email&utm_source=footer>.

tonyl...@gmail.com

unread,
Jan 18, 2025, 12:12:00 PM1/18/25
to OpenPnP
Just a bit more detail:
1. Go to your Packages tab and create a new package for the via fiducial. Name it something like "VIA-FIDUCIAL-1.0x1.7". 
2. Then go to its Footprint tab and add one pad with a Width and Length equal to the diameter of the via hole (1.000 in this case) and 100% Roundness. 
3. Select the Fiducial Vision Settings tab and click on Specialize for VIA_FIDUCIAL_1.0x1.7 button. If you have your camera over one of the vias you want to use, you can then click on the Edit Pipeline button to see if it is correctly detecting the via hole. Make changes there if you need them, but the default pipeline will probably work ok.
4. Now go to the Parts tab and create a new part for the via fiducial and assign it the package you just created above.
5. Now go to the Boards tab and select your board definition. You need to add a new placement for each of the vias you want to use assigning them the part you created in step 4. You will need to assign the X-Y coordinates for each of the vias from your CAD program. Be sure to set the Type to FIDUCIAL.

Mike Menci

unread,
Jan 18, 2025, 12:45:25 PM1/18/25
to OpenPnP
Or you can tweak this pipeline - it should work: 
<cv-pipeline>
   <stages>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="image" enabled="true" default-light="true" settle-option="Settle" count="1"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="debug_original" enabled="true" prefix="fidloc_original_" suffix=".png"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="7" enabled="true" kernel-size="7" property-name="BlurGaussian"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="6" enabled="true" threshold="5" auto="true" invert="false"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="image_gray" enabled="true" conversion="Bgr2Gray"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.Normalize" name="5" enabled="true"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="4" enabled="true" kernel-size="3" property-name="BlurGaussian"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="2" enabled="true" diameter="150" property-name="MaskCircle"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ThresholdAdaptive" name="1" enabled="true" adaptive-method="Gaussian" invert="false" block-size="3" c-parm="0"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DetectCirclesHough" name="0" enabled="true" min-distance="60" min-diameter="10" max-diameter="35" dp="1.0" param-1="80.0" param-2="20.0"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DrawCircles" name="8" enabled="true" circles-stage-name="0" thickness="1">
         <center-color r="102" g="102" b="0" a="255"/>
      </cv-stage>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="recall_image" enabled="true" image-stage-name="image"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DrawCircles" name="3" enabled="true" circles-stage-name="0" thickness="3">
         <color r="204" g="0" b="0" a="255"/>
      </cv-stage>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertModelToKeyPoints" name="results" enabled="true" model-stage-name="0"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DrawKeyPoints" name="draw_keypoints" enabled="true" key-points-stage-name="results"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="debug_results" enabled="true" prefix="fidloc_results_" suffix=".png"/>
   </stages>
</cv-pipeline>

Marshall S. (Alakuu)

unread,
Jan 19, 2025, 10:24:31 AM1/19/25
to OpenPnP
Had some weather critical things pull me away from this. The vision pipeline I'll try implementing.
I wasn't having much luck originally with the hole in the center with either of the two default fiducial pipelines but I imagine I should be able to get it running here.
I'll just have to figure out how to create another fiducial vision method which I believe shouldn't be too difficult.

Thank you both for the crazy amount of help right off the bat!

mark maker

unread,
Jan 19, 2025, 12:08:34 PM1/19/25
to ope...@googlegroups.com

Just my 2 cents:

  1. Use the modern stock pipeline with Circular Symmetry, not the ancient one by mike (no offense, mike 😇). See here how.
  2. Be sure to use the outer contour i.e. the solder land  of the through hole, not the inner edge of the hole itself. Your copper layer should be the reference, not the drilling (which is less precise, and might have a jagged edge).
  3. Problems of using holes and other 3D structures: see the Wiki explanation about parallax problems, this might also apply to regular fiducials, at least if you use the useful parallax method.
  4. It must obviously be a round solder land, not rectangular, octagonal or oblong etc.
  5. Ideally, use a through hole that has no lead on the upper side, so you get a nice round contour all around. If you don't have them, it might still work, the Circular Symmetry method is probably robust enough to cope with irregularities like small leads.
  6. Ideally there is a clearing (solder mask) around it. 
  7. That's also why vias are suboptimal, as they are normally covered (and also too small).

Report back how it goes.

_Mark

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/dc9bf2be-cf97-4119-acb3-48b02ecafc86n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages