| 300 | } |
| 301 | |
| 302 | void Segmentation::_preProcessRange(const cv::Mat& img, cv::Mat& pImg, float maxDist) { |
| 303 | std::vector<cv::Mat> channels(2); |
| 304 | cv::split(img, channels); |
| 305 | |
| 306 | pImg = img.clone(); |
| 307 | |
| 308 | // Normalize |
| 309 | double minVal = 0; |
| 310 | double maxVal = 0; |
| 311 | cv::minMaxIdx(channels[1], &minVal, &maxVal); |
| 312 | float rangeMultiplier = 1.0 / 100.0; |
| 313 | float intensityMultipler = 1.0 / (float)maxVal; |
| 314 | cv::multiply(pImg, cv::Scalar(rangeMultiplier, intensityMultipler), |
| 315 | pImg); |
| 316 | } |
| 317 | |
| 318 | void Segmentation::_argmax(const float *in, cv::Mat& maskImg){ |
| 319 | std::vector<unsigned char> max; |
nothing calls this directly
no outgoing calls
no test coverage detected