Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

vision.DemosaicInterpolator System object

Bayer-pattern image conversion to true color

Description

The DemosaicInterpolator object demosaics Bayer's format images. The object identifies the alignment as the sequence of R, G, and B pixels in the top-left four pixels of the image, in row-wise order.

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

H = vision.DemosaicInterpolator returns a System object, H, that performs demosaic interpolation on an input image in Bayer format with the specified alignment.

H = vision.DemosaicInterpolator(Name,Value) returns a System object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

Properties

Method

Interpolation algorithm

Specify the algorithm the object uses to calculate the missing color information as one of Bilinear | Gradient-corrected linear. The default is Gradient-corrected linear.

SensorAlignment

Alignment of the input image

Specify the sequence of R, G and B pixels that correspond to the 2-by-2 block of pixels in the top-left corner, of the image. It can be set to one of RGGB |GRBG | GBRG | BGGR. The default is RGGB. Specify the sequence in left-to-right, top-to-bottom order.

 Fixed-Point Properties

Methods

stepPerform demosaic operation on input
Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

Demosaic a Bayer pattern encoded-image photographed by a camera with a sensor alignment of BGGR.

 x = imread('mandi.tif');
 hdemosaic = ...
     vision.DemosaicInterpolator('SensorAlignment', 'BGGR');
 y = step(hdemosaic, x);

 imshow(x,'InitialMagnification',20); 
 title('Original Image');
 figure, imshow(y,'InitialMagnification',20); 
 title('RGB image after demosaic');

Algorithms

This object implements the algorithm, inputs, and outputs described on the Demosaic block reference page. The object properties correspond to the block parameters, except:

The Output image signal block parameter allows you to specify whether the block outputs the image as One multidimensional signal or Separate color signals. The object does not have a property that corresponds to the Output image signal block parameter. The object always outputs the image as an M-by-N-by-P color video signal.

Extended Capabilities

Introduced in R2012a