How to merge 6x6 pixels into one unit
2 views (last 30 days)
Show older comments
Mai Khaleel
on 19 Oct 2015
Commented: Image Analyst
on 20 Oct 2015
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???
0 Comments
Accepted Answer
Image Analyst
on 19 Oct 2015
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 Comments
Image Analyst
on 20 Oct 2015
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".
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!