std::vector<Shape2> FieldAlgorithms::localizePOIExample(const MultiArray<2, float> &image, MultiArray<2, RGBValue<UInt8> > &rgb_array) { std::vector<Shape2> pois(30); float thld = image[argMax(image)] * 0.2; for (int i = 0; i < pois.size(); i++) { int v1 = std::rand() % image.size() -1; // v1 in the range 0 to image.size() Shape2 poi(image.scanOrderIndexToCoordinate(v1)); poi = localizeByFollowingLocalMaxima(image, poi); if (image[poi] > thld) { pois[i] = poi; MultiArrayView<2, RGBValue<UInt8> > markAsStep(rgb_array.subarray(Shape2(poi[0] - 5, poi[1] -5), Shape2(poi[0] +5, poi[1] +5))); for (RGBValue<UInt8> & val : markAsStep) { val.setRed(200); } } else { i--; } } return pois; }