I am trying to do DWT transform on image and then quantize the image for lossy compression. However I am not getting any image after quantization, only a plotting of the signals are obtained. Kindly help.
2 次查看(过去 30 天)
显示 更早的评论
Sir , I am doing a region of interest (ROI) based compression on medical images. I am doing DWT and quantization on Non-ROI or the background. However I am not getting any image after quantization. I need the quantized image. My code is given below.
if true
% f = imread('Image_difference.bmp');
imshow(f)
wname = 'sym4';
[CA,CH,CV,CD] = dwt2( f, wname, 'mode', 'per');
subplot(311)
imagesc(CV); title('Vertical Detail Image');
colormap gray;
subplot(312)
imagesc(CA); title('Lowpass Approximation');
q = quantizer;
y1 = quantize(q, CA);
y2 = quantize(q, CH);
y3 = quantize(q, CV);
y4 = quantize(q, CD);
subplot(313)
plot(CA, y1); title('quantize lowpass Approximation');
end
Sir I am also sending the images herewith.
Kindly help me Sir. Thanks and regards Debarpita Chaudhuri.
<<
>>
0 个评论
采纳的回答
Sachin Shrestha
2016-6-14
Hi Debarpita,
There are some issues with the code. The major one being the last line;
plot(CA, y1);
Try this instead to get the image, imagesc(y1);
alike the previous ways to display the image. I can't understand why you are plotting those values to get the image.
You may define the 'quantizer' to get the better results.
I hope this will help. Good Luck!
5 个评论
enyawson
2023-9-19
@Debarpita Chaudhuri what was your solution, and were you able ot achieve compression using this ?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Encryption / Cryptography 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!