Class VisionSolutions
- java.lang.Object
-
- org.openpnp.machine.reference.solutions.VisionSolutions
-
- All Implemented Interfaces:
Solutions.Subject
public class VisionSolutions extends java.lang.Object implements Solutions.Subject
This helper class implements the Issues & Solutions for the Vision milestone.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VisionSolutions.VisionFeatureIssue
-
Field Summary
Fields Modifier and Type Field Description protected long
diagnosticsMilliseconds
-
Constructor Summary
Constructors Constructor Description VisionSolutions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Length
autoCalibrateCamera(ReferenceCamera camera, HeadMountable movable, java.lang.Double expectedDiameter, java.lang.String diagnostics, boolean secondary, boolean autoFocus)
As we don't know anything about the camera yet, the preliminary auto-calibration is somewhat of a chicken and egg proposition.void
calibrateVisualHoming(ReferenceHead head, ReferenceCamera defaultCamera, Length fiducialDiameter)
Calibrate the visual homing.Location
centerInOnSubjectLocation(ReferenceCamera camera, HeadMountable movable, Length subjectDiameter, java.lang.String diagnostics, boolean secondary)
A fiducial/nozzle tip locator using the same built-in subject detection as the auto-calibration.void
findIssues(Solutions solutions)
Report any detected issue and proposed solution in the list.long
getDiagnosticsMilliseconds()
CvStage.Result.Circle
getExpectedOffsetsAndDiameter(ReferenceCamera camera, HeadMountable movable, Location location, Length expectedDiameter, boolean secondary)
Length
getHomingFiducialDiameter()
double
getSettleAcceptableComputeTime()
double
getSettleMaximumPixelDiff()
double
getSettleTestMoveMm()
double
getSettleWantedResolutionMm()
CvStage.Result.Circle
getSubjectPixelLocation(ReferenceCamera camera, HeadMountable movable, CvStage.Result.Circle expectedOffsetAndDiameter, double extraSearchRange, java.lang.String diagnostics, DetectCircularSymmetry.ScoreRange scoreRange, boolean rough)
Before we know anything about the camera, we cannot use pipelines, so we use the DetectCircularSymmetry stage directly.int
getSuperSampling()
long
getZeroKnowledgeSettleTimeMs()
boolean
isSolvedPrimaryXY(ReferenceHead head)
boolean
isSolvedPrimaryZ(ReferenceHead head)
boolean
isSolvedSecondaryXY(ReferenceHead head)
boolean
isSolvedSecondaryZ(ReferenceHead head)
VisionSolutions
setMachine(ReferenceMachine machine)
void
zeroKnowledgeMoveTo(HeadMountable hm, Location location, boolean safeZ)
Moves the head-mountable to a location at safe Z using a conservative backlash-compensation scheme.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openpnp.model.Solutions.Subject
getSubjectIcon, getSubjectText
-
-
-
-
Method Detail
-
setMachine
public VisionSolutions setMachine(ReferenceMachine machine)
-
getSuperSampling
public int getSuperSampling()
-
getDiagnosticsMilliseconds
public long getDiagnosticsMilliseconds()
-
getZeroKnowledgeSettleTimeMs
public long getZeroKnowledgeSettleTimeMs()
-
getSettleWantedResolutionMm
public double getSettleWantedResolutionMm()
-
getSettleAcceptableComputeTime
public double getSettleAcceptableComputeTime()
-
getSettleMaximumPixelDiff
public double getSettleMaximumPixelDiff()
-
getSettleTestMoveMm
public double getSettleTestMoveMm()
-
findIssues
public void findIssues(Solutions solutions)
Description copied from interface:Solutions.Subject
Report any detected issue and proposed solution in the list.- Specified by:
findIssues
in interfaceSolutions.Subject
-
autoCalibrateCamera
public Length autoCalibrateCamera(ReferenceCamera camera, HeadMountable movable, java.lang.Double expectedDiameter, java.lang.String diagnostics, boolean secondary, boolean autoFocus) throws java.lang.Exception
As we don't know anything about the camera yet, the preliminary auto-calibration is somewhat of a chicken and egg proposition. The current solution is very simple: we just stake out three points in the camera view that we assume will always fit in (seezeroKnowledgeDisplacementMm
The three points define the X and Y axis grid.- Parameters:
camera
-movable
-expectedDiameter
-diagnostics
-secondary
- true if this should calibrate the secondary units per pixel- Returns:
- The diameter of the detected feature.
- Throws:
java.lang.Exception
-
centerInOnSubjectLocation
public Location centerInOnSubjectLocation(ReferenceCamera camera, HeadMountable movable, Length subjectDiameter, java.lang.String diagnostics, boolean secondary) throws java.lang.Exception
A fiducial/nozzle tip locator using the same built-in subject detection as the auto-calibration. This supports vision calibration early in the machine setup process, i.e. long before the user should be confronted with editing fiducial locator and nozzle tip calibration pipelines.- Parameters:
camera
-movable
-diagnostics
-secondary
-- Returns:
- Throws:
java.lang.Exception
-
getExpectedOffsetsAndDiameter
public CvStage.Result.Circle getExpectedOffsetsAndDiameter(ReferenceCamera camera, HeadMountable movable, Location location, Length expectedDiameter, boolean secondary)
-
getSubjectPixelLocation
public CvStage.Result.Circle getSubjectPixelLocation(ReferenceCamera camera, HeadMountable movable, CvStage.Result.Circle expectedOffsetAndDiameter, double extraSearchRange, java.lang.String diagnostics, DetectCircularSymmetry.ScoreRange scoreRange, boolean rough) throws java.lang.Exception
Before we know anything about the camera, we cannot use pipelines, so we use the DetectCircularSymmetry stage directly. We can get a pixel locations for now.- Parameters:
camera
-movable
-expectedOffsetAndDiameter
-extraSearchRange
- Specifies an extra search range, relative to the camera view size (minimum of width, height).diagnostics
-scoreRange
-rough
- TODO- Returns:
- The match as a Circle.
- Throws:
java.lang.Exception
-
zeroKnowledgeMoveTo
public void zeroKnowledgeMoveTo(HeadMountable hm, Location location, boolean safeZ) throws java.lang.Exception
Moves the head-mountable to a location at safe Z using a conservative backlash-compensation scheme. Used to get precise camera and camera subject positioning before proper backlash compensation can be configured and calibrated.- Parameters:
hm
-location
-safeZ
-- Throws:
java.lang.Exception
-
isSolvedPrimaryXY
public boolean isSolvedPrimaryXY(ReferenceHead head)
-
isSolvedPrimaryZ
public boolean isSolvedPrimaryZ(ReferenceHead head)
-
isSolvedSecondaryXY
public boolean isSolvedSecondaryXY(ReferenceHead head)
-
isSolvedSecondaryZ
public boolean isSolvedSecondaryZ(ReferenceHead head)
-
calibrateVisualHoming
public void calibrateVisualHoming(ReferenceHead head, ReferenceCamera defaultCamera, Length fiducialDiameter) throws java.lang.Exception
Calibrate the visual homing.- Parameters:
head
-defaultCamera
-fiducialDiameter
-- Throws:
java.lang.Exception
-
getHomingFiducialDiameter
public Length getHomingFiducialDiameter()
-
-