Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Processing on sbRIO-9651 SOM

I am using SOM sbrio-9651 development kit, i've interfaced an AMLCD with it. I've implemented an image rotation algorithm on RT, after processing I am sending this data to LCD via FPGA using DMA FIFO. Image rotation is being displayed on LCD but issue here is that I am not getting the desired frame rate per second (25FPS/40ms) as RT is taking much time for processing. Currently image processing time is around 250-270ms.

For Image rotation, I have developed my code in C and then using it in RT labview via Call Library Node.

If I develop some algorithm in Labview RT vi it takes approx... 600-700ms, (I also used image rotation example provided in LABVIEW Example) that’s why I am using my C code for image rotation.

I tried to transfer my original image data on FPGA for processing but problem here is image size (1MB) and I can’t transfer it to FPGA BRAM.

Is there any way I can increase my frame rate per second? Also can I use NI-IMAQ for SOM sbrio-9651, will it be a good practice?

Any suggestion or example code is more than welcome?

0 Kudos
Message 1 of 4
(2,311 Views)

Image rotation is a very processor intensive operation.  It has to figure out coordinates between the new and old images and average values for every pixel.

 

If you are doing a 90 degree rotation, there is a VI just for that which is much faster.

 

If you are doing the same rotation over and over, you could do some precalculation to determine which pixels go where.  You could create an array of X and Y coordinates, and loop through them to get the new image.  This would be nearest neighbor instead of interpolation, but it would be faster.  You would probably have to convert the image to an array, do the transformation, then convert it back to an image.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 4
(2,283 Views)

hello Bruce,

Thanks very much for the reply, can you please check out the following thread:

https://forums.ni.com/t5/Hardware-Developers-Community-NI/Image-Processing-on-sbRIO-9651-SOM/gpm-p/3...

i have mentioned the techniques i have tried so far but the my issue persists. Can you suggest anything on it?

 

Thanks,

Rizwan

0 Kudos
Message 3 of 4
(2,265 Views)

Doing a different rotation every time makes it very difficult to reduce the time.  Is it small rotations or large rotations?  Small rotations of only a few degrees could be done more efficiently because you can use small angle theorems.

 

You may just need to face the fact that rotating a large image takes a certain amount of processing time, and the RIO devices have slower processors than PCs, so they will take even longer.

 

Possibility: Downsample the image.  Rotating an image 1/2x1/2 size will only take 1/4 of the time.  If it is just for display, it won't really matter.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(2,252 Views)