No matching function for cv::merge
up vote
1
down vote
favorite
I want to merge 3 monochrome camera image in one 3 channeled opencv matrix. I try this in the following way:
cv::Mat merged;
std::vector<cv::Mat> channels[3];
while(1){
channels[0]=Camera1->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[1]=Camera2->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[2]=Camera3->getNextFrameSWTrig();
cv::merge(channels, merged);
(*buffer).push_back(merged.clone());
}
But the following error message comes:
no matching function for call to 'merge'
Altough in the OpenCV documentation I found:
C++: void merge(InputArrayOfArrays mv, OutputArray dst)
c++ opencv image-processing
add a comment |
up vote
1
down vote
favorite
I want to merge 3 monochrome camera image in one 3 channeled opencv matrix. I try this in the following way:
cv::Mat merged;
std::vector<cv::Mat> channels[3];
while(1){
channels[0]=Camera1->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[1]=Camera2->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[2]=Camera3->getNextFrameSWTrig();
cv::merge(channels, merged);
(*buffer).push_back(merged.clone());
}
But the following error message comes:
no matching function for call to 'merge'
Altough in the OpenCV documentation I found:
C++: void merge(InputArrayOfArrays mv, OutputArray dst)
c++ opencv image-processing
Have you included<opencv2/imgproc.hpp>
?
– sgarizvi
Nov 8 at 11:19
3
Alsostd::vector<cv::Mat> channels[3];
should bestd::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors
– Miki
Nov 8 at 11:21
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to merge 3 monochrome camera image in one 3 channeled opencv matrix. I try this in the following way:
cv::Mat merged;
std::vector<cv::Mat> channels[3];
while(1){
channels[0]=Camera1->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[1]=Camera2->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[2]=Camera3->getNextFrameSWTrig();
cv::merge(channels, merged);
(*buffer).push_back(merged.clone());
}
But the following error message comes:
no matching function for call to 'merge'
Altough in the OpenCV documentation I found:
C++: void merge(InputArrayOfArrays mv, OutputArray dst)
c++ opencv image-processing
I want to merge 3 monochrome camera image in one 3 channeled opencv matrix. I try this in the following way:
cv::Mat merged;
std::vector<cv::Mat> channels[3];
while(1){
channels[0]=Camera1->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[1]=Camera2->getNextFrameSWTrig(); //give back frame_time and frame_num
channels[2]=Camera3->getNextFrameSWTrig();
cv::merge(channels, merged);
(*buffer).push_back(merged.clone());
}
But the following error message comes:
no matching function for call to 'merge'
Altough in the OpenCV documentation I found:
C++: void merge(InputArrayOfArrays mv, OutputArray dst)
c++ opencv image-processing
c++ opencv image-processing
asked Nov 8 at 11:16
Dániel Terbe
557
557
Have you included<opencv2/imgproc.hpp>
?
– sgarizvi
Nov 8 at 11:19
3
Alsostd::vector<cv::Mat> channels[3];
should bestd::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors
– Miki
Nov 8 at 11:21
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48
add a comment |
Have you included<opencv2/imgproc.hpp>
?
– sgarizvi
Nov 8 at 11:19
3
Alsostd::vector<cv::Mat> channels[3];
should bestd::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors
– Miki
Nov 8 at 11:21
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48
Have you included
<opencv2/imgproc.hpp>
?– sgarizvi
Nov 8 at 11:19
Have you included
<opencv2/imgproc.hpp>
?– sgarizvi
Nov 8 at 11:19
3
3
Also
std::vector<cv::Mat> channels[3];
should be std::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors– Miki
Nov 8 at 11:21
Also
std::vector<cv::Mat> channels[3];
should be std::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors– Miki
Nov 8 at 11:21
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
With
std::vector<cv::Mat> channels[3];
^ ^
you're creating an array of 3 std::vector
, while you want a std::vector
with 3 elements:
std::vector<cv::Mat> channels(3);
^ ^
1
you're creating an array of vectors, same asint a[3];
is an array of 3 integers
– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
With
std::vector<cv::Mat> channels[3];
^ ^
you're creating an array of 3 std::vector
, while you want a std::vector
with 3 elements:
std::vector<cv::Mat> channels(3);
^ ^
1
you're creating an array of vectors, same asint a[3];
is an array of 3 integers
– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
add a comment |
up vote
3
down vote
accepted
With
std::vector<cv::Mat> channels[3];
^ ^
you're creating an array of 3 std::vector
, while you want a std::vector
with 3 elements:
std::vector<cv::Mat> channels(3);
^ ^
1
you're creating an array of vectors, same asint a[3];
is an array of 3 integers
– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
With
std::vector<cv::Mat> channels[3];
^ ^
you're creating an array of 3 std::vector
, while you want a std::vector
with 3 elements:
std::vector<cv::Mat> channels(3);
^ ^
With
std::vector<cv::Mat> channels[3];
^ ^
you're creating an array of 3 std::vector
, while you want a std::vector
with 3 elements:
std::vector<cv::Mat> channels(3);
^ ^
edited Nov 8 at 11:53
answered Nov 8 at 11:48
Miki
29k851131
29k851131
1
you're creating an array of vectors, same asint a[3];
is an array of 3 integers
– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
add a comment |
1
you're creating an array of vectors, same asint a[3];
is an array of 3 integers
– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
1
1
you're creating an array of vectors, same as
int a[3];
is an array of 3 integers– Miki
Nov 8 at 11:53
you're creating an array of vectors, same as
int a[3];
is an array of 3 integers– Miki
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
Aha, thanks for clarifying.
– not an alien
Nov 8 at 11:53
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206658%2fno-matching-function-for-cvmerge%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you included
<opencv2/imgproc.hpp>
?– sgarizvi
Nov 8 at 11:19
3
Also
std::vector<cv::Mat> channels[3];
should bestd::vector<cv::Mat> channels(3);
You want a vector with 3 elements, not 3 vectors– Miki
Nov 8 at 11:21
@Miki this resolved the problem! Thank you!
– Dániel Terbe
Nov 8 at 11:46
Glad it helped, posted as an answer then ;)
– Miki
Nov 8 at 11:48