Hi everyone, i have done coding for my project related to image forensics. But now i am stuck at finding svd of each block of the image. Here is my code snippet.
clc;clear;close all;%%read image
im = [];[FileName,PathName] = uigetfile({'*.png';'*.jpeg';'*.bmp';'*.gif';'*.jpg'},'Select the Image file');if~(isequal(FileName,0)|| isequal(PathName,0)) m= fullfile(PathName,FileName); im = imread(m);endimg = im2double(rgb2gray(im));[f1, f2] = size(img);%%1- Apply Stationary wavelet transform up to specified level "L" to the gray image.
disp('1-Applying SWT to grayscale image ');disp('1-Wavelet.....');LL{1} = img; k = 1; [LL{k}, LH{k}, HL{k}, HH{k}] = swt2(LL{k},1,'db6'); %%2- Divide the image into overlapping blocks.
disp('2- Dividing the image into overlapping blocks of size 16x16'); block_size = 16; patches = im2col(LL{1}(:,:,1),[block_size,block_size],'sliding'); %breaks image into blocks
[m1, n1] = size(patches); num_blocks = (1:n1);%%3- Apply SVD to each block
disp('3- Feature extraction by computing the SVD Transform of each 16x16 window');
so i am no getting how to access each block and apply SVD to each block. Plz help me if anybody knows regarding this.
Best Answer