Is cv::Mat class flawed by design?

前端 未结 4 949
感情败类
感情败类 2020-12-29 07:06

I work a lot with the OpenCV C++ interface and designed a number of classes which use Mat\'s as private resources.

Recently, I got concerned about the Mat class, as

4条回答
  •  一生所求
    2020-12-29 07:53

    [shameless ad] we now have answers.opencv.org, which is sort of StackOverflow for OpenCV-specific questions.

    Now to the questions:

    1. No. We do not see an efficient way to implement this. If you do, let's discuss it.

    2. Yes. Do not use Mat::clone() unless you plan to modify the data. Reference counting takes care of proper deallocation of the data when it's no longer used.

提交回复
热议问题