summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiller2017-07-03 20:59:45 -0500
committerMiller2017-07-03 20:59:45 -0500
commit262fadf50b4463554d496f73573b7257a2abceec (patch)
tree35f76ed5b001cfacdfe1dc8593edd35787c4696c
parent03fbae39e9a8f3cdf45788381cf60510c87169d8 (diff)
downloadrefslam-262fadf50b4463554d496f73573b7257a2abceec.zip
refslam-262fadf50b4463554d496f73573b7257a2abceec.tar.gz
cc version
-rw-r--r--Makefile2
-rw-r--r--src/body.h1
-rw-r--r--src/camera.h4
-rw-r--r--src/feature.h3
-rw-r--r--src/state.h1
-rw-r--r--src/types.h5
-rw-r--r--src/vision.cpp4
-rw-r--r--src/vision.h2
8 files changed, 14 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index e7f3390..30b5133 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
OBJECT=src/main.o src/body.o src/state.o src/feature.o src/camera.o src/ourerr.o src/vision.o #src/filter.o
SRCS=$(patsubst %.o,%.cpp,$(OBJECT))
-CXXFLAGS+=-O2 -march=native -std=c++11 -pipe -msse3
+CXXFLAGS+=-O2 -std=c++11 -pipe -msse3
CXXFLAGS+=-g
CXXFLAGS+=$(shell pkg-config --cflags eigen3 yaml-cpp)
CXXFLAGS+=$(shell pkg-config --cflags opencv)
diff --git a/src/body.h b/src/body.h
index 09c8e10..6675d5c 100644
--- a/src/body.h
+++ b/src/body.h
@@ -34,6 +34,7 @@ using std::endl;
class Body
{
public:
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* ==================== LIFECYCLE ======================================= */
Body (){ gravity_world << 0.,0.,9.80655; }; /* constructor */
diff --git a/src/camera.h b/src/camera.h
index 9cb8254..51e4e8a 100644
--- a/src/camera.h
+++ b/src/camera.h
@@ -1,9 +1,10 @@
#ifndef camera_INC
#define camera_INC
-#include <cv.h>
+#include <opencv2/core.hpp>
#include <Eigen/Dense>
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
#include <yaml-cpp/yaml.h>
#include "types.h"
@@ -28,6 +29,7 @@ class Camera
{
public:
/* ==================== LIFECYCLE ======================================= */
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Camera (const char *fin); /* constructor */
/* ==================== ACCESSORS ======================================= */
diff --git a/src/feature.h b/src/feature.h
index 37aa351..e3ec2b8 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -1,6 +1,6 @@
#ifndef feature_INC
#define feature_INC
-#include <cv.h>
+#include <opencv2/core.hpp>
#include <Eigen/Dense>
#include <iostream>
@@ -41,6 +41,7 @@ using std::endl;
class Feature
{
public:
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* ==================== LIFECYCLE ======================================= */
Feature ( int id, const Vector3d &xs, const Vector3d &xr,
const Vector3d &xbw, const Quaterniond &q, double z, Mat &p);
diff --git a/src/state.h b/src/state.h
index 70c73fe..a92f123 100644
--- a/src/state.h
+++ b/src/state.h
@@ -37,6 +37,7 @@ using std::vector;
class State
{
public:
+ EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/* ==================== LIFECYCLE ======================================= */
State (); /* constructor */
diff --git a/src/types.h b/src/types.h
index ac28f6f..ff0a089 100644
--- a/src/types.h
+++ b/src/types.h
@@ -1,7 +1,7 @@
#ifndef types_INC
#define types_INC
-#include <cv.h>
+#include <opencv2/core.hpp>
#include <Eigen/Dense>
#include <exception>
#define MAXLINE 8192
@@ -16,6 +16,7 @@ using Eigen::Vector2d;
using Eigen::Vector3d;
using Eigen::Vector4d;
+typedef Eigen::Matrix<double,2,1,Eigen::DontAlign> UVector2d;
// A struct for storing measurements.
typedef enum {BOTH,REFLECTION,MONO,HEIGHT} measurement_type;
typedef struct {
@@ -23,7 +24,7 @@ typedef struct {
int id;
Vector3d source, reflection;
double height;
- Vector2d Ssrc, Sref;
+ UVector2d Ssrc, Sref;
cv::Mat patch, refpatch;
double xcorrmax;
} measurement_t;
diff --git a/src/vision.cpp b/src/vision.cpp
index b189dbd..27d4a7b 100644
--- a/src/vision.cpp
+++ b/src/vision.cpp
@@ -111,8 +111,8 @@ Vision::drawMeasurements ( const vector<measurement_t> &z, const Camera &cam,
void
Vision::show ( )
{
- cv::imshow("Image view", display);
- cv::waitKey(1);
+ //cv::imshow("Image view", display);
+ //cv::waitKey(1);
return ;
} /* ----- end of method Vision::show ----- */
diff --git a/src/vision.h b/src/vision.h
index a0490d1..1bbc366 100644
--- a/src/vision.h
+++ b/src/vision.h
@@ -1,6 +1,6 @@
#ifndef vision_INC
#define vision_INC
-#include <cv.h>
+#include <opencv2/core.hpp>
#include <Eigen/Dense>
#include <iostream>
#include <opencv2/highgui/highgui.hpp>