cant find the white pixels

2 ビュー (過去 30 日間)
pasta pontikaki
pasta pontikaki 2019 年 4 月 2 日
コメント済み: pasta pontikaki 2019 年 4 月 4 日
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.

採用された回答

Guillaume
Guillaume 2019 年 4 月 2 日
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.
  4 件のコメント
Guillaume
Guillaume 2019 年 4 月 2 日
An edge does not have a colour. An edge (in a binary image) is the transition from black to white or white to black. Matlab The resulting edge image will have the edges shown in white indeed. Which side of the edge is actually set to white depends on the algorithm you use.
pasta pontikaki
pasta pontikaki 2019 年 4 月 4 日
okey thanks

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by