Difference between revisions of "Function:Multiply"
From CUVI Wiki
(Created page with "__NOTOC__ Multiplies two images ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus multiply(CuviImage* srcImage1, CuviImag...") |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
Multiplies | Multiplies image with another image or constant value(s). | ||
===Function=== | ====Function==== | ||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviStatus multiply(CuviImage | CuviStatus multiply(const CuviImage& src1, | ||
CuviImage | const CuviImage& src2, | ||
CuviImage | CuviImage& dst, | ||
CuviStream | const CuviStream& stream = CuviStream()); | ||
CuviStatus multiply(const CuviImage& src, | |||
const CuviScalar& values, | |||
CuviImage& dst, | |||
const CuviStream& stream = CuviStream()); | |||
CuviStatus multiply(const CuviImage& src, | |||
const Cuvi64f value, | |||
CuviImage& dst, | |||
const CuviStream& stream = CuviStream()); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
====Parameters==== | |||
{| | |||
|style="font-size:75%;"| | |||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
Line 19: | Line 31: | ||
! Description | ! Description | ||
|- | |- | ||
| | | src1 | ||
| CuviImage | | const CuviImage& | ||
| First Input Image | | First Input Image | ||
|- | |- | ||
| | | src2 | ||
| CuviImage | | const CuviImage& | ||
| Second Input Image | | Second Input Image | ||
|- | |- | ||
| | | dst | ||
| CuviImage | | CuviImage& | ||
| Resultant Image | | Resultant Image | ||
|- | |- | ||
| 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 48: | Line 61: | ||
| 8u | | 8u | ||
| 8u | | 8u | ||
|- | |||
| 16u | |||
| 16u | |||
| 16u | |||
|- | |||
| 32f | |||
| 32f | |||
| 32f | |||
|- | |- | ||
| 8u | | 8u | ||
| 8u | | 8u | ||
| 16u | | 16u | ||
|- | |||
| 8u | |||
| 8u | |||
| 32f | |||
|- | |- | ||
| 16u | | 16u | ||
| 16u | |||
| 32f | |||
|- | |||
| 8u | |||
| 16u | | 16u | ||
| 16u | | 16u | ||
|- | |- | ||
| 16u | |||
| 8u | |||
| 16u | |||
|- | |||
| 8u | |||
| 32f | | 32f | ||
| 32f | | 32f | ||
|- | |||
| 32f | |||
| 8u | |||
| 32f | |||
|- | |||
| 8u | |||
| 16u | |||
| 32f | |||
|- | |||
| 16u | |||
| 8u | |||
| 32f | | 32f | ||
|- | |- | ||
| | | 16u | ||
| | | 32f | ||
| 32f | |||
|- | |- | ||
| | | 32f | ||
| 16u | |||
| 32f | |||
|} | |||
|} | |} | ||
====Sample==== | |||
===Example=== | [[File:MultiplyIn1.png|none|frame|First Input Image (8-bit)]] | ||
<br/> | |||
[[File:MultiplyIn2.png|none|frame|Second Input Image (8-bit)]] | |||
<br/> | |||
[[File:MultiplyOut.png|none|frame| Resultant Image (16-bit)]] | |||
<br/> | |||
====Example==== | |||
{| | {| | ||
|style="font-size: | |style="font-size:100%;"| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CuviImage | CuviImage gimg1 = cuvi::io::loadImage(path); | ||
CuviImage | CuviImage gimg2 = cuvi::io::loadImage(path); | ||
CuviImage gout; | |||
// | //Multiply | ||
cuvi::arithmeticLogical::multiply(gimg1,gimg2,gout); | cuvi::arithmeticLogical::multiply(gimg1,gimg2,gout); | ||
//Multiply with a constant value | |||
gout *= 4; | |||
//Multiply each channel with a different value | |||
gout *= CuviScalar(3,5,6); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} |
Latest revision as of 20:19, 18 October 2022
Multiplies image with another image or constant value(s).
Function
|
Parameters
|
Image Type Support
|
Sample
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
Error creating thumbnail: Unable to save thumbnail to destination
Example
|