Difference between revisions of "Function:BorderMask"
From CUVI Wiki
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Adds borders on the input specified | Adds borders on the input specified by the 4 arguments: top, bottom, left and right.. | ||
===Function=== | ===Function=== | ||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus borderMask(CuviImage | CuviStatus borderMask(const CuviImage& src, | ||
CuviImage | CuviImage& dst, | ||
const Cuvi32s top, | |||
const Cuvi32s bottom, | |||
const Cuvi32s left, | |||
const Cuvi32s right, | |||
const Cuvi32f* mask, | |||
CuviStream | const CuviStream& stream = CuviStream()); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
====Parameters==== | |||
{| | |||
|style="font-size:75%;"| | |||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
Line 24: | Line 26: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src | ||
| CuviImage | | const CuviImage& | ||
| Input Image | | Input Image | ||
|- | |- | ||
| | | dst | ||
| CuviImage | | CuviImage& | ||
| Output Image | | Output Image | ||
|- | |- | ||
| top | | top | ||
| | | const Cuvi32s | ||
| Number of pixels to mask from top | | Number of pixels to mask from top | ||
|- | |- | ||
| bottom | | bottom | ||
| | | const Cuvi32s | ||
| Number of pixels to mask from bottom | | Number of pixels to mask from bottom | ||
|- | |- | ||
| left | | left | ||
| | | const Cuvi32s | ||
| Number of pixels to mask from left | | Number of pixels to mask from left | ||
|- | |- | ||
| right | | right | ||
| | | const Cuvi32s | ||
| Number of pixels to mask from right | | Number of pixels to mask from right | ||
|- | |||
| mask | |||
| const Cuvi32f* | |||
| Values of masked pixel for each channel | |||
|- | |- | ||
| stream | | stream | ||
| 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 72: | Line 79: | ||
| 16uC3 | | 16uC3 | ||
| 16uC3 | | 16uC3 | ||
|} | |||
|} | |} | ||
===Sample=== | ===Sample=== | ||
[[File:Maskin.jpg|none|frame|Input Image]] | |||
<br/> | |||
[[File:Maskout.jpg|none|frame|Masked Image]] | |||
<br/> | |||
===Example=== | ====Example==== | ||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviImage | CuviImage gimg = cuvi::io::loadImage(path), gout; | ||
Cuvi32f mask[3] = { 0 }; | |||
//Mask borders with pixel value of 0 | //Mask borders with pixel value of 0 for each channel | ||
cuvi::colorOperations::borderMask(gimg,gout,10,10,5,3, | cuvi::colorOperations::borderMask(gimg,gout,10,10,5,3,mask); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Latest revision as of 20:40, 18 October 2022
Adds borders on the input specified by the 4 arguments: top, bottom, left and right..
Function
|
Parameters
|
Image Type Support
|
Sample
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
Example
|