Ask Your Question
0

Could OpenCV return a matrix for a function? [closed]

asked 2016-01-15 18:04:05 -0600

Cabezon667 gravatar image

Is a really simple question, but I need the answer.

Image this code

#include "opencv2/opencv.hpp"
#include <iostream>
#include <stdio.h>
#include <iomanip>  // for controlling float print precision
#include <sstream>  // string to number conversion

using namespace cv;
using namespace std;

int main()
{
//I load two diferents frames for a video
.....
Mat error ,m1,m2;
Mat m1 = frame1;
Mat m2 = frame2;
error = Mat matrix_error(m1,m2);
imshow("",error);
waitKey(0);
}

In functions.h

#ifndef FUNCTIONS_H_
#define FUNCTIONS_H_
#include "opencv2/opencv.hpp"
#include <iostream>
#include <stdio.h>
#include <iomanip>  // for controlling float print precision
#include <sstream>
using namespace cv;
using namespace std;
Mat matrix_error (const Mat& F1, const Mat& F2);
#endif /* FUNCTIONS_H_ */

functions.cpp

Mat matrix_error (const Mat& F1, const Mat& F2)
{
Mat s1;
absdiff(F1, F2, s1);
return s1;
}

The error ls Description "‘matrix_error’ was not declared in this scope". I know that im doing a really stupid mistake, but IDK where. If someone could help me I will appreciate.

Thanks.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Cabezon667
close date 2016-01-15 19:51:20.469944

1 answer

Sort by » oldest newest most voted
1

answered 2016-01-15 18:58:42 -0600

mozzis gravatar image

Add #include "functions.h" in file with main()

edit flag offensive delete link more

Comments

It was the hour! lol TY!

Cabezon667 gravatar imageCabezon667 ( 2016-01-15 19:51:05 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-01-15 18:04:05 -0600

Seen: 291 times

Last updated: Jan 15 '16