|
|
|
@ -4816,7 +4816,8 @@ void SparseMat::copyTo( SparseMat& m ) const |
|
|
|
|
void SparseMat::copyTo( Mat& m ) const |
|
|
|
|
{ |
|
|
|
|
CV_Assert( hdr ); |
|
|
|
|
m.create( dims(), hdr->size, type() ); |
|
|
|
|
int ndims = dims(); |
|
|
|
|
m.create( ndims, hdr->size, type() ); |
|
|
|
|
m = Scalar(0); |
|
|
|
|
|
|
|
|
|
SparseMatConstIterator from = begin(); |
|
|
|
@ -4825,7 +4826,7 @@ void SparseMat::copyTo( Mat& m ) const |
|
|
|
|
for( i = 0; i < N; i++, ++from ) |
|
|
|
|
{ |
|
|
|
|
const Node* n = from.node(); |
|
|
|
|
copyElem( from.ptr, m.ptr(n->idx), esz); |
|
|
|
|
copyElem( from.ptr, (ndims > 1 ? m.ptr(n->idx) : m.ptr(n->idx[0])), esz); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|