我正在尝试为尼康 D7200 设置自动对焦区域
我检索了配置对象并在其中看到了以下条目:
{
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "0x0"
},
我不太确定要传递哪些参数gp_camera_set_single_config()
根据我需要传入
的代码库gp_camera_set_single_config, ($self, name, widget, context)
为了将自动对焦的中心更改为像素 100x100 (WIDTH x HEIGHT),我尝试了以下命令,但没有真正到达任何地方。不知道是否有人碰巧知道如何传递这个参数?
import gphoto2 as gp
# setup
camera = gp.check_result(gp.gp_camera_new())
context = None
gp.check_result(gp.gp_camera_init(camera, self.context))
# Method 1
gp.gp_camera_set_single_config(camera, 'changefarea', '100x100')
# Method 2
gp.gp_camera_set_single_config(camera, '--changefarea', '100x100')
# Method 3
gp.gp_camera_set_single_config(camera, 'changefarea', {
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "100x100"
})
# Method 4
gp.gp_camera_set_single_config(camera, '--changefarea', {
"idx": "6,6,0,0",
"ro": 0,
"name": "changeafarea",
"label": "Set Nikon Autofocus area",
"type": 2,
"typestr": "GP_WIDGET_TEXT",
"value": "100x100"
})
更新 #1:
为了设置配置,您必须首先使用gp.gp_camera_get_single_config(camera, 'changefarea')
. 仍然不确定要传递哪些参数。