gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

[QUESTION] How to mimic autofocus functionality on camera

Open mexicantexan opened this issue 2 years ago • 1 comments

Describe the bug Not a bug, just a question. On my Nikon D7200, I have the ability to tap the touch screen on the back or move a cursor to autofocus on a specific point. In the config dictionary I get back from the camera I saw this entry:

{
          "idx": "6,6,0,0",
          "ro": 0,
          "name": "changeafarea",
          "label": "Set Nikon Autofocus area",
          "type": 2,
          "typestr": "GP_WIDGET_TEXT",
          "value": "0x0"
 }

Is this where I would make the adjustment to get the desired functionality? I've adjusted it with various inputs, but haven't seen any changes and am slightly lost at this point.

Name the camera Nikon D7200

libgphoto2 and gphoto2 version gphoto2 2.5.23

To Reproduce Current code in python

import gphoto2 as gp

camera = gp.check_result(gp.gp_camera_new())
context = None
gp.check_result(gp.gp_camera_init(camera, self.context))

config_name =  "changeafarea"
value = "100x100"  # in my code I have it linked up to PyQt5 window where I am clicking around the live-view and the pixel value of where I clicked is being passed back and formatted into this string format

while True:
          # wait for config widget
          config_widget = gp.gp_camera_get_single_config(self.camera, config_name)
          if config_widget[1] is not None:
              break
config_widget = config_widget[1]
config_set_response = gp.gp_widget_set_value(config_widget, value)
print('set response:', gp.gp_widget_get_value(config_widget))
gp.gp_camera_set_single_config(camera, config_name, config_widget)

mexicantexan avatar Jan 31 '22 18:01 mexicantexan

I guess manually setting the focus, in general, would be helpful. I can't seem to find any differences in the configuration library when I manually adjust the manual focus myself :/

mexicantexan avatar Jan 31 '22 21:01 mexicantexan