sx700 porting - page 17 - DryOS Development - CHDK Forum
supplierdeeply

sx700 porting

  • 184 Replies
  • 103569 Views
*

Offline reyalp

  • ******
  • 14080
Re: sx700 porting
« Reply #160 on: 04 / November / 2020, 13:34:38 »
Advertisements
To be more presise on this topic: setting e.g.100 ISO via the Canon UI and e.g. 50 ISO via CHDK Menu and leave CHDK. In this case the camera takes an image if the shutter ist pressed (no shut of) and the EXIF data of the image ist updated to e.g. 50 ISO. In this case I would expect either an underexposed image or would have to set a +1EV exposure compensation. However the image is NOT underexposed but exposed like 100 ISO to stay with the example.
This is normal. On most cameras, ISO overrides to do not work much beyond the Canon range. The exif just reflects the requested value, not the exposure. On a camera with a base ISO of 100 you might get the equivalent of 90 or something like that, but I've never seen one do 50. The script c_joerg linked is good for measuring the limits objectively. The latest version is included in the CHDK/SCRIPT/TEST directory.

There can be some weirdness at the high end, because the last steps of Canon ISO are often implemented as post processing on jpeg data, but I'd be quite surprised if you can get say, ISO 3200 equivalent in raw data on a camera that only supports 1600

I'll check if I can reproduce the crash on my cams. It's not one I've seen before:
Code: [Select]
ASSERT!! CaptureAKBAD.c Line 549
Occured Time  2020:11:04 17:27:27
Task ID: 17891368
Task name: CaptSeqTask
Don't forget what the H stands for.

*

Offline CanonUser9000

  • *
  • 27
  • A570 - S95 - S100 - SX220 - SX700 - EOSM
Re: sx700 porting
« Reply #161 on: 06 / November / 2020, 06:35:55 »
Thank's a lot to reylap and c_joerg for the hints - got a much better understanding of ISOoverride now.

However while transfering my scripts from the other cams step by step, I found some more strange things at the SX700.

e.g. get_movie_status: return "1" both for "recording" and "pause", but "4" while storing to SD card. That differs from CHDK documentation and the behavior of other cams.

Keep you updated on more findings.

*

Offline CanonUser9000

  • *
  • 27
  • A570 - S95 - S100 - SX220 - SX700 - EOSM
Re: sx700 porting
« Reply #162 on: 18 / November / 2020, 05:02:31 »
re: script setfmode.lua

I've tested the script on my SX700 and got the following:

Use case for far SD:
- In <Alt> set Focus mode to "Ovr" and Focus dist mm to 10000
- start script
- CHDK OSD displays "SD:10000"
- leave <Alt>
- CHDK OSD sitll displays "SD:10000"
- Aim cam to a close subject e.g. at 200 mm (wide zoom lense)
- Take pic with shutter
- check pic: focus was set to an SD of 200 mm
In my point ov view the SD override ist not working as expected.

Use case for close SD:
- In <Alt> set Focus mode to "Ovr" and Focus dist mm to 100
- start script
- CHDK OSD displays "SD:100"
- leave <Alt>
- CHDK OSD sitll displays "SD:100"
- Aim cam to a far subject e.g. at 20000 mm
- Take pic with shutter
- CHDK OSD is now cleared
- check pic: focus was set to an SD of 100 mm as expected
However the focus mechanism of the cam now got stuck to this close SD while the CHDK OSD does not display any override. This only can be cleared by switching the cam off/on or changing the focus mode via Canon UI.

Most likely I've missunderstood the purpose of the script, but as far as I can see it does more or less the same as MF on the Canon UI does. So I would be happy to got more information how to use setfmode.lua correctly.

Another question would be how to use the script within a focus stacking script. Because I'm not very good at programming and scripting I will value any hints.

Thanks a lot in advance.

*

Offline reyalp

  • ******
  • 14080
Re: sx700 porting
« Reply #163 on: 19 / November / 2020, 00:06:21 »
re: script setfmode.lua
...
This script is mainly intended for people using cameras without MF, so they can use CHDK SD override as a replacement. Especially for cameras that require set_mf or set_aflock for overrides to work, and do not have a way in the firmware UI to enter those states.

Since SX700 has manual focus and af lock in the normal Canon UI, there should be little reason to use the script.

Quote
I've tested the script on my SX700 and got the following:

Use case for far SD:
- In <Alt> set Focus mode to "Ovr" and Focus dist mm to 10000
- start script
- CHDK OSD displays "SD:10000"
- leave <Alt>
- CHDK OSD sitll displays "SD:10000"
- Aim cam to a close subject e.g. at 200 mm (wide zoom lense)
- Take pic with shutter
- check pic: focus was set to an SD of 200 mm
In my point ov view the SD override ist not working as expected.
This does seem incorrect. Do you have "safety MF" enabled in the Canon UI? If it's on, it might not keep the focus you set.

Does the focus seem to change when you run the script, or when you half press the shutter before shooting?

Quote
Use case for close SD:
- In <Alt> set Focus mode to "Ovr" and Focus dist mm to 100
- start script
- CHDK OSD displays "SD:100"
- leave <Alt>
- CHDK OSD sitll displays "SD:100"
- Aim cam to a far subject e.g. at 20000 mm
- Take pic with shutter
- CHDK OSD is now cleared
- check pic: focus was set to an SD of 100 mm as expected
However the focus mechanism of the cam now got stuck to this close SD while the CHDK OSD does not display any override. This only can be cleared by switching the cam off/on or changing the focus mode via Canon UI.
You should be able to return to the normal state by setting the focus mode to auto in the normal canon UI. You may need to rotate through the options if it's already on AF.


Quote
Another question would be how to use the script within a focus stacking script. Because I'm not very good at programming and scripting I will value any hints.
You shouldn't need to.

SX700 needs to be in MF or AF lock mode for focus overrides to work. If the focus stacking script does not automatically set one of those, you could either set it using the canon UI before hand, or add a line like
Quote
set_mf(1)
near the start of the script.
Don't forget what the H stands for.


*

Offline CanonUser9000

  • *
  • 27
  • A570 - S95 - S100 - SX220 - SX700 - EOSM
Re: sx700 porting
« Reply #164 on: 19 / November / 2020, 08:27:54 »
Thanks to reyalp for the clarification on setfmode.lua .

Quote
Quote

    I've tested the script on my SX700 and got the following:

    Use case for far SD:
    - In <Alt> set Focus mode to "Ovr" and Focus dist mm to 10000
    - start script
    - CHDK OSD displays "SD:10000"
    - leave <Alt>
    - CHDK OSD sitll displays "SD:10000"
    - Aim cam to a close subject e.g. at 200 mm (wide zoom lense)
    - Take pic with shutter
    - check pic: focus was set to an SD of 200 mm
    In my point ov view the SD override ist not working as expected.

This does seem incorrect. Do you have "safety MF" enabled in the Canon UI? If it's on, it might not keep the focus you set.

No, "Safety MF" and all other focus options from the Canon UI were disabled for all the tests.

Code: [Select]
SX700 needs to be in MF or AF lock mode for focus overrides to work. If the focus stacking script does not automatically set one of those, you could either set it using the canon UI before hand, or add a line like
Quote

    set_mf(1)

near the start of the script.

Quite sure, my focus bracketing script (that runs well on the other cams) uses set_mf.

But I did some more tests and belive now that I've figured out what the problem with SD override on the SX700 seems to be.

While the get_focus function gives am maximum value of approx. 350000 back on this cam (or -1), the set_focus function is obviously limitied to a maximum value of 65535. Using only a value range of 0...65535 for the set_focus fuction let work the focus stacking script well.

And btw, I've tested to set the focus override directly via the CHDK menu too (build 5623). Here seems to be a problem: regrardless of the option (On/Off/Inf) and values choosen, there will be no override displayed on the CHDK OSD and no setting of focus on the cam happens.


*

Offline reyalp

  • ******
  • 14080
Re: sx700 porting
« Reply #165 on: 19 / November / 2020, 13:44:09 »
While the get_focus function gives am maximum value of approx. 350000 back on this cam (or -1), the set_focus function is obviously limitied to a maximum value of 65535. Using only a value range of 0...65535 for the set_focus fuction let work the focus stacking script well.
This is strange. There shouldn't be any such limit on this camera, and I don't see anything like that on SX710, which has similar optics and port settings.

Is your script Lua or ubasic? Can you post it here?

Note that at wide angles, the subject distance will go to -1 at quite close distances, probably before 64k.

Also, the DOF calculator setting "Use EXIF Subj. dist" also affects setting in a poorly specified way, but it doesn't seem to have a 64k limit. In any case, I'd suggest leaving that setting off.

Quote
And btw, I've tested to set the focus override directly via the CHDK menu too (build 5623). Here seems to be a problem: regrardless of the option (On/Off/Inf) and values choosen, there will be no override displayed on the CHDK OSD and no setting of focus on the cam happens.
As I mentioned, this camera must be in MF or AF lock for SD override to work. Does the override appear if you enable MF using the Canon UI?
Don't forget what the H stands for.

*

Offline CanonUser9000

  • *
  • 27
  • A570 - S95 - S100 - SX220 - SX700 - EOSM
Re: sx700 porting
« Reply #166 on: 20 / November / 2020, 05:41:07 »
Code: [Select]
Is your script Lua or ubasic? Can you post it here?FocusBrack.bas attached. German GUI and not well documented, but should be more or less selfexplaining.

Code: [Select]
As I mentioned, this camera must be in MF or AF lock for SD override to work. Does the override appear if you enable MF using the Canon UI?
Ooops, I've missed setting to MF - ist works like expected then.

*

Offline reyalp

  • ******
  • 14080
Re: sx700 porting
« Reply #167 on: 20 / November / 2020, 22:37:57 »
Code: [Select]
Is your script Lua or ubasic? Can you post it here?FocusBrack.bas attached. German GUI and not well documented, but should be more or less selfexplaining.
Looking at the script, it treats 64k as infinity. Unless this is a version you modified to stay below 64k?
Code: [Select]
print "Schritt " r,"Dist.",g,"mm"
if t=0 then g=g+c
if t=1 then g=g+c*i
if t=2 then g=g+c*i*i
if g>65530 then goto "infinity"
next i

:infinity
g = 65534
set_focus g
sleep 100

It's possible this was originally written a long time ago, for old cameras that used to short for focus distance.

Assuming this isn't a modification you made to keep it below 64k, you could either use larger numbers instead of 65530 and 65534, or change the logic to just end when get_focus returns -1. The second option would be better, IMO, because the distance the camera changes to -1 depends on the zoom, so if you use a fixed number, you might get many "infinity" shots in some cases.

Something like
Code: [Select]
...
for i=1 to s
r=i
set_focus g
sleep 500
shoot
print "Schritt " r,"Dist.",g,"mm"
if get_focus = -1 then goto "done"
if t=0 then g=g+c
if t=1 then g=g+c*i
if t=2 then g=g+c*i*i
next i

:done
set_mf 0
playsound 0
end

Note that the way this script is written, it may take multiple shots at the same focus distance, because it set_focus only goes to specific positions. Example from sx710 at wide angle (using chdkptp):
Code: [Select]
con 1> =set_mf(1)
con 2> =set_focus(100) return get_focus()
3:return:100
con 3> =set_focus(1000) return get_focus()
4:return:1021
con 4> =set_focus(1500) return get_focus()
5:return:1421
con 5> =set_focus(2000) return get_focus()
6:return:1833
con 6> =set_focus(3000) return get_focus()
7:return:2586
con 7> =set_focus(4000) return get_focus()
8:return:3939
con 8> =set_focus(5000) return get_focus()
9:return:3939
con 9> =set_focus(6000) return get_focus()
10:return:-1
Notice that 4000 and 5000 both set the distance to 3939, and 6000 is "infinity" already.
Don't forget what the H stands for.


*

Offline CanonUser9000

  • *
  • 27
  • A570 - S95 - S100 - SX220 - SX700 - EOSM
Re: sx700 porting
« Reply #168 on: 22 / November / 2020, 04:40:34 »
Quote
Assuming this isn't a modification you made to keep it below 64k, you could either use larger numbers instead of 65530 and 65534, or change the logic to just end when get_focus returns -1. The second option would be better, IMO, because the distance the camera changes to -1 depends on the zoom, so if you use a fixed number, you might get many "infinity" shots in some cases.

Yes, this was the intention as it can be derived from the DHDK docu. Anyway, to use -1 from get_focus to exit the loop is much better - thanks for the hint.

Quote
Notice that 4000 and 5000 both set the distance to 3939, and 6000 is "infinity" already.
A valuable insight for me too, that get_focus can deliver a different value as set with set_focus and that the maximum values near "infinity" differs heavily from the zoom setting. Thank's again.

*

Offline reyalp

  • ******
  • 14080
Re: sx700 porting
« Reply #169 on: 22 / November / 2020, 15:11:14 »
A valuable insight for me too, that get_focus can deliver a different value as set with set_focus and that the maximum values near "infinity" differs heavily from the zoom setting. Thank's again.
Yes. Focus actually works in positions of the focus mechanism, and there's some formula in the camera (original firmware, not CHDK) which converts from or to distance. As you'd expect from the optics involved, small changes in position correspond to large changes in distance as you get closer to infinity.

Forum member pigeonhill created some sophisticated focus stacking scripts here: https://chdk.setepontos.com/index.php?topic=13638.0
Don't forget what the H stands for.

 

Related Topics