Does blockproc() divide the image into overlapping or non-overlapping blocks?

조회 수: 9 (최근 30일)
Stewart Tan
Stewart Tan 2019년 8월 8일
댓글: Guillaume 2019년 8월 10일
So I'm exploring ways to split an image into blocks and applying DCT on each blocks of the image and i came across this example https://www.mathworks.com/help/images/discrete-cosine-transform.html
It uses the blockproc() function to first split the image into 8x8 blocks and apply DCT after. Is the blockproc() function dividing the image into overlapping or non-overlapping blocks since I'm working on copy move forgery detection?

답변 (1개)

Walter Roberson
Walter Roberson 2019년 8월 8일
In the form used in that example, blockproc() is using non-overlapping blocks.
The blockproc option 'BorderSize' permits you to define overlapping, if you want overlapping.
'BorderSize' A 2-element vector, [V H], specifying the amount of
border pixels to add to each block. V rows are
added above and below each block, H columns are
added left and right of each block. The size of
each resulting block will be:
[M + 2*V, N + 2*H]
The default is [0 0], meaning no border.
By default, the border is automatically removed
from the result of FUN. See the 'TrimBorder'
parameter for more information.
Blocks with borders that extend beyond the edges of
the image are padded with zeros.
  댓글 수: 2
Stewart Tan
Stewart Tan 2019년 8월 8일
Thank you. Is it possible to view the blocks image through an imshow() through blockproc(), just to see how it turned out to be?
Guillaume
Guillaume 2019년 8월 10일
Note that not all combinations of window size and sliding step can be achieved this way. The window size minus the sliding step must be a multiple of 2.
Also note, that this means that the image will be automatically padded on all sides with 0s.

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

Community Treasure Hunt

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

Start Hunting!

Translated by