test_cv_utils.cpp
Go to the documentation of this file.
00001 #include "jsk_recognition_utils/cv_utils.h"
00002 #include <opencv2/opencv.hpp>
00003 #include <gtest/gtest.h>
00004 
00005 
00006 TEST(CvUtils, testLabelToRGB){
00007   cv::Mat label_image = cv::Mat::zeros(1, 2, CV_32SC1);
00008   label_image.at<int>(0, 1) = 1;
00009   cv::Mat rgb_image;
00010   jsk_recognition_utils::labelToRGB(label_image, rgb_image);
00011   // background label 0 -> [0, 0, 0]
00012   EXPECT_EQ(0, cv::norm(rgb_image.at<cv::Vec3b>(0, 0)));
00013   // label 1 -> not [0, 0, 0]
00014   EXPECT_NE(0, cv::norm(rgb_image.at<cv::Vec3b>(0, 1)));
00015 }
00016 
00017 int main(int argc, char **argv){
00018   testing::InitGoogleTest(&argc, argv);
00019   return RUN_ALL_TESTS();
00020 }


jsk_recognition_utils
Author(s):
autogenerated on Sun Oct 8 2017 02:42:48