Modification of output from regionprops
조회 수: 5 (최근 30일)
이전 댓글 표시
Dear all,
I have a simple question that is slowly driving me crazy. I use the regionprops function recursively on some images taken with different magnification (50'000x and 100'000x) and I would like to translate the output of regionprops from 'pixel' to 'nanometers'. I know the conversion 'pixel2nm' (47pixels=100nm on my images) and I would like to keep the structure output from regionprops, but although I can extract the data from regionprops I couldn't find any way to replace it within the same variable. Here the code where 'props' in an array of cells with the properties I want regionprops to extract and data is a struct with the data of my image.
function [stats]=analyze_images(data, props)
img=imread(data.fileName);
BW=im2bw(imcomplement(img),data.threshold); % color --> black&white
BW=imcrop(BW, data.ROI); % crop image to the ROI
BW=bwareaopen(BW,data.minSize); % delete small features
%%get properties through "shape analysis"
[~,L] = bwboundaries(BW,'noholes');
stats=regionprops(L,props);
Now i would like to do something like to convert pixels to nanometers:
stats.Perimeter = stats.Perimetes .* pixel2nm;
... but it keeps giving me error in any way I tried to put my brackets [],{} or ()... -_-
any help would be appreciated!
Thanks,
-ste-
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!