Difference between revisions of "Function:ColorPick"

From CUVI Wiki
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
Segments input color image by selecting a specified color. Rest of the image is converted to grayscale.
Segments input color image by selecting a specified color. Rest of the image is converted to grayscale.
===Function===
====Function====
{|
{|
|style="font-size:100%;"|
|style="font-size:100%;"|
Line 14: Line 14:
|}
|}


===Parameters===
====Parameters====
 
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 41: Line 42:
| const CuviStream&
| const CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 53: Line 55:
| 8uC3
| 8uC3
| 8uC3
| 8uC3
|}
|}
|}


===Sample===
====Sample====
 
[[File:960px.jpg|none|frame|Input Image]]
<br/>
[[File:ColorPick.jpg|none|frame|Picked Color]]
<br/>


===Example===
====Example====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">



Latest revision as of 12:53, 18 October 2022

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

Input Image


Picked Color


Example

//Creating GPU images
CuviImage input = cuvi:io::loadImage(path), output;

	
//Select blue color from the image.
cuvi::colorOperations::colorPick(input,output,CUVI_COLOR_BLUE);