Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem converting JPEG string to IMAQ image

Solved!
Go to solution

Hi, I'm using the JPEG decode VI to decode an image string i'm receiving from a Blackfin Camera. This works fine when i run VI itself but when i use it as a sub-vi the program crashes .Anybody have any advice??

 

 

This is an image of my program


Free Image Hosting at www.ImageShack.us

 

this is how the file is returned from the camera 


'I''##IMJxs0s1s2s3....'grab JPEG compressed video frame

x = frame size in pixels:
1 = 80x64, 3 = 160x120, 5 = 320x240, 7 = 640x480, 9 = 1280x1024

s0s1s2s3=frame size in bytes (s0 * 256^0 + s1 * 256^1 + s2 * 256^2 + s3 * 256^3)
.... = full JPEG frame

Note that sometimes the 'I' command returns nothing if the robot camera is busy, so the 'I' command should be called as many times as needed until a frame is returned

 

I modified the JPEG decode VI by switching the red and blue colour planes. I dont know whether this caused the problem though.

Download All
0 Kudos
Message 1 of 4
(4,117 Views)
Solution
Accepted by topic author shadowzero2
Message 2 of 4
(4,110 Views)
Hi, I finally got a chance to try out your code and it works perfectly thanks alot.
0 Kudos
Message 3 of 4
(4,048 Views)

I posted an idea request for a function to convert strings back to images.  Please vote for it at:

 

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-function-to-convert-string-to-image/idi-p/1104573#...

 

Thanks,

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 4
(3,548 Views)