Pixel level image processing - page 2 - LUA Scripting - CHDK Forum

Pixel level image processing

  • 10 Replies
  • 11636 Views
Re: Pixel level image processing
« Reply #10 on: 24 / February / 2013, 17:07:26 »
Advertisements
Haven't tested it; but I think the following change is needed:
change
    int y = y_pixel * vid_get_viewport_width();
to
    int y = y_pixel * vid_get_viewport_byte_width() * vid_get_viewport_yscale();
Working on "object recognition"script and I'm now getting strange crashes in the keyboard task that appear to be from calculating the offset into the display buffer so I'll try that.  Thanks

Update  1 :  that didn't fix it - something else must be wrong ... back to debugging 101

Update 2 :  seems to really not like this line (crashes with it in - works with it commented out)
Code: [Select]
img += vid_get_viewport_image_offset(); // offset into viewport for when image size != viewport size (e.g. 16:9 image on 4:3 LCD)Same line is in the standard MD code - but I'm hammering it thousands of times looking at each pixel and it doesn't always crash right way.

Update 3 : found the crash source - bad implementation of the vid_get_viewport_xxx() functions in lib.c for the A1200.   Looks like shooting_get_prop(PROPCASE_ASPECT_RATIO) returns a value greater than 3 at times?
« Last Edit: 24 / February / 2013, 19:24:46 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal