/* 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.