MCPcopy Create free account
hub / github.com/Smorodov/Multitarget-tracker / GetImg

Method GetImg

src/Detector/BackgroundSubtract.cpp:210–236  ·  view source on GitHub ↗

---------------------------------------------------------------------- ----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

208//
209//----------------------------------------------------------------------
210cv::UMat BackgroundSubtract::GetImg(const cv::UMat& image)
211{
212 if (image.channels() != m_channels)
213 {
214 if (image.channels() == 1)
215 {
216 cv::UMat newImg;
217#if (CV_VERSION_MAJOR < 4)
218 cv::cvtColor(image, newImg, CV_GRAY2BGR);
219#else
220 cv::cvtColor(image, newImg, cv::COLOR_GRAY2BGR);
221#endif
222 return newImg;
223 }
224 else if (image.channels() == 3)
225 {
226 cv::UMat newImg;
227#if (CV_VERSION_MAJOR < 4)
228 cv::cvtColor(image, newImg, CV_BGR2GRAY);
229#else
230 cv::cvtColor(image, newImg, cv::COLOR_BGR2GRAY);
231#endif
232 return newImg;
233 }
234 }
235 return image;
236}
237
238//----------------------------------------------------------------------
239//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected