View Single Post
  #1   Spotlight this post!  
Unread 11-05-2012, 00:18
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 247
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
NI Vision Python wrappers

I'm happy to announce that I've completed a full set of Python wrappers for NI Vision (the National Instruments visual processing / machine vision library). Unfortunately, they're only usable on Windows at the moment, not on RobotPy, due to the use of Python's ctypes module (which has not yet been ported to the robot). I'll work on porting ctypes to the robot soon, but in the meantime you can experiment on Windows!

Features:
  • Full wrapping of all structures, enumerations, and functions.
  • All functions raise a nivision.ImaqError exception if an error occurs, rather than relying on nonzero or NULL return values.
  • Output parameters are returned as a tuple (in parameter order). If the function additionally returns a value, this is returned as the first element of the tuple, followed by the output parameters.
  • Count/size/length parameters that specify the length of an array are handled implicitly by using Python's len() function. This includes return values (which are returned as a sized array).
  • Additional Pythonic helper functions.
  • Automatic memory management of Image and other data types.

github page: https://github.com/robotpy/pynivision

The Downloads page has a Windows installer if you want to get started quickly. I've only tested on Python 3.x with NI Vision 2011 so far.
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)
Reply With Quote