how to find a repetation of a 8x8 block matrix in an image of group of block matrices

1 次查看(过去 30 天)
how to find a repetation of a 8x8 block matrix in an image of group of block matrices

回答(1 个)

Walter Roberson
Walter Roberson 2016-10-18
is_repeat_of_block = cellfun(@(B) isequal(B, The8x8BlockToCheckFor), TheCellHolding8x8Blocks);
provided that the "group of block matrices" is a cell array of 8 x 8 matrices. If you are given a specific 8 x 8 block and asked to find it in an image and you are only to look on 8 x 8 boundaries, then
is_repeat_of_block = blockproc(TheImage, [8 8], @(block_struct) isequal(block_struct.data, The8x8BlockToCheckFor) );
Either way, is_repeat_of_block would be an array of boolean values that tell you whether the 8 x 8 block of the image was an exact match or not against the one you were looking for. You can find() against it or just check nnz() to determine if there was at least one place there was a match.

Community Treasure Hunt

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

Start Hunting!

Translated by