diff --git a/app/SandboxSetup/camerafocus.ui b/app/SandboxSetup/camerafocus.ui index 8bbd4a1e821b704e630b00883403f5b4f522ba87..f95635618b8c9639b1ff699c254a9a4684d6b5d1 100644 --- a/app/SandboxSetup/camerafocus.ui +++ b/app/SandboxSetup/camerafocus.ui @@ -125,7 +125,7 @@ <item row="1" column="2"> <widget class="QSpinBox" name="sbxBrightness"> <property name="minimum"> - <number>-255</number> + <number>-65025</number> </property> <property name="maximum"> <number>255</number> @@ -253,7 +253,7 @@ <number>0</number> </property> <property name="maximum"> - <number>500</number> + <number>300</number> </property> <property name="value"> <number>100</number> @@ -344,7 +344,7 @@ <item row="1" column="1"> <widget class="QSlider" name="sldBrightness"> <property name="minimum"> - <number>-255</number> + <number>-765</number> </property> <property name="maximum"> <number>255</number> diff --git a/src/components/beamer.cpp b/src/components/beamer.cpp index e65277d647e66cf83f10685a3357f7b0a85613b1..03716aa38f474bd68b78bb72dff2f5174ccafb52 100644 --- a/src/components/beamer.cpp +++ b/src/components/beamer.cpp @@ -84,7 +84,9 @@ int Beamer::findBeamerFrom(Camera *camera){ cv::Point3f Beamer::deprojectPixel(cv::Point3i circle, cv::Mat *depth, Camera *camera){ float coord[2] = {(float)circle.x, (float)circle.y}; float z = static_cast<float>(depth->at<uint16_t>(circle.y, circle.x)); - return camera->deprojectPixelToPoint(coord, z / 1000.0); + // rs2.get_depth_frame().get_units() + float depth_unit = 1 / 1000.0; + return camera->deprojectPixelToPoint(coord, z * depth_unit); } void Beamer::findLinearLineFrom(std::vector<cv::Point3f> *capturedPoints, std::vector<cv::Point3d> *bases, std::vector<cv::Point3d> *directions){ diff --git a/src/components/camera.cpp b/src/components/camera.cpp index 44442dfae15083f3a92928ee825699420ec91bc4..8ba7e983219c93ab2a74d02fd843660bf1d61cdc 100644 --- a/src/components/camera.cpp +++ b/src/components/camera.cpp @@ -61,7 +61,9 @@ void Camera::capture(){ rs2::video_frame color_frame = frameset.get_color_frame(); rs2::depth_frame depth_frame = frameset.get_depth_frame(); filterDepthFrame(depth_frame); + // intrinsics.model : Brown Conrady matDepth = cv::Mat(cv::Size(depth_frame.get_width(), depth_frame.get_height()), CV_16UC1, (void *)depth_frame.get_data(), cv::Mat::AUTO_STEP); + // depth_frame.get_distance(x,y) == ((float)matDepth.at<uint16_t>(y, x) * depth_frame.get_units()) cv::Mat(cv::Size(color_frame.get_width(), color_frame.get_height()), CV_8UC3, (void *)color_frame.get_data(), cv::Mat::AUTO_STEP).copyTo(matRGB); }