How to measure the length of the particular region?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, I am new to image processing field and I want to know how to measure the length and width of the particular image using Matlab.
댓글 수: 0
답변 (2개)
Von Duesenberg
2018년 3월 17일
It depends on your goal. If you want the number of pixels, the size of your image in the workspace (with the size function) should give you this info. If you want real world units, you'll have to calibrate your camera: https://fr.mathworks.com/help/vision/ug/camera-calibration.html
댓글 수: 0
Image Analyst
2018년 3월 17일
Try this:
[rows, columns, numberOfColorChannels] = size(yourImage);
If you need the lengths in real world units, see my attached spatial calibration demo.
댓글 수: 2
Image Analyst
2018년 3월 19일
Wow, I don't know how we were expected to guess that given what you told us first. Anyway, use find
binaryImage = sobelImage > 128; % Or whatever value works.
topRow = find(binaryImage(:, 240), 1, 'first');
bottomRow = find(binaryImage(:, 240), 1, 'last');
leftColumn = find(binaryImage(300, :), 1, 'first');
rightColumn = find(binaryImage(300, :), 1, 'last');
참고 항목
카테고리
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!