[Resolved] AttributeError: module cv2 has no attribute bgsegm

Question When using cv2.bgsegm.createBackgroundSubtractorMOG() to remove the background, I encounter the following problems: AttributeError: module ‘cv2’ has no attribute ‘bgsegm’ Reason Reason for the error: The extension package contrib is not installed in the python environment used. Solution Can be installed via pip or conda pip install opencv-contrib-python -i https://pypi.tuna.tsinghua.edu.cn/simple If the error is still […]

Solve AttributeError: module cv2.cv2 has no attribute CV_CAP_PROP_FPS and CV_CAP_PROP_FRAME_WIDTH

Table of Contents Solve AttributeError: module ‘cv2.cv2’ has no attribute ‘CV_CAP_PROP_FPS’ and ‘CV_CAP_PROP_FRAME_WIDTH’ problem analysis Solution 1. Check OpenCV version 2. Replace attribute name 3. Upgrade to new version Summarize Code example: Read video frame rate and dimensions CV_CAP_PROP_FPS CV_CAP_PROP_FRAME_WIDTH Example code explanation Solving AttributeError: module ‘cv2.cv2’ has no attribute ‘CV_CAP_PROP_FPS’ and ‘CV_CAP_PROP_FRAME_WIDTH’ When using […]

Solving cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) s

Table of Contents Solve cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) s error wrong reason Solution Sample code: Implementing an image scaling application grammar Parameter Description return value Interpolation method Example Solution to cv2.error: C:\projects\opencv-python\opencv\modules\imgproc\src\resize.cpp:4044: error: (-215) s error When we use the ??cv2.resize()?? function of the OpenCV library to resize the image, sometimes we may encounter the […]

YOLOv5 uses ICCV2023 snake convolution DSConv

[Remind everyone: The module has only been briefly packaged and tested. Everyone’s data is different. Whether it can increase the point requires more experiments. You can try different positions or make further improvements] DSConv is a fusion topology-controlled convolution proposed in ICCV2023 inspired by deformed convolution. It is mainly aimed at segmenting elongated morphological targets […]

Solving cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error

Table of Contents Solve cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error problem wrong reason Solution 1. Check the image path 2. Check image format 3. Check image color space conversion 4. Update OpenCV version 5. Install OpenCV-contrib in conclusion RGB color space HSV color space YCrCb color space Solve cv2.error: OpenCV(4.1.2) C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error problem When using the OpenCV […]

OpenCV2-Mat class, image loading and saving

OpenCV2-Mat class, image loading and saving 1. Introduction to Mat class 2. Data type and value range 3.Mat class construction and assignment 4.Mat matrix operation 5.Traversal of Mat attributes and elements Method 1 pt Method 2 Iterator method Method 3 at Method 4 data member 6. Reading, displaying and saving images 1. Introduction to Mat […]

ICCV2023MRN: Multiplexed Routing Network for Incremental Multilingual Text Recognition

MRN reading Paper reading Background and motivation Rehearsal-imbalance MRN solves Rehearsal Imbalance problem MRN network structure experiment Summarize code run Build environment Create a virtual environment activate environment Install dependencies and packages start operation Paper address: MRN: Multiplexed Routing Network for Incremental Multilingual Text Recognition Source code address: https://github.com/simplify23/MRN Paper reading This is a paper […]

Project practice – target tracking: AttributeError: module cv2 has no attribute TrackerBoosting_create

Project actual combat-target tracking: AttributeError: module cv2 has no attribute TrackerBoosting_create Source: https://github.com/yoohaythem/OpenCV/issues/2 Problem description: Error description: When using the opencv library for target tracking, the error is reported as follows: AttributeError: module cv2’ has no attribute TrackerBoosting_create’ AttributeError: module cv2’ has no attribute TrackerTLD_create’ AttributeError: module cv2’ has no attribute TrackerMedianFlow_create’ AttributeError: module cv2’ […]

(Resolved) AttributeError: module cv2.gapi.wip.draw has no attribute Text

Problem description When I ran the Caption-Anything project today, I got this error at the beginning: AttributeError: module ‘cv2.gapi.wip.draw’ has no attribute ‘Text’. Caption-Anything is a versatile image processing tool that combines the functionality of Segment Anything, Visual Captioning and ChatGPT. Our solution generates descriptive captions for any object in an image, offering a range […]

cv2 restores the background image and marks foreign objects

Article directory Restore the background image of multiple identified objects based on mask Restore the background image of multiple identification objects based on yolo annotation Compare the annotation recognition results with the background image Restore the background image of multiple identified objects based on the mask import os import cv2 import numpy as np import […]