How can i save an image and read it again without change its value ?
8 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (3 件)
Image Analyst
2017 年 4 月 2 日
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 件のコメント
Walter Roberson
2017 年 4 月 2 日
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 件のコメント
Walter Roberson
2017 年 4 月 5 日
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
2019 年 1 月 21 日
There is a File Exchange contribution that claims to be able to write double precision TIFF.
budi agung
2017 年 4 月 5 日
17 件のコメント
Shoriful Islam Shuvo
2018 年 7 月 12 日
編集済み: Shoriful Islam Shuvo
2018 年 7 月 12 日
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
2018 年 7 月 12 日
The demos in my files attached to my prior comment above (and again, here) handle .avi. Did you try that?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!