MATLAB problem--Selecting 4 adjacent blocks in image and forming a shifted block.?

2 views (last 30 days)
MATLAB problem--Selecting 4 adjacent blocks in image and forming a shifted block.? I want to select 4 adjacent blocks of size 8 x 8 in an image... its shown in this image....its a png file. i have created diagram...the middle block is what i want to be selected...likewise...i want to divide whole image into 4 adjacent blocks.. LINK for diagram: http://www.mediafire.com/?63svlcpiklq2onc
.and select the middle block composed from pixels from these 4 blocks as shown in diagram and perform certain operation on it...how to do it matlab?can anybody help with code?thanks The link i have given suggests two options viewing image (diagram of my question) or downloading it. Go for viewing if you do not want to save image ,.thanks in advance.

Answers (1)

Walter Roberson
Walter Roberson on 5 Mar 2011
You can use blockproc if you have the Image Processing Toolkit and any version from 2009b onwards. There is a guide for blockproc .
In older versions of the toolbox, blkproc() could be used, and was generally faster for images that fit in memory.
If you do not have the image processing toolkit, then you can use mat2cell() to create cells containing the 8x8 blocks and then index adjacent cells as needed.
  1 Comment
Brett Shoelson
Brett Shoelson on 5 Mar 2011
NOTE: I believe that the issue that resulted in a performance degradation for using BLOCKPROC (compared to BLKPROC) has been addressed.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!