| Fix clang errors due to ambiguous call to 'iota' (https://crbug.com/801269). |
| 'iota' is defined in 'stl_numeric.h', as well as locally in spinimages.cpp. |
| Rename the local version, so it does not conflict with the standard library. |
| Upstream already has the equivalent of this patch as commit |
| https://github.com/opencv/opencv/commit/ec8637a9902e378b83cdbae901cab27b15804770 |
| which first appeared in OpenCV-2.4.5. |
| |
| --- OpenCV-2.3.0/modules/contrib/src/spinimages.cpp |
| +++ OpenCV-2.3.0/modules/contrib/src/spinimages.cpp |
| @@ -85,7 +85,7 @@ namespace |
| }; |
| size_t colors_mum = sizeof(colors)/sizeof(colors[0]); |
| |
| -template<class FwIt, class T> void iota(FwIt first, FwIt last, T value) { while(first != last) *first++ = value++; } |
| +template<class FwIt, class T> void _iota(FwIt first, FwIt last, T value) { while(first != last) *first++ = value++; } |
| |
| void computeNormals( const Octree& Octree, const vector<Point3f>& centers, vector<Point3f>& normals, |
| vector<uchar>& mask, float normalRadius, int minNeighbors = 20) |
| @@ -790,14 +790,14 @@ void cv::SpinImageModel::selectRandomSubset(float ratio) |
| else if (setSize == vtxSize) |
| { |
| subset.resize(vtxSize); |
| - iota(subset.begin(), subset.end(), 0); |
| + _iota(subset.begin(), subset.end(), 0); |
| } |
| else |
| { |
| RNG& rnd = theRNG(); |
| |
| vector<size_t> left(vtxSize); |
| - iota(left.begin(), left.end(), (size_t)0); |
| + _iota(left.begin(), left.end(), (size_t)0); |
| |
| subset.resize(setSize); |
| for(size_t i = 0; i < setSize; ++i) |
| @@ -870,7 +870,7 @@ void cv::SpinImageModel::compute() |
| { |
| mesh.computeNormals(normalRadius, minNeighbors); |
| subset.resize(mesh.vtx.size()); |
| - iota(subset.begin(), subset.end(), 0); |
| + _iota(subset.begin(), subset.end(), 0); |
| } |
| else |
| mesh.computeNormals(subset, normalRadius, minNeighbors); |