How to merge 6x6 pixels into one unit

2 ビュー (過去 30 日間)
Mai Khaleel
Mai Khaleel 2015 年 10 月 19 日
コメント済み: Image Analyst 2015 年 10 月 20 日
I'm writing a matlab program to do some calculations on image, my image is 60 x 60 pixel, I want to divide this range of pixels to 10 x 10 units, each unit is 6x6 pixels.
this is the beginning of the program
XL=1; XR=60, YU=1; YD=60; XC=(XR-XL+1)/6; XC=(XR-XL+1)/6;
and then i want to combine each 6x6 as one unit. can anyone help me how to do that???

採用された回答

Image Analyst
Image Analyst 2015 年 10 月 19 日
How do you want to do the merge? By averaging inside the 6x6 windows? You can use blockproc(), imfilter(), or conv2().
See attached blockproc demos. Adapt as needed.
  2 件のコメント
Mai Khaleel
Mai Khaleel 2015 年 10 月 20 日
Hi Image analyst, thank you for answering my question, as I explained in the question my image size is 60x60 pixels. and I want to divide this image to 10x10 blocks, each block is 6x6 pixels, and do the averaging of each block so each block will have 1 value then draw the image. I will try the demos you gave me and let you know. thank you again and have a nice day.
Image Analyst
Image Analyst 2015 年 10 月 20 日
You didn't say "averaging" before, but the demos do have averaging as one of the demos. Post your code if you have any further questions. If it worked, then maybe you can "Accept this answer".

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by