フィルターのクリア

Image division into blocks

1 回表示 (過去 30 日間)
Ayesha
Ayesha 2014 年 8 月 10 日
回答済み: Image Analyst 2014 年 8 月 10 日
Hello,
I have a code that divides an image into 16x16 blocks. This works really well. However the content of the 16x16 block is stored in a cell array similar to this one:
rgbBlock = ca{r,c};
I've been wondering about the possible alternatives that could be used instead of the line above. This is because I am converting the code to C++ using Matlab coder and the code generation does not support cell structure. Any suggestion would be appreciated.

回答 (2 件)

Matz Johansson Bergström
Matz Johansson Bergström 2014 年 8 月 10 日
If you have the image processing toolbox you could use blocproc blockproc documentation. I'm not sure it goes well with Matlab coder because I have never used it.

Image Analyst
Image Analyst 2014 年 8 月 10 日
Look at the second method in the FAQ http://matlab.wikia.com/wiki/Split_image_into_blocks. It shows you how you can take the extracted 16by16 block and put it as one plane (slice) in a 3D array. That's for gray scale images. If you have color images and want to stack small 16x16 color images, then you can use a 4D array, or else do some bookkeeping if you want to still use a 3D array.

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by