Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Guarantee continuous Mat Image

Hello, I would like to ensure a continuous frame for a mat image. I tryed the solution described Here, but I get compilation errors of no candidate for operator= on Mat (in header is defined for Mat&), so there's my question, how can I allocate the continuous frame?

Best Regards!

Guarantee continuous Mat Image

Hello, I would like to ensure a continuous frame for a mat image. I tryed the solution described Here, but I get compilation errors of no candidate for operator= on Mat (in header is defined for Mat&), so there's my question, how can I allocate the continuous frame?

Best Regards!

Here is the error I get:

Building file: ../src/Sandbox.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/local/include/opencv2 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Sandbox.d" -MT"src/Sandbox.d" -o "src/Sandbox.o" "../src/Sandbox.cpp"
../src/Sandbox.cpp: In function ‘int main(int, char**)’:
../src/Sandbox.cpp:196:13: error: ‘class cv::Mat’ has no member named ‘isContinous’
   if(!Frame.isContinous()) Frame=Frame.clone;
                ^
../src/Sandbox.cpp:196:33: error: no match for ‘operator=’ (operand types are ‘cv::Mat’ and ‘<unresolved overloaded function type>’)
   if(!Frame.isContinous()) Frame=Frame.clone;
                             ^
../src/Sandbox.cpp:196:33: note: candidates are:
In file included from /usr/local/include/opencv2/core/core.hpp:4856:0,
                 from /usr/local/include/opencv2/opencv.hpp:47,
                 from ../src/Sandbox.cpp:1:
/usr/local/include/opencv2/core/mat.hpp:281:13: note: cv::Mat& cv::Mat::operator=(const cv::Mat&)
 inline Mat& Mat::operator = (const Mat& m)
             ^
/usr/local/include/opencv2/core/mat.hpp:281:13: note:   no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘const cv::Mat&’
In file included from /usr/local/include/opencv2/core/core.hpp:4856:0,
                 from /usr/local/include/opencv2/opencv.hpp:47,
                 from ../src/Sandbox.cpp:1:
/usr/local/include/opencv2/core/mat.hpp:1417:13: note: cv::Mat& cv::Mat::operator=(const cv::MatExpr&)
 inline Mat& Mat::operator = (const MatExpr& e)
         ^
/usr/local/include/opencv2/core/mat.hpp:1417:13: note:   no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘const cv::MatExpr&’
In file included from /usr/local/include/opencv2/opencv.hpp:47:0,
             from ../src/Sandbox.cpp:1:
/usr/local/include/opencv2/core/core.hpp:1775:10: note: cv::Mat& cv::Mat::operator=(const Scalar&)
 Mat& operator = (const Scalar& s);
      ^
/usr/local/include/opencv2/core/core.hpp:1775:10: note:   no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘const Scalar& {aka const     cv::Scalar_<double>&}’
make: *** [src/Sandbox.o] Error 1

The code I'm using is

Mat Frame
VideoCapture VideoStream;
VideoStream.read(Frame);                            // Get Frame
if(!Frame.isContinous()) Frame=Frame.clone;