|
20 | 20 | #include <cras_cpp_common/log_utils/memory.h> |
21 | 21 | #include <cras_cpp_common/log_utils/node.h> |
22 | 22 | #include <geometry_msgs/TransformStamped.h> |
| 23 | +#include <opencv2/imgcodecs.hpp> |
23 | 24 | #include <robot_model_renderer/RobotModelRenderer.hpp> |
24 | 25 | #include <robot_model_renderer/robot/tf_link_updater.hpp> |
25 | 26 | #include <sensor_msgs/CameraInfo.h> |
@@ -517,7 +518,7 @@ TEST(RobotModelRenderer, MaskBackground) // NOLINT |
517 | 518 |
|
518 | 519 | robot_model_renderer::RobotModelRendererConfig config; |
519 | 520 | config.pixelFormat = Ogre::PF_BYTE_RGBA; |
520 | | - config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4); |
| 521 | + config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4); |
521 | 522 | config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255); |
522 | 523 | config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255); |
523 | 524 | config.staticMaskIsBackground = true; |
@@ -586,7 +587,7 @@ TEST(RobotModelRenderer, MaskForeground) // NOLINT |
586 | 587 |
|
587 | 588 | robot_model_renderer::RobotModelRendererConfig config; |
588 | 589 | config.pixelFormat = Ogre::PF_BYTE_RGBA; |
589 | | - config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4); |
| 590 | + config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4); |
590 | 591 | config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255); |
591 | 592 | config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255); |
592 | 593 | config.staticMaskIsBackground = false; |
@@ -655,7 +656,7 @@ TEST(RobotModelRenderer, MaskForegroundColorMode) // NOLINT |
655 | 656 |
|
656 | 657 | robot_model_renderer::RobotModelRendererConfig config; |
657 | 658 | config.pixelFormat = Ogre::PF_BYTE_RGBA; |
658 | | - config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4); |
| 659 | + config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4); |
659 | 660 | config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255); |
660 | 661 | config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255); |
661 | 662 | config.staticMaskIsBackground = false; |
@@ -725,7 +726,7 @@ TEST(RobotModelRenderer, MaskForegroundMaskMode) // NOLINT |
725 | 726 |
|
726 | 727 | robot_model_renderer::RobotModelRendererConfig config; |
727 | 728 | config.pixelFormat = Ogre::PF_BYTE_RGBA; |
728 | | - config.staticMaskImage = cv::Mat(1616, 1212, CV_8UC4); |
| 729 | + config.staticMaskImage = cv::Mat::zeros(1616, 1212, CV_8UC4); |
729 | 730 | config.staticMaskImage.at<cv::Vec4b>(0, 0) = cv::Vec4b(255, 128, 0, 255); |
730 | 731 | config.staticMaskImage.at<cv::Vec4b>(1616 / 2, 1212 / 2) = cv::Vec4b(0, 128, 0, 255); |
731 | 732 | config.staticMaskIsBackground = false; |
|
0 commit comments