Pixel decomposition
古いコメントを表示
Sir, I`m new to matlab and doing a basic work on decomposition of pixels with the criteria as follows:
Denote the numbers of rows and columns in an original image as n1 and n2, the total number of pixels as n=n1*n2, and the gray pixel-values as Pn belongs (0.255), n=1,2,3etc . assume both n1 and n2 are multiples of 8. Each pn can be represented by 8 bits, , where B(n,t)={Pn/2^t} (1)In other words Pn=(B(n,t). 2t)
We call B(n,7),B(n,6)...B(n,3)the MSB, and B(n,2),B(n,1)the LSB. Then, collect the MSB of each pixel to form an MSB set that includes 5N bits.
Kindly formulate me the code for this computation
採用された回答
その他の回答 (1 件)
Image Analyst
2011 年 10 月 9 日
I also had trouble figuring out what was wanted. I didn't know if the instructor simply wanted the lower 5 bits and/or upper 5 bits of the image, like this:
lower5bits = bitand(grayImage, uint8(32));
upper5bits = bitand(grayImage, uint8(256-32));
or something like that.
2 件のコメント
Walter Roberson
2011 年 10 月 9 日
I think it is the upper 5 bits being asked for, but extracted I think, or at least shifted down.
One thing to watch out for is that the description of the values does not preclude floating point storage of the Pn values.
Dinesh Ranganathan
2011 年 10 月 12 日
カテゴリ
ヘルプ センター および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!