Image Region Filtering, Line Fitting
18 views (last 30 days)
I am actually trying to connect the centroids in the form of a curved line and only want to keep the regions along the line.
Input Binary Image.
labeledImage = labelmatrix(bwconncomp(binaryImage,8));
props = regionprops(labeledImage, 'All');
allCentroids = vertcat(props.Centroid);
% Sort Based on Xs (For Segregation)
allCentroids = sortrows(allCentroids,1);
% Analyse and Filter Outliers Regions
regions_to_keep = ???? % How should I approach ? I may have to set various if-else checks. Please guide me through.
% Desired Output Images are also attached.
binaryImage = ismember(labeledImage, find(regions_to_keep));
The Centroids and Line (OUTPUT):
- Here I am coming across a problem in which false regions are joined with the vertebral column. How to get rid of this problem?
The Desired Output?
- So far I have manually done this Image, as a last resort I am planning to call for user input and select/reject the regions based on user input.
So, in summary, I am facing the difficulty as follows:-
- Plotting the Curved Line Across Centroids (ONLY ALONG THE VERTERBAL COLUMN)
- False Regions merging into the Vertebral Column.