Skip to content
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

noetic build #585

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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode
cmake-build-debug/
12 changes: 0 additions & 12 deletions kinect2_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self -Wunused-fun
# Additional warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warray-bounds -Wtype-limits -Wreturn-type -Wsequence-point -Wparentheses -Wmissing-braces -Wchar-subscripts -Wswitch -Wwrite-strings -Wenum-compare -Wempty-body -Wlogical-op")

# Check for c++11 support
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()

find_package(freenect2 REQUIRED HINTS "$ENV{HOME}/freenect2")

find_package(catkin REQUIRED COMPONENTS roscpp rostime tf std_msgs sensor_msgs nodelet cv_bridge compressed_depth_image_transport kinect2_registration)
Expand Down
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_BGRA2BGR);
}
else
{
cv::cvtColor(tmp, images[COLOR_HD], CV_RGBA2BGR);
cv::cvtColor(tmp, images[COLOR_HD], cv::COLOR_RGBA2BGR);
}
}

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_BGRA2BGR);
}
else
{
cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_RGBA2BGR);
cv::cvtColor(tmp, images[COLOR_SD_RECT], cv::COLOR_RGBA2BGR);
}
}

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_BGR2GRAY);
}
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_BGR2GRAY);
}
if(status[MONO_QHD])
{
cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], CV_BGR2GRAY);
cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], cv::COLOR_BGR2GRAY);
}
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_BGR2GRAY);
}
}

Expand Down
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -743,7 +743,7 @@ class CameraCalibration
#if CV_MAJOR_VERSION == 2
error = cv::stereoCalibrate(pointsBoard, pointsIr, pointsColor, cameraMatrixIr, distortionIr, cameraMatrixColor, distortionColor, sizeColor,
rotation, translation, essential, fundamental, termCriteria, cv::CALIB_FIX_INTRINSIC);
#elif CV_MAJOR_VERSION == 3
#elif CV_MAJOR_VERSION == 3 || CV_MAJOR_VERSION == 4
error = cv::stereoCalibrate(pointsBoard, pointsIr, pointsColor, cameraMatrixIr, distortionIr, cameraMatrixColor, distortionColor, sizeColor,
rotation, translation, essential, fundamental, cv::CALIB_FIX_INTRINSIC, termCriteria);
#endif
Expand Down Expand Up @@ -1091,7 +1091,7 @@ class DepthCalibration
//cv::solvePnP(board, points[index], cameraMatrix, distortion, rvec, translation, false, cv::EPNP);
#if CV_MAJOR_VERSION == 2
cv::solvePnPRansac(board, points[index], cameraMatrix, distortion, rvec, translation, false, 300, 0.05, board.size(), cv::noArray(), cv::ITERATIVE);
#elif CV_MAJOR_VERSION == 3
#elif CV_MAJOR_VERSION == 3 || CV_MAJOR_VERSION == 4
cv::solvePnPRansac(board, points[index], cameraMatrix, distortion, rvec, translation, false, 300, 0.05, 0.99, cv::noArray(), cv::SOLVEPNP_ITERATIVE);
#endif
cv::Rodrigues(rvec, rotation);
Expand Down
12 changes: 0 additions & 12 deletions kinect2_registration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self -Wunused-fun
# Additional warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warray-bounds -Wtype-limits -Wreturn-type -Wsequence-point -Wparentheses -Wmissing-braces -Wchar-subscripts -Wswitch -Wwrite-strings -Wenum-compare -Wempty-body")# -Wlogical-op")

# Check for c++11 support
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()

# additional cmake modules
LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down
12 changes: 0 additions & 12 deletions kinect2_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -Winit-self -Wunused-fun
# Additional warnings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Warray-bounds -Wtype-limits -Wreturn-type -Wsequence-point -Wparentheses -Wmissing-braces -Wchar-subscripts -Wswitch -Wwrite-strings -Wenum-compare -Wempty-body -Wlogical-op")

# Check for c++11 support
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()

find_package(catkin REQUIRED COMPONENTS roscpp rostime std_msgs sensor_msgs message_filters cv_bridge image_transport compressed_image_transport compressed_depth_image_transport kinect2_bridge)

## System dependencies are found with CMake's conventions
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