I take 4x4 blocks from the Gray image , filtered it and now i want to return it back to the original gray .
Show older comments
Dear all ;
I have a gray image . I convert it to DCT . Then i take 4x4 blocks from this DCT of the gray image . I convert the 4x4 dct blocks to idct . Then i filter this 4x4 .
Now i want to take the filtered 4x4 and put it to the original gray image . How ?!
The code is the following :
% Convert to DCT: gray3=dct2(gray2); gray4=gray3(1:4,1:4);
% Convert to idct : IDCT_Gray=idct2(gray4);
%then i filter IDCT_Gray.
Assume the filter output is yy2 . How can i return this 4x4 filter output to the original gray image .
thank you
Accepted Answer
More Answers (2)
zgrt
on 25 Oct 2013
0 votes
3 Comments
sixwwwwww
on 25 Oct 2013
I will suggest that you do processing in one of two domains. I mean perform all operations in RGB domain or do all the processing in DCT domain. Then it will be easy to handle
sixwwwwww
on 25 Oct 2013
I will suggest that you do processing in one of two domains. I mean perform all operations in RGB domain or do all the processing in DCT domain. Then it will be easy to handle
zgrt
on 26 Oct 2013
Image Analyst
on 27 Oct 2013
0 votes
Sounds like you have it solved since you marked this as accepted but I didn't understand it. I don't know anything about compression (if that's what you're doing) but your explanation of the algorithm, which makes no sense to me. You say you convert an image to DCT, then you take 4x4 blocks. yet your code only deals with the first block, not all of them. Then you inverse transform it, which will of course not give you the same size image in the spatial domain that you started with, but a 4x4 spatial domain image. Perhaps you wanted to zero out the other blocks, maintaining the same size spectrum, rather than extracting 14 elements from it.
But anyway, you then have a very, very tiny, very, very blurry spatial domain image again. But now you say you want to filter it . Strange, because you were just in the Fourier domain and already filtered it there (by taking just a 4x4 chunk of it) so why filter it again in the spatial domain??? And exactly what type of spatial domain filtering can you have with only 4 by 4 pixels? Nothing of any use, I would think.
But whatever....at least you have it solved (whatever it is).
Categories
Find more on Signal Generation 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!