フィルターのクリア

convert an image into binary matrix and visualize the coordinate of each pizel

29 ビュー (過去 30 日間)
Danilo Sanfilippo
Danilo Sanfilippo 2019 年 8 月 2 日
コメント済み: Danilo Sanfilippo 2019 年 8 月 6 日
Hello guys,
I have an image .jpg format, i use this code to convert into a matrix. I think with this code i get with 1 the position of pixel and with zero ( no pixel ):
I = imread('origianl_picture.jpg');
BW = imbinarize(I);
what i am looking for is to convert the 1 and 0 into cartesian coordinate ( x,y,z) also i would like to visualize the binary images, a matrix with the 3 coordianate corresponding with the position of pixel.
I attached original jpg but i cannot do it with the binary one, basically i display the same but in black and white.
Can u please help me with this?
Thanks

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 8 月 2 日
編集済み: KALYAN ACHARJYA 2019 年 8 月 2 日
To visulise the binary use it
BW = imbinarize(I)
or
I = imread('origianl_picture.jpg');
BW = imbinarize(I);
imshow(BW)
2nd one:
"what i am looking for is to convert the 1 and 0 into cartesian coordinate ( x,y,z)"
The image is 2D only, hence you get the spatial co-ordinates of the binary image, having white pixels (Black)
I = imread('origianl_picture.jpg');
BW = imbinarize(I);
[y x]=find(BW==1);
Or Are you looking for different? Be specific please.
  8 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 8 月 6 日
Share the complete code?
Danilo Sanfilippo
Danilo Sanfilippo 2019 年 8 月 6 日
clc;
clear all;
I = imread('origianl_picture.jpg');
BW = imbinarize(I);
[y x]=find(BW==1);
imshow(BW)

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

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by