Photogrammetry, distance in image

조회 수: 7 (최근 30일)
Joachim Huet
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)
Thanks
  댓글 수: 2
Image Analyst
Image Analyst 2017년 9월 22일
Interpolate what variable between what starting value and and what ending value?
Joachim Huet
Joachim Huet 2017년 9월 25일
The big rectangle is the A4 sheet of paper and I would like to measure the size of the object on top of it.
I could do it manually by measuring the length of both the object and the A4 sheet and then doing a linear interpolation knowing the real length of the A4 sheet. But is there a way in matlab to do that automatically ? (Sorry if it is not clear enough)

댓글을 달려면 로그인하십시오.

채택된 답변

Ramnarayan Krishnamurthy
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!
  댓글 수: 1
Joachim Huet
Joachim Huet 2017년 9월 26일
Thanks for your answer, I will give it a try !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Camera Calibration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by