MCPcopy Create free account
hub / github.com/MIT-SPARK/Kimera-VIO / ReadAndConvertToGrayScale

Method ReadAndConvertToGrayScale

src/utils/UtilsOpenCV.cpp:598–607  ·  view source on GitHub ↗

-------------------------------------------------------------------------- */ Reads image and converts to 1 channel image.

Source from the content-addressed store, hash-verified

596/* -------------------------------------------------------------------------- */
597// Reads image and converts to 1 channel image.
598cv::Mat UtilsOpenCV::ReadAndConvertToGrayScale(const std::string& img_name,
599 bool equalize) {
600 cv::Mat img = cv::imread(img_name, cv::IMREAD_ANYCOLOR);
601 if (img.channels() > 1) cv::cvtColor(img, img, cv::COLOR_BGR2GRAY);
602 if (equalize) { // Apply Histogram Equalization
603 LOG(INFO) << "- Histogram Equalization for image: " << img_name;
604 cv::equalizeHist(img, img);
605 }
606 return img;
607}
608
609/* -------------------------------------------------------------------------- */
610// reorder block entries of covariance from state: [bias, vel, pose] to [pose

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected