フィルターのクリア

divide image into block of size 1*2

1 回表示 (過去 30 日間)
aditya kumar sahu
aditya kumar sahu 2016 年 10 月 12 日
コメント済み: Walter Roberson 2016 年 10 月 12 日
I have a 512*512 image and I want to divide into blocks each having 1x2 pixels.So I will get total 131072 blocks.Now I want to process each blocks.
i am doing in matlab code.. Any idea?

採用された回答

Walter Roberson
Walter Roberson 2016 年 10 月 12 日
image_blocks = num2cell(TheImage);
Now image_blocks{J,K} will be the 1 x 1 block corresponding to the pixel at TheImage{J,K}
I cannot think of any advantage of dividing into 1 x 1 blocks, unless perhaps it is for convenience in holding the bit equivalent as a unit ? But if that is the situation then
bit_cells = arrayfun(@(V) dec2bin(V,8), TheImage, 'Uniform', 0);
  2 件のコメント
aditya kumar sahu
aditya kumar sahu 2016 年 10 月 12 日
編集済み: aditya kumar sahu 2016 年 10 月 12 日
Thank you Mr. Walter Roberson ..you are right..no use of 1*1..BUT IF I WANT TO DO 1*2 PIXELS IN A BLOCK..THEN HOW CAN I
Walter Roberson
Walter Roberson 2016 年 10 月 12 日
image_blocks = mat2cell(TheImage, ones(1,size(TheImage,1), 2 * ones(1, size(TheImage,2)/2) );

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by