How to divide a grayscale image in two blocks
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
Please I want to divide a grayscale image into two halves? Then, after dividing it make each half independent, say
A = top half and
B = the bottom half.
So that I can extract features from each half.
I read some similar questions, and get a code as:
n=fix(size(B,1)/2) //B is the grayscale image
C=B(1:n,:,:);
D=B(n+1:end,:,:)
figure,imshow(C)
figure,imshow(D)
It's almost working, but the results are 2 blank images(C and D).
Really need your help asap, thank you all!
1 件のコメント
Ahmet Cecen
2014 年 8 月 10 日
There is no reason why the above shouldn't work. I can't suggest anything further without seeing the image. Attach the original image as a .mat file.
回答 (1 件)
Image Analyst
2014 年 8 月 10 日
Maybe somehow they got to be floating point. Use
imshow(C, []);
imshow(D, []);
and see if they show up. In general, see the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!