How to make a histogram plot that displays information regarding the distribution as a function of diameter, density and length of nanorods for that image.

2 views (last 30 days)
Hello, I'm completely new to matlab (and coding in general) and I was given a task by a grad student in the research lab I work at to find the distribution of nanorods in the image provided by making a histogram plot of the nanorods density, diameter, and length. I was able to come up with an algorithm based on what I was able to find in research papers (Note: I'm not a CS major in the slightest) but I'm having trouble implementing it on matlab (I can't even seem to get imread to work correctly). Here is my code so far:
ReadFile = imread(‘C:\Users\Admin\Pictures\ns.jpg’); Image = imshow(ReadFile); BW = roipoly(Image) BW = createMask(e,h_im); *Note: I'm not entirely sure what are the variables to put in createMask h = fspecial('gaussian', hsize, sigma) *Again I don't understand what should I put for hsize IM2 = imtophat(Image,SE)*I don't seem to know should I put for SE IM3 = imdilate(Im2,SE)
Level = graythresh(IM3); BWImage = (ReadFile, Level); imshow(BWImage);
BWImage = im2bw(IM3, level) IM4 = imopen(BW1,SE) IM5 = imclose(IM4,SE) BW2 = imclearborder(IM5) imshow(BW2)
After all this image processing I need to find out a way to get an array of the lengths and diameters of each structure (currently the only way I now is to measure them with the ruler icon in imtool).
As for finding the density I'm going to try to use what I found here http://blogs.mathworks.com/steve/2012/12/18/counting-objects-without-bias/?s_tid=Blog_Steve_Archive
Again I'm freaking clueless and I could use as much help as I can get!!

Answers (0)

Community Treasure Hunt

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

Start Hunting!