Skip to content
Snippets Groups Projects
Commit 2ee96aed authored by Guangli Li's avatar Guangli Li
Browse files

Fixes for CodeBook algorithm

parent e246604d
Branches
Tags
No related merge requests found
...@@ -43,7 +43,14 @@ void CodeBook::process(const cv::Mat &img_input, cv::Mat &img_output, cv::Mat &i ...@@ -43,7 +43,14 @@ void CodeBook::process(const cv::Mat &img_input, cv::Mat &img_output, cv::Mat &i
} }
cv::Mat img_input_gray; cv::Mat img_input_gray;
cv::cvtColor(img_input, img_input_gray, CV_BGR2GRAY);
if (img_input.channels() == 1)
{
img_input_gray = img_input;
} else
{
cv::cvtColor(img_input, img_input_gray, CV_BGR2GRAY);
}
fg_cb(img_input_gray, img_foreground); fg_cb(img_input_gray, img_foreground);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment