MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / plotCameraLegend

Function plotCameraLegend

tracking/apps/tracker_node_3d.cpp:162–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void
163plotCameraLegend (std::map<std::string, int> curr_color_map)
164{
165 // Compose camera legend:
166 cv::Mat legend_image = cv::Mat::zeros(500, 500, CV_8UC3);
167 for(std::map<std::string, int>::iterator
168 colormap_iterator = curr_color_map.begin();
169 colormap_iterator != curr_color_map.end(); colormap_iterator++)
170 {
171 int color_index = colormap_iterator->second;
172 cv::Vec3f color = camera_colors[color_index];
173 int y_coord = color_index * legend_image.rows
174 / (curr_color_map.size()+1) + 0.5 * legend_image.rows
175 / (curr_color_map.size()+1);
176 cv::line(legend_image, cv::Point(0,y_coord), cv::Point(100,y_coord),
177 cv::Scalar(255*color(2), 255*color(1), 255*color(0)), 8);
178 cv::putText(legend_image, colormap_iterator->first, cv::Point(110,y_coord),
179 1, 1, cv::Scalar(255, 255, 255), 1);
180 }
181
182 // Display the cv image
183 cv::imshow("Camera legend", legend_image);
184 cv::waitKey(1);
185}
186
187Eigen::Matrix4d
188readMatrixFromFile (std::string filename)

Callers 1

detection_cbFunction · 0.70

Calls 3

beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected