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 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have to count black pixels between two white pixels in any direction???
0 comentarios
Respuestas (1)
Guillaume
el 18 de Jul. de 2018
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 comentarios
Guillaume
el 18 de Jul. de 2018
I have absolutely no idea what you are asking now. There's only one direction between two given pixels.
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!