Image quality and dimension
Show older comments
Hello here i attached my processed image using convn, the problem is when I process one image and save it to my local machine its perfect, but if I process 5000 images using same pipeline and save that 5000 images, the image shape and structures are collapsed I dont know why, I attached my code and processed images, if anybody know please try to help.

This is my single processed image.
If i use 5000 image in the same pipeline the result be like this

Both are same image filtered using same pipeline.
Here is my code
infolder = 'C:\Users\91894\Desktop\matlab\Dataset\images_001\images'
outfolder = 'C:\Users\91894\Desktop\matlab\Dataset\images_001\processed image'
imgFiles = dir([infolder,filesep,'\*.png']) ;
N = length(imgFiles) ;
refback = zeros(25, 25);
for i = 1:N
thisFile = [infolder,filesep,imgFiles(i).name] ;
[filepath,name,ext] = fileparts(thisFile) ;
outFile = [outfolder,filesep,[name,ext]] ;
I = imread(thisFile) ;
J = imresize(I,[256 256]);
for f = 1:4
SpatDog = fspecial('gaussian',25,0.732) - fspecial('gaussian',25,0.785);
FreqDog = fftshift(fft2(fftshift(SpatDog)));
Y = abs(FreqDog)
refback = refback + im2double(Y);
end
refback = (1/4) * refback;
Y = fftshift(ifft2(fftshift(refback)));
conv = convn(J,Y);
imwrite(conv,outFile) ;
end
I need to write the image to my laptop as its shown in the first image
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!