forming bit-stream

I have taken a 26 image,processed,IWT,ebcot process,now i want to give 2 inputs to weighting weighting model,one is menn energy of co-efficients and other is VOI coordinates,please help

 Accepted Answer

I am having difficulty understanding your question as phrased. It is also not clear what bit-stream you are trying to form.
At this time could the question be simplified to "How do I convert numeric data to a bit stream?" If so then use dec2bin, possibly after having used typecast() if needed to re-represent floating point numbers as unsigned integers. dec2bin() will output a string of characters, each '0' or '1'. If you need decimal 0 and decimal 1, then you can subtract '0' from the result, as in
dec2bin(314159) - '0'

8 Comments

FIR
FIR on 31 Dec 2011
i have an image from that i want to convert that into bit stream output
The first step would be to define what "bit stream output" is, precisely.
The second step would be to convert your "image" to numeric data.
The third step would be to re-read my answer above and implement it.
FIR
FIR on 2 Jan 2012
walter bit stream is getting the output in bitstreams=[0 1 1 0 0 1 0 etc]
Okay, that would be the version that subtracts the character '0' from the dec2bin() result.
You will probably want to use transpose() and reshape() after the conversion to 0's and 1's.
FIR
FIR on 2 Jan 2012
Walter will image compression output will give bitstream outputs
That depends on which image compression routine you use. I have never looked at EBCOT as it is part of JPEG 2000, which I avoid looking at for patent reasons (*)
Some image compression routines produce byte-oriented outputs, and other image compression routines produce bit-oriented outputs.
If you end up with a numeric array after your image compression routine, then use dec2bin() and subtract '0' to convert to a stream of 0's and 1's.
* (The only way to find out what the JPEG 2000 patent terms say is to agree to them, and _then_ you can find out what you just agreed to. My legal department absolutely will not permit that.)
FIR
FIR on 2 Jan 2012
I=imread('lena.bmp')
K=dec2bin(I);
[r c]=size(K)
J=K-0;
W=zeros(r,c);
J=K-W
i get numeric values
K = dec2bin(I) - '0';
just like I wrote. The character, not the number.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!