Operation Workflow

You are currently viewing the documentation for the latest version (2.5.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

This topic introduces the basic workflow of using Mech-Eye API to control a camera. The figure and descriptions in this topic use the class and method names of C++ Mech-Eye API. For the corresponding names of different languages, please refer to the example codes.

operation workflow

Discover

Call the discoverCameras() method in the Camera class to enumerate all currently connectable cameras and obtain the information of each camera.

std::vector<mmind::eye::CameraInfo> cameraInfoList = mmind::eye::Camera::discoverCameras();
c++

Connect

After instantiating the Camera class, call the connect() method in this class to connect to the corresponding camera using the IP address or the device information obtained by the discoverCameras() method.

mmind::eye::Camera camera;
mmind::eye::ErrorStatus status = camera.connect(cameraInfoList[inputIndex]);
c++
mmind::eye::Camera cameras;
mmind::eye::ErrorStatus status = camera.connect("192.168.0.10");
c++

Configure

Call the methods in the UserSetManager and UserSet classes to select the parameter group on the camera and adjust the parameters.

  1. Call the selectUserSet method in the UserSetManager class to select the parameter group to be used.

    You can obtain all the available parameter groups on the camera through the getAllUserSetNames() method in this class.
    mmind::eye::UserSetManager userSetManager = camera.userSetManager();
    std::vector<std::string> userSets;
    auto status = userSetManager.getAllUserSetNames(userSets);
    status = userSetManager.selectUserSet(userSets.front());
    c++
  2. Call the getAvailableParameters() method in the UserSet class to obtain the information of all the parameters in the current parameter group and check the data type of each parameter.

    mmind::eye::UserSet currentUserSet = camera.currentUserSet();
    std::vector<Parameter*> parameters = currentUserSet.getAvailableParameters();
    c++
  3. Call the getIntValue() and other similar methods in the UserSet class to obtain the current value of a parameter.

    int fringeContrastThreshold = 0;
    currentUserSet.getIntValue(mmind::eye::pointcloud_processing_setting::FringeContrastThreshold::name, fringeContrastThreshold);
    c++
  4. Call the setIntValue() and other similar methods in the UserSet class to set the value of a parameter.

    auto status = currentUserSet.setIntValue(mmind::eye::pointcloud_processing_setting::FringeContrastThreshold::name, 15);
    c++
  5. Call the saveAllParametersToDevice() method in the UserSet class to save the set parameter values to the camera.

    auto status = currentUserSet.SaveAllParametersToDevice();
    c++

Acquire and Retrieve Data

Mech-Eye API provides various methods for acquiring and retrieving different types of data. Using these methods, you can obtain the 2D and 3D data separately or together.

  • Acquire and retrieve the data for generating the 2D image:

    mmind::eye::Frame2D frame2D;
    camera.capture2D(frame2D);
    mmind::eye::Color2DImage color = frame2D.getColorImage();
    mmind::eye::GrayScale2DImage gray= frame2D.getGrayScaleImage();
    c++
  • Acquire and retrieve the data for generating the depth map and untextured point cloud:

    mmind::eye::Frame3D frame3D;
    camera.capture3D(frame3D);
    mmind::eye::DepthMap depth = frame3D.getDepthMap();
    mmind::eye::PointCloud cloud= frame3D.getUntexturedPointCloud();
    c++
  • Acquire and retrieve the data for generating the 2D image, depth map, and textured point cloud:

    mmind::eye::Frame2DAnd3D frame2DAnd3D;
    camera.capture2DAnd3D(frame2DAnd3D);
    mmind::eye::Color2DImage color = frame2DAnd3D.frame2D().getColorImage();
    mmind::eye::DepthMap depth = frame2DAnd3D.frame3D().getDepthMap();
    mmind::eye::TexturedPointCloud cloud = frame2DAnd3D.getTexturedPointCloud();
    c++
  • Acquire and retrieve the data for generating the depth map and untextured point cloud with normals:

    mmind::eye::Frame3D frame3D;
    camera.capture3DWithNormal(frame3D);
    mmind::eye::DepthMap depth = frame3D.getDepthMap();
    PointCloudWithNormals pointCloud = frame3D.getUntexturedPointCloudWithNormals();
    c++
  • Acquire and retrieve the data for generating the 2D image, depth map, and textured point cloud with normals:

    mmind::eye::Frame2DAnd3D frame2DAnd3D;
    camera.capture2DAnd3DWithNormal(frame2DAnd3D);
    mmind::eye::Color2DImage color = frame2DAnd3D.frame2D().getColorImage();
    mmind::eye::DepthMap depth = frame2DAnd3D.frame3D().getDepthMap();
    TexturedPointCloudWithNormals pointCloud = frame2DAnd3D.getTexturedPointCloudWithNormals();
    c++

Disconnect

Call the disconnect() method in the Camera class to disconnect from the current camera.

camera.disconnect();
c++

This topic introduced the basic workflow of using Mech-Eye API to control a camera. The next topic provides the reference manual for Mech-Eye API.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.