Is a desktop java application for visualization of Fourier Descriptor.
Fourier Descriptor definition: A method used in object recognition and image processing to represent the boundary shape of a segment in an image. The first few terms in a Fourier series provide the basis of a descriptor. This type of object descriptor is useful for recognition tasks because it can be designed to be independent of scaling, translation, or rotation.
Deeper theory can be found on this page: http://fourier.eng.hmc.edu/e161/lectures/fd/node1.html
Properties:
- We can reconstruct original boundary of image object from its Fourier Descriptor.
- If we remove some of the Fourier Descriptors, we receive only approximation of original shape.
- The more Fourier Descriptors are removed, the more will be the shape round.
- If only first Fourier Descriptor remains, we receive the center of the object.
- If first two Fourier Descriptors remain, we receive average radius from the center.
- If first two and last Fourier Descriptors remain, we receive eccentricity of the shape.
This application shows the effects of removing high frequency Fourier Descriptors (contains only shape details, which are less important information than those from low frequencies) from the image. The reconstruction of the shape is shown on the central image. On the bottom left corner there is a small overview of original image.
Text guide:
The main page of the application allows user to change the number of Fourier Descriptors with various tools.
- Spinner which enables entering the precise number of Fourier Descriptors or allows changing the value by one (W-key up, S-key down).
- Slider for fast modification of the number of Fourier Descriptors.
- Numerous buttons which sets the amount of used Fourier Descriptors to maximum (N-Key), minimum (J-key), half (K-key) or double (M-key) the current value.
Application also includes tools for object extraction from regular image file types:
- Choose option “Load Image” in “File” menu and chose image file.
- The image is converted to grayscale palette and afterwards to binary by given threshold.
- If automatic threshold is not chosen correctly, you can edit it with given spinner.
- Foreground of the image is white! If you want to invert the selection to black, you must enable “inverse image” option in the upper right corner.
- After you are content with thresholding, click on the “next” button in the lower right corner.
- You can return back to thresholding by pressing “back” button.
- Now, you can select object which you want to process.
- Currently selected object is highlighted in green color.
- You can choose another object with given spinner – objects are sorted by their size.
- After you click “finish”, the border of given shape is extracted and used as a template for Fourier Descriptor analysis.
It includes option to save current image as PNG.
- Choose option “Save Image” in “File” menu and chose image file name.
- Click “save” button to save the image.
It supports special type of text file, which can be imported or exported via the application.
- Those files have this structure: 1. line – comment, 2. line – dimension of the image, 3. line – comment, 4. to last – coordinates of border pixels.
- Choose option “Save Coordinates” in “File” menu to save current image in this format.
- Choose option “Load Coordinates” in “File” menu to load image from this format.
Some of the system properties can be adjusted.
- In “Setting” select “Inverse View Color” to change the foreground color to Black and background color to White.
- In “Setting” select “Fill Shape” to fill the area of the shape. All inner holes will be filled too!
- In “Setting” in “Selection Mode” select “middle”, ”last” or ”first” to change the way of selecting Fourier Descriptors for reconstruction.
Application contains preprocessed image templates which are used for fast preview of Fourier Descriptor shape approximation.
- In “Templates” click on “Shapes” to open various geometric shapes.
- In “Templates” click on “Objects” to open various real life object representations.
You can also view raw data of current shape (default coordinates, new coordinates, Fourier Descriptors values, Fourier Descriptors used for reconstruction)
- In “Tools” click on “View Raw Data” to open a table.
- Left table contains information about shape coordinates.
- Right table contains values of Fourier Descriptors calculated from shape.
If you have any further questions or encounter any problem, please contact me on e-mail address bast1@centrum.sk .