This repo features an image processing algorithm that undistorts images along with segmentation of cod and classification of damage to cod.
The input is pictures of cod and the output is an image where wound on cod is marked and tagged along with a CDI (catch damage index). The CDI marks which image file names that contains cod with wounds.
-
Put cod images into fish_pics/input_images.
-
Select the run mode by setting the script parameters in the configurations or passing them in command line/terminal/shell. How to pass arguments for a python script :
- "n" : Run the program using only openCV functions
- "y" : Run the program using own built functions
- "y e": Run the program using own built functions, and see not yet finished version of future implementations
NOTE: when running the program using own built functions it normally takes 420 sec. for one image. Consider having only few images in fish_pics/input_images
-
The output is saved.
- Images for manual inspection is saved in fish_pics/output_images/manual_inspection
- Images for manual inspection with CLAHE applied is saved in fish_pics/output_images/manual_inspection_CLAHE
- Images where wounds are marked are saved in fish_pics/output_images/marked_images
- The CDI is saved in output_CDI
- Optional: run recalibration of intrinsic parameters for undistortion:
- Put checkerboard images into calibration/checkerboard_pics
- Run the python script calibration/main_harris-corner-detection.py. A .mat file is generated - "calibration/image_points_checkerboard/image_points_for_MATLAB.mat"
- Run the MATLAB script calibration/GetCameraParameters.m that uses the .mat file generated from previous step. The script generates the parametres k_1, k_2, imgCenterX, imgCenterY, Fx and Fy, that is py into parameters.yaml. The intrinsic parameters are now calibrated
- Grass fire algorithm
- Harris corner detection
- Thresholding
- Find center of contur mass
- Camera calibration
- Blur