shadowzero2 Posted February 21, 2009 Report Share Posted February 21, 2009 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 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. Quote Link to comment
Neville D Posted February 21, 2009 Report Share Posted February 21, 2009 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. Quote Link to comment
shadowzero2 Posted March 4, 2009 Author Report Share Posted March 4, 2009 Hi I ended up using a JPEG in Memory Vi i found in the NI forums. Thanks for the help though. I'll try to make the picture bigger next time lol Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.