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

前端 未结 4 1652
忘了有多久
忘了有多久 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 18:54

    Mat::copyTo is for when you already have a destination cv::Mat that (may be or) is already allocated with the right data size. Mat::clone is a convenience for when you know you have to allocate a new cv::Mat.

提交回复
热议问题