IS Programatic Control - page 2 - Feature Requests - CHDK Forum  

IS Programatic Control

  • 19 Replies
  • 8582 Views
Re: IS Programatic Control
« Reply #10 on: 27 / November / 2012, 13:53:29 »
Advertisements
Application to 3d pairs
I can understand the movement isn't enough to converge near, but what if you mounted the cameras with toe-in to the sweet spot, then adjust +- with tilt?

Well, are you volunteering to find the function addresses (see S95 100H example above) for all cameras ?

In addition, SDM's sister software SPM (StereoPhoto Maker) easily auto-corrects toe-in and other errors :

http://stereo.jpn.org/eng/stphmkr/index.html

The up/down movement would be useful for eliminating vertical errors if it could be done one pixel at a time.

Re: IS Programatic Control
« Reply #11 on: 27 / November / 2012, 13:56:26 »
Can you help me get this working on any of my cameras? 

As a 'hack' it is extremely simple, you just call the firmware functions, there are no parameters.
I cannot remember how I found the addresses from the information I gave above.

Philmoz, reyalp or others may be able to offer a suggestion.

Re: IS Programatic Control
« Reply #12 on: 27 / November / 2012, 14:02:04 »
From looking at the comments, I see that there's a zero-terminated listing of functions names.  How did you find the addresses corresponding to those functions? 
And yes, it seems obvious that those 4 functions would require no arguments, and though not very useful by themselves, at least I can test the amount of movement for my cameras.  If we can document how the problem was solved, others can do it for their models if they want to.

In the German build, by default there's the ability to register eventproc's, so I could simply write a script, but I don't know exactly how this is done.
« Last Edit: 27 / November / 2012, 14:03:37 by jmac698 »

Re: IS Programatic Control
« Reply #13 on: 27 / November / 2012, 14:24:11 »
How did you find the addresses corresponding to those functions? 

As I said, I cannot remember .. unfortunately.

The functions are quite distinctive in that they each call FFB67000 with a different parameter and then FF87F398.

Code: [Select]
ROM:FFB666E0 ; ---------------------------------------------------------------------------
ROM:FFB666E0                 STMFD   SP!, {R4,LR}
ROM:FFB666E4                 MOV     R0, #3
ROM:FFB666E8                 BL      sub_FFB67000
ROM:FFB666EC ; ---------------------------------------------------------------------------
ROM:FFB666EC                 LDMFD   SP!, {R4,LR}
ROM:FFB666F0                 B       sub_FF87F398
ROM:FFB666F4 ; ---------------------------------------------------------------------------
ROM:FFB666F4                 STMFD   SP!, {R4,LR}
ROM:FFB666F8                 MOV     R0, #2
ROM:FFB666FC                 BL      sub_FFB67000
ROM:FFB66700 ; ---------------------------------------------------------------------------
ROM:FFB66700                 LDMFD   SP!, {R4,LR}
ROM:FFB66704                 B       sub_FF87F398
ROM:FFB66708 ; ---------------------------------------------------------------------------
ROM:FFB66708                 STMFD   SP!, {R4,LR}
ROM:FFB6670C                 MOV     R0, #1
ROM:FFB66710                 BL      sub_FFB67000
ROM:FFB66714 ; ---------------------------------------------------------------------------
ROM:FFB66714                 LDMFD   SP!, {R4,LR}
ROM:FFB66718                 B       sub_FF87F398
ROM:FFB6671C ; ---------------------------------------------------------------------------
ROM:FFB6671C                 STMFD   SP!, {R4,LR}
ROM:FFB66720                 MOV     R0, #0
ROM:FFB66724                 BL      sub_FFB67000
ROM:FFB66728 ; ---------------------------------------------------------------------------
ROM:FFB66728                 LDMFD   SP!, {R4,LR}
ROM:FFB6672C                 B       sub_FF87F398



Re: IS Programatic Control
« Reply #14 on: 27 / November / 2012, 14:32:37 »
Ok, I'm learning from http://chdk.setepontos.com/index.php?topic=8833.msg92195#msg92195
Code: [Select]
propcase=require("propcase")

  -- check for native call interface:
  if (type(call_event_proc) ~= "function" ) then
    error("your CHDK does not support native calls")
  end

MoveISLensToRightLimitPositionproc="MoveISLensToRightLimitPosition"

--Register procs if needed (this is a dummy example)
    if (call_event_proc("RegisterISFuncs") == -1) then
      error("RegisterISFuncs failed")
    end

  --  MoveISLensToRightLimitPosition
  function  MoveISLensToRightLimitPosition()
    if (call_event_proc(MoveISLensToRightLimitPositionproc) == -1) then
      print("MoveISLensToRightLimitPosition failed")
    end
  end

From what I can guess, you need to call a register function before you can call from that group of functions.  Is this a property of CHDK itself or the Canon firmware?  If it's a mechanism of CHDK, what does this translate to? Do the functions eventually lead to the "stubs"?  Can I just call a Canon function by address?
Should I use
Code: [Select]
MoveISLensToRightLimitPositionptr=0xFFB666E0
call_func_ptr(MoveISLensToRightLimitPositionptr)

*

Offline lapser

  • *****
  • 1093
Re: IS Programatic Control
« Reply #15 on: 27 / November / 2012, 14:53:25 »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: IS Programatic Control
« Reply #16 on: 27 / November / 2012, 14:57:34 »
If you search Strings.txt for '.create' you will find something like :-

00025E7C   00025E7C      0   Capture.Create
00025E8C   00025E8C      0   Mecha.Create
00025E9C   00025E9C      0   FA.Create
00025EA8   00025EA8      0   System.Create
00025EB8   00025EB8      0   DispDev.Create
00025EC8   00025EC8      0   Driver.Create

I would guess Mecha.Create is the relevant one.

Quote
Can I just call a Canon function by address?

That is what I did.


*

Offline reyalp

  • ******
  • 14117
Re: IS Programatic Control
« Reply #17 on: 27 / November / 2012, 23:54:14 »
From what I can guess, you need to call a register function before you can call from that group of functions.  Is this a property of CHDK itself or the Canon firmware?
It's entirely defined by the Canon firmware. The eventprocs are available by name from Canon's own built in scripting language (http://chdk.wikia.com/wiki/Canon_Basic), and some of those eventprocs register other eventprocs. I made a fairly comprehensive list for a540 http://chdk.wikia.com/wiki/User:ReyalP/EventProcNotes but it's an old vxworks camera (without IS) so will not be completely right for newer cams.

If you have the address, then you can call it directly. However, you may have to adjust how the arguments are past. For example on many cameras if you call the address of PT_PlaySound with call_func_ptr, it will expect a single argument which is a pointer to the two real arguments, while if you call it as an call_event_proc, you must pass 2 individual and the canon enventproc system will automatically convert it (note the _PT_PlaySound in CHDK stubs will point to a lower level function on these cameras)

edit:
It's also worth noting that some of the registration eventprocs also do other things, so calling the functions directly may skip some expected initialization.

edit:
On my D10, many IS releated functions appear to be registered by StartImStEventProc, which itself is registered by Mecha.Create. The first function registered by this is "ISInitMotion"

MoveISLensTo* ect looks like they should be registered by InitializeAdjustmentSystem
« Last Edit: 28 / November / 2012, 00:22:20 by reyalp »
Don't forget what the H stands for.


Re: IS Programatic Control
« Reply #18 on: 27 / April / 2015, 11:40:09 »
Turns out that my ideas from 2012 were implemented by Pentax in 2013.

http://www.digitalcamerareview.com/review/pentax-astrotracer-review-astrophotography-made-easier/

This camera uses IS for super resolution and also a star tracker.  The GPS isn't necessary; I would just do a trial run and analyze the star trails, then provide an onscreen guide for positioning.  For that camera, at some lattitudes you can get up to 5 minutes tracking.  Nice to see that the idea actually works, now why didn't I patent it?

Re: IS Programatic Control
« Reply #19 on: 27 / April / 2015, 12:02:32 »
btw also my motion blur idea was used.  There is now a feature for simulating an antialiasing filter by just shifting the sensor around to blur the image. (the new Pentax K3)

http://www.dpreview.com/articles/8471769357/ricoh-unveils-pentax-k-3-ii-with-pixel-shift-resolution-mode

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal