Hi,
I need to find the path from the attached displacement field attached as .MAT file. My code was working on other data sets that I was analyzing but is not working for the new data set I have.
Currently I am using following code:
Igray = mat2gray(dispfield);th = multithresh(Igray,2);Iseg = imquantize(Igray,th);se = strel('disk',1);BW1 = bwperim(Iseg == 1);BW1 = imdilate(BW1,se);BW2 = bwperim(Iseg == 2);BW2 = imdilate(BW2,se); BWedge = BW1 & BW2;BWedge = bwmorph(BWedge,'skel',Inf);bwedge = BWedge;[Y,X] = find(bwedge); cracklinefit = fit(X,Y,'poly3','Normalize','on');% cracklinefit = fit(X,Y,'poly3','Normalize','on','Robust','Bisquare');
outputArg3 = [1:size(bwedge,2)]';outputArg2 = round(cracklinefit(outputArg3));
Best Answer