Skip to content
Snippets Groups Projects
Commit 20213e24 authored by simon.fanetti's avatar simon.fanetti
Browse files

adjust app to lib

parent 4c88772f
No related branches found
No related tags found
No related merge requests found
......@@ -4,11 +4,19 @@ API_PATH=../ar_sandbox_lib
CFLAGS=-std=c++11 -Wall -Wextra -g
CCP=g++
all: app
app: app.o
$(CCP) $^ -o $@ -L$(API_PATH) -lsandbox $(DEP_SANDBOX)
%.o: %.cpp
$(CCP) $(CFLAGS) -I$(API_PATH)/includes -c $< -o $@
$(CCP) $(CFLAGS) -I$(API_PATH)/inc -c $< -o $@
run:
./app
setup:
$(API_PATH)/app/SandboxSetupApp
clean:
rm -f *.o app
#include "../ar_sandbox_lib/includes/sandbox.h"
#include "../ar_sandbox_lib/sandbox.h"
#include <numeric>
#include <fstream>
#include <string>
......@@ -10,7 +10,59 @@ using namespace cv;
#define ESCAPE_CHAR 27
Mat coloredFrame(Mat frameDepth);
void showLevel();
void showDiff();
//vector<int> findCercleZ(Mat &rgb);
//void trackCircle();
Sandbox client;
void (*apps[2])() = {showLevel, showDiff};
int main(int argc, char *argv[])
{
if(client.loadConfig()){
std::cout << "Error : Couldn't load the configuration" << std::endl;
return 1;
}
showLevel();
/*cout << "Press: \n 0: Show level \n 1: Show difference \n";
int n = 0;
cin >> n;
apps[n]();*/
}
void showLevel()
{
char windowName[] = "Sandbox";
Mat frameData;
Mat colored;
Mat proj_frame;
//client.initWindowsFullScreen();
cv::namedWindow(windowName, CV_WINDOW_AUTOSIZE);
do{
client.getDepthFrame().copyTo(frameData);
colored = coloredFrame(frameData);
colored.copyTo(proj_frame);
Mat* res = client.adjustProjection(&proj_frame);
cv::imshow(windowName, *res);
//client.showImage(&colored);
} while (waitKey(10) != ESCAPE_CHAR);
cv::destroyAllWindows();
}
Mat coloredFrame(Mat frameDepth)
{
......@@ -45,29 +97,16 @@ Mat coloredFrame(Mat frameDepth)
}
}
}
bitwise_not(depthFrameColored, depthFrameColored); //reverse colormap
applyColorMap(depthFrameColored, depthFrameColored, cv::COLORMAP_JET);
cv::bitwise_not(depthFrameColored, depthFrameColored); //reverse colormap
cv::applyColorMap(depthFrameColored, depthFrameColored, cv::COLORMAP_JET);
depthFrameColored.setTo(cv::Scalar(0, 0, 0), (frameDepth == 0));
return depthFrameColored;
}
void showLevel()
{
//char windowName[] = "Sandbox";
Mat frameData;
client.getDepthFrame().copyTo(frameData);
Mat colored;
do
{
client.getDepthFrame().copyTo(frameData);
colored = coloredFrame(frameData);
client.showImage(&colored);
} while (waitKey(10) != ESCAPE_CHAR);
destroyAllWindows();
}
void showDiff(){
/*
void showDiff(Mat frameBase)
{
Mat frameData;
client.getDepthFrame(&frameData);
Mat frameData;
client.getDepthFrame(&frameData);
resize(frameBase, frameBase, frameData.size()); //to match with camera frame
......@@ -89,8 +128,10 @@ void showDiff(Mat frameBase)
keyCode = waitKey(10);
} while (keyCode!= ESCAPE_CHAR);
destroyAllWindows();
*/
}
/*
vector<int> findCercleZ(Mat &rgb)
{
Mat src_gray;
......@@ -136,20 +177,4 @@ void trackCircle()
} while (waitKey(100) != ESCAPE_CHAR);
destroyAllWindows();
}*/
int main(int argc, char *argv[])
{
client = Sandbox();
cout << "Press: \n 0: Show difference \n 1: Show level \n";
int f = 0;
cin >> f;
if (f == 0)
{
//Mat frameData;
//client.getDepthFrame(&frameData);
//showDiff(frameData);
}
else if (f == 1)
showLevel();
}
\ No newline at end of file
}*/
\ No newline at end of file
SCREEN=DVI-D-0
SCREEN=eDP-1
SCN_RES=1920x1080
BEAMER=HDMI-0
BEAMER=HDMI-1
BM_RES=1400x1050
xrandr --output $SCREEN --rate 60 --mode $SCN_RES --fb $SCN_RES --panning $SCN_RES* \
......
AdjustingMatrix:
width: 3
height: 2
matrix: [1, 0, 0, -0, 1, 0]
CroppingMask:
x: 160
y: 120
width: 320
height: 245
BeamerPosition:
x: 0
y: 0
z: 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment