Accessing full resolution image data in playback mode? - General Discussion and Assistance - CHDK Forum

Accessing full resolution image data in playback mode?

  • 4 Replies
  • 5830 Views
Accessing full resolution image data in playback mode?
« on: 13 / October / 2008, 13:35:38 »
Advertisements
First, my apologies if this is already posted somewhere, however I did a little forum searching before posting this thread and couldn't find the answer. Thanks in advance for any tips you can offer.

I'm trying to access the full resolution image data in playback mode. Basically, I want to hook into the image browser/viewer system and do some processing of images that are loaded from the external memory card and displayed on the LCD.

It seems straightforward to access the LCD image (via the viewport functions), and the raw hook functions seem to permit ready access to captured raw images, but I haven't been able to find a way to get a handle on the image data for images that are loaded from the memory card in playback mode. All I need is a pointer to a buffer, or a function that will permit me to load the image from the memory card to a memory buffer myself, etc.

Thanks!

Re: Accessing full resolution image data in playback mode?
« Reply #1 on: 14 / October / 2008, 11:19:46 »
Hi Tim123,
I don't think CHDK knows where the full resolution image is in ram.  In fact I'm not sure that CHDK even knows what the filename of the current image is.  I sort of recall some progress on this, but couldn't find anything when I searched.

My guess is that the full resolution image is never stored in ram.  The jpg data is probably stored somewhere (not sure that CHDK knows where) and a routine converts that on the fly into data displayed in the viewport.

So if you want to do some image processing on images you need to use the viewport.  I have posted routines that can read and write the viewport image to a file.

If you want to snoop around looking for data relevant to the image being displayed I would suggest looking at memory locations near the memory location that holds the playback viewport address.  See the routine vid_get_viewport_fb_d().  When I poked around that location on the A570IS I found some locations that held the same data whenever I displayed the same image.

Jon

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Accessing full resolution image data in playback mode?
« Reply #2 on: 14 / October / 2008, 11:52:49 »
well, the progress hiker_jon talks about has been made here and here. there hasnt been an actual implementation into the trunk yet, as these adresses cannot be found analysing the firmwaredumps (yet!?). might give you some clues on where to search though, good luck :)

edit: these links will give info on how to obtain the filename of the currently shown item in playback. you may try to WRITE to these adresses to have a different jpg loaded? keep us posted about your findings please :)

Re: Accessing full resolution image data in playback mode?
« Reply #3 on: 14 / October / 2008, 14:14:36 »
Thank you both for the info.

Given that this is still a bit of a mystery, I think that I'm going to try using a port of libjpeg into the firmware to manually open the full-resolution image and override the camera buttons to implement my own version of the playback browser/viewer.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Accessing full resolution image data in playback mode?
« Reply #4 on: 14 / October / 2008, 14:49:53 »
A custom image browser has been discussed before by the way, see for example #64 in http://chdk.setepontos.com/index.php/topic,1373.0.html.

It's likely that you'll have some RAM issues to sort out as you probably can't have the entire JPEG in memory but must decode in smaller bits instead, hopefully libjpeg can do that as is. Or can the RAW buffer be used as RAM in play mode by CHDK (I think this has been discussed before as well)? Also, your viewer will probably be significantly slower than the original if it's hardware based.

But all that remains to be seen, good luck!

 

Related Topics


SimplePortal © 2008-2014, SimplePortal