1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

opencv: Use cv::AutoBuffer<>::data()

This commit is contained in:
Alexander Alekhin
2018-06-10 22:42:00 +00:00
committed by Alexander Alekhin
parent 135ea264ef
commit b09a4a98d4
90 changed files with 333 additions and 339 deletions
+3 -3
View File
@@ -285,13 +285,13 @@ int KDTree::findNearest(InputArray _vec, int K, int emax,
CV_Assert(K > 0 && (normType == NORM_L2 || normType == NORM_L1));
AutoBuffer<uchar> _buf((K+1)*(sizeof(float) + sizeof(int)));
int* idx = (int*)(uchar*)_buf;
int* idx = (int*)_buf.data();
float* dist = (float*)(idx + K + 1);
int i, j, ncount = 0, e = 0;
int qsize = 0, maxqsize = 1 << 10;
AutoBuffer<uchar> _pqueue(maxqsize*sizeof(PQueueElem));
PQueueElem* pqueue = (PQueueElem*)(uchar*)_pqueue;
PQueueElem* pqueue = (PQueueElem*)_pqueue.data();
emax = std::max(emax, 1);
for( e = 0; e < emax; )
@@ -433,7 +433,7 @@ void KDTree::findOrthoRange(InputArray _lowerBound,
std::vector<int> idx;
AutoBuffer<int> _stack(MAX_TREE_DEPTH*2 + 1);
int* stack = _stack;
int* stack = _stack.data();
int top = 0;
stack[top++] = 0;