bitluni / LEDWallCamera

102 stars 23 forks source link

refactoring downsample? #5

Open dromer opened 4 years ago

dromer commented 4 years ago

So, what I was playing with is instead using something like

    sensor->set_quality(sensor, 35);

And then don't bother with averaging every block of 4*4 pixels, but instead just skip across the pixels like

    unsigned char p[3];
    getPixel(x * 4, y * 4, frame, p);
    newImage[y][x][0] = p[0];
    newImage[y][x][1] = p[1];
    newImage[y][x][2] = p[2];
bitluni commented 4 years ago

Thanks for the suggestion, nice trick! I didn't see the need for optimization yet but that would be a way. I'd kick the down sampling first, too. Since the resolution is so low there was no need though

dromer commented 4 years ago

Yup. I've been using your code with https://github.com/JanKlopper/pixelvloed which basically sends the pixels over UDP and I quickly ran in to memory problems with the ESP, so I figured I'd try to cut costs where I could :)