Get (automatically) position of pixels that are white in my binary mask image

2 ビュー (過去 30 日間)
JoaquinB
JoaquinB 2019 年 11 月 11 日
編集済み: JoaquinB 2019 年 11 月 13 日
Hello, i do have a logical image (since i applied a binary mask) and i would like to have the position (x,y) of all the pixels that are white (background is black), automatically, withouth needing to click it.
I have tried 'bwconncomp' but it gives me the indice pixels (in a cell array) instead of the position and since the image is logical type, it gives an error when i want to transform it into position since its a cell array (i.e ind2sub doesnt works with cell arrays).

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 11 日
編集済み: KALYAN ACHARJYA 2019 年 11 月 11 日
"Get (automatically) position of pixels that are white in my binary mask image"
Let suppose im1 is a binary image
[r c]=find(im1==1);
  1 件のコメント
JoaquinB
JoaquinB 2019 年 11 月 11 日
It works but i dont know how to insert it into the loop (if not the code will be too much big, since i will have to create 15 images)
-I cant create a 3D matrix of zeros and saving each x,y in one dimension like i did for INT because i dont know the exact dimensions that find will provides me.
I guess the easiest form will be concatening the results in a 3D-matrix like A=[x,y,k] but i dont know the form exactly.

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by