Save RAW files in DNG format instead of RAW - page 25 - Feature Requests - CHDK Forum

Save RAW files in DNG format instead of RAW

  • 392 Replies
  • 193640 Views
*

Offline reyalp

  • ******
  • 14098
Re: Save RAW files in DNG format instead of RAW
« Reply #240 on: 06 / December / 2008, 21:43:55 »
Advertisements
Nice!

Is it necessery to hold something in front of the lens, so the camera takes a "darkframe", in order to create the badpixel file?
No, bad pixels are detected by having a zero value, which is done automatically by the camera (presumably from it's own bad pixel list or other detection mechanism)
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Save RAW files in DNG format instead of RAW
« Reply #241 on: 07 / December / 2008, 05:49:04 »
Add this to the line above the shoot command;

if get_propset() == 2 then
   set_prop(264,0)
else
   set_prop(69,0)
end

That will automatically set the shutter to 1".

This will work not truly. The propcaeses 264 or 69 should be set after shoot_half. But then the script is not working.

set_raw(255) is a weird construction. :) After this command it's not possible setting other commands as shoot(). Only shoot() is working. Neither a loop nor a setting like above seems to work.

We need a right solution to set a defined shutter speed.
CHDK-DE:  CHDK-DE links

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Save RAW files in DNG format instead of RAW
« Reply #242 on: 07 / December / 2008, 06:00:48 »
Almost, but not quite. First, the propset 1 prop should be 40, not 69 (user tv). And after that, the above is better done this way nowadays:

props=require "propcase"
set_prop(props.TV,0)
shoot()

But this is no good because it only works in Tv mode (and in M mode in those cameras in which M mode is a combined Av+Tv mode, not a modified P or AUTO mode).

To really change Tv in any mode, one should use the "Tv for next shot" propcase (69/262), which must be set after autoexposure if it's enabled. Some of Allbest's set_tv* commands probably do this but they're poorly documented and have/had bugs at 1 second tv and I still haven't had the motivation to figure them out from the source. So I suggest this instead:


props=require "propcase"
-- 1 second Tv:
tv=0
-- 0.5 second Tv:
-- tv=96
press("shoot_half")
repeat
  sleep(1)
until get_shooting() == true
set_prop(propcase.TV, tv)
press("shoot_full")


Note: All these propcases take tv96 (96 per full Ev stop, centered at 0==1 second, positive==faster exposure). There's an old script command set_tv which uses enumerated id's from (range for s3is -12 to 35, not the same range for all cameras due to different available steps by Canon) to change the "user Tv" propcase, I think. Those steps are definded by CHDK in platform/*/shooting.c shutterspeeds_table[].



Re: Save RAW files in DNG format instead of RAW
« Reply #243 on: 07 / December / 2008, 06:03:34 »
Why the second exif time dng file are different exif jpg file?
Normally the dng file use jpg exif info, but times there is 1 second between the dng and the jpg exif information.
This is a problem with lightroom because it use exif info to link the dng and the jpg.


*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Save RAW files in DNG format instead of RAW
« Reply #244 on: 07 / December / 2008, 06:17:27 »
Why the second exif time dng file are different exif jpg file?
Normally the dng file use jpg exif info, but times there is 1 second between the dng and the jpg exif information.

DNG don't use any EXIF info from jpg, because it saved before jpg is created.
But I have another question: if exposure time is, for example, 10 seconds,  which time must be written in dng? Time when shutter is open, or when shutter is closed, or simple average time?

Re: Save RAW files in DNG format instead of RAW
« Reply #245 on: 07 / December / 2008, 06:34:32 »
But why the jpg file does not have the same hour in the EXIF data that the dng file?

And i think it's the time when shutter is open if the exposure time is 10 seconds.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Save RAW files in DNG format instead of RAW
« Reply #246 on: 07 / December / 2008, 07:09:55 »
@fudgey

Thats all right what you wrote. But it is not the problem.

This is the working script:
Code: (lua) [Select]
--[[
@title Create badpixel.bin
]]
if "A/CHDK/badpixel.bin" then
os.remove("A/CHDK/badpixel.bin")
end

print("Wait please...")
sleep(1500)
a=get_raw()

set_raw(255)

shoot()

print("bad pixel count:",get_raw())
set_raw(a)

os.rename("A/CHDK/bad_tmp.bin", "A/CHDK/badpixel.bin")

sleep(1500)

os.remove("A/CHDK/bad_tmp.bin")

print("Done.")

when I replace shoot() with:
Code: (lua) [Select]
props=require "propcase"
-- 1 second Tv:
tv=0
-- 0.5 second Tv:
--tv=96
press("shoot_half")
repeat
  sleep(1)
until get_shooting() == true
set_prop(props.TV, tv)
press("shoot_full")
release("shoot_full")
release("shoot_half")

the shooting is ok, but set_raw(255) will not work. There is no file created. That's my problem.
CHDK-DE:  CHDK-DE links

Re: Save RAW files in DNG format instead of RAW
« Reply #247 on: 07 / December / 2008, 09:15:56 »
The code I posted worked fine for me. I didn't realize it has flaws.
________________________
Jim Manning
Canon Powershot S5 IS (1.01b)


*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Save RAW files in DNG format instead of RAW
« Reply #248 on: 07 / December / 2008, 10:55:13 »
@binsurf

Which mode are you using?

I can't doubt, that your code is right running - sorry.  :-[


Has somebody a good and working idea for a solution of this problem? I think a simple and automatic script is a good thing to create the badpixel.bin for everybody.
CHDK-DE:  CHDK-DE links

*

Offline ewavr

  • ****
  • 1057
  • A710IS
Re: Save RAW files in DNG format instead of RAW
« Reply #249 on: 07 / December / 2008, 14:23:57 »
Well, here is other version of script.
It sets Tv=0.5s and makes 2 shoots to verify that result is the same.
Tested on SX100 in Auto and P modes.

Code: (lua) [Select]
--[[
@title Create badpixel.bin
]]

function get_bad_count()
 a=get_raw()
 set_raw(255)
 set_tv96_direct(96)
 shoot()
 b=get_raw()
 set_raw(a)
 return b
end

print("Wait please...")
sleep(1500)
x1=get_bad_count()
x2=get_bad_count()
if (x1==x2) then
 print("Bad pixel count: ", x1)
 print("press SET to save file,")
 print("or other key to exit")
 wait_click(0)
 if is_pressed "set" then
  os.remove("A/CHDK/badpixel.bin")
  os.rename("A/CHDK/bad_tmp.bin", "A/CHDK/badpixel.bin")
  print("File is saved.");
 end
 os.remove("A/CHDK/bad_tmp.bin")
 else
  print("Try this script again...")
 end

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal