Class MechEyeDevice

Class Documentation

class MechEyeDevice

Interface that is used to connect the LNX Mech-Eye device and access basic information of the device.

Public Functions

MechEyeDevice()

Constructor.

~MechEyeDevice()

Destructor.

ErrorStatus connect(const MechEyeDeviceInfo &info, const int timeout = 10000)

Connect to the device by the MechEyeDeviceInfo identifying a device.

Parameters
  • info[in] the device information used to connect to the device which can be obtained by enumerateMechEyeDeviceList function.

  • timeout[in] the timeout value (ms).

Returns

See ErrorStatus for details.

ErrorStatus connect(const std::string &ipAddress, const int port = 5577, const int timeout = 10000)

Connects to a device by the IP address and port of the device.

Parameters
  • ipAddress[in] the IP address of the device to be connected.

  • port[in] the port of the device to be connected.

  • timeout[in] the timeout value (ms).

Returns

See ErrorStatus for details.

void disconnect()

Disconnect from the device.

ErrorStatus getDeviceInfo(api::MechEyeDeviceInfo &info) const

Get the basic information of the connected device.

Parameters

info[out] See MechEyeDeviceInfo for details.

Returns

See ErrorStatus for details.

ErrorStatus saveAllSettingsToUserSets() const

Save all parameter values to the current parameter group.

Returns

See ErrorStatus for details.

ErrorStatus setCurrentUserSet(const std::string &userSetName) const

Select the parameter group to use by its name.

Parameters

userSetName[in]

Returns

See ErrorStatus for details.

ErrorStatus getCurrentUserSet(std::string &userSetName) const

Get the name of the currently selected parameter group.

See also

getAllUserSets

Parameters

userSetName[out]

Returns

See ErrorStatus for details.

ErrorStatus getAllUserSets(std::vector<std::string> &userSetNames) const

Get the names of all available parameter groups.

Parameters

userSetNames[out]

Returns

See ErrorStatus for details.

ErrorStatus deleteUserSet(const std::string &userSetName) const

Delete the specified parameter group. If the input name is the currently selected parameter group’s, the parameter group of the previous index value in the list will be selected instead.

Parameters

userSetName[in]

Returns

See ErrorStatus for details.

ErrorStatus addUserSet(const std::string &userSetName) const

Add a new parameter group, set all the current parameter values to it, and select it as the current parameter group.

Parameters

userSetName[in]

Returns

See ErrorStatus for details.

ErrorStatus captureLnx2DImage(ColorMap &colorMap) const

Perform scanning of one line and obtain the line scan image.

Parameters

colorMap[out] See Frame for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxBatchRollData(float *depth, unsigned char *intensity, unsigned int *encoder, long long *frameId, int &lineCount) const

Get the acquired batch data.

Parameters
  • depth[out] the depth value or profile value (mm)

  • intensity[out] the intensity value

  • encoder[out] the encoder value

  • frameId[out] the frame ID

  • lineCount[out] the count of frame

Returns

See ErrorStatus for details.

ErrorStatus stopLnxCaptureImage()

Stop scanning.

Returns

See ErrorStatus for details.

ErrorStatus startLnxCaptureImage()

Start scanning.

Returns

See ErrorStatus for details.

ErrorStatus setLnxCaptureMode(CaptureMode value) const

Set scan mode.

Parameters

value[in] See CaptureMode for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxCaptureMode(CaptureMode &value) const

Get the current scan mode.

Parameters

value[out] See CaptureMode for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxRawTimeout(int time) const

Set the timeout value for obtaining the line scan image.

Parameters

time[in] (ms)

Returns

See ErrorStatus for details.

ErrorStatus getLnxRawTimeout(int &time) const

Get the current timeout value for obtaining the line scan image.

Parameters

time[out] (ms)

Returns

See ErrorStatus for details.

ErrorStatus setLnxDepthTimeout(int time) const

Set the timeout value for obtaining the depth map.

Parameters

time[in] (ms)

Returns

See ErrorStatus for details.

ErrorStatus getLnxDepthTimeout(int &time) const

Get the current timeout value for obtaining the depth map.

Parameters

time[out] (ms)

Returns

See ErrorStatus for details.

ErrorStatus getLnxXScale(float &xScale) const

Get the X resolution.

Parameters

xScale(um)[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxLaserPowerLevel(int powerLevel) const

Set the laser power level.

Parameters

powerLevel[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxLaserPowerLevel(int &powerLevel) const

Get the current laser power level.

Parameters

powerLevel[out]

Returns

See ErrorStatus for details.

ErrorStatus setScanExposureMode(ExposureMode mode) const

Set the exposure mode.

Parameters

mode[in] ExposureMode for details.

Returns

See ErrorStatus for details.

ErrorStatus getScanExposureMode(ExposureMode &mode) const

Get the current exposure mode.

Parameters

mode[out] ExposureMode for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxExposure(int time) const

Set the exposure time for the Timed exposure mode.

Parameters

time[in] (μs)

Returns

See ErrorStatus for details.

ErrorStatus getLnxExposure(int &time) const

Get the current exposure time for the Timed exposure mode.

Parameters

time[in] (μs)

Returns

See ErrorStatus for details.

ErrorStatus setScan3DHDRExposureSequence(int time1, int time2, int time3) const

Set the exposure sequence for the HDR exposure mode.

Parameters
  • time1[in] the exposure time1 (μs)

  • time2[in] the exposure time2 (μs)

  • time3[in] the exposure time3 (μs)

Returns

See ErrorStatus for details.

ErrorStatus getScan3DHDRExposureSequence(int &time1, int &time2, int &time3) const

Get the current exposure sequence for the HDR exposure mode.

Parameters
  • time1[out] the exposure time1 (μs)

  • time2[out] the exposure time2 (μs)

  • time3[out] the exposure time3 (μs)

Returns

See ErrorStatus for details.

ErrorStatus setLnxHDRDualSlope(int value) const

Set the y-coordinate of the first HDR knee point.

Parameters

value.[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxHDRDualSlope(int &value) const

Get the current y-coordinate of the first HDR knee point.

Parameters

value.[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxHDRTripleSlope(int value) const

Set the y-coordinate of the second HDR knee point.

Parameters

value.[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxHDRTripleSlope(int &value) const

Get the current y-coordinate of the second HDR knee point.

Parameters

value.[out]

Returns

See ErrorStatus for details.

ErrorStatus setScan3DAnalogGain(ImageAnalogGain gainVal) const

Set the analog gain.

Parameters

gainVal[in] See ImageAnalogGain for details.

Returns

See ErrorStatus for details.

ErrorStatus getScan3DAnalogGain(ImageAnalogGain &gainVal) const

Get the current analog gain.

Parameters

gainVal[out] See ImageAnalogGain for details.

Returns

See ErrorStatus for details.

ErrorStatus setScan3DDigitalGain(int gainVal) const

Set the digital gain.

Parameters

gainVal[in]

Returns

See ErrorStatus for details.

ErrorStatus getScan3DDigitalGain(int &gainVal) const

Get the current digital gain.

Parameters

gainVal[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxROIMode(ROIMode mode) const

Set the ROI mode.

Parameters

mode[in] See ROIMode for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxROIMode(ROIMode &mode) const

Get the current ROI mode.

Parameters

mode[out] See ROIMode for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxTriggerDelay(int delay) const

Set the trigger delay time.

Parameters

delay[in] (1-2600us)

Returns

See ErrorStatus for details.

ErrorStatus getLnxTriggerDelay(int &delay) const

Get the current trigger delay time.

Parameters

delay[out] (1-2600us)

Returns

See ErrorStatus for details.

ErrorStatus setLnxDepthTriggerSource(TriggerSource triggerSource) const

Set the trigger source for the Depth scan mode.

Note: this function can only be used in CaptureMode::Depth. It does not take effect in CaptureMode::Raw.

Parameters

triggerSource[in] See TriggerSource for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxDepthTriggerSource(TriggerSource &triggerSource) const

Get the current trigger source for the Depth scan mode.

Parameters

triggerSource[out] See TriggerSource for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxLineRate(double rate) const

Set the line rate for the Software trigger source.

Parameters

rate[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxLineRate(double &rate) const

Get the current line rate for the Software trigger source.

Parameters

rate[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxProfileNum(int profileNum) const

Set the maximum number of lines to be scanned.

Parameters

profileNum[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxProfileNum(int &profileNum) const

Get the current maximum number of lines to be scanned.

Parameters

profileNum[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxEncoderTriggerMode(EncoderTriggerMode mode) const

Set the encoder trigger mode.

Parameters

mode[in] See EncoderTriggerMode for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxEncoderTriggerMode(EncoderTriggerMode &mode) const

Get the current encoder trigger mode.

Parameters

mode[out] See EncoderTriggerMode for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxEncoderTriggerDirection(EncoderTriggerDirection value) const

Set the encoder rotation direction.

Parameters

value[in] See EncoderTriggerDirection for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxEncoderTriggerDirection(EncoderTriggerDirection &value) const

Get the current encoder rotation direction.

Parameters

value[out] See EncoderTriggerDirection for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxEncoderDivide(int interval) const

Set the encoder divider value. Camera frame rate = encoder signal rate * encoder multiplier / encoder divider.

Parameters

interval[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxEncoderDivide(int &interval) const

Get the current encoder divider value.

Parameters

interval[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxEncoderMultiplier(EncoderMultiplier multiple) const

Set the encoder multiplier value.

Parameters

multiple[in] See EncoderMultiplier for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxEncoderMultiplier(EncoderMultiplier &multiple) const

Get the current encoder multiplier value.

Parameters

multiple[out] See EncoderMultiplier for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxFilterType(FilterType type) const

Set the filter type.

Parameters

type[in] See FilterType for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxFilterType(FilterType &type) const

Get the filter type.

Parameters

type[out] See FilterType for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxMeanFilterWindow(MeanFilterWindow window) const

Set the window size for mean filtering.

Parameters

window[in] See MeanFilterWindow for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxMeanFilterWindow(MeanFilterWindow &window) const

Get the current window size for mean filtering.

Parameters

window[out] See MeanFilterWindow for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxMedianFilterWindow(MedianFilterWindow window) const

Set the window size for median filtering.

Parameters

window[in] See MedianFilterWindow for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxMedianFilterWindow(MedianFilterWindow &window) const

Get the current window size for median filtering.

Parameters

window[out] See MedianFilterWindow for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxMaxFillingPointCount(int value) const

Set the maximum number of invalid points to be interpolated.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxMaxFillingPointCount(int &value) const

Get the current maximum number of invalid points to be interpolated.

Parameters

value[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxImagePixelFormat(ImagePixelFormat pixelFormat) const

Set the image pixel format.

Parameters

pixelFormat[in] See ImagePixelFormat for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxImagePixelFormat(ImagePixelFormat &pixelFormat) const

Get the image pixel format.

Parameters

pixelFormat[out] See ImagePixelFormat for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxProfileStrategy(ProfileStrategy value) const

Set profile extraction strategy.

Parameters

value[in] See ProfileStrategy for details.

Returns

See ErrorStatus for details.

ErrorStatus getLnxProfileStrategy(ProfileStrategy &value) const

Get the current profile extraction strategy.

Parameters

value[out] See ProfileStrategy for details.

Returns

See ErrorStatus for details.

ErrorStatus setLnxGrayFilterThresh(int value) const

Set the grayscale value threshold. Grayscale values of pixels below this threshold are set to zero before profile extraction.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxGrayFilterThresh(int &value) const

Get the current grayscale value threshold.

Parameters

value[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxMinStripeWidth(int value)

Set the minimum laser line width.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxMinStripeWidth(int &value) const

Get the current minimum laser line width.

Parameters

value[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxMaxStripeWidth(int value)

Set the maximum laser line width.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxMaxStripeWidth(int &value) const

Get the current maximum laser line width.

Parameters

value[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxMinStripeIntensity(int value)

Set the minimum laser line intensity.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxMinStripeIntensity(int &value) const

Get the current minimum laser line intensity.

Parameters

value[out]

Returns

See ErrorStatus for details.

ErrorStatus setLnxMaxStripeIntensity(int value)

Set the maximum laser line intensity.

Parameters

value[in]

Returns

See ErrorStatus for details.

ErrorStatus getLnxMaxStripeIntensity(int &value) const

Get the current maximum laser line intensity.

Parameters

value[out]

Returns

See ErrorStatus for details.

Public Static Functions

static std::vector<api::MechEyeDeviceInfo> enumerateMechEyeDeviceList()

Enumerate Mech-Eye devices by the MechEyeDeviceInfo identifying the device.

Returns

Information on all detectable Mech-Eye devices.

static ErrorStatus getLnxXDataWidth(int &xDataWidth)

Get the line width in the X direction.

Parameters

xDataWidth[out]

Returns

See ErrorStatus for details.