Distance bethween two regions

1 次查看(过去 30 天)
Good evening, I have to measure the distance between the two regions, as shown in the image, in a sequence of 1800 frames in succession. The distance varies frames by frames. I have difficulty in finding the minimum distance between these two. I enclose a picture type. thank you very much
  4 个评论
Ektor Lucci
Ektor Lucci 2013-9-18
in the picture I have used the imdistline. I have to create a loop to make sure that detects the distance between the two white regions in an automatic way.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2013-9-18
Try this:
% Get a thick band of pixels
band = grayImage(42:68, :);
% Get the mean horizontal profile by
% averaging along rows within each column.
horizontalProfile = mean(band, 1);
% Threshold to find dark area
darkPixels = horizontalProfile < 128' % Or whatever value...
% Find starting column
startingColumn = find(darkPixels, 1, 'first');
% Find ending column
endingColumn = find(darkPixels, 1, 'last');
  2 个评论
Ektor Lucci
Ektor Lucci 2013-9-18
can you send me a loop for 10 images as an example?
Image Analyst
Image Analyst 2013-9-18
Sure! Code for that is here in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F. Just copy, paste, and make slight adaptations.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by