Hello,
I have an image as follows:
I am using activecontour to detect the edges of the bone.
function [bw] = segmentBone(imageFile)%Function for segmenting the bone from the background
imageFile = imageFile(:,:,1);mask_width = 1;border_width = 2;imageFile = padarray(imageFile, [border_width, border_width], 0);mask = zeros(size(imageFile));mask(mask_width:end-mask_width,mask_width:end-mask_width) = 1;small_image_itter = 651;bw = activecontour(imageFile, mask, small_image_itter, 'Chan-Vese', 'SmoothFactor', 0.95);end
This is the result I get:
The issue is that crack in the middle of the bone. I want to flatten it, so that the lower surface looks smooth. This is an example of what I want to achieve:
It is really important that the boundaries of the bone stay the same and do not get thicker!
Any ideas on how to solve this task?
Thanks in advance!
Best Answer