I'm a beginner in image processing and I have to create a segmentation algorithm to detect lungs from an image . Image given :
And after removing the noise from the image and applying a threshold the image should look like this :
I would like to know if there is a specific approach that is used for lung detection and segmentation .
I subtract the background
from the image , then apply the gamma function
and then the median
filter . Afterwards I perform thresholding
This is my algorithm so far in java
with imagej
and I need a cleaner result :
IJ.run(imp2, "Remove Outliers...", "radius=100 threshold=50 which=Dark"); //remove dark noise square
IJ.run(imp2, "Gamma...", "value=0.76"); //appply gamma function
IJ.run(imp2, "Subtract Background...", "rolling=2000 light"); //subtract bg
IJ.run(imp2, "Median...", "radius=20"); //Apply median filter
IJ.run(imp2, "Auto Threshold", "method=Li white"); //Li method for thresholding
IJ.run(imp2, "Invert", "");
imp2.show();
Image after algorithm :
. I would appreciate your help .