Transpose Blocks of Image Using Block Processing
This example shows how to transpose blocks of an image using block processing.
Example Model
Open the Simulink® model.
modelname = "ex_blkblockprocessing.slx";
open_system(modelname)
The model reads an input image using an Image From File block and performs a transpose operation on the blocks of the image using a Block Processing block with these parameters:
Number of inputs —
1
Add port to supply subsystem parameters —
off
Number of outputs —
1
Block size —
{[32 32]}
Overlap —
{[0 0]}
Traverse order —
Row-wise
Subsystem — Consists of a Transpose (Simulink) block that transposes each block of the input image.
The Block Processing block divides the input image of size 64-by-64 into 4 blocks, each of size 32-by-32. It performs a transpose operation on each block, and then reassembles the transposed blocks to construct an output image of size 64-by-64.
Simulate the Model
Run the model. The model displays the input image and the block-wise transposed output image using Video Viewer blocks.
sim(modelname);