フィルターのクリア

Extract patches and save its coordinate points

1 回表示 (過去 30 日間)
MD RESHAD UL HOQUE
MD RESHAD UL HOQUE 2018 年 1 月 29 日
コメント済み: MD RESHAD UL HOQUE 2018 年 1 月 30 日
I have an image [800 x 900 x 4 ]. I want to extract patches [patch size= 17 x 17] and at the same time save its corresponding coordinate (center).Can anyone give me suggestions or code for that?.
Thanks
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 1 月 29 日
Overlapping patches or not overlapping ?
MD RESHAD UL HOQUE
MD RESHAD UL HOQUE 2018 年 1 月 29 日
Overlapping patches

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

採用された回答

Rik
Rik 2018 年 1 月 29 日
編集済み: Rik 2018 年 1 月 29 日
You previous question suggests you already have the center coordinates, why not save that variable as well? Anyway, you can easily extend the solution there to include the center coordinate.
(Also, it's better not to overwrite the patch function with a variable)
selected_patches = cell(length(x),2);
for i=1:length(x)
xtemp=x(i)+[-8 8];
xtemp(xtemp<1)=1;xtemp(xtemp>size(IM,1))=size(IM,1);
ytemp=y(i)+[-8 8];
ytemp(ytemp<1)=1;ytemp(ytemp>size(IM,2))=size(IM,2);
selected_patches{i,1}=IM(xtemp,ytemp,:);
selected_patches{i,2}=[x(i) y(i)];
end

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by