double endY = Double.parseDouble(txtEndY.getText());
// Calculate bounding box
double width = Math.abs(endX - startX);
double height = Math.abs(endY - startY);
// Determine how many images are needed
BufferedImage image = camera.capture();
// Figure out how many units per image we are getting
Location unitsPerPixel = camera.getUnitsPerPixel();
unitsPerPixel = unitsPerPixel.convertToUnits(Configuration.get().getSystemUnits());
double imageWidthInUnits = unitsPerPixel.getX() * image.getWidth();
double imageHeightInUnits = unitsPerPixel.getY() * image.getHeight();