detecting pores from regions of selected depth (grayscale image)

1 view (last 30 days)
Hi, I'm very new to MATLAB and trying to analyze pores of my grayscale image.
Here's the image.
https://plus.google.com/u/0/photos/113657467628549170985/albums/5908362509774990801/5908362515954507314?pid=5908362515954507314&oid=113657467628549170985
I'm hoping to calculate the pore number, size, and area from some regions of selected depth. From the contour plot, it seems to me that the regions with z < 70 should be deeper in the actual object structure, and thus have less artifacts of sample preparation.
I wonder if there's a way to analyze the pore only from the regions of z < 70. As for pore detection, I'm hoping to use the Sobel method, since the pores have various z values depending on the region depths.
So far based on my reading and searching, I tried the roifilt2 method, but only got the horizontal gradient. I wonder how to have gradient at both directions at the same time. Plus, I don't know how to proceed to binary image once the gradient image is formed.
Below is the code I used.
Sorry if my description is not clear. I appreciate your input very much!
Thanks in advance!!!
----------------------------------------------------------------------
imdir = 'C:\Users\wkuo7\Documents\MATLAB\20130724\'; imfile1 = '401.tif'; I1 = imread([imdir, imfile1]); imshow(I1, []); axis on; BW = roicolor(I1,0,70); H = fspecial('sobel'); J = roifilt2(H,I1,BW); figure, imshow(I1), figure, imshow(J)

Answers (0)

Community Treasure Hunt

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

Start Hunting!