필터 지우기
필터 지우기

how to divide image into 3x3 blocks? '9 parts'

조회 수: 6 (최근 30일)
nitesh patil
nitesh patil 2014년 1월 19일
댓글: Walter Roberson 2018년 12월 15일
i have one rgb image, i converted it to gray then to binary, did imfill, further i want to split that image into 9 blocks i.e 3x3 , please help me
  댓글 수: 1
Jan
Jan 2014년 1월 19일
Please show us, what you have tried so far and explain explicitly which problem occur.

댓글을 달려면 로그인하십시오.

답변 (2개)

Matt J
Matt J 2014년 1월 19일
Using MAT2TILES
splitImage=mat2tiles(grayImage,[3,3]);
  댓글 수: 2
nitesh patil
nitesh patil 2014년 1월 20일
i want to split complete image into 9 parts ,that is it,
Matt J
Matt J 2014년 1월 20일
splitImage=mat2tiles(grayImage,ceil(size(grayImage)/3));

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2014년 1월 19일
  댓글 수: 4
moahaimen talib
moahaimen talib 2017년 5월 14일
편집: moahaimen talib 2017년 5월 14일
i think i solved the problem by putting
figure(k);
subplot(3,3,1);
imshow(image1);
subplot(3,3,2);
imshow(image2);
subplot(3,3,3);
imshow(image3);
subplot(3,3,4);
imshow(image4);
subplot(3,3,5);
imshow(image5);
subplot(3,3,6);
imshow(image6);
subplot(3,3,7);
imshow(image7);
subplot(3,3,8);
imshow(image8);
subplot(3,3,9);
imshow(image9);
--------------------------------------------------------------
now it shows all segmented images but how can i store each part and extract features for them and store them in good dataset for classification?
-------------------------------------------------------------------
i could make this instruction it will extract features for image1 for all 20 images but i need it for all 9 parts(image1...image9)
% Extract the 9 images.
image1 = imageArray(1:r3, 1:c3);
GLCM = graycomatrix(image1,'Offset',[0 2]);
Resultstats = graycoprops(GLCM,{'energy','Homogeneity'})
image2 = imageArray(1:r3, c3+1:2*c3);
image3 = imageArray(1:r3, 2*c3+1:end);
image4 = imageArray(r3+1:2*r3, 1:c3);
image5 = imageArray(r3+1:2*r3, c3+1:2*c3);
image6 = imageArray(r3+1:2*r3, 2*c3+1:end);
image7 = imageArray(2*r3+1:end, 1:c3);
image8 = imageArray(2*r3+1:end, c3+1:2*c3);
image9 = imageArray(2*r3+1:end, 2*c3+1:end);
Walter Roberson
Walter Roberson 2018년 12월 15일
atiqah ghaffar comments to Image Analyst
Thank you. This helps a lot.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by