필터 지우기
필터 지우기

what is the formula to divide an image into number of blocks?

조회 수: 1 (최근 30일)
anu
anu 2018년 2월 8일
답변: Walter Roberson 2018년 2월 8일
I know how to divide image into blocks using Matlab. But I want to know generalized formula to divide an image into blocks.
  댓글 수: 1
Adam
Adam 2018년 2월 8일
If you know how to do it in Matlab then it isn't really a Matlab question to understand the generalized maths.
You can divide an image up however you want though. There isn't one formula that works for every kind of dividing up you would ever want to do.

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2018년 2월 8일

Walter Roberson
Walter Roberson 2018년 2월 8일
Converting from block numbers to matrix indices:
starting matrix position in a direction = (block number in that direction, minus 1) times (block size in that direction), then plus 1
ending matrix position in a direction = (block number in that direction) times (block size in that direction), but never more than matrix size in that direction (because the last block in the direction might be a partial block)
Converting from matrix indices to block number:
block number in a direction = floor( (matrix position in that direction) minus 1) divided by block size in that direction) plus 1
For example if the block size was 64, the matrix index 219 would be block number floor((219-1)/64) + 1 = 4 in that direction. The first block would be index 1 to 64, the second block would be 65 to 128, the third block would be 129 to 192, the fourth block would be 193 to 256, so block #4 in the direction is correct for matrix index 219.

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by