13 #include <opencv2/highgui/highgui.hpp>
32 for(
double angle = 0; angle < 6.283; angle += 0.05) {
34 image = cv::Mat(image.rows, image.cols, CV_32FC1, 0.0);
42 cv::imshow(
"visualization", image / 10);
62 for(
double angle = 0; angle < 6.283; angle += 0.05) {
69 image = cv::Mat(image.rows, image.cols, CV_32FC1, 0.0);
72 for(
unsigned int i = 0; i < angles.
size(); ++i) {
74 double x = (p.
x * 25) + image.cols / 2;
75 double y = (p.
y * 25) + image.rows / 2;
77 image.at<
float>(y, x) = 1;
80 cv::imshow(
"visualization", image);
91 int main(
int argc,
char **argv) {
92 geo::serialization::registerDeserializer<geo::Shape>();
100 scale = atof(argv[2]);
126 for(
double x = -5; x < 5; x += 0.5) {
127 for(
double y = -5; y < 5; y += 0.5) {
128 for(
double z = -5; z < 5; z += 0.5) {
136 for(
unsigned int i = 0; i < points.
size(); ++i) {
147 for(
double x = -0.8; x < 0.8; x += res) {
148 for(
double y = -0.35; y < 0.35; y += res) {
153 for(
int mx = -1; mx <= 1; mx += 2) {
154 for(
int my = -1; my <= 1; my += 2) {
155 if (mx != 1 || my != 1) {
156 for(
double z = 0.05; z < 0.75; z += res) {
169 for(
int i = 0; i < N; ++i) {
180 for(
int i = 0; i < N; ++i) {
201 tree.
raytrace(*it, 0, it->getLength());
219 tree.
raytrace(*it, 0, it->getLength());
227 for(
double v = 0; v < 1; v += res2) { axis.
add(
geo::Vector3(v, 0, 0)); }
228 for(
double v = 0; v < 1; v += res2 * 2) { axis.
add(
geo::Vector3(0, v, 0)); }
229 for(
double v = 0; v < 1; v += res2 * 4) { axis.
add(
geo::Vector3(0, 0, v)); }
245 for(
int mx = 0; mx < hmap_size; ++mx) {
246 map[mx].
resize(hmap_size, 0);
249 for(
int j = 0; j < hmap_size / 2; ++j) {
250 for(
int i = 0; i < hmap_size - j * 2; ++i) {
257 map[i+j][hmap_size-j-1] = h;
259 map[hmap_size-j-1][i+j] = h;
315 cv::Mat depth_image2 = depth_image / 8;
317 depth_image2.copyTo(destinationROI);
324 lrf.
render(
geo::Box(
geo::Vector3(-0.5, -3.5, -0.5),
geo::Vector3(0.5, 3.5, 0.5)),
geo::Pose3D(0, 0, 0),
geo::Pose3D(-2, 0, 0), ranges);
330 for(
unsigned int i = 0; i < points.
size(); ++i) {
332 double x = (-p.
y * 25) + image.cols / 2;
333 double y = (-p.
x * 25) + image.rows / 2;
335 if (x >= 0 && y >= 0 && x < image.cols && y < image.rows) {
336 lrf_image.
at<
float>(y, x) = 1;
342 lrf_image.copyTo(destinationROI2);
344 cv::imshow(
"visualization", display_image);
348 char key = cv::waitKey(3);