Differences between cvcopy and cvcloneimage

Source: Internet
Author: User

/* Copies source array to destination array */
Cvapi (void)Cvcopy(Const cvarr * SRC, cvarr * DST,
Const cvarr * mask cv_default (null ));

/* Creates a copy of IPL image (widthstep may differ )*/
Cvapi (iplimage *)Cvcloneimage(Const iplimage * image );

If you set parameters such as ROI, cvcopy only copies the set region to a new iplimage that matches the set parameter.
Cvcloneimage copies the entire iplimage structure to the new iplimage, And the ROI and other parameters are also copied. The new iplimage will be exactly the same as the original one.

 

The cvcopy prototype is:
Void cvcopy (const cvarr * SRC, cvarr * DST, const cvarr * mask = NULL );
Before using this function, you must use a function such as cvcreateimage () to open a piece of memory and then pass it to DST. Cvcopy copies the data in SRC to the DST memory.

The prototype of cvcloneimage is:
Iplimage * cvcloneimage (const iplimage * image );
You do not need to open up the memory before using the function. This function will open a memory, copy the data in the image, and return the data in the memory to you.

Clone is to copy all the data, that is, whether or not you set the ROI, COI, and other parameters that affect the copy, clone will be intact.
Copy is different. Only the ROI region is copied. After clone replication is used, the source image disappears in the memory, and the copied image remains unchanged. After the source image disappears, the copied image remains unchanged.

The difference between cvcloneimage () and cvcopy () is that when copying, cvcloneimage () copies a complete image, including the settings of the header and data area and some of the parameters; cvcopy (). If the ROI is set in advance, only the ROI is copied. Otherwise, the complete image is copied like cvcloneimage.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.