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!