I guess we also have an enhanced pano function,thanks!
[I do not really understand how it works.
Hope this helps.
I have get absolutely nowhere trying to get this to work on my A620 AFTER I have pressed the shutter.
// Code to test the idea of an edge overlay// Put this after the line #include "motion_detector.h" in main.c#include "gui_draw.h"// until the edge thresh is put into conf structure I have hardcoded the threshold see "thresh" below#define MARGIN 30#define CALCYMARGIN 3#define DELAY 10#define MEMDELAY 10#define EDGECOLOR 0x26#define NSTAGES 8#define XINC 6#define YINC 2void edge_overlay(){ static char *imgbuf = 0; static int inmem=0; static int viewport_height; static int viewport_width;// screenwidth * 3 static int viewport_size; static int imgmem = 0; static int ymin = 0; static int thresh = 30; static int delay = 0; static int memdelay = 0; static int xoffset = 0; static int yoffset = 0; static unsigned char *img; int i, hi, c; int x, y, h, v, ymax, y1, x1; char * ptrh1; char * ptrh2; char * ptrv1; char * ptrv2; char * optr; //if(!conf.edge_thresh) return; img=((mode_get()&MODE_MASK) == MODE_PLAY)?vid_get_viewport_fb_d():((kbd_is_key_pressed(KEY_SHOOT_HALF))?vid_get_viewport_fb():vid_get_viewport_live_fb()); if (img==NULL){ img = vid_get_viewport_fb(); } viewport_height = vid_get_viewport_height(); viewport_width = screen_width * 3; viewport_size = viewport_height * screen_width; if(imgbuf == 0) imgbuf = malloc(viewport_size * 3); if((mode_get()&MODE_MASK) != MODE_PLAY) { if (kbd_is_key_pressed(KEY_RIGHT)) { xoffset -=XINC; delay = DELAY; } if (kbd_is_key_pressed(KEY_LEFT)) { xoffset +=XINC; delay = DELAY; } if (kbd_is_key_pressed(KEY_DOWN)) { yoffset -=YINC; delay = DELAY; } if (kbd_is_key_pressed(KEY_UP)) { yoffset +=YINC; delay = DELAY; } if (kbd_is_key_pressed(KEY_SHOOT_HALF)) { if(!(memdelay++)) { memcpy(imgbuf,img,viewport_size * 3); ymin = CALCYMARGIN; inmem = 1; xoffset = 0; yoffset = 0; } return; } else { if(memdelay) memdelay++; if(memdelay > MEMDELAY) memdelay = 0; if (inmem) { ymax = ymin + (screen_height - 2 * CALCYMARGIN) / NSTAGES; if(ymax > screen_height - CALCYMARGIN) ymax = screen_height - CALCYMARGIN; for (y=ymin; y<ymax; y++) { ptrh1 = imgbuf + y * viewport_width + 7; ptrh2 = imgbuf + y * viewport_width - 5; ptrv1 = imgbuf + (y + 1) * viewport_width + 1; ptrv2 = imgbuf + (y - 1) * viewport_width + 1; optr = imgbuf + y * viewport_width + 3; for (x=12; x<(screen_width- 4) * 3; x+=6) { h = ptrh1[x] - ptrh2[x]; if(h < 0) h = -h; v = ptrv1[x] - ptrv2[x]; if(v < 0) v = -v; optr[x] = h + v; h = ptrh1[x + 3] - ptrh2[x + 3]; if(h < 0) h = -h; v = ptrv1[x + 3] - ptrv2[x + 3]; if(v < 0) v = -v; optr[x + 2] = h + v; } } if(ymin < screen_height-CALCYMARGIN) delay = DELAY; ymin += (screen_height - 2 * CALCYMARGIN) / NSTAGES; } if((ymin >= screen_height-CALCYMARGIN)&& ((gui_get_mode() == GUI_MODE_NONE) || (gui_get_mode() == GUI_MODE_ALT))) { if(++delay > DELAY) {// thresh = (conf.edge_thresh - 1) * 10; for (y=MARGIN; y<screen_height-MARGIN; y++) { y1 = y + yoffset; if((y1 < CALCYMARGIN) || (y1 >= screen_height - CALCYMARGIN)) { for (x=MARGIN; x < screen_width - MARGIN; x+=2) { draw_pixel(x, y, 0); draw_pixel(x+1, y, 0); } } else { for (x=MARGIN; x < screen_width - MARGIN; x+=2) { x1 = x + xoffset; if((x1 < 12) || (x1 >= screen_width-13)) { draw_pixel(x, y, 0); draw_pixel(x+1, y, 0); } else { c = 0; if(imgbuf[y1 * viewport_width + x1 * 3 + 3] > thresh) c = EDGECOLOR;// else if(imgbuf[y * viewport_width + x * 3 + 3] > thresh/2)// c = 0x01; draw_pixel(x, y, c); c = 0; if(imgbuf[y1 * viewport_width + x1 * 3 + 5] > thresh) c = EDGECOLOR;// else if(imgbuf[y * viewport_width + x * 3 + 5] > thresh/2)// c = 0x01; draw_pixel(x+1, y, c); } } } } delay=0; } } } } }//End of edge detector code. next put edge_overlay(); after the line histogram_process();
Here is a new version that is split into stages, minimizes the amount of calculation when shooting, and has a vertical as well as horizontal edge calculation.
Does this have the potential to create "sperical" panoramas?
The new multipart version does not solve the problem so it is something other than a timing problem.
Started by hiker_jon General Help and Assistance on using CHDK stable releases
Started by d_w_ General Help and Assistance on using CHDK stable releases
Started by ultimA « 1 2 3 4 » General Discussion and Assistance
Started by rikrd Script Writing
Started by Zaphod General Discussion and Assistance