Skip to content

Commit

Permalink
Merge branch 'master' into module_rbt
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Dec 19, 2024
2 parents 20203be + 3e3b020 commit bc9a67e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion modules/vision/src/pose-estimation/vpPoseLagrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void vpPose::poseLagrangePlan(vpHomogeneousMatrix &cMo, bool *p_isPlan, double *
const unsigned int index_5 = 5;

// determination of the plane equation a X + b Y + c Z + d = 0
double a, b, c, d;
double a = 0, b = 0, c = 0, d = 0;

// Checking if coplanar has already been called and if the plan coefficients have been given
bool p_isplan_and_p_a_no_null = (p_isPlan != nullptr) && (p_a != nullptr);
Expand Down
7 changes: 6 additions & 1 deletion tutorial/computer-vision/tutorial-pose-from-points-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int main(int argc, char **argv)
}

vpImage<unsigned char> I;
vpCameraParameters cam;

//! [Grabber]
#if defined(VISP_HAVE_V4L2)
Expand All @@ -92,21 +93,25 @@ int main(int argc, char **argv)
g.setDevice(device.str());
g.setScale(1);
g.open(I);
cam.initPersProjWithoutDistortion(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
#elif defined(VISP_HAVE_DC1394)
(void)opt_device; // To avoid non used warning
std::cout << "Use DC1394 grabber" << std::endl;
vp1394TwoGrabber g;
g.open(I);
cam.initPersProjWithoutDistortion(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
#elif defined(VISP_HAVE_CMU1394)
(void)opt_device; // To avoid non used warning
std::cout << "Use CMU1394 grabber" << std::endl;
vp1394CMUGrabber g;
g.open(I);
cam.initPersProjWithoutDistortion(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
#elif defined(VISP_HAVE_FLYCAPTURE)
(void)opt_device; // To avoid non used warning
std::cout << "Use FlyCapture grabber" << std::endl;
vpFlyCaptureGrabber g;
g.open(I);
cam.initPersProjWithoutDistortion(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
#elif defined(VISP_HAVE_REALSENSE2)
(void)opt_device; // To avoid non used warning
std::cout << "Use Realsense 2 grabber" << std::endl;
Expand All @@ -130,11 +135,11 @@ int main(int argc, char **argv)
cv::Mat frame;
g >> frame; // get a new frame from camera
vpImageConvert::convert(frame, I);
cam.initPersProjWithoutDistortion(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
#endif
//! [Grabber]

// Parameters of our camera
vpCameraParameters cam(840, 840, I.getWidth() / 2, I.getHeight() / 2); // Default parameters
vpXmlParserCamera parser;
if (!opt_intrinsic_file.empty() && !opt_camera_name.empty()) {
std::cout << "Intrinsic file: " << opt_intrinsic_file << std::endl;
Expand Down
7 changes: 2 additions & 5 deletions tutorial/tracking/blob/tutorial-blob-tracker-live.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main()
vpImage<unsigned char> I; // Create a gray level image container
int opt_device = 0; // For OpenCV and V4l2 grabber to set the camera device

//! [Grabber]
//! [Grabber]
#if defined(VISP_HAVE_V4L2)
vpV4l2Grabber g;
std::ostringstream device;
Expand Down Expand Up @@ -80,9 +80,6 @@ int main()
config.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_RGBA8, 30);
g.open(config);
g.acquire(I);

std::cout << "Read camera parameters from Realsense device" << std::endl;
cam = g.getCameraParameters(RS2_STREAM_COLOR, vpCameraParameters::perspectiveProjWithoutDistortion);
#elif ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
cv::VideoCapture g(opt_device); // open the default camera
if (!g.isOpened()) { // check if we succeeded
Expand Down Expand Up @@ -116,7 +113,7 @@ int main()
bool germ_selected = false;
vpMouseButton::vpMouseButtonType button;

while (! quit) {
while (!quit) {
try {
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2)
g.acquire(I);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ int main()
config.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_RGBA8, 30);
g.open(config);
g.acquire(I);

std::cout << "Read camera parameters from Realsense device" << std::endl;
cam = g.getCameraParameters(RS2_STREAM_COLOR, vpCameraParameters::perspectiveProjWithoutDistortion);
#elif ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
std::cout << "Use OpenCV grabber on device " << opt_device << std::endl;
cv::VideoCapture g(opt_device); // Open the default camera
Expand Down Expand Up @@ -129,7 +126,7 @@ int main()
//! [me ellipse container]

bool quit = false;
while (! quit) {
while (!quit) {
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2)
g.acquire(I);
#elif ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
Expand Down
5 changes: 1 addition & 4 deletions tutorial/tracking/moving-edges/tutorial-me-line-tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ int main()
config.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_RGBA8, 30);
g.open(config);
g.acquire(I);

std::cout << "Read camera parameters from Realsense device" << std::endl;
cam = g.getCameraParameters(RS2_STREAM_COLOR, vpCameraParameters::perspectiveProjWithoutDistortion);
#elif ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
std::cout << "Use OpenCV grabber on device " << opt_device << std::endl;
cv::VideoCapture g(opt_device); // Open the default camera
Expand Down Expand Up @@ -146,7 +143,7 @@ int main()

//! [loop]
bool quit = false;
while (! quit) {
while (!quit) {
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_FLYCAPTURE) || defined(VISP_HAVE_REALSENSE2)
g.acquire(I);
#elif ((VISP_HAVE_OPENCV_VERSION < 0x030000) && defined(HAVE_OPENCV_HIGHGUI))|| ((VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(HAVE_OPENCV_VIDEOIO))
Expand Down

0 comments on commit bc9a67e

Please sign in to comment.