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.

回答(2 个)

Von Duesenberg
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

Image Analyst
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
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');
Dinesh Kumar Kanagaraj
This 4 lines is suitable for all sizes of images or only 480*480 images.. And can u give some notes to understand this concept...because I am doing real time project based on this method...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by