Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
Mat A = imread(argv[1], CV_LOAD_IMAGE_COLOR);

Mat B = A.clone();  // B is a deep copy of A. (has its own copy of the pixels)
Mat C = A;          // C is a shallow copy of A ( rows, cols copied, but shared pixel-pointer )
Mat D; A.copyTo(D); // D is a deep copy of A, like B