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
Walter Roberson
2016년 2월 18일
편집: Walter Roberson
2016년 2월 18일
The cel.png file contains errors, apparently. At least my browser thinks so, but Preview (OS-X) seems happy with it.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Biomedical Imaging에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!