Jump to content

Problem changing a JPEG string to an IMAQ image


Recommended Posts

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

srvimage1aj0.th.png

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.

Link to comment

QUOTE (shadowzero2 @ Feb 20 2009, 01:11 AM)

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??

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

The JPEG encode/decode for sure have a memory leak in it. And your right, you do need to swap the R-B colour planes. Those were unsupported VI's posted on the NI website, and I have tried many times to get them to fix the bugs in it, but no luck. There are other posts on LAVA about them.

You can use IMAQ ReadFile or IMAQ Write File2 or IMAQ Write String vi's to do what you need. You might have to save the string to file and then open it to duplicated the "jpeg decode".

PS Next time resize your jpeg screenshot to a reasonable size and post here using the "Insert Image" button above. It was almost unreadably small.

Neville.

Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.