Help with get_exp_count - Script Writing - CHDK Forum supplierdeeply

Help with get_exp_count

  • 7 Replies
  • 3727 Views
*

Offline Mac

  • *
  • 40
Help with get_exp_count
« on: 14 / July / 2009, 21:14:26 »
Advertisements
Hi all!
Appreciate help finding INFO on get_exp_count.
My attemps to use have not produce anticipated results.
1.  The number returned if no images are on the card appears to be random (related to previous shooting?) Appears to get the number from CANON even if the camera doesn't use that number.
2.  The number does not always increment by one when taking a series of photos.

My application is with a LUA version of AutoHDR in which I would like to identify the first (nominal exposure) photo. and keep track of exposures and photo names.

Is there is a work-around or alternative to get_exp_count?

Thanks

*

Online reyalp

  • ******
  • 13878
Re: Help with get_exp_count
« Reply #1 on: 14 / July / 2009, 22:31:42 »
What camera ? Sounds like the function may be broken in that port.

Are you using continuous or autoreset numbering in the canon menu ? Does the number you are getting match the continuous number ?

In lua, you can also read params directly. The param display (in misc->debug) may help you find the right one.
Don't forget what the H stands for.

*

Offline Mac

  • *
  • 40
Re: Help with get_exp_count
« Reply #2 on: 15 / July / 2009, 11:30:38 »
Thank you for prompt response.
Sorry for not supplying INFO.
Cameras I am using are S2is and S5is - both with same problem regarding get_exp_count()
Reset is ON.

The number of the first photo taken as returned by get_exp_count() does not correspond to the number assigned to the photo stored on the disk if it is the only photo on the disk.  Appears (not sure) that the number returned is the number that would have been used if the previously taken photos hadn't been deleted. - ???
Numbers of subsiquent photos and get_exp_count() seem to be OK.

Reviewed propcase settings (http://chdk.wikia.com/wiki/PropertyCase) but found no propcase listed for determining number corresponding to the photo just taken - IMG_000#?

Has anyone found the appropriate propcase numbers for DIGIC II and DIGIC III with regards to photo numbers? (Does one even exist?)

Help/suggestions appreciated.

*

Offline Mac

  • *
  • 40
Re: Help with get_exp_count
« Reply #3 on: 15 / July / 2009, 12:33:55 »
Back again!
Tried the following script to find if ther was a prop setting corresponding to then number used to store image:

--Search for propcase corresponding to photo number
function Log(name)
   local i = 0
   repeat
      i = i + 1
      num = 1000 + i
      numstr = string.sub(tostring(num),-3)
      path = "A/CHDK/LOGS/"
      filename = path..name..numstr
      res,msg = io.open(filename)
      until not res
   io.output(io.open(filename,"a+"))
   end
function Record_Header()
   io.write("PropCase Script\n")
   io.write("Attempt to find propcase for photo numbers\n")
   io.write(os.date("%m/%d/%Y %X\n"))
   end
name="PropCase"
Log(name)
Record_Header()
for photo=1,5 do
   shoot()
   sleep(100)
   num=get_exp_count()
   for i = 1,299 do
      if num==get_prop(i) then
         io.write("Photo: ",photo,"  exp_count: ",num,"  Propcase: ",i,"\n")
         end
      end
   end
io.close()

Result: No value returned corresponded to image number.
Such is life.


*

Online reyalp

  • ******
  • 13878
Re: Help with get_exp_count
« Reply #4 on: 15 / July / 2009, 18:51:47 »
Reviewed propcase settings (http://chdk.wikia.com/wiki/PropertyCase) but found no propcase listed for determining number corresponding to the photo just taken - IMG_000#?
Params are not propcases.

Also, as I said before the actual count used may be combined with other numbers, so just searching for the exact value wouldn't necessarily find it anyway. See platform/generic/shooting.c get_exposure_counter() remembering that this is #included from platform/<yourplatform>/shooting.c

Don't forget what the H stands for.

*

Offline Mac

  • *
  • 40
Re: Help with get_exp_count
« Reply #5 on: 15 / July / 2009, 20:41:46 »
Thanks for your response.
Apologize for my ignorance regarding params and props.  Only a key pounder.
Script works fine today. 
Only difference is that no dark frame subtraction was used to take the HDR photos.
Don't know how this relates but definite correlation.
Thanks again.

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Help with get_exp_count
« Reply #6 on: 26 / July / 2009, 10:53:47 »
Does it work perfectly if you either
1) don't let the camera reset image counter
or
2) always shoot one dummy shot before starting your script?

*

Offline Mac

  • *
  • 40
Re: Help with get_exp_count
« Reply #7 on: 26 / July / 2009, 21:19:05 »
get_exp_count always works for me if there is already a photo on the chip.
With no photos saved, the number returned is unpredictable.


 

Related Topics