SOD C/C++ API Reference - Image Processing


Syntax

void sod_grayscale_image_3c(sod_img input);

Description

Convert a given image colorspace to the gray color model. A grayscale (or graylevel) image is simply one in which the only colors are shades of gray. Grayscale images are very common & entirely sufficient for many tasks such as face detection and so there is no need to use more complicated and harder-to-process color images. A typical input image should look like the following after processing:

Input Picture

Nature before processing

After Processing via sod_grayscale_image_3c()

Nature after processing

Parameters

sod_img    input

The input image to be processed. This function is a no-op if the input image is a single channel (i.e. already grayscaled). The image can be loaded from disk using sod_img_load_from_file(), from memory (i.e. network socket) via sod_img_load_from_mem() or dynamically created via sod_make_image().

Return Value

None. The colorspace conversion takes in place unlike sod_grayscale_image() which return the result of the graysclae color conversion in a new sod_img instance.

Example

Checkout the introduction course, the C/C++ samples on the download page or refer to the SOD Github Repository.

See also

sod_canny_edge_imagesod_image_draw_bboxsod_normalize_imagesod_hough_lines_detectsod_crop_imagesod_composite_image.



Back