How can I find the x and y coordinate of the first pixel of an image .

3 ビュー (過去 30 日間)
Anushka
Anushka 2015 年 2 月 7 日
コメント済み: Anushka 2015 年 2 月 7 日
I have divided an image of size 256*256 into 64 blocks of size 32*32.Can any one suggest any method to find the (x,y) coordinates of the first pixels of each block.Each block was saved as Block(:,:,i),were i denotes the block number,ie i can be any number from 1 to 64.

採用された回答

Youssef  Khmou
Youssef Khmou 2015 年 2 月 7 日
編集済み: Youssef Khmou 2015 年 2 月 7 日
I think you mean the intensity of the first element in each block, otherwise, you already know the coordinates :
firs block : (1,1);
second block : (1,33); % moving in right direction
eighth block : (1,32*7+1);
last block : (225,225);
If you start from left top and count horizontally, the fast way to get the coordinates is :
l=1:32:256;
n=length(l); % equals 8 blocks
FirstPositionBlock=zeros(n,2);
ind=1;
for x=1:n
for y=1:n
FirstPositionBlock(ind,:)=[l(x),l(y)];
ind=ind+1;
end
end
  2 件のコメント
Youssef  Khmou
Youssef Khmou 2015 年 2 月 7 日
see the edited answer.
Anushka
Anushka 2015 年 2 月 7 日
Thank you very much sir it worked properly.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by