GF225()
📖 Method Description
Instantiate the GF225 class for operating the GF225 model Vitai vision-based tactile sensor. This class provides core functionality for sensor initialization, data acquisition, and image processing.
📝 Syntax
from pyvitaisdk import GF225, GF225VideoStreamProfile, GF225OutputProfile
sensor = GF225(
config=None,
marker_size=[9, 9],
marker_offsets=None,
stream_format=GF225VideoStreamProfile.MJPG_640_360_30,
output_format=GF225OutputProfile.W240_H240
)
🔧 Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
config | VTSDeviceConfig | None | None | Device configuration object obtained via VTSDeviceFinder.Set to None for offline data processing |
marker_size | int | List[int] | [9, 9] | Marker point row and column count Can be an integer (square) or a list with 2 elements [rows, cols] |
marker_offsets | List[int] | None | None | Marker display boundary offset parameters List with 4 elements: [top, bottom, left, right] |
stream_format | VideoStreamFmt | MJPG_640_360_30 | Video stream format, controls acquisition resolution and frame rate |
output_format | OutputFmt | W240_H240 | Output image data size Affects WARPED_IMG, DIFF_IMG, DEPTH_MAP, MARKER_IMG |
📤 Return Type
GF225 - GF225 sensor instance object
💡 Example Code
Online Data Collection (Real-time Sensor)
from pyvitaisdk import GF225, VTSDeviceFinder, GF225VideoStreamProfile, GF225OutputProfile
# Get devices
finder = VTSDeviceFinder()
devices = finder.get_devices()
if devices:
# Create sensor instance with default parameters
sensor = GF225(devices[0])
print("GF225 sensor initialized (default configuration)")
# Or use custom parameters
# sensor = GF225(
# config=devices[0],
# marker_size=[10, 10],
# marker_offsets=[5, 5, 5, 5],
# stream_format=GF225VideoStreamProfile.MJPG_640_360_30,
# output_format=GF225OutputProfile.W240_H240
# )
# print("GF225 sensor initialized (custom configuration)")
sensor.release() # Release resources
else:
print("No devices found")
Offline Data Processing
from pyvitaisdk import GF225, GF225OutputProfile
# For offline processing, set config to None
sensor = GF225(
config=None, # Offline mode
marker_size=[9, 9],
output_format=GF225OutputProfile.W240_H240
)
print("GF225 sensor initialized (offline processing mode)")
sensor.release() # Release resources
⚠️ Notes
Device Configuration
- Online Mode:
configparameter must be a validVTSDeviceConfigobject - Offline Mode: Set
configparameter toNonefor processing saved image data
Marker Configuration Recommendations
marker_size: Configure based on the actual Marker point matrix on the sensor surfacemarker_offsets: Used to adjust visualization boundaries
Output Format Selection
Different output_format values affect output image resolution:
W240_H240: 240×240 pixels- Choose appropriate resolution based on actual needs to balance performance and accuracy
🔗 Related Methods
- VTSDeviceFinder() - Get device configuration
- calibrate - Calibrate sensor
- collect_sensor_data - Collect sensor data
- release - Release sensor instance