Hello, I have consulted this community very often and it has helped me a lot. This is my first direct question as I have a rather unique problem. Without going into too much detail, I am trying to develop a tracking-like program to trace linear lines in input photos of fingerprints. In this specific case, the visual shape of a curve is still apparent through the distribution of telltale droplets of residue, which I have segmented as individual boundaries using the bwboundary feature.
In low quality regions (below), the ridges are not distinct and there is much more noise, but these droplet points still can be seen to exhibit linear character.
I am trying to put together a segmentation workflow to cut the noise of these disparate points and to automatically 'join the dots'. I'm imagining some sort of fitting function that best fits a straight line or curve to intercept as many points as possible in a best-fit fashion. In a more basic sense, when you have points that have a linear arrangment among other noise points, is there a way to highlight the ones that follow that linear/curve character?
Code section for the segmentation above
%A manual binarization threshold value
highestValueToPlot = 200
%Percentile value to determine the minimum permeter threshold of boundaries to include, i.e. filter out boundaries below a certain percentile of perimeter values
dotpercentile = 85
% Threshold image - manual threshold
BW = cropim > highestValueToPlot;
imshow(BW);
pointbin = BW;
% Adjust data to span data range.
cropim = imadjust(cropim);
% Create masked image.
maskedImage = cropim;
maskedImage(~BW) = 0;
bwbound = bwboundaries(maskedImage);
%Filter small boundaries
dotthreshold = prctile(cellfun(@length,bwbound),dotpercentile);
bwfilter = cellfun(@length,bwbound) >= dotthreshold;
filteredbound = bwbound(bwfilter);
I apologize for the messiness or clumsiness of the code, I don't have a formal coding background and this is a cross-disciplinary project; I am learning the basic of MATLAB and Image segmentation on the go for this project. Also not intending for anyone to do my work for me, just looking for promising directions to study and implement. Any comments or criticism of this existing workflow also welcomed.