Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Signal & Image Processing for compression

Status
Not open for further replies.

anitharajmitts

Newbie level 4
Newbie level 4
Joined
Feb 28, 2014
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Visit site
Activity points
60
Signal Processing & Image Processing

I have designed a new FFT algorithm and want to Quantize an FFT signal.The input is an color Image.With the Quantization matrix available on net I tried but Iam getting very less compression say CR=3-4.So please let me know how to quantize and Compress an FFT signal so that I get CR=15-30.
 

Re: Signal Processing & Image Processing

Could you describe more specifically what you are doing? I'm not sure what you mean when you say you want to quantise an FFT signal. Any digital signal is quantised, so the input to the FFT and the output are, in general, quantised already.

If you want to compress it, I suppose there could be many ways of doing that. Does your compression need to be lossless? If so, it may be theoretically impossible to achieve the compression ratios you require, depending on the nature of the signals.
 

Sir,
Iam a research Scholar and designed a novel algorithm for FFT. Its working fine and published as IEEE paper.The algorithm works as
1.Read an image block by block(8*8) using blockproc in matlab.
2. I/p it FFT function and find FFT of Image.
3.Threshold the FFT signal for some value (insignificant coefficients)say 10% of max and make below threshold values as Zero.
4.Filter zeros & find CR=Image Size(m*n*p)/No. of non zero coefficients.
5.Transmit the signal to Decoder & at the decoder end reconstruct the signal by applying IFFT.
The problem is I tried with thresholding to compress the signal & the CR Iam getting is less(3-4)If I increase threshold value say 20-50% the PSNR goes below 35dB.
So I opted for Quantizing the FFTsignal (FFT signal./Quantization matrix)so that I can get more zeros after Quantization.But here the magnitude of FFT signal are 3 digits in magnitude & I get less no. of zeros after quantization bcoz quantization matrix has 2 digits values.So CR is less by this method also n mine is Lossy compression method.Please let me how to perform compression in Transform domain I get more CR and PSNR>35dB.
 

I've had a very quick look at your paper and have a few general comments which may be useful to you.

Firstly, PSNR and perceived image quality are not always well correlated. Sometimes, a large drop in PSNR will be completely imperceptible. Other times, a clearly-visible defect will actually represent only a small drop in PSNR. This is due to the human visual system being more sensitive to certain types of information. A well-known example is that we are very sensitive to high-frequency "edge" information. Therefore, we can often discard a lot of low-frequency information without noticing anything. Conversely, if we discard just a small amount of edge information, then the image will seem obviously blurred.

Perhaps you could experiment with this in your simple thresholding method; adjust the threshold so you discard more low-frequency information and keep as much high-frequency information as possible.

In general, your methods need to be more scientific and rigorous. For example, you use (8x8) image blocks. Why not (4x4)? Or (1843x9782)? Would changing the block size affect performance? In what ways?

Why do you need an FFT at all? Why not a discrete cosine transform (like jpeg) or wavelet transforms (like jpeg 2000)?

Many image compression schemes already exist. Why should we use your scheme? How does it compare to jpeg, jpeg 2000, etc.?

Returning to your question, you need to be aware that some images are more amenable to compression than others. As a very simple example, let's imagine your input image is completely black; every pixel value is exactly zero. Of course, this will be very easy to compress and reconstruct exactly. Conversely, if an image contains spectrally-flat Gaussian noise, the PSNR will drop rapidly when you try to compress it. Every image is different.

From what you have written, your idea of quantisation sounds the same as thresholding. Personally, I would strongly discourage all types of fixed thresholding, as a threshold that works well with one image will be terrible with another. Therefore, you should at least find a way for your threshold to adapt depending on the input image. To give more specific advice, I will need to see your code. I am experienced with Matlab, so if you want any specific help with your code, I will be happy to help.
 
Code:
%%%%%%To find the FFT and IFFT of a color Image
%%To read the file from host system
close all;
clear all;
clc;
I1=imread('Sunflower.bmp'); 
I2=rgb2gray(I1)
[m,n]=size(I2);

% To obtain the DFT of the image
Id=blkproc(I2,[8,8],'dft');
% plot(abs(dft,freq))
D=Id;
%  % To filter zeros from matrix
 pos=find(Id==0);
 Id(Id==0)=[];
 nbits=length(Id);
 %To find the Compression Ratio based on no. of fft co-efficients
 Cr=numel(I2)/numel(Id);
 % To pad zeros to the fft signal
Mz=pad0(Id,pos,n);
% To convert vector to matrix
F=reshape(Mz,m,n);
 % To obtain the Inverse DFT of the image
I3=blkproc(F,[8,8],'idft');

%# Create the gaussian filter with hsize = [5 5] and sigma = 2
G = fspecial('gaussian',[2 2],0.8);
%# Filter it
Ig = imfilter(I3,G,'same');
%# Display
imshow(Ig)


% To display the Reconstructed & the original image

I0=uint8(I2);figure(1),imshow(I1),title('Original image');

I4=uint8(Ig);
% I5=imadjust(I4,[0.3 1],[]);
figure(2),imshow(I4),title('Reconstructed image');


P=255;

MSE=mean((I1(:)-I4(:)).^2);
PSNR=10*log10(P^2/MSE);

Sir,
In few papers & MIT Researchers paper it is said that most of the FFT energy is concentrated at low frequency components!So I tried to low pass FFT signal but not able to get any zero coefficients!I don't know why?
2.The block size is 8*8 for VLSI implementation it is optimized.
3.FFT has its own advantages over DCT
4. Iam not particular about lossy compression methods but wants to compress signal in frequency domain by any methods.
Please let me suitable compression method so that CR=Image size/No. of non zero FFT co efficients
 
Last edited by a moderator:

why are u using FFT's?? JPEG and other watermarking concepts focus on DCT's or wavelet transforms.you just have to replace dct and idct in your blockproc code.

However if you are also particular about the time taken by your matlab code .i suggest you write your own blockproc code because blockproc code from MATLAB takes few ms more to reduce your input image into 8x8 blocks.
 
why are u using FFT's?? JPEG and other watermarking concepts focus on DCT's or wavelet transforms.
Yes, I made this exact point in my previous post.

However if you are also particular about the time taken by your matlab code .i suggest you write your own blockproc code because blockproc code from MATLAB takes few ms more to reduce your input image into 8x8 blocks.
The original poster has stated that the approach is intended for VLSI hardware implementation. Matlab (as is often the case) has been used only for convenience in demonstrating the concepts involved.
 
I am on FFT & now at the finishing stage my guide will not accept for changing it to DCT.I want to know
how to compress FFT Signal ie., compression in frequency domain
 

I am on FFT & now at the finishing stage my guide will not accept for changing it to DCT.I want to know
how to compress FFT Signal ie., compression in frequency domain

i am not sure if you are doing 2D DFT of the signal..in the code you are doing a one dimensional dft.there is a command in matlab for 2d signals such as dct2 or fft2 which does dft's for 2d signals.well in watermarking after using dct2...the watermark is embedded in lower co-efficient values..so i believe you need to do the same using dft2 as these lower co-efficient values are not noticeable and therefore the watermark can be embedded in these co-effiecients.

However i found in the wikipedia page
https://en.wikipedia.org/wiki/Discrete_Fourier_transform

in the data compression section it states that
For example, several lossy image and sound compression methods employ the discrete Fourier transform: the signal is cut into short segments, each is transformed, and then the Fourier coefficients of high frequencies, which are assumed to be unnoticeable, are discarded. The decompressor computes the inverse transform based on this reduced number of Fourier coefficients. (Compression applications often use a specialized form of the DFT, the discrete cosine transform or sometimes the modified discrete cosine transform.)

so you can try the following methods of compressing.However I am not sure from your matlab code that you are doing 2D DFT.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top