magnify (zoom) image of bottom vision pipeline?

142 views
Skip to first unread message

Jim Freeman

unread,
Aug 7, 2020, 12:09:21 PM8/7/20
to OpenPnP
Dear group. Is it possible to zoom the image in the bottom  vision pipeline editor (that is expand only the central region)? I currently see all pixels of the camera and it is difficult to see what exactly is going on when calibrating the nozzle. It would be great to limit the number of pixels displayed and zoom on them. (I am using a 5MP bottom camera.)
Best, Jim

Tony Luken

unread,
Aug 7, 2020, 12:48:46 PM8/7/20
to OpenPnP
If you have a mouse wheel you can use that to zoom any of the camera views.  You can control how fast it zooms by right clicking (menu select) in the camera view and changing Zoom Increment Per Mouse Wheel Tick.

Tony

ma...@makr.zone

unread,
Aug 7, 2020, 12:51:39 PM8/7/20
to ope...@googlegroups.com

Hi Jim

You can use the AffineWarp pipeline stage to extract a region from the image. It is then zoomed to that in the following stage in the editor (and in the camera view if you make it the result image). This also speeds up processing (fewer pixel to chew).

 

Use the AffineUnwarp stage to transform obtained vision results back to the full scale.

This is my pipeline, as an example for small passives:

                   <pipeline>
                        <stages>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="0" enabled="true" settle-first="true" count="1"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.AffineWarp" name="warp" enabled="true" length-unit="Millimeters" x-0="-2.5" y-0="2.5" x-1="2.5" y-1="2.5" x-2="-2.5" y-2="-2.5" scale="1.0" rectify="false" region-of-interest-property="regionOfInterest"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="13" enabled="true" prefix="bv_source_" suffix=".png"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="10" enabled="true" kernel-size="9"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="4" enabled="true" diameter="300"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="1" enabled="false" conversion="Bgr2HsvFull"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MaskHsv" name="2" enabled="false" auto="false" fraction-to-mask="0.0" hue-min="0" hue-max="255" saturation-min="0" saturation-max="255" value-min="0" value-max="128" invert="false" binary-mask="false"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="6" enabled="true" conversion="Bgr2Gray"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="12" enabled="true" threshold="145" auto="false" invert="false"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.BlurMedian" name="17" enabled="true" kernel-size="5"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MinAreaRect" name="results1" enabled="true" threshold-min="100" threshold-max="255"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="3" enabled="true" image-stage-name="warp"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.DrawRotatedRects" name="8" enabled="true" rotated-rects-stage-name="results1" thickness="2" draw-rect-center="false" rect-center-radius="40" show-orientation="true">
                              <color r="255" g="255" b="0" a="255"/>
                           </cv-stage>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.AffineUnwarp" name="results" enabled="true" warp-stage-name="warp" results-stage-name="results1"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="15" enabled="true" prefix="bv_result_" suffix=".png"/>
                        </stages>

Having said that...

Do you really need 5MP? Usually that's slow/low fps and I can't imaging where you would need such high resolution.

Does the camera have other options, perhaps with higher fps? That's usually more important.

_Mark


Am 07.08.2020 um 18:09 schrieb Jim Freeman:
Dear group. Is it possible to zoom the image in the bottom  vision pipeline editor (that is expand only the central region)? I currently see all pixels of the camera and it is difficult to see what exactly is going on when calibrating the nozzle. It would be great to limit the number of pixels displayed and zoom on them. (I am using a 5MP bottom camera.)
Best, Jim

--
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/9e0a11ff-9716-4a93-bab0-b8264d843e74o%40googlegroups.com.

ozzy_sv

unread,
Aug 8, 2020, 5:42:15 AM8/8/20
to OpenPnP
Hi Mark
you can show your pipeline   for capacitors for example 0805 and something more, for example soic-8 or soic-16

thank

ma...@makr.zone

unread,
Aug 8, 2020, 8:04:53 AM8/8/20
to ope...@googlegroups.com

For 0805 it is the same. And I don't have these large parts in my project.

Note, I'm still not running my machine "productively", I kept getting sidetracked on the OpenPnP software and feeder/3D printing side. It's a hobby: I do what is most fun ;-)

_m

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

Jim Freeman

unread,
Sep 29, 2020, 12:21:21 PM9/29/20
to OpenPnP
Hi, Mark. Thanks for the information! I used the transformations. I am able to zoom nicely on the region of interest. I have observed strange behavior though and that is why I waited replying. I am using the affine  warp stage as you showed in your message. I am using it for nozzle tip calibration. I can successfully calibrate the nozzle. But at the end of the calibration the machine moves the nozzle away. Using the "position tool over bottom camera button" in the "calibrate" tab of the nozzle tip section has no effect. the nozzle has gone somewhere else like the location of the camera got changed. If I go to the bottom camera tab of the machine setup, and use the position tab, then hit the " position tool over the center of the location" then the tool goes back to the correct place over the bottom camera and I can go from there. I am not understanding something. My pipeline is included below.

Yes, I am using a 5MP camera. I use it with the vision system to measure the part I am placing. My goal is to get about 1/1000 dimension accuracy of the part I am measuring. The parts are of order 5cm and my pixel size right now is 50microns/pixel.So I am at the accuracy limit with my pixel size. For me speed is not important so a low frame rate is not a problem.
Best, Jim


<cv-pipeline>

   <stages>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="0" enabled="true" settle-first="true" count="1"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="1" enabled="true" diameter="200"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="2" enabled="true" conversion="Bgr2Gray"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.AffineWarp" name="warp" enabled="true" length-unit="Millimeters" x-0="-2.5" y-0="2.5" x-1="2.5" y-1="2.5" x-2="-2.5" y-2="-2.5" scale="1.0" rectify="true" region-of-interest-property="regionOfInterest"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="3" enabled="true" threshold="25" auto="false" invert="true"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.BlurMedian" name="4" enabled="true" kernel-size="5"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DetectCirclesHough" name="results" enabled="true" min-distance="50" min-diameter="10" max-diameter="50" dp="1.0" param-1="120.0" param-2="5.0"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="5" enabled="true" image-stage-name="warp"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DrawCircles" name="6" enabled="true" circles-stage-name="results" thickness="2">
         <color r="255" g="0" b="51" a="255"/>
         <center-color r="0" g="204" b="255" a="255"/>
      </cv-stage>
      <cv-stage class="org.openpnp.vision.pipeline.stages.AffineUnwarp" name="8" enabled="true"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="7" enabled="true" prefix="runoutCalibration" suffix=".png"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="10" enabled="false" settle-first="false" count="1"/>
   </stages>
</cv-pipeline>

ma...@makr.zone

unread,
Sep 29, 2020, 3:30:53 PM9/29/20
to ope...@googlegroups.com

Hi Jim

You need to make sure the AffineUnwarp stage is effective for the "results" stage, i.e. it must be inserted before or even become the "results" stage. Ususally this means you needn to rename the original "results" stage. This is because AffineWarp changes the pixel coordinate system. So we need to transform the results back to the full image pixel coordinate system.

This is one of my bottom vision pipelines for guidance:

                    <pipeline>
                        <stages>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="0" enabled="true" settle-first="true" count="1"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.AffineWarp" name="warp" enabled="true" length-unit="Millimeters" x-0="-2.5" y-0="2.5" x-1="2.5" y-1="2.5" x-2="-2.5" y-2="-2.5" scale="1.0" rectify="false" region-of-interest-property="regionOfInterest"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="13" enabled="true" prefix="bv_source_" suffix=".png"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="10" enabled="true" kernel-size="9"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="4" enabled="true" diameter="300"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="1" enabled="false" conversion="Bgr2HsvFull"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MaskHsv" name="2" enabled="false" auto="false" fraction-to-mask="0.0" hue-min="0" hue-max="255" saturation-min="0" saturation-max="255" value-min="0" value-max="128" invert="false" binary-mask="false"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="6" enabled="true" conversion="Bgr2Gray"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="12" enabled="true" threshold="145" auto="false" invert="false"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.BlurMedian" name="17" enabled="true" kernel-size="5"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.MinAreaRect" name="results1" enabled="true" threshold-min="100" threshold-max="255"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="3" enabled="true" image-stage-name="warp"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.DrawRotatedRects" name="8" enabled="true" rotated-rects-stage-name="results1" thickness="2" draw-rect-center="false" rect-center-radius="40" show-orientation="true">
                              <color r="255" g="255" b="0" a="255"/>
                           </cv-stage>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.AffineUnwarp" name="results" enabled="true" warp-stage-name="warp" results-stage-name="results1"/>
                           <cv-stage class="org.openpnp.vision.pipeline.stages.ImageWriteDebug" name="15" enabled="true" prefix="bv_result_" suffix=".png"/>
                        </stages>

                     </pipeline>

_Mark

Reply all
Reply to author
Forward
0 new messages