Question
Hi all, i try to detect the edges of my image. I use canny edge detector. Then i tried [c,r]=find(Image==1) to detect the white pixels. I thought in a b/w image the edges would be the white pixels, but this not works quite good. For example the vector with the coordinates is the follwing: I made a grid for every pixel in image using the method that Steves proposed As you can see the first pixel [64,2] is not laying on a white pixel while some other are on whites. Does anyone have any idea why this is happening? Are the edges on a binary image the white pixel or not? If yes then why i get also black pixels coordinates.
Expert Answer
Neeta Dsouza
PhD Expert
Answered Aug 30, 2026
I suspect you're getting confused with your coordinates. In particular, the names of the variables in your line:
[c, r] = find(...rest does not matter
are very misleading, as c is going to be the rows and r the columns where white pixels are found. Typically, one writes:
[r, c] = find(...rest does not matter.
Also, note that the upper left corner of the image is (1, 1) not (0,0). find returns matrix indices which are 1-based.
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related white pixels Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →