Skip to main content

GF225()

Constructor | GF225 Sensor Class

📖 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

ParameterTypeDefaultDescription
configVTSDeviceConfig | NoneNoneDevice configuration object obtained via VTSDeviceFinder.
Set to None for offline data processing
marker_sizeint | List[int][9, 9]Marker point row and column count
Can be an integer (square) or a list with 2 elements [rows, cols]
marker_offsetsList[int] | NoneNoneMarker display boundary offset parameters
List with 4 elements: [top, bottom, left, right]
stream_formatVideoStreamFmtMJPG_640_360_30Video stream format, controls acquisition resolution and frame rate
output_formatOutputFmtW240_H240Output 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: config parameter must be a valid VTSDeviceConfig object
  • Offline Mode: Set config parameter to None for processing saved image data
Marker Configuration Recommendations
  • marker_size: Configure based on the actual Marker point matrix on the sensor surface
  • marker_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