Setting scale (pixel to mm)

So I have an image taken by a microscope (cel.png) it has a scale bar and the cell is gray etc. I need to find the area of the cell. My code is
clear;
clc;
prompt = 'Enter filename (include extension name): ';
str = input(prompt,'s');
A = imread(str);
image(A)
%Thresholding the image to gray-scale
level = graythresh(A);
BW = im2bw(A,level);
imshow(BW)
%Determine image dimensions
size = size(BW);
xpixel = size(2); %image dimesnions in the x axis
ypixel = size(1); %image dimesnion in the y axis
wpixel = length(BW(BW==1))
bpixel = length(BW(BW==0))
The threshold (refer to thshld.png) us working, its counting the white and black pixels. However, now I need to figure a way so the scale bar doesn't get counted and also I need to find out how to make matlab get pixel to mm ratio using the scale bar.
Any suggestions or do I need to use imageJ to get the pixel to mm ratio.

1 个评论

The cel.png file contains errors, apparently. At least my browser thinks so, but Preview (OS-X) seems happy with it.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by