Image segmenting or image division

1 回表示 (過去 30 日間)
shalaw faraj
shalaw faraj 2019 年 7 月 17 日
コメント済み: KALYAN ACHARJYA 2019 年 7 月 17 日
Hello everyone,
I want to create a program to divide image into segment and I want to statically to specife Row and Column
for example
Row=4, Column=4
the program divide the image into 4x4, it mean 16 segments.
or Row=6, Column=4
the program divide image into 6x4, it mean 24 segments.
thanks

回答 (1 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 17 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 17 日
Lets say Image is image1 having size 64x64
[rows colm]=size(image1);
m=1;
im1=[];
for i=1:4:rows-4
for j=1:4:colm-4
im1{m}=image(i:i+3,j:j+3) ;
m=m+1;
end
end
#I did it using loops, without loop is recomended
  2 件のコメント
shalaw faraj
shalaw faraj 2019 年 7 月 17 日
I have this error.
Error in Untitled21 (line 7)
im1(m)=image(i:i+3,j:j+3) ;
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 7 月 17 日
Edited
im1{m}=image(i:i+3,j:j+3) ;

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

Community Treasure Hunt

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

Start Hunting!

Translated by