Select Git revision
simon.fanetti authored
beamer.h 1.88 KiB
#ifndef SANDBOX_BEAMER_H
#define SANDBOX_BEAMER_H
#include <opencv2/opencv.hpp>
#include "camera.h"
#include "frameProcessProfil.h"
class Beamer{
private:
cv::Point3f beamerPosition;
cv::Size resolution;
FrameProcessProfil *profil;
public:
Beamer();
~Beamer();
const unsigned int MAX_LINEAR_LINE_POINTS = 3; //number of point to calculate 1 vector
const double LINEAR_REGRESSION_FACT = -20.0; // used for linear regression
cv::Point3f getPosition(){ return beamerPosition; };
void setPosition(cv::Point3f pos){ beamerPosition = pos; };
void setWidth(int w){ resolution.width = w; };
int getWidth(){ return resolution.width; };
void setHeight(int h){ resolution.height = h; };
int getHeight(){ return resolution.height; };
void setResolution(cv::Size res){
setWidth(res.width);
setHeight(res.height);
}
FrameProcessProfil* getProfil(){ return profil; };
void setProfil(FrameProcessProfil p){ profil->setProfil(p); };
cv::Mat editContrast(cv::Mat image, double contrast, int brightness);
cv::Point3f deprojectPixel(cv::Point2i circle, cv::Mat *depth, Camera *camera);
std::vector<cv::Point2i> getCrossList();
cv::Mat buildCrossFrame(cv::Point2i projectedCross, int step, int max, bool circlesFound);
cv::Point3d approximatePosition(std::vector<cv::Point3d> *bases, std::vector<cv::Point3d> *directions);
void findLinearLineFrom(std::vector<cv::Point3f> *capturedPoints, std::vector<cv::Point3d> *bases, std::vector<cv::Point3d> *directions);
std::vector<cv::Point3i> findCircles(cv::Mat &rgb, double contrast, int brightness, double centersMinDist, int cannyEdgeThreshold, int houghAccThreshold, double minRadius, double maxRadius);
void printPosition();
};
#endif