How to detect between any two pixels (preferably far) there exist an number of foreground pixels of an image (foreground=white and background=black)???

조회 수: 1 (최근 30일)
Hi,
I have to count black pixels between two white pixels in any direction???

답변 (1개)

Guillaume
Guillaume 2018년 7월 18일
improfile (with the default 'nearest' interpolation) should give you all the pixels between your two points. It's then trivial to sum the pixels that are 0.
numblackpixels = sum(improfile(yourimage, locationofpixel1, locationofpixel2) == 0)
  댓글 수: 3
Guillaume
Guillaume 2018년 7월 18일
I have absolutely no idea what you are asking now. There's only one direction between two given pixels.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by