Simple question, how to read in a color band file?
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Image Analyst
on 2 Mar 2023
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 Comments
More Answers (1)
Nikhilesh
on 2 Mar 2023
To read in a color band file, you can follow a similar approach as the thermal infrared band example you provided.
0 Comments
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!