Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

ADV Toolkit (Imageprocessing on NVidia GPU)

Colleagues,

 

Last weekend I have done (more or less) my "ADV Toolkit", and very happy to announce it. May be this toolkit will be useful for someone else...

For me this project is "just for fun", the toolkit itself is free (GPL).

 

In general "NPP" part of this toolkit is a high-level wrapper to NVPP Imageprocessing Library, so it enables usage of NVidia GPU resources for image processing directly from LabVIEW environment. Right now roughly 100 SubVIs inside. I tried to preserve "IMAQ Vision" ideology, so if you have experience with IMAQ Vision, then using of this toolkit should be also quite easy for you (sorry, no documentation provided at this moment, except few examples).

 

Requirements:

- NVidia CUDA-enabled videocard

- Latest NVidia driver with CUDA 3.0 support

- LabVIEW 2009

- Vision Acquisition Software or Vision Development Module 2009

- CVI Run-Time 2009

 

If your system meet the requirements above, then download ADV Toolkit 1.0.1 (12 MB)

 

How to install:

- Download and unzip archive (link above)

- Run Setup (be sure that LabVIEW 2009 is not running)

- Point installer to the directory where LabVIEW2009 installed (usually C:\Program Files\National Instruments\LabVIEW 2009)

 

 After install you should get "AD Vision Toolkit" in the palette menu.

 

Toollkit and all necessary DLLs will be installed then in <LabVIEW 2009>\user.lib\_ADVision.

 

Getting started:

At the first please open example "00.Check your GPU Card.vi" (should be located in <LabVIEW 2009>\examples\ADVision\NPP Examples), then run it.

If your GPU is supported, then you will see something like that:

 

 

 

After that you can open other examples and see how it works.

 

This toolkit equipped with "Bridge to IMAQ", so as result you can easily and transparently integrate your IMAQ code with GPU code, for example:

 

 

Toolkit was tested on NVidia Quadro NVS 290, Quadro FX 1700, GeForce 9200 and GeForce 9600 GT.

Speed of execution depends from the videocard, in some cases GeForce 9600GT faster than QuadCore Xeon.

 

Please save your job every time before start! (there are lot of bugs, mostly from me, partially from NVidia)

 

Feedbacks, bug reports, etc are highly appreciated to AndyDm@GMail.com

 

Thanks,

 

Andrey.

 

Message Edited by Andrey Dmitriev on 05-17-2010 06:51 PM
Message 1 of 34
(16,601 Views)

Awesome job Andrey! I haven't had a chance to play with it yet, but your toolkit looks very nicely done.

 

Out of curiosity, have you played around with the current offering NI has up on NI Labs for GPU computing (http://decibel.ni.com/content/docs/DOC-6064)? I know the NI one one is not Vision-specific, but I was wondering if you had a chance to play with that and if you have any thoughts on what the shortcomings of it might be compared to yours.

 

Eric 

Message 2 of 34
(16,498 Views)

Thank you, Eric!

 

Yes of course, I have played with "LabVIEW GPU Computing" from NI Labs.

More exactly, I have used NICompute Framework in my toolkit as well (because all CUDA calls should be performed from the same context). Now all calls in my toolkit are thread-safe (thanks to MathGuy)

 

From functionality point of view both solutions quite different and can't be compared. As far as I can understand, NI Labs solution is "more generic" and "low level", and my solution is "high level" and closely specific to image processing (because this is my primary area of interest).

 

Also don't expect too much. This is just wrapper to NVPP. 

 

My goal was to deliver really simple integration for CPU/GPU code. So, the best use case is to use this solution together with IMAQ for speeding up some "bottlenecks" if performance of IMAQ Vision is not enough for very basic operations such as arithmetic operators or basic filters. May be also useful for Video processing in realtime.

 

Functions which I got running so far:

 

Image Management, Pixel Manipulation, Files: Create, Dispose, Set, Convert, Copy, Get Info,  GPU Image from/to IMAQ Image,  GPU Image from/to LabVIEW Array, Load Image from File to GPU Memory

Image manipulation (Geometry Transforms): Mirror, Resize, Transpose

Filter Functions: FilterBox, Filter (Convolution), FilterRow, FilterColumn, FilterMax, FilterMin, SumWindowColumn, SumWindowRow, Filter Kernels

Analysis (Statistics Functions): Mean, StdDev, NormDiff, Sum, MinMax, HistogramEven

Operators: Add Sub, Mul, Div, AbsDiff, Compare

Processing: Threshold, LUT Linear

 

Image types: U8, U16, I16, SGL, RGB U32, RGB U64 (but mostly supported are U8 and RGB U32) 

 

In my "ToDo" list: JPEG conversion and Affine Transforms. 

 

 

Thanks, 

 

Andrey. 

 

Message 3 of 34
(16,481 Views)
Great job andrey. I am gonna try this.
Message 4 of 34
(16,424 Views)

Looks awesome.  Anyone know if this works with Labview 2010?

0 Kudos
Message 5 of 34
(15,713 Views)

Andrey,

 

This looks great. I realise it may not be simple, but is it possible to get this in 8.6?

 

Thanks

Dave

0 Kudos
Message 6 of 34
(15,286 Views)

 


@DavidU wrote:

Andrey,

 

This looks great. I realize it may not be simple, but is it possible to get this in 8.6?

 

Thanks

Dave


 

Unfortunately its not so easy right now. I tried to make downconvert with version 1.1, but there are some small technical troubles with this action (mostly compatibility with old vision versions). So at this moment I decided to make support only for recent LabVIEW version (toolkit for LV2010 coming soon) without downward compatibility.

 

But if you have LabVIEW 8.6 + Vision (2009 or above) you can try this version:  ADV-1_1_2(LV86).zip

If you have pure LabVIEW 8.6 without Vision installed, then you can try ADV-1_1_2(LV86)+.zip

If you have LabVIEW 8.6 with Vision 8.6, then you have no chance (and please do not try - you may need to reinstall Vision after this attempt).

 

Andrey.

PS

Use attached software at your own risk.

Message 7 of 34
(15,270 Views)

Thanks Andrey,

 

I'll try it and let you know.

 

Dave

0 Kudos
Message 8 of 34
(15,251 Views)

 

Hello Andrey

Right what I tried to do actually. A really goog job, I begin to tried it on labview 2010,  it look to work fine.

 

A question: it would mean that an application created  with your library can be ditributed without the ni vision royalty.

but what about the "IMAQ image.ctl" used in your example. It is not possible to create a new one without doing a copy/past from your example? (from \vi.lib\vision\Image Controls.llb it doesn't work) Is it a probleme with license?

(As you understand, I haven't the ni vision dev module)

 

In fact I try to create also some wraper for openCV the goal is to decode 7segment LCD captured from a webcam

the application will be done in labview 8.5 (without ni vision developpement)

If possible I still continue to use the useful IMAQ image.ctl but I have probleme with the convertion between IMAQ pointer and openCV image structure pointer.

in your example the pointer is a void *src (handle by value) but in an older message (Re: Using OpenCV library in LabVIEW) you propose

 

int Convolution_OpenCV_NI (char* LVImagePtrSrc, int LVLineWidthSrc,
                           char* LVImagePtrDst, int LVLineWidthDst,
                           int LVWidth, int LVHeight)
but it need ni vision isn't it?

or

int Convolution_OpenCV (IMAQ_Image *ImageSrc, IMAQ_Image *ImageDst)
that need also the ni vision dll?

 

Is it possible to have the sources code of your dll? Is it possible to compile them without NI vision?

 

best regard

0 Kudos
Message 9 of 34
(15,060 Views)

 

Hi Andrey,

 

 

I want to congratulate you for this great toolkit, is exactly what I needed.

 

 

I have just bought an GTS450 videocard to use it in my image processing projects.

 

 

I have checked the NVidia website for how many Processor Cores this videocard has, it says 192.

 

   

But when I try you're example it says number of streaming processors = 4 !!!

 

   

I am a bit upset since is lower than you’re 9800 videocard

 

There is any way I can use more of these Streaming Processors to have my computations done faster?

 

   

Please Help.

 

   

Best Regards

 

Andrei 

0 Kudos
Message 10 of 34
(14,736 Views)