
01-12-2012, 10:52 PM
|
 |
WINriver C++
AKA: Steve Hoffing
 FRC #1647
Team Role: Programmer
|
|
Join Date: Feb 2009
Rookie Year: 2008
Location: Shamong, New Jersey, America
Posts: 10
|
|
|
Re: NI Vision Functions
Quote:
Originally Posted by JewishDan18
Alright, I got my first one working! I did the convex hull, since that will be useful to have, and didn't require any new structures.
Code:
private static final BlockingFunction imaqConvexHullFn = NativeLibrary.getDefaultInstance().getBlockingFunction("imaqConvexHull");
static { imaqConvexHullFn.setTaskExecutor(taskExecutor); }
public static void convexHull(Pointer source, Pointer dest, int connectivity8) throws NIVisionException{
assertCleanStatus(imaqConvexHullFn.call3(source.address().toUWord().toPrimitive(), dest.address().toUWord().toPrimitive(), connectivity8));
}
Only thing I am unsure of it that according to the NI docs, connectivity8 is a boolean, so I assume 0 for false (meaning use connectivity to the 4 adjacent pixels) and 1 for true (meaning use connectivity to the 8 adjacent pixels).
|
Where would this code go? In NIVision.java or in your main robot class file?
__________________
---
Team 1647's Software "thing" for 2011
Death-Spin autonomous mode is my favorite.
|