38#include "CameraProperties.h" 
   39#include "ErrorStatus.h" 
   40#include "CommonTypes.h" 
   45    std::cout << 
"............................." << std::endl;
 
   46    std::cout << 
"Camera Model Name:           " << cameraInfo.
model << std::endl;
 
   47    std::cout << 
"Camera Serial Number:        " << cameraInfo.
serialNumber << std::endl;
 
   48    std::cout << 
"Camera IP Address:           " << cameraInfo.
ipAddress << std::endl;
 
   49    std::cout << 
"Camera Subnet Mask:          " << cameraInfo.
subnetMask << std::endl;
 
   50    std::cout << 
"Camera IP Assignment Method: " 
   52    std::cout << 
"Hardware Version:            " 
   54    std::cout << 
"Firmware Version:            " 
   56    std::cout << 
"............................." << std::endl;
 
   57    std::cout << std::endl;
 
   62    std::cout << 
".....Camera Temperature....." << std::endl;
 
   63    std::cout << 
"CPU :               " << cameraStatus.temperature.
cpuTemperature << 
"°C" 
   67    std::cout << 
"............................" << std::endl;
 
   69    std::cout << std::endl;
 
   75    std::cout << 
"Texture Map size : (width : " << cameraResolutions.texture.width
 
   76              << 
", height : " << cameraResolutions.texture.height << 
")." << std::endl;
 
   77    std::cout << 
"Depth Map size : (width : " << cameraResolutions.depth.width
 
   78              << 
", height : " << cameraResolutions.depth.height << 
")." << std::endl;
 
   81inline void printCameraMatrix(
const std::string& title,
 
   84    std::cout << title << 
": " << std::endl
 
   85              << 
"    [" << cameraMatrix.
fx << 
", " << 0 << 
", " << cameraMatrix.
cx << 
"]" 
   88              << 
"    [" << 0 << 
", " << cameraMatrix.
fy << 
", " << cameraMatrix.
cy << 
"]" 
   91              << 
"    [" << 0 << 
", " << 0 << 
", " << 1 << 
"]" << std::endl;
 
   92    std::cout << std::endl;
 
   95inline void printCameraDistCoeffs(
const std::string& title,
 
   98    std::cout << title << 
": " << std::endl
 
   99              << 
"    k1: " << distCoeffs.
k1 << 
", k2: " << distCoeffs.
k2 
  100              << 
", p1: " << distCoeffs.
p1 << 
", p2: " << distCoeffs.
p2 << 
", k3: " << distCoeffs.
k3 
  102    std::cout << std::endl;
 
  107    std::cout << 
"Rotation: " << title << 
": " << std::endl;
 
  108    for (
int i = 0; i < 3; i++) {
 
  110        for (
int j = 0; j < 3; j++) {
 
  111            std::cout << transform.
rotation[i][j];
 
  115        std::cout << 
"]" << std::endl;
 
  117    std::cout << std::endl;
 
  118    std::cout << 
"Translation " << title << 
": " << std::endl;
 
  120              << 
"mm, Z: " << transform.
translation[2] << 
"mm" << std::endl;
 
  121    std::cout << std::endl;
 
  126    printCameraMatrix(
"Texture Camera Matrix", intrinsics.
texture.cameraMatrix);
 
  127    printCameraDistCoeffs(
"Texture Camera Distortion Coefficients",
 
  128                          intrinsics.
texture.cameraDistortion);
 
  130    printCameraMatrix(
"Depth Camera Matrix", intrinsics.
depth.cameraMatrix);
 
  131    printCameraDistCoeffs(
"Depth Camera Distortion Coefficients",
 
  132                          intrinsics.
depth.cameraDistortion);
 
  134    printTransform(
"From Depth Camera to Texture Camera", intrinsics.
depthToTexture);
 
  139    std::cout << 
"Find Mech-Eye Industrial 3D Cameras..." << std::endl;
 
  142    if (deviceInfoList.empty()) {
 
  143        std::cout << 
"No Mech-Eye Industrial 3D Cameras found." << std::endl;
 
  147    for (
int i = 0; i < deviceInfoList.size(); i++) {
 
  148        std::cout << 
"Mech-Eye device index : " << i << std::endl;
 
  149        printCameraInfo(deviceInfoList[i]);
 
  152    std::cout << 
"Please enter the device index you want to connect: ";
 
  153    unsigned inputIndex = 0;
 
  158        if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
 
  159            atoi(str.c_str()) < deviceInfoList.size()) {
 
  160            inputIndex = atoi(str.c_str());
 
  163        std::cout << 
"Input invalid. Please enter the device index you want to connect: ";
 
  167    status = device.
connect(deviceInfoList[inputIndex]);
 
  169    if (!status.
isOK()) {
 
  174    std::cout << 
"Connect Mech-Eye Industrial 3D Camera Successfully." << std::endl;
 
  178inline std::vector<mmind::eye::Camera> findAndConnectMultiCamera()
 
  180    std::cout << 
"Find Mech-Eye Industrial 3D Cameras..." << std::endl;
 
  183    if (cameraInfoList.empty()) {
 
  184        std::cout << 
"No Mech-Eye Industrial 3D Cameras found." << std::endl;
 
  188    for (
int i = 0; i < cameraInfoList.size(); i++) {
 
  189        std::cout << 
"Mech-Eye device index : " << i << std::endl;
 
  190        printCameraInfo(cameraInfoList[i]);
 
  194    std::set<unsigned> indices;
 
  197        std::cout << 
"Please enter the device index you want to connect: " << std::endl;
 
  198        std::cout << 
"Enter the character 'c' to terminate adding devices" << std::endl;
 
  203        if (std::regex_match(str.begin(), str.end(), std::regex{
"[0-9]+"}) &&
 
  204            atoi(str.c_str()) < cameraInfoList.size())
 
  205            indices.insert(atoi(str.c_str()));
 
  207            std::cout << 
"Input invalid. Please enter the device index you want to connect: ";
 
  210    std::vector<mmind::eye::Camera> cameraList(indices.size());
 
  212    auto iter = indices.cbegin();
 
  213    for (
int i = 0; i < indices.size(); ++i, ++iter) {
 
  214        showError(cameraList[i].connect(cameraInfoList[*iter]));
 
  220inline bool confirmCapture3D()
 
  222    std::cout << 
"Do you want the camera to capture 3D image ? Please input y/n to confirm: " 
  225        std::string confirmStr;
 
  226        std::cin >> confirmStr;
 
  227        if (confirmStr == 
"y") {
 
  229        } 
else if (confirmStr == 
"n") {
 
  230            std::cout << 
"program ends!" << std::endl;
 
  233            std::cout << 
"Please input y/n again!" << std::endl;
 
Operates the Mech-Eye Industrial 3D Cameras. Use Camera::connect to connect an available camera,...
static std::vector< CameraInfo > discoverCameras()
Discovers all available cameras, and returns the camera information list for them....
ErrorStatus connect(const CameraInfo &info, unsigned int timeoutMs=5000)
Connects to a camera via CameraInfo.
std::string toString() const
Converts a Version object to a string of Version.
Describes the distortion parameters.
double k1
Radial distortion coefficients.
double k3
Radial distortion coefficients.
double p2
Tangential distortion coefficients.
double k2
Radial distortion coefficients.
double p1
Tangential distortion coefficients.
Defines the camera information.
IpAssignmentMethod ipAssignmentMethod
The IP assignment method of the device.
std::string serialNumber
Device serial number.
Version hardwareVersion
The version of the hardware which is pre-determined from the factory.
std::string model
Device model name, such as Mech-Eye Nano.
Version firmwareVersion
The version of the firmware which can be upgraded.
std::string subnetMask
The IP subnet mask of the device.
std::string ipAddress
The IP address of the device.
Defines the 3D camera intrinsic, including the texture source camera, depth source camera and the tra...
Intrinsics2DCamera texture
The intrinsic parameters of the camera for capturing the texture image.
Intrinsics2DCamera depth
The intrinsic parameters of the camera for capturing the depth map.
Transformation depthToTexture
Describes the camera intrinsic matrix.
double cx
Principal point.
double cy
Principal point.
Defines the camera resolutions information, including texture image resolution and depth map resoluti...
Describes the camera running status.
float projectorTemperature
Projector module temperature in degrees Celsius.
float cpuTemperature
CPU temperature in the device motherboard in degrees Celsius.
Describes the types of errors.
bool isOK() const
Returns true if the operation succeeds.