Function:ColorPick

From CUVI Wiki
Revision as of 21:28, 13 June 2014 by Ghazanfar (talk | contribs) (Created page with "__NOTOC__ Segments input color image by selecting a specified color. Rest of the image is converted to grayscale. ===Function=== {| |style="font-size:150%;"| <syntaxhighlight ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Segments input color image by selecting a specified color. Rest of the image is converted to grayscale.

Function

CuviStatus colorPick(const CuviImage& src,
                     CuviImage& dst,
                     const CuviColor color,
                     const Cuvi32f threshold = 128.0f,
                     const CuviStream& stream = CuviStream());

Parameters

Name Type Description
src const CuviImage& Input Image
dst CuviImage& Destination Image
color CuviColor The color to select from the image
threshold Cuvi32f The threshold for color selection
stream const CuviStream& GPU stream ID for execution

Image Type Support

Input Output
8uC3 8uC3

Sample

Example

//Creating GPU images
CuviImage gimg = cuvi:io::loadImage(path), gout;

	
//Select blue color from the image.
cuvi::arithmeticLogical::NOT(gimg,gout,CUVI_COLOR_BLUE);

//The same can be achieved using the ~ operator
gout = ~gimg;