test_cv_utils.cpp
Go to the documentation of this file.
2 #include <opencv2/opencv.hpp>
3 #include <gtest/gtest.h>
4 
5 
6 TEST(CvUtils, testLabelToRGB){
7  cv::Mat label_image = cv::Mat::zeros(1, 2, CV_32SC1);
8  label_image.at<int>(0, 1) = 1;
9  cv::Mat rgb_image;
10  jsk_recognition_utils::labelToRGB(label_image, rgb_image);
11  // background label 0 -> [0, 0, 0]
12  EXPECT_EQ(0, cv::norm(rgb_image.at<cv::Vec3b>(0, 0)));
13  // label 1 -> not [0, 0, 0]
14  EXPECT_NE(0, cv::norm(rgb_image.at<cv::Vec3b>(0, 1)));
15 }
16 
17 int main(int argc, char **argv){
18  testing::InitGoogleTest(&argc, argv);
19  return RUN_ALL_TESTS();
20 }
void labelToRGB(const cv::Mat src, cv::Mat &dst)
convert label image to rgb one.
Definition: cv_utils.cpp:147
int main(int argc, char **argv)
TEST(CvUtils, testLabelToRGB)


jsk_recognition_utils
Author(s):
autogenerated on Fri Dec 6 2019 04:02:51