imapplymatrix() - Image Processing
Y = imapplymatrix(M,X) computes the linear
combination of the rows of M with the color channels
of X. The output data type is the same as the type
of X.Y = imapplymatrix(M,X,C) computes the linear
combination of the rows of M with the color channels
of X, adding the corresponding constant value from C to
each combination. The output data type is the same as the type of X.Y = imapplymatrix(..., output_type) returns
the result of the linear combination in an array of type output_type.
Syntax
Y = imapplymatrix(M,X)Y = imapplymatrix(M,X,C)Y = imapplymatrix(..., output_type)
Example
RGB = imread('peppers.png');
M = [0.30, 0.59, 0.11];
gray = imapplymatrix(M, RGB);
figure
subplot(1,2,1), imshow(RGB), title('Original RGB')
subplot(1,2,2), imshow(gray), title('Grayscale Conversion')
Output / Return Value
Limitations
Alternatives / See Also
Reference