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
采纳的回答
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 个评论
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!