How can i save an image and read it again without change its value ?
6 views (last 30 days)
Show older comments
im doing watermarking image using DWT and got problem about the value change when i try to read the watermarked image
imwrite(Watermarkedimage_final ,'iwater.bmp');
x=imread('iwater.bmp');
x=im2double(x);
[F11,F22]= wfilters('haar', 'd');
[a b c d]=dwt2(x,'haar','d');
[aa bb cc dd]=dwt2(a,'haar','d');
[aaa bbb ccc ddd]=dwt2(aa,'haar','d');
recovered_image=imadjust(recovered_image);
imshow(uint8(recovered_image),[]);
imwrite(recovered_image ,'bmp.bmp');
0 Comments
Answers (3)
Image Analyst
on 2 Apr 2017
Watermarkedimage_final and the badly-named "x" will have the same values because BMP is a lossless format.
Likewise, if you use imread to read in the badly-named 'bmp.bmp' then the recalled image will have the same values as uint8(recovered_image).
2 Comments
Walter Roberson
on 2 Apr 2017
Sorry, No, MATLAB does not support any double precision floating point image formats. It supports single precision TIFF; see https://www.mathworks.com/matlabcentral/answers/7184-how-can-i-write-32-bit-floating-point-tifs-with-nans#comment_15023 .
TIFF 6.0 added support for IEEE double precision but MATLAB is not able to write those out.
3 Comments
Walter Roberson
on 5 Apr 2017
The TIFF class can only handle single precision. The TIFF file format revision 6 and later can handle double precision, but imwrite() and the TIFF class cannot write version 6 TIFF files.
In other words, if you need to be able to write the watermarked data as an image file, you have three choices:
- find a way to write TIFF 6 double precision files -- which your display program probably would not be able to display anyhow; or
- use an integer-to-integer DWT instead of a double precision DWT; or
- modify the values in such as way that after writing to file and reading back in the changed data is reliably distinguishable from the original values and can be processed to extract the watermark.
LSB (Least Significant Bit) modifications of the double precision wavelet transform are not enough to be able make recoverable changes.
Walter Roberson
on 21 Jan 2019
There is a File Exchange contribution that claims to be able to write double precision TIFF.
budi agung
on 5 Apr 2017
17 Comments
Shoriful Islam Shuvo
on 12 Jul 2018
Edited: Shoriful Islam Shuvo
on 12 Jul 2018
It is not mandatory for me to use mp4 video format.so i have tried uncompressed avi format and looks like it is working
Image Analyst
on 12 Jul 2018
The demos in my files attached to my prior comment above (and again, here) handle .avi. Did you try that?
See Also
Categories
Find more on Wavelet Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!