mirror of
https://github.com/opencv/opencv.git
synced 2026-11-13 11:59:33 -06:00
python: align setMouseCallback argument names with its keywords
Same change as the 5.x port, to keep the two branches in sync.
The wrapper parses window_name, on_mouse and param, but the cv2.cpp help
text and the typing stub in api_refinement.py both say windowName and
onMouse, so the stub promises keywords the runtime rejects:
>>> cv2.setMouseCallback(windowName="w", onMouse=cb)
TypeError: function missing required argument 'window_name' (pos 1)
createTrackbar is left alone: it is registered METH_VARARGS, so its
arguments cannot be passed by keyword at all.
This commit is contained in:
@@ -115,7 +115,7 @@ static PyMethodDef special_methods[] = {
|
||||
#ifdef HAVE_OPENCV_HIGHGUI
|
||||
{"createTrackbar", (PyCFunction)pycvCreateTrackbar, METH_VARARGS, "createTrackbar(trackbarName, windowName, value, count, onChange) -> None"},
|
||||
{"createButton", CV_PY_FN_WITH_KW(pycvCreateButton), "createButton(buttonName, onChange [, userData, buttonType, initialButtonState]) -> None"},
|
||||
{"setMouseCallback", CV_PY_FN_WITH_KW(pycvSetMouseCallback), "setMouseCallback(windowName, onMouse [, param]) -> None"},
|
||||
{"setMouseCallback", CV_PY_FN_WITH_KW(pycvSetMouseCallback), "setMouseCallback(window_name, on_mouse [, param]) -> None"},
|
||||
#endif
|
||||
#ifdef HAVE_OPENCV_DNN
|
||||
{"dnn_registerLayer", CV_PY_FN_WITH_KW(pyopencv_cv_dnn_registerLayer), "registerLayer(type, class) -> None"},
|
||||
|
||||
Reference in New Issue
Block a user