I'm trying to write a script which takes an action when the camera takes a photo containing a certain image (say a big red box).
Reading off the display screen should work too
You will need to write a function like color = get_lcd_pixel(x,y) which would be a very useful addition to chdk.
what kind of things were you thinking it might be used for?
Image processing like AForge.NET uses is a real cpu hog. I am not sure how lua script calls compare speed wise to the compiled builds so it might be better to include some high level calls in chdk instead.
Since we have loadable modules, an image processing module could be written in C or assembler without unnecessarily bloating CHDK for people who don't need it.
--[[@title Pixel Value Test]]screenwidth=360screenheight=240if ( get_mode() == false ) then set_record(1) while ( get_mode() == false ) do sleep(100) endendsleep(2000)repeat row = screenheight/3 col = screenwidth/2 press("shoot_half") repeat sleep(100) until get_shooting() == true y = md_get_pixel_val(1,col,row) u = md_get_pixel_val(0,col,row) v = md_get_pixel_val(2,col,row) r = md_get_pixel_val(3,col,row) g = md_get_pixel_val(4,col,row) b = md_get_pixel_val(5,col,row) for i=1, 50, 1 do draw_string( 10, ((screenheight/3)*2) , string.format("Y:%d U:%d V:%d R:%d G:%d B:%d",y,u,v,r,g,b) , 258, 263) draw_rect( col-6, row-6, col+6,row+6, 263, 3) sleep(100) end draw_clear() release("shoot_half") repeat sleep(100) until get_shooting() == falseuntil (false)
@philmoz : if you can spare a couple of minutes, would you check for me to see if I correctly interpreted the pixel code you put into motion_detect.c ? TIA ..
Started by hiker_jon Feature Requests
Started by fjanton DSLR Hack development
Started by Jeremy McGhie General Discussion and Assistance
Started by kdsee General Help and Assistance on using CHDK stable releases
Started by Steev General Discussion and Assistance