Can Anyone help me how can i implement this concept ?

Following image processing, we apply tracing software to identify the axes of fibers, recognize and maintain cross-links between fibers, and extract the diameter, length, and orientation of fibers. To extract 2D information from an image, we apply Euclidean distance mapping (EDM) to encode the brightness of each pixel on the image as the distance to the nearest pixel in the background 17, and then use an implicit disk whose radius is equal to the mapped distance value to trace in fibers. As shown in figure 2, tracing procedures start from the global maximum distance point (i.e., the unlabeled point in an image with the largest EDM mapping value such as point ‘O’) to find local maximum distance points (i.e., the unlabeled point with a larger EDM mapping value than its left and right neighbors on the circle, such as point ‘A’, ‘B’, ‘C’ and ‘D’), and thus form branches along axes (‘OA’, ‘OB’, ‘OC’ and ‘OD’). Then, the implicit disk area centered at point ‘O’ is labeled. The procedures repeat tracing from new tracing centers (i.e., the found local maximum distance points) till the end of the fiber is reached. For example, the new branches ‘AE,’ ‘EF,’ ‘EG’ are found following the ‘OA’ direction. Then, the tracing procedures will start from a new unlabeled global maximum distance point till all fibers in image are labeled.Based on position, length, orientation of branches, we can truncate unwanted branches caused by small variation at boundaries or inside objects, such as ‘EF,’ and connect the branches to form continuous fibers, such as ‘COAEG.’ Simultaneously, the quantitative data for each fiber are calculated. For example, the orientation of fiber ‘COAEG’ is measured by linear regression of all points belonging fiber axes. Summing (or averaging) distance value of each point belonging to a fiber measures the length (or mean radius). Thus, the structure information of fiber is extracted from a two-dimensional image. Here is the paper
I want to apply this implicit disk tracking technique can any one help me how can i do that?or can provide me any resource that can help me to implement this idea.

Answers (2)

You can use bwdist() to get the EDM. To find the radius along the centerlines, find the skeleton with bwmorph and multiply it by the EDM. I just did something like that within the past week for someone - search for it here.
sheli whitson
sheli whitson on 19 Mar 2016
Edited: sheli whitson on 19 Mar 2016
Finally got this result after multiplying it by EDM
here is the Iput Image
Output :
got more better result (from fig 7 of the attached paper)
Now I want to find the diameter and length of the Fiber .How can get the diameter and length of fiber like they did .
Thanks in advance sir.

13 Comments

Hello Image Analyst ,
I am thinking to use improfile to find the length and diameter.or do you have any better idea how can i do that ?
I don't. They published the method in the paper so I assume they did lots of research and testing on it so I would just go with what they have published. I don't have anything better especially since I can't even tell what's a single fiber. You could try what I said but it would just give you bulk widths, not individual fiber lengths, which I think would be very difficult to determine from that image.
Hello Image Analyst,
Thank you sir.I am trying to implement their idea but problem is I do not know how to follow that.I tried to find out some resources about this implicit circular and triangular disk mapping technique but i did not find any resources.I would be grateful if you could guide me to follow their steps.
To do the circular and tirangular structuring element stuff, you can use strel() and morphological functions like imerode(), imdilate(), imclose(), imopen(). For a triangle, you'd have to create that manually since I'm pretty sure strel() does not have a triangle option.
Hello Image analyst,
I am using spline plot to measure the length, here is my code
units='pixel';
button=1
while button ~= 2
% Get which action the user wants to do.
button = menu('Choose an action', 'spline', 'Exit');
if button == 2
% Bail out because they clicked Exit.
break;
end
fold = 10
[U, V] = ginput(4)
hold on
% plot(U,V)
% spcv = cscvn( [U, V].' )
%hold on
%fnplt( spcv )
%hold off
n=length(U)
t = 1 : (1/fold) : n;
xi = interp1(1 : n, U, t, 'spline');
yi = interp1(1 : n, V, t, 'spline');
plot(xi, yi, 'linewidth', 1);
% calculate the spline length
L = sum( hypot( diff(xi),diff(yi) ) );
%txtInfo = sprintf('Distance = %.1f %s, which = %.1f pixels.', ...t);
disp(L)
end
here is my image
and here is *the length value: 130.6733pixel
but i want to display that data on my image instead of command window also i would like to add another button,suppose'display',so that when i will click that button it will show the length value and if i double click it ,the length value will remove.For each of the fiber I will find the length by using that method.How can i do that.Please give me some ideas how can i add these features in my code.
Thanks in advance sir
Hello Image Analyst,
Now I can write my data on image ,here is an example image which actually gives clear result that is why i use that image
but problem is how can i move these values at the right side of the image?How can i represent those values in such a way that one can easily understand which value is for which object .
Here is my code
f=imread('ecm3.png')
figure
imshow(f)
units='pixel';
button=1
while button ~= 2
% Get which action the user wants to do.
button = menu('Choose an action', 'spline', 'Exit');
if button == 2
% Bail out because they clicked Exit.
break;
end
fold = 10
[U, V] = ginput()
hold on
% plot(U,V)
% spcv = cscvn( [U, V].' )
%hold on
%fnplt( spcv )
%hold off
n=length(U)
t = 1 : .1 : n;
xi = interp1(1 : n, U, t, 'spline');
yi = interp1(1 : n, V, t, 'spline');
plot(xi, yi, 'linewidth', 1);
% calculate the spline length
L = sum( hypot( diff(xi),diff(yi) ) );
caption = sprintf('value = %f',L);
text(L/2,L/2,caption, 'FontSize',10, 'Color','r');
end
Also I want extract those values in excel file.I tried to use xlswrite(filename,L); but it only stored the current data instead of all the data points .How can i store multiple data points one after another ?
Need your valuable suggestion .Thanks in advance.
Just compute xText and yText from the size of the image
[rows, columns, numberOfColorChannels] = size(f);
xText = 0.9 * columns; % Change 0.9 to whatever you want.
yText = 0.7 * rows % Change 0.7 to whatever you want.
text(xText, yText, caption, 'FontSize',10, 'Color', 'r');
By adjusting xText and yYext you can position the text labels wherever you want.
Hello Image Analyst,
Thank you. values moved to the right side but when i tried to determine another length , new value is just overlapping on the previous value.How could I solve this problem.I want to display all the value on my image .
Hello Image Analyst,
I solved that problem . Here is my result
Now I want to extract all the data points in excel file.I tried xlswrite(filename,L).But that only give one value.How can write all my data points into excel?
Well L is only a single value. If you want it to be an array, you have to have a counter in the loop
counter = 1;
while ......
......
L(counter) = sum(.......
counter = counter + 1;
.....
end
Thank you sir.I will apply that technique.
You're welcome - maybe you could "Accept" my original answer? Thanks in advance.

Sign in to comment.

Categories

Asked:

on 19 Mar 2016

Commented:

on 22 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!