This repository contains sample scripts used to implement the Filtered Canny algorithm on MATLAB software.
This code is based on a hybrid combination of Otsu segmentation and Canny edge detection. Contours obtained using segmentation are used to form a 2D morphological mask which is applied as a spatial filter to 2D gradient maps used to compute Canny contours.
To run the code, simply input your raw image and the chosen width of the mask and run the script provided. The code will output an image with the detected edges in logical format (1: edge, 0: no edge). The code may require certain MATLAB toolboxes (i.e., Image Processing Toolbox) which can be downloaded from the official MathWorks website. To read .im7 format files, the independent PIVMat Toolbox may be required (http://www.fast.u-psud.fr/pivmat/), alongside the ReadIMX package available upon registration on the LaVision official website (http://www.lavision.de/en/).
Note that while this code provides a solid foundation for flame front detection, it may not be optimized for all types of data. Therefore, it is recommended that you review the code and adjust it as needed to achieve the best results for your specific use case. Parameters which may require tuning are the pre-processing settings and minor morphological operations (i.e., bwareaopen, bwmorph).
## Content
- MATLAB (R2021b) flame front detection script (scripts/fdetect.m).
- Raw OH-PLIF images used for demonstration purposes (images/).