replace one bit plane with random image in DCT domain and get DCT inverse
1 view (last 30 days)
Show older comments
Hi, I want to replace one bit plane with random image in DCT domain and get DCT inverse but I can't get correct image like orginal image.
What's the problem? If I didn't replace bit plane with random image I can get result like source image.
I tested with different bit plane but I got this result.
img=imread('cameraman.tif');
b= dct2(img);
img=uint8(b);
[n,m]=size(img);
random=randi([0 1], n,m);
bitset(img, 1,random );
idct_T= idct2(img);
imshow(uint8(idct_T));
img=imread('cameraman.tif');
b= dct2(img);
idct_T= idct2(b);
imshow(uint8(idct_T));
0 Comments
Accepted Answer
yanqi liu
on 26 Jan 2022
may be use uint8 loss some image data,can use more bigger range format,such as
img=imread('cameraman.tif');
b = dct2(img);
img=int32(b);
[n,m]=size(img);
random=randi([0 1], n,m);
bitset(img, 1, random );
idct_T = idct2(img);
figure;
imshow(mat2gray(idct_T));
img=imread('cameraman.tif');
b= dct2(img);
idct_T= idct2(b);
figure;
imshow(mat2gray(idct_T));
0 Comments
More Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis 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!