mecheye.area_scan_3d_camera.Camera

class mecheye.area_scan_3d_camera.Camera(*args)

Camera connection, SDK operations, and NumPy capture conveniences.

Camera() requires explicit connect(). Camera(ip) remembers an IP and connects on context entry or first convenience capture/configuration. Camera(other_camera) shares the native connection and callback registry. Construction does not connect. Use a context manager or disconnect() to release a connection; close() is the same operation.

SDK methods return ErrorStatus and never retry implicitly. Convenience methods raise the MechEyeError subclasses from mecheye.shared on failure. SDK access is serialized across camera instances; user code must synchronize writes to returned NumPy arrays and to its own callback state.

static discover_cameras(timeoutMs=5000)

Discover cameras on reachable interfaces without connecting.

Parameters:

timeoutMs – Discovery timeout in milliseconds.

Returns:

A VectorCameraInfo containing discovered device information.

connect(*args)

Connect using an IP address or CameraInfo and an optional timeout.

Accepted forms are connect(ip) and connect(info), with an optional second positional timeoutMs argument (default 5000 milliseconds). The IP is remembered after a successful connection. No retries are performed.

Returns:

ErrorStatus; inspect is_ok() before using the connection.

disconnect()

Disconnect and stop this connection’s callback registrations.

Camera copies share the connection, so disconnecting one also affects the others. This method can be called repeatedly.

Returns:

None.

close()

Disconnect and stop this connection’s callback registrations.

Camera copies share the connection, so disconnecting one also affects the others. This method can be called repeatedly.

Returns:

None.

property connected

Whether the shared native camera connection is currently active.

property ip

The optional or last successfully connected IP address, or None.

property device_info

Read device metadata into a new Python dictionary.

Includes model, device name, serial number, SDK and firmware versions, IP address, subnet mask, assignment method, port, and support information.

Raises:

mecheye.shared.MechEyeConnectionError – The SDK cannot read the device information.

property camera_parameters

Read camera matrices, distortion coefficients, and depth-to-texture transform.

The returned dictionary contains depth and texture dictionaries with flat 3-by-3 intrinsic_matrix values and five distortion coefficients. T_texture_camera_depth_camera_matrix_mm is a 4-by-4 nested list.

Raises:

mecheye.shared.MechEyeConnectionError – The SDK cannot read the intrinsics.

configure_depth_source_2d_exposure(mode)

Set and verify the depth-source 2D exposure mode.

Parameters:

mode – Either "timed" or "flash".

Returns:

The requested mode after successful device readback.

Raises:
capture_points(timeoutMs=10000)

Capture aligned grayscale and organized XYZ arrays in millimeters.

Uses depth-source 2D and 3D capture, camera intrinsics, and SDK mapping. The camera model must support depth-source 2D capture. An optional constructor IP enables lazy connection; SDK capture errors are not retried.

Parameters:

timeoutMs – Capture timeout in milliseconds.

Returns:

(image, points) with owned NumPy buffers. image has shape (height, width) and dtype uint8; points has shape (height, width, 3) and dtype float64. All-zero SDK points become NaN triplets; non-finite coordinate components become NaN.

Raises:

The previous cloud unit is restored after capture or mapping succeeds or fails. If restoration itself fails, that configuration error is raised.

pop_callback_errors()

Return and clear pending callback exceptions in registration context order.

Camera copies share the error queue. Exceptions are retained without printing. :return: A new list of exceptions.

set_heartbeat_interval(timeIntervalMs)

Set the SDK heartbeat interval in milliseconds; return ErrorStatus.

get_camera_info(info)

Fill the supplied CameraInfo with device metadata; return ErrorStatus.

get_camera_status(status)

Fill the supplied CameraStatus with temperatures; return ErrorStatus.

get_camera_resolutions(resolutions)

Fill the supplied CameraResolutions with image sizes; return ErrorStatus.

current_user_set()

Return a handle to the current device UserSet.

Read and write operations on the handle report SDK status values. Obtain a new handle after reconnecting or changing the selected configuration.

user_set_manager()

Return the connection’s UserSetManager for selecting and persisting user sets.

capture_3d(frame3D, timeoutMs=5000)

Capture a 3D frame into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_3d_with_normal(frame3D, timeoutMs=10000)

Capture a 3D frame with normals into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_2d(frame2D, timeoutMs=5000)

Capture a 2D frame into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_depth_source_2d(frame2D, timeoutMs=5000)

Capture the depth-source 2D frame into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_2d_and_3d(frame2DAnd3D, timeoutMs=10000)

Capture a combined texture 2D and 3D frame into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_depth_source_2d_and_3d(frame2DAnd3D, timeoutMs=10000)

Capture a combined depth-source 2D and 3D frame into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_2d_and_3d_with_normal(frame2DAnd3D, timeoutMs=15000)

Capture a combined 2D and 3D frame with normals into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds.

capture_stereo_2d(left, right, isRectified=False, timeoutMs=5000)

Capture left and right stereo 2D frames into the supplied output container.

timeoutMs is measured in milliseconds. The camera must already be connected; this SDK operation does not initiate a connection or retry a failure. :return: ErrorStatus; only read output data after is_ok() succeeds. :param isRectified: Whether the SDK should rectify the stereo images.

set_point_cloud_unit(unit)

Set CoordinateUnit_Millimeter or CoordinateUnit_Meter; return ErrorStatus.

save_virtual_device_file(fileName)

Save a virtual-device file at fileName through the SDK; return ErrorStatus.

get_camera_intrinsics(wrappedIntrinsics)

Fill the supplied CameraIntrinsics with calibration values; return ErrorStatus.

get_point_cloud_unit()

Return [status, unit] for the SDK’s current CoordinateUnit selection.