This is the initial work on the camera calibration and distance calculation tool described in #297 . This is a huge amount of code, so I thought that I'd start a PR for the current work completed.
Basic idea for the system:
User captures calibration images from each camera and saves them to a folder. These images can be viewed or deleted in the GUI (Finished in this PR)
The user requests to capture an image from a camera which will be undistorted using the camera calibration information found from the first tool. Currently able to get the distortion matrix for a set of images; need to create the distortion correction code. (Half finished in this PR)
During the image capture all of the current ROV sensor information will be saved and somehow linked to the photo (only need pitch and depth, but more the better). (Not started)
The user will be able to draw a triangle on the image (by choosing valid ground plane points) and calculate the relative distances and angles between them (Not started)
The major additions to the codebase are the new GalleryView and GalleryViewController objects. This will enable us to load an image folder in a JavaFX view and display it to the user. The view contains two Subjects which will let the user refresh the folder and subscribe to selected images. In the CameraCalibrationView selecting an image will open a fullscreen view of that image. In the DistanceCalculatorView the idea is that the user will open plotter tool to create the ground plane triangle.
I wanted the view to grab the folder locations from the config, so I decided to create a new annotation for injecting objects in the viewloader. The new @Configurable("lookup") annotation will automatically grab a config from the Config object and inject it into a ViewController. Here is an example from CameraCalibrationViewController:
@Inject
public CameraCalibrationViewController(
final CameraCalibrationView view,
final GalleryView cameraACalibration,
final GalleryView cameraBCalibration,
final VideoDecoder videoDecoder,
@Configurable("cameraCalibration")final CameraCalibrationConfig config
) {
This camera calibration config is also passed to the CameraCalibration object which handles the magic opencv code. I tried to add a lot of documentation to this section seeing as the JavaCV docs are not the greatest.
This is the initial work on the camera calibration and distance calculation tool described in #297 . This is a huge amount of code, so I thought that I'd start a PR for the current work completed.
Basic idea for the system:
The major additions to the codebase are the new
GalleryView
andGalleryViewController
objects. This will enable us to load an image folder in a JavaFX view and display it to the user. The view contains twoSubject
s which will let the user refresh the folder and subscribe to selected images. In theCameraCalibrationView
selecting an image will open a fullscreen view of that image. In theDistanceCalculatorView
the idea is that the user will open plotter tool to create the ground plane triangle.I wanted the view to grab the folder locations from the config, so I decided to create a new annotation for injecting objects in the viewloader. The new
@Configurable("lookup")
annotation will automatically grab a config from theConfig
object and inject it into aViewController
. Here is an example fromCameraCalibrationViewController
:This camera calibration config is also passed to the
CameraCalibration
object which handles the magic opencv code. I tried to add a lot of documentation to this section seeing as the JavaCV docs are not the greatest.