Photogrammetry, distance in image
1 回表示 (過去 30 日間)
古いコメントを表示
Joachim Huet
2017 年 9 月 19 日
コメント済み: Joachim Huet
2017 年 9 月 26 日
I have the following image and I want to measure the size of the object on the A4 sheet of paper (Known dimensions 297*210).
I started by grayscaling the image and then applied a Sobel filter in order to get the edges.
How can I interpolate the size then ? (Automatically)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167316/image.png)
Thanks
2 件のコメント
Image Analyst
2017 年 9 月 22 日
Interpolate what variable between what starting value and and what ending value?
採用された回答
Ramnarayan Krishnamurthy
2017 年 9 月 22 日
編集済み: Ramnarayan Krishnamurthy
2017 年 9 月 22 日
A possible approach would be to use the function 'regionprops' after some basic pre-processing:
I = imread('edges.png');
% Reduce the number of individual regions
I1 = double(ones(size(I))-(I));
% Label the connected components
I2 = bwlabel(I1,4);
% Find the label of the region of interest using the data cursor
imagesc(I2)
% Use regionprops to automatically evaluate the image properties (FilledArea as an example)
R = regionprops(I2,'Area');
% The component of interest is labeled 12 and the output is the number of pixels of the region
R(12).Area
% Identify the ROI visually
R_I = regionprops(I2,'Image');
% Plot the Region of Interest
imshow(R_I(12).Image);
There are additional features such as Perimeter, Filled Area, etc which may be of interest to you. The complete list of properties is available at:
Hope this helps!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Camera Calibration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!