What's the difference between Mat::clone and Mat::copyTo?

前端 未结 4 1653
忘了有多久
忘了有多久 2020-12-29 18:34

I know \'copyTo\' can handle mask. But when mask is not needed, can I use both equally?

http://docs.opencv.org/modules/core/doc/basic_structures.html#mat-clone

4条回答
  •  失恋的感觉
    2020-12-29 19:12

    This is the implementation of Mat::clone() function:

    inline Mat Mat::clone() const
    {
      Mat m;
      copyTo(m);
      return m;
    }
    

    So, as @rotating_image had mentioned, if you don't provide mask for copyTo() function, it's same as clone().

提交回复
热议问题