Replace CV_BGRA2RGBA with CV_BGR2RGB

This commit is contained in:
Kalman 2018-08-07 16:58:19 +08:00
parent 6d961203be
commit 67a0356a84
4 changed files with 6 additions and 6 deletions

View File

@ -142,8 +142,8 @@ int main(int argc, char *argv[]) {
cv::Mat right_img(
right_data.frame->height(), right_data.frame->width(), CV_8UC3,
right_data.frame->data());
cv::cvtColor(left_img, left_img, CV_BGRA2RGBA);
cv::cvtColor(right_img, right_img, CV_BGRA2RGBA);
cv::cvtColor(left_img, left_img, CV_BGR2RGB);
cv::cvtColor(right_img, right_img, CV_BGR2RGB);
cv::hconcat(left_img, right_img, img);
} else {
return -1;

View File

@ -47,7 +47,7 @@ cv::Mat frame2mat(const std::shared_ptr<device::Frame> &frame) {
return img;
} else if (frame->format() == Format::BGR888) {
cv::Mat img(frame->height(), frame->width(), CV_8UC3, frame->data());
cv::cvtColor(img, img, CV_BGRA2RGBA);
cv::cvtColor(img, img, CV_BGR2RGB);
return img;
} else {
return cv::Mat(frame->height(), frame->width(), CV_8UC1, frame->data());

View File

@ -79,7 +79,7 @@ void Dataset::SaveStreamData(
cv::Mat img(
data.frame->height(), data.frame->width(), CV_8UC3,
data.frame->data());
cv::cvtColor(img, img, CV_BGRA2RGBA);
cv::cvtColor(img, img, CV_BGR2RGB);
cv::imwrite(ss.str(), img);
} else {
cv::Mat img(

View File

@ -106,11 +106,11 @@ int main(int argc, char *argv[]) {
cv::Mat left_img(
left_frame->height(), left_frame->width(), CV_8UC3,
left_frame->data());
cv::cvtColor(left_img, left_img, CV_BGRA2RGBA);
cv::cvtColor(left_img, left_img, CV_BGR2RGB);
cv::Mat right_img(
right_frame->height(), right_frame->width(), CV_8UC3,
right_frame->data());
cv::cvtColor(right_img, right_img, CV_BGRA2RGBA);
cv::cvtColor(right_img, right_img, CV_BGR2RGB);
cv::hconcat(left_img, right_img, img);
} else {
return -1;