Skip to content

Added support for ROS noetic and OpenCV4.0+ #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions kinect2_bridge/src/kinect2_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ class Kinect2Bridge
void initCompression(const int32_t jpegQuality, const int32_t pngLevel, const bool use_png)
{
compressionParams.resize(7, 0);
compressionParams[0] = CV_IMWRITE_JPEG_QUALITY;
compressionParams[0] = cv::IMWRITE_JPEG_QUALITY;
compressionParams[1] = jpegQuality;
compressionParams[2] = CV_IMWRITE_PNG_COMPRESSION;
compressionParams[2] = cv::IMWRITE_PNG_COMPRESSION;
compressionParams[3] = pngLevel;
compressionParams[4] = CV_IMWRITE_PNG_STRATEGY;
compressionParams[5] = CV_IMWRITE_PNG_STRATEGY_RLE;
compressionParams[4] = cv::IMWRITE_PNG_STRATEGY;
compressionParams[5] = cv::IMWRITE_PNG_STRATEGY_RLE;
compressionParams[6] = 0;

if(use_png)
Expand Down Expand Up @@ -1100,11 +1100,11 @@ class Kinect2Bridge
cv::flip(color, tmp, 1);
if(colorFrame->format == libfreenect2::Frame::BGRX)
{
cv::cvtColor(tmp, images[COLOR_HD], CV_BGRA2BGR);
cv::cvtColor(tmp, images[COLOR_HD], cv::COLOR_BGR2RGB);
}
else
{
cv::cvtColor(tmp, images[COLOR_HD], CV_RGBA2BGR);
cv::cvtColor(tmp, images[COLOR_HD], cv::COLOR_BGR2RGB);
}
}

Expand Down Expand Up @@ -1180,11 +1180,11 @@ class Kinect2Bridge
cv::flip(cv::Mat(sizeIr, CV_8UC4, registered.data), tmp, 1);
if(color.format == libfreenect2::Frame::BGRX)
{
cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_BGRA2BGR);
cv::cvtColor(tmp, images[COLOR_SD_RECT], cv::COLOR_BGR2RGB);
}
else
{
cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_RGBA2BGR);
cv::cvtColor(tmp, images[COLOR_SD_RECT], cv::COLOR_BGR2RGB);
}
}

Expand Down Expand Up @@ -1247,19 +1247,19 @@ class Kinect2Bridge
// MONO
if(status[MONO_HD])
{
cv::cvtColor(images[COLOR_HD], images[MONO_HD], CV_BGR2GRAY);
cv::cvtColor(images[COLOR_HD], images[MONO_HD], cv::COLOR_BGR2RGB);
}
if(status[MONO_HD_RECT])
{
cv::cvtColor(images[COLOR_HD_RECT], images[MONO_HD_RECT], CV_BGR2GRAY);
cv::cvtColor(images[COLOR_HD_RECT], images[MONO_HD_RECT], cv::COLOR_BGR2RGB);
}
if(status[MONO_QHD])
{
cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], CV_BGR2GRAY);
cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], cv::COLOR_BGR2RGB);
}
if(status[MONO_QHD_RECT])
{
cv::cvtColor(images[COLOR_QHD_RECT], images[MONO_QHD_RECT], CV_BGR2GRAY);
cv::cvtColor(images[COLOR_QHD_RECT], images[MONO_QHD_RECT], cv::COLOR_BGR2RGB);
}
}

Expand Down
2 changes: 1 addition & 1 deletion kinect2_calibration/src/kinect2_calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Recorder
circleFlags = cv::CALIB_CB_ASYMMETRIC_GRID + cv::CALIB_CB_CLUSTERING;
}

params.push_back(CV_IMWRITE_PNG_COMPRESSION);
params.push_back(cv::IMWRITE_PNG_COMPRESSION);
params.push_back(9);

board.resize(boardDims.width * boardDims.height);
Expand Down
2 changes: 1 addition & 1 deletion kinect2_viewer/src/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class Receiver
combine(color, depthDisp, combined);
//combined = color;

cv::putText(combined, oss.str(), pos, font, sizeText, colorText, lineText, CV_AA);
cv::putText(combined, oss.str(), pos, font, sizeText, colorText, lineText, cv::LINE_AA);
cv::imshow("Image Viewer", combined);
}

Expand Down