![]() | Download Help (Windows Only) |
Owning Class: support
Requires: MathScript RT Module
b = rgb_to_grayscale(a)
Legacy Name: rgb2gray
Converts an RGB image to grayscale.
Name | Description |
---|---|
a | Specifies a real matrix. |
Name | Description |
---|---|
b | Returns the grayscale representation of the image. b is the same size as a. |
The following table lists the support characteristics of this function.
Supported in the LabVIEW Run-Time Engine | Yes |
Supported on RT targets | Yes |
Suitable for bounded execution times on RT | Not characterized |
[X, Y] = meshgrid2d(-1:0.01:1);
R = (2-X.^2-Y.^2)*255/2;
G = cos(X*pi/2).*255;
B = cos(Y*pi/2).*255;
image = R*255*255+G*255+B;
fwrite_image(image, '/images/reference/en-XX/help/373123C-01/imagetest.bmp', 'BMP');
gray = rgb_to_grayscale(image);
surface(gray);
colormap([0, 0, 0; 1, 1, 1]);
Helpful
Not Helpful