Go to Post With people from the high northeast, mid east, mid west and far west all in one hotel room, we had the time of our lives simply by sitting there. - Keith Chester [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #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
  #2   Spotlight this post!  
Unread 11-05-2012, 00:27
Slix Slix is offline
Registered User
AKA: Peter Kowalczyk
FRC #2115 (NightMares)
Team Role: Programmer
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Mundelein, IL
Posts: 31
Slix is an unknown quantity at this point
Re: NI Vision Python wrappers

Neat!

So, does this mean that the best way to process images (finding targets and such) with RobotPy is to send the images to the driver's station, process them there, and then send the result back to the bot?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-05-2012, 02:43
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
Re: NI Vision Python wrappers

Quote:
Originally Posted by Slix View Post
So, does this mean that the best way to process images (finding targets and such) with RobotPy is to send the images to the driver's station, process them there, and then send the result back to the bot?
At the moment, yes, but I do plan on getting the wrappers working on the robot eventually. With the 2012 game rules, many teams did image processing on the driver station anyway. The robot is limited in processing power; using the full power of a fast laptop it's possible to do a lot more/faster processing on the driver station.
__________________
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
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi