I take 4x4 blocks from the Gray image , filtered it and now i want to return it back to the original gray .
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
zgrt
el 25 de Oct. de 2013
0 votos
3 comentarios
sixwwwwww
el 25 de Oct. de 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
el 25 de Oct. de 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
el 26 de Oct. de 2013
Image Analyst
el 27 de Oct. de 2013
0 votos
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).
Categorías
Más información sobre Signal Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!