Computing the optimal split dimension of an image.

2 visualizaciones (últimos 30 días)
Stewart Tan
Stewart Tan el 6 de Ag. de 2019
Respondida: KSSV el 6 de Ag. de 2019
So I'm currently working on splitting an image into blocks but I'm having issues calculating the optimal split for images of different size. In an example shown in Matlab wiki, the block dimension is first hardcoded. https://matlab.fandom.com/wiki/Split_image_into_blocks
block_row = 150;
block_col = 200;
So this means if i have an image of size 650x1200, the split would be that, at each block, the row would be of 150 dimension, and column would be of 200 dimension. Of course, the remainder would have lesser dimension.
But the problem is that i find it impractical to hard code the block dimension as above, if i were to constantly feed in images of different sizes. If i have a new image of much smaller size 200x350 for example, then i would have to readjust the block_row and block_col in the code again.
What I'm trying to do now is to find a way to compute the optimal block_row and block_col for any images of different size i pass in. Is there anyone who have done this before and mind giving some ideas on what can i do?

Respuestas (1)

KSSV
KSSV el 6 de Ag. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by