Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create footprint template if pipeline stage is used in bottom vision #1140

Merged

Conversation

doppelgrau
Copy link
Contributor

Description

The pipeline stage CreateFootprintTemplate didn't work in bottom vision, since the required attribute "footprint" was not set.
Changed the pipeline, to get the footprint with the attribute "nozzle" that is available.

Justification

Allow the generated footprint to be used in pipelines, e.g. using TemplateMatch.

<cv-pipeline>
   <stages>
      <cv-stage class="org.openpnp.vision.pipeline.stages.CreateFootprintTemplateImage" name="7" enabled="true" footprint-view="Fiducial">
         <pads-color r="255" g="255" b="255" a="255"/>
         <body-color r="0" g="0" b="0" a="255"/>
         <background-color r="0" g="0" b="0" a="255"/>
      </cv-stage>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="18" enabled="true" conversion="Bgr2Gray"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageCapture" name="0" enabled="true" default-light="true" settle-first="true" count="1"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.BlurGaussian" name="10" enabled="true" kernel-size="5"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ConvertColor" name="6" enabled="true" conversion="Bgr2Gray"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.Normalize" name="1" enabled="true"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.MaskCircle" name="4" enabled="true" diameter="400"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.Threshold" name="12" enabled="true" threshold="150" auto="false" invert="false"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.BlurMedian" name="5" enabled="true" kernel-size="9"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.MinAreaRect" name="21" enabled="true" threshold-min="10" threshold-max="255"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="9" enabled="true" image-stage-name="1"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.MatchPartTemplate" name="result" enabled="true" log="false" template-stage-name="18" model-stage-name="21" threshold="0.4000000059604645"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.SelectSingleRect" name="results" enabled="true" position="0" rotated-rects-stage-name="result"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.ImageRecall" name="14" enabled="true" image-stage-name="0"/>
      <cv-stage class="org.openpnp.vision.pipeline.stages.DrawRotatedRects" name="8" enabled="true" rotated-rects-stage-name="results" thickness="2" draw-rect-center="false" rect-center-radius="20" show-orientation="true"/>
   </stages>
</cv-pipeline>

Instructions for Use

Does not change, only works now in bottom vision.
Call the pipeline stage, get a picture of the part as configured in the footprint.

Implementation Details

  1. How did you test the change? Created a pipeline (see above)
  2. Did you follow the coding style? yes
  3. If you made changes in the org.openpnp.spi or org.openpnp.model packages you will need to add additional justification for these changes. Changes to these packages require extensive review and testing. No changes
  4. Be sure to run mvn test before submitting the Pull Request. If the tests do not pass the Pull Request will not be accepted. done

@doppelgrau
Copy link
Contributor Author

Update: can not reproduce the failing checks

@vonnieda
Copy link
Member

Looks good to me, thank you @doppelgrau!

@vonnieda vonnieda merged commit 97d95c7 into openpnp:develop Mar 12, 2021
@doppelgrau doppelgrau deleted the feature/CreateFootprintForBottomVision branch March 12, 2021 08:10
vonnieda added a commit that referenced this pull request Mar 13, 2021
* develop:
  - Update changes for recent PRs.
  Revert "NgUI - Themeable User Interface (#1142)" (#1144)
  NgUI - Themeable User Interface (#1142)
  Create footprint template if pipeline stage is used in bottom vision (#1140)
  Implement "Snap" option for OrientRotatedRets (#1138)
  ReferenceBottomVision - Part size check option for detecting bad part pick (#1135)
  - Changes / fixes ReferenceNozzle and AbstractNozzle so that setting the part during pick and place operations fires a property change. Needed for a feature @doppelgrau is working on, and just generally should have been like this from the start.
  Added GUI configurable pixel dimensions to simulated cameras (SimulatedUpCamera, ImageCamera).
  Camera transform must not be optimized while a camera is calibrating.
  Delete TRAVIS.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants