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

fixed xrandr parsing

parent 4838cac3
Branches
No related tags found
No related merge requests found
......@@ -63,7 +63,6 @@ FORMS += \
saveconfiggui.ui
INCLUDEPATH += ../../inc
LIBS += -L"../../build" -lsandbox -lrealsense2 -lyaml-cpp
......
......@@ -84,7 +84,7 @@ void MonitorGui::on_cbxOutputs_currentIndexChanged(int index)
void MonitorGui::initMonitorMapWithFile(std::string path){
// Save in file the monitors and their resolutions
int err = system( ("xrandr -d :0 | sed -n '1!p' > " + path).c_str() );
int err = system( ("xrandr | sed -n '1!p' > " + path).c_str() );
if(err){
std::cout << "Couldn't get screens and their resolutions" << std::endl;
exit(err);
......
......@@ -53,7 +53,11 @@ void ProjectionGui::refreshFrame(){
void ProjectionGui::startCapture(){
if(!cameraUsed){
// open blue screen on the selected output
cv::Mat blue = cv::Mat(1, 1, CV_8UC3, cv::Scalar(0, 0, 255));
setup->getCamera()->capture();
cv::Mat rgb = setup->getCamera()->getColorFrame();
cv::Size sz = rgb.size();
cv::Mat blue = cv::Mat(sz.height, sz.width, CV_8UC3, cv::Scalar(0, 0, 255));
cv::circle(blue, cv::Point(sz.width/2, sz.height/2), sz.height*2/100, cv::Scalar(255,0,0), CV_FILLED, 8,0);
blueScreen->editGeometry(mg->getResolution());
blueScreen->imShow(blue);
cameraUsed = true;
......
......@@ -51,7 +51,7 @@
<x>30</x>
<y>370</y>
<width>581</width>
<height>101</height>
<height>131</height>
</rect>
</property>
<property name="readOnly">
......@@ -62,7 +62,9 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Project a blue screen on the previously selected output to help you setup your beamer and camera manually. Adjust the position and orientation of your beamer to project the blue frame in your sandbox. Then adjust the position and oritentation of your camera to capture the blue screen projected. Try to set your camera, so the camera's point of view above is mostly filled with the blue screen.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Project a blue screen on the previously selected output to help you setup your beamer and camera manually.&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Firstly, adjust the position and orientation of your beamer to project the blue frame in your sandbox. The red dot indicates the center of the blue screen.&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Then adjust the position and oritentation of your camera to capture the sandbox. Your camera must capture all of the blue screen and must be perpendicular to the sandbox's top.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QLabel" name="label">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment