rawinfo
Syntax
Description
Examples
Determine Sensor Layout in RAW File
Retrieve metadata from a RAW image file.
info = rawinfo("colorCheckerTestImage.NEF");
Examine the CFALayout
field to determine the sensor layout.
sensor_layout = info.CFALayout
sensor_layout = "RGGB"
Input Arguments
filename
— Name of RAW file
character vector | string scalar
Name of RAW file, specified as a string scalar or character vector. Specify
filename
as a full path, containing the file name and extension,
or as a relative path from the current folder or from any folder on the MATLAB® path.
The rawinfo
function does not support RAW file formats that
employ JPEG compression.
Data Types: char
| string
Output Arguments
info
— Metadata from RAW file
struct
Metadata from the RAW file, returned as a struct
with these
fields.
Field | Description |
---|---|
Filename | String scalar specifying the full name, including the path, to the RAW image file. |
CFASensorType | String scalar specifying the type of the sensor that captured the
image. |
CFALayout | String scalar specifying the sensor layout for Bayer sensors. Sensor
layouts supported by rawinfo include but are not limited to
"BGGR" , "RGGB" ,
"GBRG" , and "GRGB" . For non-Bayer
sensors, this value is empty. |
CFAImageSize | Two-element row vector of type double specifying the
total number of rows and columns present in the CFA image. |
SamplesPerPixel | Scalar of type double specifying the number of samples
in every pixel of the image. |
ImageSizeInfo | Structure containing all the size information that describes a CFA image. |
ColorInfo | Structure containing all of the color information required to render an RGB image from the CFA image. |
ExifTags | Structure containing the EXIF Tags, if any, present in the file. The
Makernotes , if any, are included in this field. |
LensInfo | Structure containing information about the lens used to capture the image. |
MiscInfo | Structure containing information, if any, about the camera and image creator present in the file. |
XMPData | String scalar containing the Adobe Extensible Metadata Platform (XMP) data, if any, present in the file. |
FormatSpecificInfo | Structure containing format specific information, such as DNG Tags and X-Trans sensor layout descriptions. If no format specific information is available, this value is an empty structure. |
LibrawVersion | String scalar specifying the version of the LibRaw library currently being used. LibRaw is a library for reading RAW files obtained from digital photo cameras. For more information, see libraw.org. |
More About
RAW File Format
The RAW file format preserves image data in its most unedited state, recorded directly from the camera sensor. Most camera manufacturers define their own proprietary RAW file format, such as the Nikon NEF file format and the Canon CRW format. Adobe has also defined a RAW file format, DNG (digital negative), which is supported by several cameras. The name of the format is typically capitalized, like other file formats such as JPG and TIF. However, unlike other file formats, RAW is not an acronym.
Version History
Introduced in R2021aR2024a: LibRaw version updated to 0.21.1
The function now uses LibRaw version 0.21.1 for reading the CFA image data.
R2021b: LibRaw version updated to 0.20.2
The function now uses LibRaw version 0.20.2 for reading the CFA image data. Before, the function used LibRaw version 0.20.0.
See Also
raw2planar
| rawread
| planar2raw
| raw2rgb
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)