Manual Focus @ Infinity not working - page 5 - Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes) - CHDK Forum

Manual Focus @ Infinity not working

  • 151 Replies
  • 53142 Views
Re: Manual Focus @ Infinity not working
« Reply #40 on: 30 / October / 2014, 16:42:17 »
Advertisements
So i'm asking WW:
could we (I) set that mecha # via script? or that "FocusLensCurrentPosition" is a RO value we can get?
I've been thinking that it may come down to something like that. But I've been avoiding jumping to that conclusion because of the possibility of mechanical damage if it's done wrong.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Manual Focus @ Infinity not working
« Reply #41 on: 30 / October / 2014, 17:15:39 »
For the close focus, where did you measure from - the end of the lens or the sensor plane?

The code is a bit messy; but I think CHDK assumes you are measuring from the end of the lens. It then tries to adjust the value sent to the camera to convert it to the distance from the sensor.

If you measured from the sensor then you can try checking the 'Use EXIF Subj. Dist (PC65)' setting (CHDK Settings -> OSD Settings -> DOF Calculator). This will turn off the lens to sensor adjustment.

Phil.
This had come up before. As a matter of fact, I was just looking unsuccessfully for where reyalp and I discussed it.  It might explain the variation in closeup settings but not the "soft" focus some cameras see at infinity under set_focus ()?

No; but there might be some other adjustment needed for infinity.

The 'mecha' values being logged might hold a clue - if I understand correctly these are the focus position values. My understanding is this would be the position of the focus stepper motor, not the subject distance.

The close values are consistently larger for the out of focus images - this is consistent with the 'adjustment' factor being applied by CHDK to compensate for the sensor to lens distance.

The mecha values for infinity are consistently lower in the out of focus shots logged (if I'm reading the logs correctly). So the focus position used when CHDK selects infinity focus is closer than the one chosen by the camera.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Manual Focus @ Infinity not working
« Reply #42 on: 30 / October / 2014, 17:27:45 »
The 'mecha' values being logged might hold a clue - if I understand correctly these are the focus position values. My understanding is this would be the position of the focus stepper motor, not the subject distance.
Yes - that's been the assumption.  What the actual numbers mean is unclear - they never go to zero for example and seem to be different with different camera models for the same SD setting.

Quote
The close values are consistently larger for the out of focus images - this is consistent with the 'adjustment' factor being applied by CHDK to compensate for the sensor to lens distance.  The mecha values for infinity are consistently lower in the out of focus shots logged (if I'm reading the logs correctly). So the focus position used when CHDK selects infinity focus is closer than the one chosen by the camera.
Yea - that's pretty much where this is going so far.  Although lower mecha value imply farther SD points. So the CHDK set_focus(65535) mecha value might actually be out past infinity (and thus out of focus).   

Which implies that using something like set_focus(20000) for infinity (given the depth of field of the lens and the fact that is still past the hyperfocal limit) should give better results.  I think fabri22 tried that with his camera without much success.

Also, very detailed testing that was done with a couple of misbehaving S100's that had the focus going bad once the value passed to set_focus() was more than a meter or two.  And at that point, nothing was in focus ( near, mid, far objects all bad in the images). I bought an S100 to work on that problem,  but Mr Murphy selected mine and it works prefectly with set_focus() and I could not reproduce the issue.  I've pinged the original testers hoping for some new data.

« Last Edit: 30 / October / 2014, 17:35:44 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Manual Focus @ Infinity not working
« Reply #43 on: 30 / October / 2014, 17:44:41 »
Although lower mecha value imply farther SD points.

Hmm, missed that; but the logs seem to confirm it.

That blows my theory for the close values since the camera has focussed closer on the OOF images, not further away. Could be a problem with 'shooting_get_lens_to_focal_plane_width' or the functions it uses.

The stub for GetFocusLensSubjectDistanceFromLens on the A3100 is found using the really old signature matching method - it could be wrong.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline eponymous

  • *
  • 38
  • Canon A4000
Re: Manual Focus @ Infinity not working
« Reply #44 on: 30 / October / 2014, 17:57:04 »
Although lower mecha value imply farther SD points.

Hmm, missed that; but the logs seem to confirm it.

That blows my theory for the close values since the camera has focussed closer on the OOF images, not further away. Could be a problem with 'shooting_get_lens_to_focal_plane_width' or the functions it uses.

The stub for GetFocusLensSubjectDistanceFromLens on the A3100 is found using the really old signature matching method - it could be wrong.

Phil.


Infinity on my camera seems to give a mecha of 660-something and closer objects have higher values, but set_focus gets it down into the 650s, so it's focusing further away.

Any chance it's going too far? The set_focus() command when in manual mode must be really goofing things up in the lens. In my infinity photos it looks like nothing is in focus, even stuff 5 m away from the camera.

I think this is what WW is saying too.
John

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Manual Focus @ Infinity not working
« Reply #45 on: 30 / October / 2014, 18:00:35 »
Although lower mecha value imply farther SD points.

Hmm, missed that; but the logs seem to confirm it.

That blows my theory for the close values since the camera has focussed closer on the OOF images, not further away. Could be a problem with 'shooting_get_lens_to_focal_plane_width' or the functions it uses.

The stub for GetFocusLensSubjectDistanceFromLens on the A3100 is found using the really old signature matching method - it could be wrong.

Phil.


Infinity on my camera seems to give a mecha of 660-something and closer objects have higher values, but set_focus gets it down into the 650s, so it's focusing further away.

Any chance it's going too far? The set_focus() command when in manual mode must be really goofing things up in the lens. In my infinity photos it looks like nothing is in focus, even stuff 5 m away from the camera.

I think this is what WW is saying too.

That would be my guess - there is some other piece of the focussing logic that we are not taking into account.

Focussing beyond infinity would explain the completely out of focus images.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Manual Focus @ Infinity not working
« Reply #46 on: 30 / October / 2014, 18:18:32 »
I think this is what WW is saying too.
Yup - pretty much.   The test script will let you try closer values for the focus point.  What do your images look like if you use 5, 10, 20 or 30 meters as the Distance value ?  And what's the reported mecha position for each?
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Manual Focus @ Infinity not working
« Reply #47 on: 30 / October / 2014, 18:21:56 »
The stub for GetFocusLensSubjectDistanceFromLens on the A3100 is found using the really old signature matching method - it could be wrong.
I've wondered about that and the choice of the _MoveFocusLensToDistance routine.  Perhaps a look at the routine(s) that call that routine is in order at some point.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Manual Focus @ Infinity not working
« Reply #48 on: 31 / October / 2014, 06:44:52 »

For the close focus, where did you measure from - the end of the lens or the sensor plane?

I measured from the end of the lens.

As for the infinity focus, I confirm what eponymous and watterwingz say: my long distance photos (the MF ones) are completely out of focus, so they seem to confirm the past infinity guess from waterwingz
Canon A3100IS - 100d
CHDK a3100-100d-1.2.0-3643-full_ALPHA

Re: Manual Focus @ Infinity not working
« Reply #49 on: 31 / October / 2014, 07:51:01 »
As for the infinity focus, I confirm what eponymous and watterwingz say: my long distance photos (the MF ones) are completely out of focus, so they seem to confirm the past infinity guess from waterwingz
Would you try pointing the camera to something "off in the distance" and then using the script parameter called "Distance" to run the tests at 5. 10 and 20?

The first shot will be AF (autofocus) mode and should be at infinity (using the Canon firmware).  The next two will be under CHDK control. 

It will be interesting to see how the mecha position and actual focus in the images compare at those settings.

Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics