void MyMainWindow::slotAddImage() { if (radioButtonGray->isChecked()) ShowGrayImage(); if (radioButtonRgb->isChecked()) ShowColorImage(); }
void GeometryCorrection::slotAddImage() { if (radioButtonGray->isChecked()) ShowGrayImage(); if (radioButtonRgb->isChecked()) ShowColorImage(); }
/// Show color or range image or both. /// @param argc/argv "c": only color image, "r": only range image, no arguments: both /// @return Return code unsigned long main(int argc, char* argv[]) { /// Open range and color camera when no parameters are passed if (argc == 1) { /// Color camera init & open if (InitAndOpenColorCamera() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while Initializing/Opening color camera." << std::endl; getchar(); return ipa_utils::RET_FAILED; } /// Range imaging sensor init & open if (InitAndOpenRangeCamera() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while initializing/opening range imaging sensor." << std::endl; getchar(); return ipa_utils::RET_FAILED; } if (ShowColorAndRangeImage() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while showing images." << std::endl; getchar(); return ipa_utils::RET_FAILED; } colorCamera->Close(); rangeImagingSensor->Close(); } // args else if (argc >= 2) { char* ptr; ptr = argv[1]; // Color cam if (ptr[0] == 'c') { /// Color camera init & open if (InitAndOpenColorCamera() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while Initializing/Opening color camera." << std::endl; getchar(); return ipa_utils::RET_FAILED;; } // shows camera property information if (colorCamera->PrintCameraInformation() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error" << std::endl; std::cerr << "\t ... Could not print camera (properties) information." << std::endl; } // shows color image (and handles window) if (ShowColorImage() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while showing color image." << std::endl; getchar(); return ipa_utils::RET_FAILED; } colorCamera->Close(); } // range sensor else if (ptr[0] == 'r') { /// Range imaging sensor init & open if (InitAndOpenRangeCamera() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while initializing/opening range imaging sensor." << std::endl; getchar(); return ipa_utils::RET_FAILED; } if (ShowRangeImage() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while showing range image." << std::endl; getchar(); return ipa_utils::RET_FAILED; } rangeImagingSensor->Close(); } // test if (ptr[0] == 't') { /*// Color camera init & open if (InitAndOpenColorCamera() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while Initializing/Opening color camera." << std::endl; getchar(); return ipa_utils::RET_FAILED;; }*/ if (Test() & libCameraSensors::RET_FAILED) { std::cerr << "main: Error while testing." << std::endl; getchar(); return ipa_utils::RET_FAILED; } colorCamera->Close(); } else { /// Output help message std::cout << "usage: \t TestCameraSensors \n" "\t default \t Show color and range image \n" "\t c \t\t Show only color image \n" "\t r \t\t Show only range image \n" << std::endl; } } return ipa_utils::RET_OK; }