Window properties, invalid parameter, kept for OpenCV compatibility.
Window size, first value is width, second is height, in the form of [width, height].
Port number to use, a random port will be used when default or unusable port is provided.
None
Builds a web page using the specified port or a random port, while creating a window in the Web Desktop pointing to this page. The web page is bound to the winname, and based on this winname, developers can use other APIs to affect this web page. When multiple Web Desktops are open, this window will appear in each Web Desktop.
Note: Unlike OpenCV, windows created in the Web Desktop cannot be freely resized. If developers want to control the window size to match the image, please explicitly pass the size parameter when using this API.
Callback function that will be called when the mouse clicks on the target window. The callback function must follow this format: call_back(event, x, y, flags, param). Where event is the constant corresponding to the triggered mouse event type, consistent with OpenCV's definition. x, y are the click positions of the mouse. flags is a constant for mouse event flags, an invalid parameter kept for OpenCV compatibility. param is the parameter passed in by the developer, which is the third parameter of the setMouseCallback function.
Optional parameter passed to the callback function, custom external data defined by the developer.
None
Sets the mouse callback function for the specified window, currently only responds to mouse click events.
Name bound to the target window. If the target window does not exist, namedWindow(winname, size = (frame.shape[1], frame.shape[0]), port = port) will be automatically called to create the window.
Image data to be displayed, typically BGR color image data is provided and displayed as RGB color.
None
Displays the specified image in the target window.
The VideoCapture class is used to capture video frames from cameras or video files. It supports USB cameras and MIPI cameras. Due to underlying limitations, it currently does not support opening multiple MIPI cameras simultaneously. When used without extended parameters, it behaves consistent with cv2.VideoCapture; using extended parameters initializes the VideoCapture object with AidCV extensions.
Parameter index, maximum value is 18. The parameters corresponding to each index are consistent with OpenCV. Due to underlying implementation issues, when device="mipi", currently only 3: width, 4: height, 5: frame rate are effective.
Constant representing the value of the corresponding parameter.
Parameter index, maximum value is 18. The parameters corresponding to each index are consistent with OpenCV. Due to underlying implementation issues, when device="mipi", currently only 3: width, 4: height, 5: frame rate are effective.
Value to be set for the corresponding parameter.
Boolean constant indicating whether the parameter setting was successful.
Sets the specified parameter of the camera. The parameter to be specified and its value must be within the range allowed by the camera.
Constant of numpy.array type, with the same shape as parameter x, representing the value of parameter x on the specified axis after calculation by the softmax function.
A 2D or 3D mask. 2D masks should be of int type, and 3D masks should be of float type.
A list of mapped colors, each represented by a 3-tuple (r, g, b).
[color_mask] or [color_mask,...] [color_mask]: A 2D mask returns one color mask image, where each position indicates the class it belongs to. [color_mask,...]: A 3D mask returns a list of color masks, each representing the probability of belonging to a specific class.
Uses the color to map a 2D or 3D mask mask into a color image. The mapping logic is as follows:
For 2D masks, the value at each position in the mask is an integer (e.g., 0, 1, 2,...), which is treated as the class index. Different values map to different colors.
For 3D masks, the third dimension represents different classes. The first two dimensions hold the probability that the position belongs to each class. Each class maps to a different color.