Detect Aspect Ratio¶
The detect aspect ratio plugin can be used on checkerboard style images to obtain an aspect ratio that can be used to calibrate other images in the set. This way you can, along with the white and black samples scan a checkerboard to calibrate the aspect ratio.
Theory¶
The plugin uses Harris corner detection to detect corners in checkerboard panels. Then a complex(imaginary) number sorting algorithm is used to set them into a grid shape to calculate parameters.
The plugin works based on a set of assumptions.
- The grid is perfectly aligned in X and Y direction with no rotation. This assumption has to be made because combined with the inaccuracy of the corner Harris detector it is near impossible to properly detect small rotations. Meaning for optimal results, try to lay down the checkerboard pattern as straight as possible.
- The aspect ratio is uniform troughout the wavelength range. This is an assumption that has to be made because for low and high wavelengths (outside of the visible range) it is near impossible to properly detect the checkerboard, meaning that a per-wavelength aspect ratio would be very inaccurate outside the visible range.
Using the plugin¶
- Load up the checkerboard using the plugin.
- Select an appropriate wavelength with high contrast between the white and black squares for optimal detection.
- In the image select a fully enclosed set of squares, meaning no lines of the selected region should lie on edges in the checkerboard.
- Press “Detect Corners” and observe result. The window should appear as below with the numbers sorted in order from bottom left to top right. Is this not the case, or are there points inbetween corners or were there missed corners, play with the corner Harris parameters and the used wavelength until it is correct, different images require different parameters.
- Fill out the physical image dimension section. In this section you must tell the program how many squares are in the enclosed region in the x and y direction, in the sample this is 12 x 12.
- Press Calculate parameters, the plugin will perform a dimensioning check and inform you if there is a mistake. (incorrect number of points for the shape selected) If everything is right the aspect ratio and dimensions will appear on the right.
- Apply to File(s), a window will open in which you can select files (hold CTRL) to apply this aspect ratio correction to. If you then display these images using the display plugin they will be corrected for the aspect ratio.