|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: NI Vision Functions
Quote:
|
|
#2
|
||||
|
||||
|
Re: NI Vision Functions
If you want to modify the WPILib source code, it can go in the NIVision.java. However, each time the plugins get updated, I believe your changed will get removed. I just put it in my robot class, but for the final code it will go in its own class. To answer your question, it can go anywhere.
|
|
#3
|
||||
|
||||
|
Re: NI Vision Functions
We try adding it to our own class and tried extending it. We are getting the following error. cannot find symbol variable imaqConvexHullFn
We imported import com.sun.cldc.jna.*; is there anything else we need to import or do we need to extend the class or something. Last edited by rudun : 14-01-2012 at 14:02. Reason: typo |
|
#4
|
||||
|
||||
|
Re: NI Vision Functions
Quote:
|
|
#5
|
|||
|
|||
|
Re: NI Vision Functions
We've been starting to work on camera-tracking code, and we ran into some issues. We thought that it might be a good idea to try the code that was posted here first, and make sure we could get that much to work. This is what we have so far:
Code:
public class Camera2012 {
public AxisCamera camera = AxisCamera.getInstance();
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));
}
}
taskExecutor: cannot find symbol assertCleanStatus: cannot find symbol My own experience with Java is limited; could you help us out with this? If you happen to notice anything that might be helpful, we'll take all suggestions. Thanks so much! |
|
#6
|
||||
|
||||
|
Re: NI Vision Functions
Essentially, this means you never created the taskExecutor object. The simplest way (I think) to use that code is to copy NIVision.java to your project, and add Dan's code into that.
|
|
#7
|
||||
|
||||
|
Re: NI Vision Functions
Quote:
Is there any documentation for the imaq functions C-side? Specifically, I would like to use imaqDetectRectangles and need the fields of the RectangleMatch struct. |
|
#8
|
|||
|
|||
|
Re: NI Vision Functions
Quote:
-Joe |
|
#9
|
||||
|
||||
|
Re: NI Vision Functions
Quote:
|
|
#10
|
|||
|
|||
|
Re: NI Vision Functions
Thanks so much for the tips - everything runs error-free now.
Would it be possible to see an example of convexHull() being properly called (for an image which I've already used an HSL threshold on)? |
|
#11
|
||||
|
||||
|
Re: NI Vision Functions
Quote:
Code:
convexHull(binaryImage.image,binaryImage.image,1); |
|
#12
|
|||
|
|||
|
Re: NI Vision Functions
Does anyone know if there is full documentation of the NIVision C functions anywhere to make this process easier?
|
|
#13
|
|||
|
|||
|
Re: NI Vision Functions
Program Filles/National Instruments/Vision/Documentation.
Specifically, you should look at the CVI document. Greg Mckaskle |
|
#14
|
|||
|
|||
|
Re: NI Vision Functions
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|