How to convert a negative value to 1bit binary?

I have A = (1; 0; 1; 0; 1) (in vector )
A value, I embed it in the watermarking process. and the output of the extraction B = (-1.9934; -2.337; -1.1123; -3.4532; 1.2186) (in vector).
so how to change the value of B to be the same as the value of A (in binary )?
How to convert a negative value to 1bit binary?

2 comentarios

Bhaskar R
Bhaskar R el 30 de Oct. de 2019
You can get your answer from the Convert floating point to binary community answer
Walter Roberson
Walter Roberson el 30 de Oct. de 2019
In cases where you are thinking of embedding bits into floating point numbers, that is often the wrong thing to do. People wanting to do this are often working either with floating point DCT coefficients, or else with floating point wavelet coefficients. When you change a single bit in DCT or wavelet coefficients, often there is no effect on the decoded image, and when there is an effect, often re-encoding in order to extract the bits will not get back the stored bits. Changing a single LSB for a wavelet coefficient can result in a representation that is invalid, something that cannot be produced by any input image, which can lead to the back transformation to an "image" to fail.
Think about it this way: the input image is typically Rows * Columns * 8 bits, and the floating point DCT or wavelet coefficients occupy Rows * Columns * 32 bits total, so you have 4 times as much information capacity in the floating point representation. If you change a single bit in that floating point representation, then even if you just consider it as a random process, there would only be a 1 in 4 chance that the bit was important to back-constructing an image.
What is recommended is to use Integer DCT (IDCT) or one of the integer wavelet transforms.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Preguntada:

el 30 de Oct. de 2019

Comentada:

el 30 de Oct. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by