how to reduce the number of overlapping blocks taken for processing ?

1 次查看(过去 30 天)
I am working on copy move forgery detection using DCT-KPCA. here image of size 512*512 is converted to overlapping blocks of size16*16. The total number of blocks will be very huge . Processing these much number of blocks is not neccessary for comparing the region of forgery . So I'm not knowing how to reduce the number of blocks to process KPCA , so that it takes minimum time for execution without losing the content of the image
  2 个评论
gowripriya p
gowripriya p 2022-5-26
编辑:gowripriya p 2022-5-26
I have coded the DCT part and taken ready code for KPCA from net . I have attached the codes and images one forged and unforged. I also shared the reference paper I'm using. Hope you could help me out and thank you for your response.

请先登录,再进行评论。

回答(1 个)

Milan Bansal
Milan Bansal 2023-11-20
Hi Gowripriya,
It is my understanding that you want to reduce the number of overlapping blocks to reduce the total time of processing for forgery detection using DCT-KPCA.
As per the code given in the attached file "dctpcacomofod.m", a window of size [16 16] is used to extract the overlapping blocks from the image with a stride of 1. As a result the total number of blocks becomes 247009.
In order to reduce the number of blocks, increase the window size and the value of stride at which the blocks are extracted from the image. Modify the code for extracting the blocks as shown in the code snippet below.
% increase the height and width of the window from 16 to 32
h=32;
w=32;
count = (f-h+1)*(e-w+1);
outMat = zeros(h,w,count);
l = 0;
% define the stride variable
stride = 4;
% Use the stride value for extracting blocks from the image
for i= 2: stride: e-(h-1)+1
for j=2:stride: f-(w-1)+1
l = l + 1;
outMat(:,:,l) = double(outImg((i-1:i+h-2),(j-1:j+w-2)));
end
end
With the above modifications, the number of blocks are reduced to 14641. Try different values of window size and stride for best results according to the applications.
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Pattern Recognition and Classification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by