Class VRLandMarkMethod
java.lang.Object
videoRangePanel.vrmethods.AbstractVRMethod
videoRangePanel.vrmethods.landMarkMethod.VRLandMarkMethod
- All Implemented Interfaces:
VRMethod
The LandMark uses landmarks at known positions or at known angles from the
position the image was taken to calculate an animal's position. Two
Landmark's essentially give you the four out of the five vital bits of
information required to get a true location (on the sea surface). Image
bearing, pitch and tilt and degrees per pixel. The fifth bit of information ,
the height from which the image was taken, is defined by the user.
Angular convention for this module and method.
Bearing- 0==north, 90==east 180=south, 270==west
Pitch- 90=-g, 0=0g, -90=g
Tilt 0->180 -camera turning towards left to upside down 0->-180 camera turning right to upside down
- Author:
- Jamie Macaulay
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
New image orientation measurement.static final int
New measurement has been made.static final int
static final int
Fields inherited from class videoRangePanel.vrmethods.AbstractVRMethod
MEASURE_ANIMAL, MEASURE_DONE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
calcAnimalBearing
(double tilt, Point lndmrkPoint, Point animalPoint, double calValue) Calculates the bearing of the target animal based on a landmark point, the animal location and a calibration value;static double
calcAnimalPitch
(double tilt, Point lndmrkPoint, Point animalPoint, double calValue) Calculates the pitch of the target animal based on a landmark point, the animal location and a calibration value;static double
calcBearingDiffAnimal
(double tilt, Point landmrkp1, Point animal) Calculates the bearing of the animal in pixelsstatic Point
calcPerpPoint
(double tilt, double bearingDiff, Point landMark2) Calculates the point at which the perpendicular corner of the pitch/bearing triangle resides.calcPerpPoint
(double tilt, Point landmrkP1, Point landmrkP2, LandMark landmrk1, LandMark landmrk2, LatLong imagePos) Calculates location of the perpendicular vertex of the triangle defined by landmarks 1 and 2, with the side of the triangle following the tilt of the picture.static double
Calculate the pitch between a landMark and image location.static double
calcPitchDiffAnimal
(double tilt, Point landmrkp1, Point animal) Calculates the pitch of the animal in pixelsstatic double
Calculates the tilt of the image based on two landmarks selected on that image and the known angles between those landmarks.static double
void
calcVals()
Calculate the mean pixels per degree and the tilt of the mean tilt of the image based on the set landmarks.void
void
Clears all user interactions and resets overlay.int
Get the current status flag.getImagePos
(boolean tideHeight) Return the position the image was taken from.Get the current landmark points.getName()
The name of this type of analysis method.The AWT overlay.The FX overlay.Get the currently selected landmark group.Get the currently set landmarks.getTilt()
Get the current tiltTilt measurment for all combinations of landmarks.Get the controller for the module.boolean
Check whether a landmark based calculation is ready.boolean
Check whether a landmark is in the current list of landmarks whihc have been set.void
measureAnimal
(Point point) Measure the location of an animal for a certain location in the image.void
Print the current values.void
removeLandMark
(LandMark landMark) Remove a landmark from the landmark list.void
setCurrentStatus
(int flag) Set the current status flag.setImagePosVals
(VRMeasurement measurement) Calculate the image bearing, pitch and tilt.void
setLandMark
(LandMark landMark, Point point) Set a landmark in the set landmarks list.void
update
(int updateType) Called from other parts of the module whenever a method panel may needed updated e.g.static double
wrap360
(double t) Make sure an angle falls between zero and 2pi(360 degrees)Methods inherited from class videoRangePanel.vrmethods.AbstractVRMethod
calcLocLatLong, calculateHorizonTilt, getCandidateMeasurement, getGPSinfo, getGPSinfo, getHorizonPixel, getHorizonTilt, getImageHeading, getImagePitch, newAnimalMeasurement_Horizon, setHorizonTilt
-
Field Details
-
SET_LANDMARK
public static final int SET_LANDMARK- See Also:
-
SET_LANDMARK_READY
public static final int SET_LANDMARK_READY- See Also:
-
NEW_IMAGE_BEARING_CAL
public static final int NEW_IMAGE_BEARING_CALNew image orientation measurement.- See Also:
-
NEW_MESURMENT
public static final int NEW_MESURMENTNew measurement has been made.- See Also:
-
-
Constructor Details
-
VRLandMarkMethod
VRLandMark method constructor- Parameters:
vrControl
- - reference to the vrControl.
-
-
Method Details
-
getName
Description copied from interface:VRMethod
The name of this type of analysis method.- Returns:
- the name of the method
-
getSelectedLMGroup
Get the currently selected landmark group. This contains a list of the landmarks which can be set on the image- Returns:
- the current landmark group.
-
setImagePosVals
Calculate the image bearing, pitch and tilt.- Parameters:
measurement
- - the measurement data unit.- Returns:
- the updated measurment data unit.
-
wrap360
public static double wrap360(double t) Make sure an angle falls between zero and 2pi(360 degrees)- Returns:
- angle between 0 and 360;
-
measureAnimal
Measure the location of an animal for a certain location in the image.- Parameters:
point
- - the location of the animal in pixels on the screen
-
calcVals
public void calcVals()Calculate the mean pixels per degree and the tilt of the mean tilt of the image based on the set landmarks. Note there must be at least two landmarks but more is preferable. -
isInList
Check whether a landmark is in the current list of landmarks whihc have been set.- Parameters:
landMark
- - the landmakr to check- Returns:
- true if in the list.
-
setLandMark
Set a landmark in the set landmarks list.- Parameters:
landMark
- - the landmark on the screen.point
- - the location of the landmark on the image.
-
removeLandMark
Remove a landmark from the landmark list.- Parameters:
landMark
- - the landmark to remove.
-
isCalcReady
public boolean isCalcReady()Check whether a landmark based calculation is ready. If there are two landmarks then the method is ready for an animal measurement.- Returns:
- true if ready for measurement;
-
getRibbonPanel
-
getSettingsPanel
-
clearOverlay
public void clearOverlay()Description copied from interface:VRMethod
Clears all user interactions and resets overlay. Required for changes to settings, picture being changed and other interactions not directly associated with the VRMethod. -
clearLandMarks
public void clearLandMarks() -
update
public void update(int updateType) Description copied from interface:VRMethod
Called from other parts of the module whenever a method panel may needed updated e.g. when new calibration data is manually added in the settings dialog.- Specified by:
update
in interfaceVRMethod
- Overrides:
update
in classAbstractVRMethod
- Parameters:
updateType
- - the update flag.
-
printValues
public void printValues()Print the current values. -
calcAnimalBearing
public static double calcAnimalBearing(double tilt, Point lndmrkPoint, Point animalPoint, double calValue) Calculates the bearing of the target animal based on a landmark point, the animal location and a calibration value;- Parameters:
tilt
- - tilt of the image in radians.calValue
- - calibration value in pixels per degreelandmrkp1
- -landmark point.animal
- -animal point.- Returns:
- bearing relative to the landmark - radians.
-
calcAnimalPitch
public static double calcAnimalPitch(double tilt, Point lndmrkPoint, Point animalPoint, double calValue) Calculates the pitch of the target animal based on a landmark point, the animal location and a calibration value;- Parameters:
tilt
- - tilt of the image in radians.calValue
- - calibration value in pixels per degree.landmrkp1
- -a point on the image for which we know the pitch and bearing.animal
- -animal point.- Returns:
- pitch relative to the landmark .radians.
-
calcBearingDiffAnimal
Calculates the bearing of the animal in pixels- Parameters:
tilt
- - tilt of the image in radians.landmrkp1
- -a point on the image for which we know the pitch and bearing.animal
- -animal point.- Returns:
- bearing in pixels.
-
calcPitchDiffAnimal
Calculates the pitch of the animal in pixels- Parameters:
tilt
- - tilt of the image in radians.landmrkp1
- -a point on the image for which we know the pitch and bearing.animal
- -animal point.- Returns:
- bearing in pixels.
-
calcPerpPoint
public Point calcPerpPoint(double tilt, Point landmrkP1, Point landmrkP2, LandMark landmrk1, LandMark landmrk2, LatLong imagePos) Calculates location of the perpendicular vertex of the triangle defined by landmarks 1 and 2, with the side of the triangle following the tilt of the picture.- Parameters:
tilt
- -tilt of imagelandmrkP1
- -landmark 1 point on imagelandmrkP2
- -landmark 2 point on imagelandmrk1
- -landmark 1landmrk2
- -landmark 2imagePos
- -the from which the image was taken from. Note that this can be null if the landmarks are defined by bearings rathar than GPS co-ordinates.- Returns:
- the perpindicular vertex of a tringle where the other two vertex have been defined by landmark points.
-
calcPerpPoint
Calculates the point at which the perpendicular corner of the pitch/bearing triangle resides.- Parameters:
tilt
- -tilt in radiansbearingDiff
- -difference in bearing angle, in pixels.
-
calcTilt
-
calcPitch
Calculate the pitch between a landMark and image location.- Parameters:
landMrk
- -current landmarkimagePos
- -image location- Returns:
-
calcTilt
public static double calcTilt(Point landmrkP1, Point landmrkP2, double bearingDiff, double pitchDiff) Calculates the tilt of the image based on two landmarks selected on that image and the known angles between those landmarks.- Parameters:
landmrkP1
- - the location on the image of landmark1-pixelslandmrkP2
- - the location on the image of landmark2-pixelsbearingDiff
- - the difference in heading between landMark1 and landMark2pitchDiff
- - the difference in pitch between landMark1 and landMark2- Returns:
- tilt in radians
-
getImagePos
Return the position the image was taken from. This is either the location from which bearings were determined for the current land mark group or uses the location manager to determine a position. Note that in the event any landmark is defined by bearings rather than a latlong then the position of the image has to be the location from which those bearings were calculated.- Returns:
- the position of the image.
-
getTilt
Get the current tilt- Returns:
- the tilt
-
getVRControl
Get the controller for the module.- Returns:
- the control
-
getCurrentStatus
public int getCurrentStatus()Get the current status flag.- Returns:
- the status flag.
-
setCurrentStatus
public void setCurrentStatus(int flag) Set the current status flag.- Parameters:
flag
- - the current status flag to set
-
getLandMarkPoints
Get the current landmark points.- Returns:
- the land mark points.
-
getTiltVals
Tilt measurment for all combinations of landmarks.- Returns:
- array list of points.
-
getSetLandMarks
Get the currently set landmarks.- Returns:
- the set landmarks
-
getOverlayAWT
Description copied from interface:VRMethod
The AWT overlay. This handles all graphical interactions within AWT- Returns:
- the awt overlay
-
getOverlayFX
Description copied from interface:VRMethod
The FX overlay. This handles all graphical interactions within JavaFX- Returns:
- the awt overlay
-