Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Copy() and Clone() functions

Need description of the following code :

    1   Mat A = imread(argv[1], CV_LOAD_IMAGE_COLOR);
    2   **Mat F = A.clone()**;
    3   Mat G;
    4   **A.copyTo(G)**;

The second line, is the header A is copied to F ?

The forth line, is the header A copied to G or vice versa( G copied to A) ?

Copy() CopyTo() and Clone() functions

Need description of the following code :

    1   Mat A = imread(argv[1], CV_LOAD_IMAGE_COLOR);
    2   **Mat F = A.clone()**;
    3   Mat G;
    4   **A.copyTo(G)**;

The second line, is the header A is copied to F ?

The forth line, is the header A copied to G or vice versa( G copied to A) ?

CopyTo() and Clone() functions

Need description of the following code :

    1   Mat A = imread(argv[1], CV_LOAD_IMAGE_COLOR);
    2   **Mat Mat F = A.clone()**;
A.clone();
    3   Mat G;
    4   **A.copyTo(G)**;
A.copyTo(G);

The second line, is the header A is copied to F ?

The forth line, is the header A copied to G or vice versa( G copied to A) ?