Class VRControl

All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class VRControl extends PamControlledUnit implements PamSettings
The videoRange module determines location information based on photographs of objects (photogrammetry). The ideal for determining the location of an animal is to know the heading, pitch, roll, focal length, GPS location and height of a camera along with the height of the tide.

However, not all these parameters are necessarily needed to gain some sort of location information. For example, tilt and pitch, focal length and height can determine the distance to animal without the need for heading information or a GPS location.

There are various ways a user can determine required parameters, either directly from a photograph or external data. The simplest example is using the horizon to determine the pitch and tilt of the camera and manually inputting height data along with a calibration (pixels per degree/rad) value. Users may want to use external IMU data, either in real time or for post processing. Geo-tagged photos are another option.

This module is designed to provide a framework for photogrammetry. The core functionality allows users to open and view photographs/images along with any meta data. VRMethod classes are then used to provide the user interface for determining the l.ocation of an object

VRmethods use a JLayer over the photograph to allow users to select locations, draw lines etc. Each VRMethod has it's own side panel and ribbon panel to allow users to input information and select relevant. The VRMethod is responsible for calculating location information which is passed back to VRControl to be saved as a generic video range data unit.

Generic Information Handled outside VRMethods (these are used by one or more VRMethods but handled solely within a VRMethod class)

GPS location of camera

Calibration Values

Landmark Locations

Tide Information

Imported Maps

External Sensor data

Photo meta data

Author:
Doug Gillespie and Jamie Macaulay
  • Field Details

    • vrTabPanelControl

      public VRTabPane vrTabPanelControl
      Panel containing all gui components
    • SETTINGS_CHANGE

      public static final int SETTINGS_CHANGE
      Some settings in the vrparams may have changed
      See Also:
    • IMAGE_CHANGE

      public static final int IMAGE_CHANGE
      The image has changed
      See Also:
    • IMAGE_SCALE_CHANGE

      public static final int IMAGE_SCALE_CHANGE
      The scale of the image has been changed.
      See Also:
    • IMAGE_TIME_CHANGE

      public static final int IMAGE_TIME_CHANGE
      The time of the image has been changed.
      See Also:
    • HEADING_UPDATE

      public static final int HEADING_UPDATE
      The heading of the image has been changed (usually manually).
      See Also:
    • PITCH_UPDATE

      public static final int PITCH_UPDATE
      The pitch of the image has been changed (usually manually)
      See Also:
    • TILT_UPDATE

      public static final int TILT_UPDATE
      The roll of the image has been changed (usually manually), note: roll is often referred to as tilt.
      See Also:
    • METHOD_CHANGED

      public static final int METHOD_CHANGED
      The vrMethod has changed
      See Also:
    • REPAINT

      public static final int REPAINT
      A repaint has been called.
      See Also:
    • NOIMAGE

      public static final int NOIMAGE
      See Also:
    • MOUSEMOVED

      public static final int MOUSEMOVED
      The mouse has moved on the display.
      See Also:
    • LANDMARKGROUP_CHANGE

      public static final int LANDMARKGROUP_CHANGE
      The landmark group selection has been changed
      See Also:
    • HEIGHT_CHANGE

      public static final int HEIGHT_CHANGE
      The height has been changed
      See Also:
    • DBCOMMENTLENGTH

      public static final int DBCOMMENTLENGTH
      See Also:
  • Constructor Details

    • VRControl

      public VRControl(String unitName)
  • Method Details

    • getMethods

      public ArrayList<VRMethod> getMethods()
      Get an arraylist of all the vr methods currently available.
      Returns:
    • setVRMethod

      public void setVRMethod(int method)
      Set the current method.
      Parameters:
      method - - integer specifying method position in vrMethods ArrayList.
    • getCurrentMethod

      public VRMethod getCurrentMethod()
      Get the current vr Method.
      Returns:
    • getCalibrationMethod

      public AddCalibrationMethod getCalibrationMethod()
      Get the calibration method. Some dialogs require this.
      Returns:
      the AddCalibration vrmethod
    • settingsButtonAWT

      public void settingsButtonAWT(Frame frame, int tab)
      Opens the settings dialog and updates the module if new settings are saved.
      Parameters:
      frame -
      tab - - the tab to open the settings dialog on.
    • settingsButtonFX

      public void settingsButtonFX(int tab)
      Opens settings pane which updates module settings
      Parameters:
      tab - - which tab to open on. e.g. VRSettingsPane.HEIGHTTAB;
    • setVRParams

      public void setVRParams(VRParameters newParams)
      Parameters:
      newParams -
    • pasteButton

      public void pasteButton()
      Pastes an image from the computers clipboard.
    • findNextFile

      public File findNextFile(File file, ImageFileFilter filefilter, boolean forward)
      Find the next file which is approved by the Image file filter in the folder. Returns null if no file is found.
      Parameters:
      file - - current file selected in the directory. If null the first file in the directory is chosen.
      filefilter - - the file filter.
      forward - - true move forward in the folder, false move backward in the folder.
      Returns:
      the image file
    • selectHeight

      public void selectHeight(int heightIndex)
      Set the current selected height
      Parameters:
      heightIndex -
    • getCurrentHeight

      public double getCurrentHeight()
      Get the current height of the camera from sea level. Includes any offset calulated by the tide manager.
      Returns:
      the current height oif the camera from sea level- (this is fiorm the current sea level)
    • loadFile

      public void loadFile(File file)
      Load an image file
      Parameters:
      file - - image file.
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • update

      public void update(int updateType)
      Updates the VRControl depending on flag and passes update flag to the VRTabPanel (gui) and the VRMethods.
      Parameters:
      updateType -
    • notifyModelChanged

      public void notifyModelChanged(int changeType)
      Description copied from class: PamControlledUnit
      General notification when the PAMGAURD model changes.
      Overrides:
      notifyModelChanged in class PamControlledUnit
      Parameters:
      changeType - type of change
    • getVrSubStatus

      public int getVrSubStatus()
    • newMousePoint

      public void newMousePoint(Point mousePoint)
    • getImageName

      public String getImageName()
      Returns:
    • getImageTimeString

      public String getImageTimeString()
      Get the time of the current image.
      Returns:
      the image date and time string.
    • getMeasuredAnimals

      public ArrayList<VRMeasurement> getMeasuredAnimals()
      Get a list of the current measurements on the image
      Returns:
      the current measurements on the image
    • getVRParams

      public VRParameters getVRParams()
      Get the VR paramters class.
      Returns:
      the vr params.
    • getVRPanel

      public VRPane getVRPanel()
      Get the vr panel.
      Returns:
    • getVRProcess

      public VRProcess getVRProcess()
      Get the VRProcess.
      Returns:
      the vr process.
    • setMeasuredAnimals

      public void setMeasuredAnimals(ArrayList<VRMeasurement> measuredAnimals)
    • getRangeMethods

      public VRHorzMethods getRangeMethods()
    • setRangeMethods

      public void setRangeMethods(VRHorzMethods rangeMethods)
    • getMapFileManager

      public MapFileManager getMapFileManager()
      Get the file manager for shore based method maps.
      Returns:
      the map manager
    • getLocationManager

      public LocationManager getLocationManager()
      Get the location manager. This handles the location of the images.
      Returns:
      the location manager
    • getTideManager

      public TideManager getTideManager()
      Get the tide manager. This handles tide imports.
      Returns:
      tide imports.
    • setCurrentImage

      public void setCurrentImage(PamImage image)
      Set the current image.
      Parameters:
      image - - the current displayed image.
    • getCurrentImage

      public PamImage getCurrentImage()
      Get the current pam image.
      Returns:
      the current image.
    • getVRTabPanel

      public VRTabPane getVRTabPanel()
    • getImageTime

      public long getImageTime()
      Get the current image time in millis.
      Returns:
      the current image time.
    • getImageDate

      public Date getImageDate()
      Get the date of the image.
      Returns:
      the date of the image
    • getIMUListener

      public IMUListener getIMUListener()
    • isFX

      public boolean isFX()
      Check whether the GUI is FX or not.
      Returns:
    • getTideImport

      public ImportDataSystem<String> getTideImport()
      Get the import system for tide data.
      Returns:
      the tideImport
    • getImageTimeParser

      public ImageTimeParser getImageTimeParser()
      Get the current image time aprser
      Returns: