IR focusing beyond infinity? - General Help and Assistance on using CHDK stable releases - CHDK Forum  

IR focusing beyond infinity?

  • 16 Replies
  • 7494 Views
IR focusing beyond infinity?
« on: 24 / May / 2015, 18:36:54 »
Advertisements

I have modified an A4000 for taking IR photos and having some issues with manual focus. With autofocus, the camera works perfectly 80% of the time. Photos are sharp almost always, but occasionally the autofocus gets it wrong (unsure why). I am taking all far away shots, so what I would like to do is just set it to infinity. The issue is that the infinity focus point is a bit different with the IR conversion. I am trying to use CHDK to manually focus where I want it, but it doesn't seem to have any effect beyond the infinity setting.

If I use manual focus and set infinity, the SD gets set to around 1600. The issue is that when I go higher than this it doesn't seem to have any effect and the pics never get sharper. I know the camera can focus beyond there because it will do it in autofocus mode.

Is there some software limit I need to remove? Any other ideas? Thanks for any tips in advance!

Re: IR focusing beyond infinity?
« Reply #1 on: 24 / May / 2015, 21:15:44 »
The issue is that the infinity focus point is a bit different with the IR conversion.
While that may be technically correct,  the DOF on these little cameras with their little lenses and sensor tends to make everything beyond 5 meters the same when you set for "infinity".   I don't think that should change much when using IR.

Quote
I am trying to use CHDK to manually focus where I want it, but it doesn't seem to have any effect beyond the infinity setting.
If I use manual focus and set infinity, the SD gets set to around 1600.
Where are you getting the 1600 number from?  If it's a CHDK OSD value then that is only 1.6 meters!

Quote
The issue is that when I go higher than this it doesn't seem to have any effect and the pics never get sharper. I know the camera can focus beyond there because it will do it in autofocus mode. Is there some software limit I need to remove? Any other ideas?
Unfortunately, the whole CHDK SD override process is hit & miss at best.  For example,  my S100 with accept SD override commands successfully but several other forum members cannot get the same results with their S100's.

I'd like to tell you there is a simple fix for this but so far all we have come up with is "some cameras work, some cameras" don't,

There is a long forum thread here : Setting focus from scripts or menus detailing a huge amount of work that went into this last year.  We had some success - especially with using SD overrides from scripts.  But there are still a lot of things we just don't understand or have not figured out the correct way to port.

Quote
I know the camera can focus beyond there because it will do it in autofocus mode.
It's my personal opinion that the whole SD override thing on the cheaper Powershots (the ones without built-in Canon MF capability) is something Canon left in the code but never tuned / calibrated.  The thread I posted above talks about comparing the focus mechanical position to the reported focus point and trying to work with that.  The results are interesing but inconclusive.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: IR focusing beyond infinity?
« Reply #2 on: 25 / May / 2015, 00:41:45 »
I have modified an A4000 for taking IR photos and having some issues with manual focus.
The issue is that the infinity focus point is a bit different with the IR conversion.
Any other ideas?
My "Guess" is that the removal of the IR Filter (i.e. IR conversion) has affected the Cameras
ability to correctly focus.

You may need to "Manually" "Re-Adjust" the Lens assembly focus or to "Substitute" something for the
removal of the IR Filter to restore the original "Optical" path.

H-H
« Last Edit: 25 / May / 2015, 00:52:18 by Hardware_Hacker »

Re: IR focusing beyond infinity?
« Reply #3 on: 25 / May / 2015, 09:27:46 »
Hm, seems I'm in uncharted waters (as usual!)

I was hoping this wouldn't be too challenging to do. If I fail here I could try to figure out why the autofocus fails to focus occasionally and try to fix it from that angle. I believe it just happens on lower contrast scenes. Seemed like locking focus to infinity should be the easy way!

I have been playing around with PTP to see if I can get it to focus where I want it through that interface.

Q: What does it mean when get_focus() returns -1? If I set focus manually on infinity, after shooting it returns -1. Likewise, when I autofocus (and get a sharp picture in IR), get_focus() also returns -1 afterwards. Does this mean the focus is adjusted beyond the calibrated part?

set_focus seems to work on this camera, but if I call it with anything above around 3000, get_focus later returns -1.

AFL seems to work well, but it would be quite annoying to have to auto focus on infinity and set AFL each time I use the camera.

Appreciate the help here guys.



Re: IR focusing beyond infinity?
« Reply #4 on: 25 / May / 2015, 09:59:07 »
I did a full sweep of set_focus shots and it doesn't seem that it will manually set focus beyond where the "infinity" is set. Autofocus will go beyond this point to get a sharp shot though.

Is it possible I can alter the camera's "infinity point" in software?

Re: IR focusing beyond infinity?
« Reply #5 on: 25 / May / 2015, 10:45:36 »
I did a full sweep of set_focus shots and it doesn't seem that it will manually set focus beyond where the "infinity" is set. Autofocus will go beyond this point to get a sharp shot though.

Is it possible I can alter the camera's "infinity point" in software?
You could try this :

http://chdk.setepontos.com/index.php?topic=9443.msg102557#msg102557

Also,  there was some work done with setting the lens focus mechanism manually,  trying to find a "good" infinity position.  The complete thread is here :
Manual Focus @ Infinity not working .   
There are several script variation posted over the course of the thread.   IIRC we never reached a truly satisfying conclusion but it might be enough for what you are trying to do.

[Hint : look for call_event_proc("MoveFocusLensWithPosition",p) ]

Forum Power User Tip:  If you want to quickly read through a long thread like the one I posted here,  select the "Print"  Option on the right hand side of the menu bar at the top of every forum page.  It will give you the entire thread in one "text only" web page.  I find that a lot easier to read through.
« Last Edit: 25 / May / 2015, 10:55:08 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: IR focusing beyond infinity?
« Reply #6 on: 25 / May / 2015, 11:35:28 »
Will check through those.

Maybe another solution would be for me to write a script that focuses, checks for focus success and if true sets AFL? It seems when the camera does not focus it usually "knows". May need to experiment with this more.

*

Offline blackhole

  • *****
  • 942
  • A590IS 101b
    • Planetary astrophotography
Re: IR focusing beyond infinity?
« Reply #7 on: 25 / May / 2015, 14:03:54 »
Quote
My "Guess" is that the removal of the IR Filter (i.e. IR conversion) has affected the Cameras
ability to correctly focus.

You may need to "Manually" "Re-Adjust" the Lens assembly focus or to "Substitute" something for the
removal of the IR Filter to restore the original "Optical" path.
This is true.

@arsenix
How do you modify the camera for infrared photography, scraping Bayer matrix and UV / IR coating on the sensor, removing the glass IR filter or did you do both? When you remove the IR filter, R channel is no longer in the same focal plane as the G and B channels, these may appear to be defocused.


Re: IR focusing beyond infinity?
« Reply #8 on: 25 / May / 2015, 19:48:41 »
I remove the IR block filter from inside the camera, then fit a high pass filter (in this case a 750nm) to the end of the lens barrel. I use the custom white balance function in the camera to rebalance the colors (or just shoot in raw). In general the photos are good quality and appear to be well focused, as long as the autofocus is used. I just can't get manual focus to work.

Re: IR focusing beyond infinity?
« Reply #9 on: 09 / June / 2015, 17:30:09 »
Revisiting this topic...

It seems the focusing issues are more complex than I thought. I have a number of cameras modified this way. Some of them work perfectly, and some just don't seem to be able to focus properly. In many cases, as they cycle through the autofocus cycle you can see the image come clear in the viewfinder, but it then defocuses before taking the photo. In all cases they seem to be fine at focusing on closer objects, but far away is often blurry.

Can anyone shed light on the focus algorithm for these cams? I had thought they just did a "seek" for the sharpest image, but that seems to not be the case.

Maybe if I use the CHDK focusing functions above it will allow me to focus them even on the ones where autofocus does not work? I have not yet tried this yet.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal