Postprocessing with PicoC

Started by desmovalvo, February 13, 2013, 01:43:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

desmovalvo

Hi, I'm looking for a way to edit photos on the camera with picoC scripts, but reading the API I could not find anything useful. Can you help me? I would like to open one or more images and elaborate them... Forgive me if my question is too silly :)

Fabio
EOS 1000d and EOS 1100d. standard 18-55  and 55-250mm f/4-5.6.

a1ex

It's very slow for this. Here's an example (it takes around 1 minute for a 720x480 image):


// image processing test

console_hide();
click(PLAY);
sleep(1);

// 5D Mark II only
// for others, look in platform/YOUR.CAMERA/consts.h for YUV422_LV_BUFFER_DISPLAY_ADDR
short * buf = *(short**)0x2900;

for (int i = 0; i < 480; i++)
{
    for (int j = 0; j < 720; j++)
    {
        // for each pixel, keep chroma, set luma to 0x80
        buf[i*720+j] = (buf[i*720+j] & 0x00FF) | 0x8000;
    }
}


So... consider using plain C. It's useful only for previewing, like fisheye correction, or averaging two images, or brightening/darkening.


desmovalvo

Thank you for the quick reply a1ex! ;) I'll give it a try! I only need to do some minor editing but if it's really too slow I'll switch to plain C!
Many thanks! I'll share with you my achievements :)

Fabio
EOS 1000d and EOS 1100d. standard 18-55  and 55-250mm f/4-5.6.