IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.
Sets a region of interest (ROI) in one command. The data order is "OffsetX", "OffsetY", "Width", "Height" with 4 bytes each.
If you change the image size, you must stop image acquisition and recreate the buffers, see Starting and stopping image acquisition and Preparing image acquisition: create buffer.
Name |
UEyeROI |
Category |
|
Interface |
Register |
Access |
Write |
Unit |
- |
Visibility |
Guru |
Values |
Camera specific |
Standard |
IDS |
Availability uEye+ |
- |
Availability uEye |
|
Code example
C++
struct Rect
{
int32_t x{};
int32_t y{};
int32_t width{};
int32_t height{};
};
// Get the RegisterNode for UEyeROI
auto registerNode =
nodeMapRemoteDevice->FindNode<peak::core::nodes::RegisterNode>("UEyeROI");
// Create the rectangle with the needed dimensions
Rect rect{0, 0, 640, 480};
// Cast the struct to uint8_t* and write the value to registerNode
registerNode->Write(reinterpret_cast<uint8_t *>(&rect), sizeof(rect));
C#
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Rect
{
public int x;
public int y;
public int width;
public int height;
}
Rect rect = new Rect { x = 0, y= 0, width = 640, height = 480 };
// Marshal the struct to a byte array
int size = Marshal.SizeOf(rect);
byte[] buffer = new byte[size];
IntPtr ptr = Marshal.AllocHGlobal(size);
try
{
Marshal.StructureToPtr(rect, ptr, false);
Marshal.Copy(ptr, buffer, 0, size);
// Wrap in ByteCollection
var byteCollection = new std.ByteCollection(buffer);
// Get the RegisterNode for UEyeROI and write
var registerNode = nodeMapRemoteDevice.FindNodeRegister("UEyeROI");
registerNode.Write(byteCollection);
}
finally
{
Marshal.FreeHGlobal(ptr);
}
Python
# Pack the four integers (x, y, width, height)
bin_packed = struct.pack('4I', 0, 0, 640, 480)
# Get the RegisterNode for UEyeROI
register_node = nodemap_remote_device.FindNode("UEyeROI")
# Write the binary values using ids_peak.VectorUInt8
register_node.Write(ids_peak.VectorUInt8(bin_packed))