Hi everybody,I am currently trying to find a way to analyze the color of pictures directly on a camera. What I would need is that the cam displays the average color intensities per pixel in the red, blue, and green channels. Since I have no experience with CDHK yet, I wanted to ask the experts in this forum, if writing such a script is feasible and if somebody without prior knowledge (just a bit of programming experience in C++ but that's already a while back) can realistically do it on a reasonable time scale.
Also, would it be necessary to use RAW images, i.e. do you know how color intensities are changed when the picture is transformed from RAW -> JPG?`
I am currently trying to find a way to analyze the color of pictures directly on a camera. What I would need is that the cam displays the average color intensities per pixel in the red, blue, and green channels.
I think you need to restrict your color area of interest to a small section of the screen. I can imagine turning your camera into a live spot color meter
Quote from: Davo on 05 / October / 2013, 06:22:15I think you need to restrict your color area of interest to a small section of the screen. I can imagine turning your camera into a live spot color meterThat is exactly what the SDM readYUV command does.
Quote from: Microfunguy on 05 / October / 2013, 06:25:43That is exactly what the SDM readYUV command does.My bad - I had never heard of that command.
That is exactly what the SDM readYUV command does.
Anyhoos, I forgot to mention that I recently started CHDK scripting from a C# background. I found Lua to be really easy to pick up and NotePad++ is great for writing the code.
--[[Spot Meter v1.1@title SpotMeter1.1@param a Columns @default a 5@param b md_rows @default b 5--]]require("drawings")function restore() set_console_autoredraw(1) print("done")endfunction meter(mode,x,y) -- measure mode Y=1, U=0, V=2, R=3, G=4, B=5 md_detect_motion( md_cols, md_rows, mode, 100, 100, 250, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10) return(md_get_cell_val(x,y))endset_console_autoredraw(0)cls()md_cols = amd_rows = bscreenwidth=360screenheight=240md_colsize=screenwidth/md_colsmd_rowsize=screenheight/md_rowsbox_X = (md_cols+1)/2box_Y = (md_rows+1)/2box = draw.add("rect", (box_X-1)*md_colsize, (box_Y-1)*md_rowsize, (box_X-1)*md_colsize+md_colsize, (box_Y-1)*md_rowsize+md_rowsize, "blue", 2)txtXpos = (screenwidth/2)-35txtYpos = screenheight-35rvalue=draw.add("string", txtXpos, txtYpos, "000", "black", "red")gvalue=draw.add("string", txtXpos+30, txtYpos, "000", "black", "green")bvalue=draw.add("string", txtXpos+60, txtYpos, "000", "black", "blue")if ( get_mode() == false ) then -- switch to shooting mode sleep(1000) set_record(1) while ( get_mode() == false) do sleep(100) endendrepeat i=9 repeat i=i+1 if (i >= 10) then i=0 red = meter(3,box_X,box_Y) green = meter(4,box_X,box_Y) blue = meter(5,box_X,box_Y) draw.replace(rvalue,"string", txtXpos, txtYpos, string.format("%03d",red), "white", "red") draw.replace(gvalue,"string", txtXpos+30, txtYpos, string.format("%03d",green), "white", "green") draw.replace(bvalue,"string", txtXpos+60, txtYpos, string.format("%03d",blue), "white", "blue") end draw.overdraw() wait_click(100) until not( is_key("no_key")) if ( is_key("left") and (box_X>1)) then box_X=box_X-1 elseif ( is_key("right") and (box_X<md_cols)) then box_X=box_X+1 elseif ( is_key("up") and (box_Y>1)) then box_Y=box_Y-1 elseif ( is_key("down") and (box_Y<md_rows)) then box_Y=box_Y+1 elseif ( is_key("set")) then box_X = (md_cols+1)/2 box_Y = (md_rows+1)/2 end draw.replace(box,"rect", (box_X-1)*md_colsize, (box_Y-1)*md_rowsize, (box_X-1)*md_colsize+md_colsize, (box_Y-1)*md_rowsize+md_rowsize, "blue", 2) draw.redraw()until ( is_key("menu") )restore()
Started by mx3 « 1 2 3 » General Discussion and Assistance
Started by LjL General Chat
Started by Nikki Feature Requests
Started by KaLi General Help and Assistance on using CHDK stable releases
Started by SticK « 1 2 ... 46 47 » RAW Shooting and Processing