emabellor
Posts: 3
Joined: Tue Oct 29, 2013 1:51 pm

OpenMax JPEG - Raspberry Pi

Tue Oct 29, 2013 2:01 pm

Hello Everybody

I'm working in a Project where I use 2 JPEG cameras with a resolution of 640x480. I need to implement a motion detection algorithm, so I'm looking for the fastest way to convert a JPEG image in a YUV or RGB format.

Last week I heard about OpenMax. I built the examples in the folder /opt/vc/src/hello_pi, and I tested the example "hello_jpeg". I have no problems with lower resolution (320x240, JPEG-RGB conversion time: 10ms), but when I tested it with a 640x480 image, the time conversion is around 2 seconds.

Has somebody tried before this algorithm with high resolution images? I need to use OpenMax because software conversion needs a lot of time.

Thanks for your help.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenMax JPEG - Raspberry Pi

Tue Oct 29, 2013 2:08 pm

Does that include saving the result to SD card? Or is that in memory conversion?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

emabellor
Posts: 3
Joined: Tue Oct 29, 2013 1:51 pm

Re: OpenMax JPEG - Raspberry Pi

Tue Oct 29, 2013 3:30 pm

jamesh wrote:Does that include saving the result to SD card? Or is that in memory conversion?
No, I send the image stream by http using mjpeg_streamer. Working on the code and reading the forum, I commented the following part in jpeg.c:

Code: Select all

	
//  if ((done == 0) || (decoder->pOutputBufferHeader == NULL))
//  sleep(1);
Now It seems to work. To convert 640x480 images, it requires 10ms.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenMax JPEG - Raspberry Pi

Tue Oct 29, 2013 4:30 pm

I have a feeling that the hello_jpeg code isn't as up to date as it needs to be - there are some odd bits of code in there.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

jviyer
Posts: 30
Joined: Mon Nov 04, 2013 3:48 pm

Re: OpenMax JPEG - Raspberry Pi

Sat Dec 07, 2013 8:48 pm

I have tried several files with hello_jpeg.bin, including a sample that was 320X240
In each case I get "did not receive executing stat -1" error.
The lowest resolution I tried was 320X240. for that I also get the addition line of output:
"No EOS event on image resizer 1"

any ideas what I could be doing wrong ?
On all the other hello_pi, I have built and executed and they all work fine except the "hello_jpeg.bin"

Return to “General discussion”