Skip to content

Add types to cv.resize() function #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cv2/__init__.pyi
Original file line number Diff line number Diff line change
@@ -2838,7 +2838,7 @@ def reprojectImageTo3D(disparity, Q, _3dImage=..., handleMissingValues=..., ddep
"reprojectImageTo3D(disparity, Q[, _3dImage[, handleMissingValues[, ddepth]]]) -> _3dImage\n. @brief Reprojects a disparity image to 3D space.\n. \n. @param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit\n. floating-point disparity image. The values of 8-bit / 16-bit signed formats are assumed to have no\n. fractional bits. If the disparity is 16-bit signed format, as computed by @ref StereoBM or\n. @ref StereoSGBM and maybe other algorithms, it should be divided by 16 (and scaled to float) before\n. being used here.\n. @param _3dImage Output 3-channel floating-point image of the same size as disparity. Each element of\n. _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity map. If one\n. uses Q obtained by @ref stereoRectify, then the returned points are represented in the first\n. camera's rectified coordinate system.\n. @param Q \\f$4 \\times 4\\f$ perspective transformation matrix that can be obtained with\n. @ref stereoRectify.\n. @param handleMissingValues Indicates, whether the function should handle missing values (i.e.\n. points where the disparity was not computed). If handleMissingValues=true, then pixels with the\n. minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed\n. to 3D points with a very large Z value (currently set to 10000).\n. @param ddepth The optional output array depth. If it is -1, the output image will have CV_32F\n. depth. ddepth can also be set to CV_16S, CV_32S or CV_32F.\n. \n. The function transforms a single-channel disparity map to a 3-channel image representing a 3D\n. surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it\n. computes:\n. \n. \\f[\\begin{bmatrix}\n. X \\\\\n. Y \\\\\n. Z \\\\\n. W\n. \\end{bmatrix} = Q \\begin{bmatrix}\n. x \\\\\n. y \\\\\n. \\texttt{disparity} (x,y) \\\\\n. z\n. \\end{bmatrix}.\\f]\n. \n. @sa\n. To reproject a sparse set of points {(x,y,d),...} to 3D space, use perspectiveTransform."
...

def resize(src: Mat, dsize: typing.Tuple[int, int], dts: Mat = ..., fx: int = ..., fy: int = ..., interpolation: int = ...) -> Mat:
def resize(src: Mat, dsize: typing.Tuple[int, int] | None, dts: Mat = ..., fx: float = ..., fy: float = ..., interpolation: int = ...) -> Mat:
'resize(src, dsize[, dst[, fx[, fy[, interpolation]]]]) -> dst\n. @brief Resizes an image.\n. \n. The function resize resizes the image src down to or up to the specified size. Note that the\n. initial dst type or size are not taken into account. Instead, the size and type are derived from\n. the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,\n. you may call the function as follows:\n. @code\n. // explicitly specify dsize=dst.size(); fx and fy will be computed from that.\n. resize(src, dst, dst.size(), 0, 0, interpolation);\n. @endcode\n. If you want to decimate the image by factor of 2 in each direction, you can call the function this\n. way:\n. @code\n. // specify fx and fy and let the function compute the destination image size.\n. resize(src, dst, Size(), 0.5, 0.5, interpolation);\n. @endcode\n. To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to\n. enlarge an image, it will generally look best with c#INTER_CUBIC (slow) or #INTER_LINEAR\n. (faster but still looks OK).\n. \n. @param src input image.\n. @param dst output image; it has the size dsize (when it is non-zero) or the size computed from\n. src.size(), fx, and fy; the type of dst is the same as of src.\n. @param dsize output image size; if it equals zero, it is computed as:\n. \\f[\\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\\f]\n. Either dsize or both fx and fy must be non-zero.\n. @param fx scale factor along the horizontal axis; when it equals 0, it is computed as\n. \\f[\\texttt{(double)dsize.width/src.cols}\\f]\n. @param fy scale factor along the vertical axis; when it equals 0, it is computed as\n. \\f[\\texttt{(double)dsize.height/src.rows}\\f]\n. @param interpolation interpolation method, see #InterpolationFlags\n. \n. @sa warpAffine, warpPerspective, remap'
...