Converting uint8 array into 32-bit
33 ビュー (過去 30 日間)
古いコメントを表示
I have a 1280x960 uint8 array that I would like to convert into uint32. Any suggestions?
Thanks!
0 件のコメント
採用された回答
Walter Roberson
2012 年 6 月 6 日
uint32(YourArray)
Are you also wanting to scale the values so that 255 in uint8 becomes a large value in uint32? If so then
uint32(YourArray) .* uint32(2^24)
2 件のコメント
Walter Roberson
2012 年 6 月 6 日
im2double() your original arrays and subtract those. The result will be double precision in the range -1 to +1. You can imagesc() to view, or add 1.0 and divide the result by 2 in order to get a matrix in the range 0 to 1 with 0.5 representing "no difference"
その他の回答 (1 件)
Thomas
2012 年 6 月 6 日
I'm not sure maybe the type cast command will help
doc typecast
1 件のコメント
Walter Roberson
2012 年 6 月 6 日
typecast would be for the case where several uint8 had to be bundled together to form a single uint32.
参考
カテゴリ
Help Center および File Exchange で Numeric Types についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!