what is the difference between clone, copy and copyto of an image in EmguCV?

StackOverflow https://stackoverflow.com/questions/20986337

  •  25-09-2022
  •  | 
  •  

Question

What is the difference between clone, copy and copyto of an image in EmguCV?.

I know similar questions has been asked before but I am asking this with regard to an image object.

Was it helpful?

Solution

The Clone() and Copy() methods are quite similar, but they differ in how they deal with the ROI. An example will make this clearer. Let's say you have a 640x480 image with an ROI of 100x100 at position (200, 200). Using Clone() will create a new image of size 640x480 with an ROI of 100x100 located at (200, 200). Using Copy() will create a new image of size 100x100 in which the data is identical to the 100x100 window located at (200, 200) in the original image. If you don't have any ROI then both methods will return the same result (a new image of 640x480).

The CopyTo() works in the same ROI logic as Copy() except that you need to provide the destination image, it won't create a new image for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top