| 160 | } |
| 161 | |
| 162 | void |
| 163 | plotCameraLegend (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 | |
| 187 | Eigen::Matrix4d |
| 188 | readMatrixFromFile (std::string filename) |
no test coverage detected