Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d4245aa4
Commit
d4245aa4
authored
Dec 07, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5704 from sturkmen72:patch-3
parents
6423b366
8418d564
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
core.hpp
modules/core/include/opencv2/core.hpp
+21
-21
No files found.
modules/core/include/opencv2/core.hpp
View file @
d4245aa4
...
...
@@ -876,34 +876,34 @@ CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);
/** @brief Copies specified channels from input arrays to the specified channels of
output arrays.
The function
s mixChannels provide
an advanced mechanism for shuffling image channels.
The function
cv::mixChannels provides
an advanced mechanism for shuffling image channels.
split and merge and some forms of cvtColor are partial cases of
mixChannels .
cv::split and cv::merge and some forms of cv::cvtColor are partial cases of cv::
mixChannels .
In the example below, the code splits a 4-channel
RGBA image into a 3-channel BGR (with R and B
In the example below, the code splits a 4-channel
BGRA image into a 3-channel BGR (with B and R
channels swapped) and a separate alpha-channel image:
@code{.cpp}
Mat
rgba( 100, 100, CV_8UC4, Scalar(1,2,3,4
) );
Mat bgr(
rgba.rows, rgb
a.cols, CV_8UC3 );
Mat alpha(
rgba.rows, rgb
a.cols, CV_8UC1 );
Mat
bgra( 100, 100, CV_8UC4, Scalar(255,0,0,255
) );
Mat bgr(
bgra.rows, bgr
a.cols, CV_8UC3 );
Mat alpha(
bgra.rows, bgr
a.cols, CV_8UC1 );
// forming an array of matrices is a quite efficient operation,
// because the matrix data is not copied, only the headers
Mat out[] = { bgr, alpha };
//
rgba[0] -> bgr[2], rgb
a[1] -> bgr[1],
//
rgba[2] -> bgr[0], rgb
a[3] -> alpha[0]
//
bgra[0] -> bgr[2], bgr
a[1] -> bgr[1],
//
bgra[2] -> bgr[0], bgr
a[3] -> alpha[0]
int from_to[] = { 0,2, 1,1, 2,0, 3,3 };
mixChannels( &
rgb
a, 1, out, 2, from_to, 4 );
mixChannels( &
bgr
a, 1, out, 2, from_to, 4 );
@endcode
@note Unlike many other new-style C++ functions in OpenCV (see the introduction section and
Mat::create ), mixChannels requires the output arrays to be pre-allocated before calling the
Mat::create ),
cv::
mixChannels requires the output arrays to be pre-allocated before calling the
function.
@param src input array or vector of matrices
l
; all of the matrices must have the same size and the
@param src input array or vector of matrices; all of the matrices must have the same size and the
same depth.
@param nsrcs number of matrices in
src
.
@param dst output array or vector of matrices; all the matrices *
must be allocated
*; their size and
depth must be the same as in
src[0]
.
@param ndsts number of matrices in
dst
.
@param nsrcs number of matrices in
`src`
.
@param dst output array or vector of matrices; all the matrices *
*must be allocated*
*; their size and
depth must be the same as in
`src[0]`
.
@param ndsts number of matrices in
`dst`
.
@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
...
...
@@ -911,16 +911,16 @@ src[0].channels()-1, the second input image channels are indexed from src[0].cha
src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is
filled with zero .
@param npairs number of index pairs in
fromTo
.
@sa
split, merge,
cvtColor
@param npairs number of index pairs in
`fromTo`
.
@sa
cv::split, cv::merge, cv::
cvtColor
*/
CV_EXPORTS
void
mixChannels
(
const
Mat
*
src
,
size_t
nsrcs
,
Mat
*
dst
,
size_t
ndsts
,
const
int
*
fromTo
,
size_t
npairs
);
/** @overload
@param src input array or vector of matrices
l
; all of the matrices must have the same size and the
@param src input array or vector of matrices; all of the matrices must have the same size and the
same depth.
@param dst output array or vector of matrices; all the matrices *
must be allocated
*; their size and
@param dst output array or vector of matrices; all the matrices *
*must be allocated*
*; their size and
depth must be the same as in src[0].
@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
...
...
@@ -935,9 +935,9 @@ CV_EXPORTS void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst
const
int
*
fromTo
,
size_t
npairs
);
/** @overload
@param src input array or vector of matrices
l
; all of the matrices must have the same size and the
@param src input array or vector of matrices; all of the matrices must have the same size and the
same depth.
@param dst output array or vector of matrices; all the matrices *
must be allocated
*; their size and
@param dst output array or vector of matrices; all the matrices *
*must be allocated*
*; their size and
depth must be the same as in src[0].
@param fromTo array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment