How to represent the value of X and Y Pixels in array of Two Dimensions using Matlab

4 ビュー (過去 30 日間)
Hi , Suppose if this is my image
I need to find the x, y coordinates of white pixels in image. I am getting the value of x and y coordinates separately one after the other, i want to represent it in 2 dimensional array matrix like [x,y] ,how can i represent it in 2 D matrix?
Then i need to calculate the farthest distance in that box ? how to solve this?

採用された回答

Youssef  Khmou
Youssef Khmou 2014 年 9 月 15 日
The provided answer is correct, you only need some processing steps, the image contains white borders , you need to crop it using some software, after that, you need to convert into grayscale and then to double instead of unit8 :
X=rgb2gray(X);
X=im2double(X);
% then the command provided above.
  12 件のコメント
Youssef  Khmou
Youssef Khmou 2014 年 9 月 16 日
x(1,:) means the x,y coordinates of the 1st point, but y(:,1) is the x coordinates of all points, that is where you get the error, the distance between the x and y points is sqrt((M(x,1)-M(y,1))^2-(M(x,2)-M(y,2))^2)
Lakshya
Lakshya 2014 年 9 月 17 日
k attach me your complete code ,,, ill just try

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputational Geometry についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by