Mech-Eye API 2.3.3
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
MechEyeApi.h
1/*******************************************************************************
2 *BSD 3-Clause License
3 *
4 *Copyright (c) 2016-2024, Mech-Mind Robotics
5 *All rights reserved.
6 *
7 *Redistribution and use in source and binary forms, with or without
8 *modification, are permitted provided that the following conditions are met:
9 *
10 *1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 *2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 *3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 *AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 *DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 *SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 *CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 *OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 *OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 ******************************************************************************/
32
33#pragma once
34#include <memory>
35#include <vector>
36#include "api_global.h"
37#include "MechEyeFrame.hpp"
38#include "MechEyeDataType.h"
39#include "MechEyeSettings.h"
40
41namespace mmind {
42
43namespace api {
44
45class MechEyeDeviceImpl;
46
51std::string MMIND_API_EXPORT getApiInformation();
52
57class MMIND_API_EXPORT MechEyeDevice
58{
59public:
64
69
76 static std::vector<MechEyeDeviceInfo> enumerateMechEyeDeviceList();
77
87 const ColorMap& textureMask,
88 const DeviceIntri& intri, PointXYZMap& pointXYZMask);
89
100 const ColorMap& textureMask, const ColorMap& texture,
101 const DeviceIntri& intri,
102 PointXYZBGRMap& pointXYZBGRMask);
103
111 ErrorStatus connect(const MechEyeDeviceInfo& info, int timeout = 10000);
112
120 ErrorStatus connect(const std::string& ipAddress, int port = 5577, int timeout = 10000);
121
126
133
140
147
154
167
174
185 ErrorStatus captureOrthogonalDepthMap(DepthMap& depthMap, double& xScale, double& yScale,
186 double& xOffset, double& yOffset) const;
187
194
201
208
215
221 ErrorStatus getScan2DExposureTime(double& value) const;
222
228 ErrorStatus setScan2DHDRExposureSequence(std::vector<double>& values) const;
229
235 ErrorStatus getScan2DHDRExposureSequence(std::vector<double>& values) const;
236
243
250
257
264
271
278
284 ErrorStatus setScan2DROI(const ROI& value) const;
285
292
298 ErrorStatus setScan3DExposure(const std::vector<double>& valueSequence) const;
299
305 ErrorStatus getScan3DExposure(std::vector<double>& valueSequence) const;
306
312 ErrorStatus setScan3DGain(double value) const;
313
319 ErrorStatus getScan3DGain(double& value) const;
320
326 ErrorStatus setScan3DROI(const ROI& value) const;
327
335
342
349
356
363
370
377
384 [[deprecated("please use setCloudOutlierRemovalMode() instead.")]] ErrorStatus
386
393 [[deprecated("please use getCloudOutlierRemovalMode() instead.")]] ErrorStatus
395
402 [[deprecated("please use setCloudSurfaceSmoothingMode() instead.")]] ErrorStatus
404
411 [[deprecated("please use getCloudSurfaceSmoothingMode() instead.")]] ErrorStatus
413
421
429
437
445
453
461
469
477
485
493
501
509
517
525
533
541
549
557
566
575
584
593
599
606
613
620 ErrorStatus addPoseAndDetect(const std::vector<double>& poseData) const;
621
627 ErrorStatus calculateExtrinsics(std::string& extrinsic) const;
628
635
643 ErrorStatus setCurrentUserSet(const std::string& userSetName) const;
644
651 ErrorStatus getCurrentUserSet(std::string& userSetName) const;
652
659 ErrorStatus getAllUserSets(std::vector<std::string>& userSetNames) const;
660
669 ErrorStatus deleteUserSet(const std::string& userSetName) const;
670
679 ErrorStatus addUserSet(const std::string& userSetName) const;
680
681private:
682 MechEyeDeviceImpl* _d;
683};
684
685} // namespace api
686} // namespace mmind
Definition of data structure in device capturing image.
Interface that is used to connect the Mech-Eye Industrial 3D Camera and access basic information of t...
Definition MechEyeApi.h:58
ErrorStatus addUserSet(const std::string &userSetName) const
ErrorStatus captureOrthogonalDepthMap(DepthMap &depthMap, double &xScale, double &yScale, double &xOffset, double &yOffset) const
Captures an orthogonal depth image.
void disconnect()
Disconnects from the device.
ErrorStatus setDepthRange(const DepthRange &value) const
Sets depth range in 3D image.
ErrorStatus setCloudNoiseRemovalMode(PointCloudProcessingSettings::PointCloudNoiseRemoval value) const
Sets the point cloud noise removal mode.
ErrorStatus getScan3DGain(double &value) const
Gets gain to capture the 3d image.
ErrorStatus getDeviceTemperature(DeviceTemperature &temperature) const
Gets the temperature information about the connected device.
ErrorStatus addPoseAndDetect(const std::vector< double > &poseData) const
Add current pose of robot, capture the image and calculate necessary parameters prepared for calibrat...
ErrorStatus getCloudOutlierRemovalMode(PointCloudProcessingSettings::PointCloudOutlierRemoval &value) const
Gets the point cloud outlier removal mode.
ErrorStatus getFringeContrastThreshold(int &value) const
Gets the signal contrast threshold for effective pixels.
ErrorStatus setScan2DExpectedGrayValue(int value) const
Sets the expected gray value in Scanning2DSettings::Auto exposure mode.
ErrorStatus setUhpCaptureMode(UhpSettings::UhpCaptureMode value) const
Sets UHP camera capture mode. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus setFringeMinThreshold(int value) const
Sets the signal minimum threshold for effective pixels.
ErrorStatus setCloudEdgePreservationMode(PointCloudProcessingSettings::PointCloudEdgePreservation value) const
Sets the point cloud edge preservation mode.
ErrorStatus calculateExtrinsics(std::string &extrinsic) const
Start to calculate the result of handeye calibration.
ErrorStatus setScan2DROI(const ROI &value) const
Sets ROI to capture the 2D image.
ErrorStatus getScan2DToneMappingEnable(bool &value) const
Gets whether gray level transformation algorithm is used or not.
ErrorStatus getDeviceResolution(DeviceResolution &imageResolution) const
Gets the device resolution.
ErrorStatus setFringeContrastThreshold(int value) const
Sets the signal contrast threshold for effective pixels.
ErrorStatus setProjectorFringeCodingMode(ProjectorSettings::FringeCodingMode value) const
Sets projector's fringe coding mode. Only support with Mech-Eye NANO and PRO series industrial 3D cam...
ErrorStatus connect(const std::string &ipAddress, int port=5577, int timeout=10000)
Connects to the device by the ip address and port identifying a device.
ErrorStatus setCloudSmoothMode(PointCloudProcessingSettings::CloudSmoothMode value) const
Sets the point cloud smoothing algorithm.
ErrorStatus getProjectorAntiFlickerMode(ProjectorSettings::AntiFlickerMode &value) const
Gets projector's anti-flicker mode. Only support with Mech-Eye NANO and PRO series industrial 3D came...
ErrorStatus getUhpCaptureMode(UhpSettings::UhpCaptureMode &value) const
Gets UHP camera capture mode. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus getAllUserSets(std::vector< std::string > &userSetNames) const
Gets the names of all user sets.
ErrorStatus setLaserSettings(const LaserSettings &value) const
Sets laser device settings. Only support with Mech-Eye Laser series industrial 3D camera.
ErrorStatus setCloudOutlierFilterMode(PointCloudProcessingSettings::CloudOutlierFilterMode value) const
Sets the point cloud outliers removal algorithm.
static ErrorStatus getCloudFromTextureMask(const DepthMap &depthMap, const ColorMap &textureMask, const ColorMap &texture, const DeviceIntri &intri, PointXYZBGRMap &pointXYZBGRMask)
Gets the colored point cloud image within the mask specified by the texture map.
ErrorStatus setScan3DExposure(const std::vector< double > &valueSequence) const
Sets the exposure time of the camera to capture the 3D image.
ErrorStatus getCloudOutlierFilterMode(PointCloudProcessingSettings::CloudOutlierFilterMode &value) const
Gets the point cloud outliers removal algorithm.
ErrorStatus getCloudNoiseRemovalMode(PointCloudProcessingSettings::PointCloudNoiseRemoval &value) const
Gets the point cloud noise removal mode.
ErrorStatus setScan3DROI(const ROI &value) const
Sets ROI to capture the 3D image.
ErrorStatus setScan2DToneMappingEnable(bool value) const
Sets whether gray level transformation algorithm is used or not.
ErrorStatus setScan2DExposureMode(Scanning2DSettings::Scan2DExposureMode value) const
Sets the camera exposure mode to capture the 2D images.
ErrorStatus getDeviceInfo(MechEyeDeviceInfo &info) const
Gets the basic information about the connected device.
ErrorStatus getProjectorPowerLevel(ProjectorSettings::PowerLevel &value) const
Gets projector's powerl level. Only support with Mech-Eye NANO, LOG and PRO series industrial 3D came...
ErrorStatus deleteUserSet(const std::string &userSetName) const
static ErrorStatus getCloudFromTextureMask(const DepthMap &depthMap, const ColorMap &textureMask, const DeviceIntri &intri, PointXYZMap &pointXYZMask)
Gets the point cloud image within the mask specified by the texture map.
ErrorStatus setScan2DHDRExposureSequence(std::vector< double > &values) const
Sets the camera HDR exposure sequence in Scanning2DSettings::HDR exposure mode.
ErrorStatus getScan3DROI(ROI &value) const
Gets ROI to capture the 3D image. MechEye UHP serials in capture mode 'Merge' does not support this p...
ErrorStatus captureDepthMap(DepthMap &depthMap) const
Captures a depth image.
ErrorStatus capturePointXYZBGRMap(PointXYZBGRMap &pointXYZBGRMap) const
Captures a colored point cloud image.
ErrorStatus getCurrentUserSet(std::string &userSetName) const
Gets the name of the current user set.
ErrorStatus getScan2DExposureTime(double &value) const
Gets the camera exposure time in Scanning2DSettings::Timed exposure mode.
ErrorStatus getDeviceIntri(DeviceIntri &intri) const
Gets the intrinsic camera parameter about the connected device.
ErrorStatus captureColorMap(ColorMap &colorMap) const
Captures a color image.
ErrorStatus setScan3DGain(double value) const
Sets gain to capture the 3d image.
ErrorStatus setProjectorPowerLevel(ProjectorSettings::PowerLevel value) const
Sets projector's powerl level. Only support with Mech-Eye NANO, LOG and PRO series industrial 3D came...
static std::vector< MechEyeDeviceInfo > enumerateMechEyeDeviceList()
Enumerates Mech-Eye Industrial 3D Camera by the type of MechEyeDeviceInfo identifying the device.
ErrorStatus getUhpSettings(UhpSettings &value) const
Gets UHP device settings. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus getScan3DExposure(std::vector< double > &valueSequence) const
Gets the exposure time sequence of the camera to capture the 3D image.
ErrorStatus getUhpFringeCodingMode(UhpSettings::UhpFringeCodingMode &value) const
Gets UHP camera fringe coding mode. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus setCurrentUserSet(const std::string &userSetName) const
ErrorStatus setScan2DExposureTime(double value) const
Sets the camera exposure time in Scanning2DSettings::Timed exposure mode.
ErrorStatus setUhpSettings(UhpSettings value) const
Sets UHP device settings. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus captureCalibrationFeatureImage(ColorMap &colorMap) const
Only capture current image with feature recognition result for test.
ErrorStatus getProjectorFringeCodingMode(ProjectorSettings::FringeCodingMode &value) const
Gets projector's fringe coding mode. Only support with Mech-Eye NANO and PRO series industrial 3D cam...
ErrorStatus getCloudEdgePreservationMode(PointCloudProcessingSettings::PointCloudEdgePreservation &value) const
Gets the point cloud edge preservation mode.
ErrorStatus getScan2DSharpenFactor(double &value) const
Gets the image sharpen factor.
ErrorStatus setScan2DSharpenFactor(double value) const
Sets the image sharpen factor.
ErrorStatus getScan2DExposureMode(Scanning2DSettings::Scan2DExposureMode &value) const
Gets the camera exposure mode to capture the 2D images.
ErrorStatus getFringeMinThreshold(int &value) const
Gets the signal minimum threshold for effective pixels.
ErrorStatus getCloudSmoothMode(PointCloudProcessingSettings::CloudSmoothMode &value) const
Gets the point cloud smoothing algorithm.
ErrorStatus getScan2DROI(ROI &value) const
Gets ROI to capture the 2D image.
ErrorStatus capturePointXYZMap(PointXYZMap &pointXYZMap) const
Captures a point cloud image.
ErrorStatus getScan2DHDRExposureSequence(std::vector< double > &values) const
Gets the camera HDR exposure sequence in Scanning2DSettings::HDR exposure mode.
ErrorStatus connect(const MechEyeDeviceInfo &info, int timeout=10000)
Connects to the device by the MechEyeDeviceInfo identifying a device.
ErrorStatus setCloudSurfaceSmoothingMode(PointCloudProcessingSettings::PointCloudSurfaceSmoothing value) const
Sets the point cloud surface smoothing mode.
ErrorStatus saveAllSettingsToUserSets() const
Saves all parameters to the current user set.
ErrorStatus setUhpFringeCodingMode(UhpSettings::UhpFringeCodingMode value) const
Sets UHP camera fringe coding mode. Only support with Mech-Eye UHP series industrial 3D camera.
ErrorStatus setProjectorAntiFlickerMode(ProjectorSettings::AntiFlickerMode value) const
Sets projector's anti-flicker mode. Only support with Mech-Eye NANO and PRO series industrial 3D came...
ErrorStatus setBoardType(HandeyeCalibrationSettings::boardType boardType) const
Set the board type for this calibration.
ErrorStatus setCloudOutlierRemovalMode(PointCloudProcessingSettings::PointCloudOutlierRemoval value) const
Sets the point cloud outlier removal mode.
ErrorStatus setCalibrateType(HandeyeCalibrationSettings::calibrationType calibrationType) const
Set the calibration type for this calibration.
ErrorStatus getScan2DExpectedGrayValue(int &value) const
Gets the expected gray value in Scanning2DSettings::Auto exposure mode.
ErrorStatus getDepthRange(DepthRange &value) const
Gets depth range in 3D image.
ErrorStatus getCloudSurfaceSmoothingMode(PointCloudProcessingSettings::PointCloudSurfaceSmoothing &value) const
Gets the point cloud surface smoothing mode.
ErrorStatus getLaserSettings(LaserSettings &value) const
Gets laser device settings. Only support with Mech-Eye Laser series industrial 3D camera.
This struct defines the depth range.
This struct defines device intrinsic parameters, including texture camera and depth camera.
This struct defines camera map resolution.
This struct describes the device temperature information.
This enumeration defines the types of errors.
This struct defines device information.
This struct defines camera region of interest.