Simple question, how to read in a color band file?
2 次查看(过去 30 天)
显示 更早的评论
Hi, I am very new to image manipulations and MatLab. How do I properly read in a color band into MatLab. For example, I have three .raw files, named band1.raw, band2.raw, and band3.raw representing blue-green, green, and red. The following is an example of reading in a thermal infrared band. How can I read in, for example, the green band file?
Thank you.
thermal_ir = fread( fopen( 'band_thermal_ir.raw', 'r'), [1000 1000], '*uint8')';
%The following is my guess.
green = fread( fopen( 'band_thermal_ir.raw', 'r'), [1000 1000], '*uint8')';
0 个评论
采纳的回答
Image Analyst
2023-3-2
You got the filename wrong. You can't use the same name for the green band as for the thermal band, so try this:
thermalBand = fread( fopen('band_thermal_ir.raw', 'r'), [1000, 1000], '*uint8')';
% The following is my guess.
% Read in blue-green band.
blueGreenBand = fread(fopen('band1.raw', 'r'), [1000, 1000], '*uint8')';
% Read in green band.
greenBand = fread(fopen('band2.raw', 'r'), [1000, 1000], '*uint8')';
% Read in red band.
redBand = fread(fopen('band3.raw', 'r'), [1000, 1000], '*uint8')';
3 个评论
更多回答(1 个)
Nikhilesh
2023-3-2
To read in a color band file, you can follow a similar approach as the thermal infrared band example you provided.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!