How to measure the length of the particular region?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dinesh Kumar Kanagaraj
el 17 de Mzo. de 2018
Comentada: Dinesh Kumar Kanagaraj
el 20 de Mzo. de 2018
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 comentarios
Respuestas (2)
Von Duesenberg
el 17 de Mzo. de 2018
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 comentarios
Image Analyst
el 17 de Mzo. de 2018
Try this:
[rows, columns, numberOfColorChannels] = size(yourImage);
If you need the lengths in real world units, see my attached spatial calibration demo.
2 comentarios
Image Analyst
el 19 de Mzo. de 2018
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');
Ver también
Categorías
Más información sobre Camera Calibration en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!