File: test_rgb_colors.cpp

package info (click to toggle)
ros-vision-opencv 1.15.0%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 556 kB
  • sloc: cpp: 2,481; python: 677; xml: 91; sh: 20; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "cv_bridge/rgb_colors.h"
#include <opencv2/opencv.hpp>
#include <gtest/gtest.h>


TEST(RGBColors, testGetRGBColor)
{
  cv::Vec3d color;
  // red
  color = cv_bridge::rgb_colors::getRGBColor(cv_bridge::rgb_colors::RED);
  EXPECT_EQ(1, color[0]);
  EXPECT_EQ(0, color[1]);
  EXPECT_EQ(0, color[2]);
  // gray
  color = cv_bridge::rgb_colors::getRGBColor(cv_bridge::rgb_colors::GRAY);
  EXPECT_EQ(0.502, color[0]);
  EXPECT_EQ(0.502, color[1]);
  EXPECT_EQ(0.502, color[2]);
}