|
|
| (3 intermediate revisions by the same user not shown) |
| Line 44: |
Line 44: |
| |} | | |} |
|
| |
|
| ===Image Type Support=== | | ====Image Type Support==== |
| | | {| |
| | |style="font-size:75%;"| |
| {| class="wikitable" | | {| class="wikitable" |
| |- | | |- |
| Line 60: |
Line 61: |
| | 32fC1 | | | 32fC1 |
| |} | | |} |
|
| |
| ===Sample===
| |
| {|
| |
| |-
| |
| |[[File:ColoIn.jpg|frame|Color Image]]
| |
| |[[File:RGB2GrayOut.jpg|frame|Output Gray Image]]
| |
| |} | | |} |
|
| |
|
| | ====Sample==== |
| | [[File:ColoIn.jpg|none|frame|Color Image]] |
| | <br/> |
| | [[File:RGB2GrayOut.jpg|none|frame|Output Gray Image]] |
| | <br/> |
|
| |
|
| | | ====Example==== |
| ===Example=== | |
| {| | | {| |
| |style="font-size:150%;"| | | |style="font-size:100%;"| |
| <syntaxhighlight lang="cpp"> | | <syntaxhighlight lang="cpp"> |
|
| |
|
Latest revision as of 13:09, 18 October 2022
Converts an RGB image to gray scale using fixed or custom transform coefficients
Function
CuviStatus rgb2gray(const CuviImage& src,
CuviImage& dst,
const CuviStream& stream = CuviStream());
CuviStatus rgb2gray(const CuviImage& src,
CuviImage& dst,
const CuviScalar& coeffs,
const CuviStream& stream = CuviStream());
|
Parameters
| Name
|
Type
|
Description
|
| src
|
CuviImage&
|
Input 3 channel image
|
| dst
|
CuviImage&
|
Output single channel image
|
| coeffs
|
CuviScalar&
|
Custom transformation coefficients
|
| stream
|
CuviStream&
|
GPU stream ID for execution
|
|
Image Type Support
| Input
|
Output
|
| 8uC3
|
8uC1
|
| 16uC3
|
16uC1
|
| 32fC3
|
32fC1
|
|
Sample
Color Image
Output Gray Image
Example
CuviImage gimg = cuvi::io::loadImage(path), gout;
//Convert to gray-scale using standard coefficients
cuvi::colorOperations::rgb2gray(gimg,gout);
//Convert to gray-scale using custom coefficients
CuviScalar coeffs(0.33, 0.33, 0.33);
cuvi::colorOperations::rgb2gray(gimg,gout, coeffs);
|