# Python

**URL:** https://forum.opencv.org/c/python/7.md?page=4

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

**Page:** 5

---

## [How to use opacity in drawKeypoints or drawMatches?](https://forum.opencv.org/t/how-to-use-opacity-in-drawkeypoints-or-drawmatches/20792)

<div class="topic-metadata">

**Author:** [@dustinfreeman](https://forum.opencv.org/u/dustinfreeman)\
**Replies:** 1\
**Last updated:** [April 10, 2025, 8:51pm UTC](https://forum.opencv.org/t/how-to-use-opacity-in-drawkeypoints-or-drawmatches/20792 "2025-04-10T20:51:08Z")

</div>

I’m using OpenCV 4.10 in python, but this should generalize to anyone using drawKeypoints or drawMatches. I want to draw the keypoints with less than 100% opacity over the image. I have tried: img3 = cv2.drawKeypoints(i…

---

## [OpenCV with CUDA build seems ok yet not working/usable](https://forum.opencv.org/t/opencv-with-cuda-build-seems-ok-yet-not-working-usable/20747)

<div class="topic-metadata">

**Author:** [@GuyBl](https://forum.opencv.org/u/GuyBl)\
**Replies:** 4\
**Last updated:** [April 10, 2025, 1:24pm UTC](https://forum.opencv.org/t/opencv-with-cuda-build-seems-ok-yet-not-working-usable/20747 "2025-04-10T13:24:25Z")

</div>

Recently started learning Python and opencv to create a custom object detection script (YOLO11) script that work really well. In an effort to take advantage of cuda i ventured into creating a custom cv build following B…

---

## [Detecting and identifying rectangular gums](https://forum.opencv.org/t/detecting-and-identifying-rectangular-gums/20723)

<div class="topic-metadata">

**Author:** [@Aditya09](https://forum.opencv.org/u/Aditya09)\
**Replies:** 10\
**Last updated:** [April 3, 2025, 4:32pm UTC](https://forum.opencv.org/t/detecting-and-identifying-rectangular-gums/20723 "2025-04-03T16:32:57Z")

</div>

I Need help with detecting and identifying rectangular gums in images using a rule-based image processing approach and overlaying detected gums with green and red rectangles based on shape.

---

## [Finding and correcting a warped table (as a preprocessing step to isolate each cell)](https://forum.opencv.org/t/finding-and-correcting-a-warped-table-as-a-preprocessing-step-to-isolate-each-cell/20714)

<div class="topic-metadata">

**Author:** [@danelyn](https://forum.opencv.org/u/danelyn)\
**Replies:** 0\
**Last updated:** [April 2, 2025, 2:27am UTC](https://forum.opencv.org/t/finding-and-correcting-a-warped-table-as-a-preprocessing-step-to-isolate-each-cell/20714 "2025-04-02T02:27:55Z")

</div>

hi y’all! I’m a complete newbie to image processing, and I’ve found myself trying to process an image of a table, printed on a sheet of paper. in my use case, this sheet of paper can be warped a decent amount, because of…

---

## [RoboDK and Open CV Part Measurement](https://forum.opencv.org/t/robodk-and-open-cv-part-measurement/20706)

<div class="topic-metadata">

**Author:** [@Khaboom](https://forum.opencv.org/u/Khaboom)\
**Replies:** 1\
**Last updated:** [April 1, 2025, 10:50pm UTC](https://forum.opencv.org/t/robodk-and-open-cv-part-measurement/20706 "2025-04-01T22:50:16Z")

</div>

I am using RoboDK to simulate vision detection. Camera is perpendicular to the ArUco marker However, I cannot get the virtual camera to have correct contour detection. The image is suppose to me 100mm x 100mm. However…

---

## [OpenCV cudacodec nvdec says unsupported format on blackwell Gpu](https://forum.opencv.org/t/opencv-cudacodec-nvdec-says-unsupported-format-on-blackwell-gpu/20684)

<div class="topic-metadata">

**Author:** [@haider\_abbasi](https://forum.opencv.org/u/haider_abbasi)\
**Replies:** 4\
**Last updated:** [April 1, 2025, 6:42pm UTC](https://forum.opencv.org/t/opencv-cudacodec-nvdec-says-unsupported-format-on-blackwell-gpu/20684 "2025-04-01T18:42:12Z")

</div>

Hey CudaMates, Context: I have just started working with OpenCV gpu/cuda decoding capabilites to utilize its advantages over the cpu counterpart in my goal of making an efficient application. The problem is i am getting…

---

## [Problems with getting values for face angle age estimation](https://forum.opencv.org/t/problems-with-getting-values-for-face-angle-age-estimation/20692)

<div class="topic-metadata">

**Author:** [@Thomas\_Clarke](https://forum.opencv.org/u/Thomas_Clarke)\
**Replies:** 3\
**Last updated:** [April 1, 2025, 3:18pm UTC](https://forum.opencv.org/t/problems-with-getting-values-for-face-angle-age-estimation/20692 "2025-04-01T15:18:12Z")

</div>

I’m having problems with values for R1, C1, C2 in step 6: I don’t want to use dlib or yunet for my solution! Find the row number R1 with minimum row sum of gray level in UPART. Find the column numbers C1 and C2 with …

---

## [No module named cv2 after installed the opencv-python](https://forum.opencv.org/t/no-module-named-cv2-after-installed-the-opencv-python/20700)

<div class="topic-metadata">

**Author:** [@kk\_k](https://forum.opencv.org/u/kk_k)\
**Replies:** 3\
**Last updated:** [April 1, 2025, 1:05pm UTC](https://forum.opencv.org/t/no-module-named-cv2-after-installed-the-opencv-python/20700 "2025-04-01T13:05:38Z")

</div>

I create a new env and “pip install opencv-python” in this env but when i try to import cv2 i still get i google a lot for this problem win11 vscode try python=3.7,3.8.3.10,3.11 Any kind of help is appreciated!

---

## [cv2.inRange on HSV image always empty](https://forum.opencv.org/t/cv2-inrange-on-hsv-image-always-empty/20694)

<div class="topic-metadata">

**Author:** [@mmuinos](https://forum.opencv.org/u/mmuinos)\
**Replies:** 1\
**Last updated:** [April 1, 2025, 8:54am UTC](https://forum.opencv.org/t/cv2-inrange-on-hsv-image-always-empty/20694 "2025-04-01T08:54:08Z")

</div>

Hello! I am running into a strange issue involving the use of cv2.inRange and could use some help. For context, I am trying to identify the colors of each individual circle for this board game. Since some of the col…

---

## [Connect Pycharm with Unity Game](https://forum.opencv.org/t/connect-pycharm-with-unity-game/15647)

<div class="topic-metadata">

**Author:** [@Long\_Le\_Dinh](https://forum.opencv.org/u/Long_Le_Dinh)\
**Replies:** 2\
**Last updated:** [March 27, 2025, 6:17am UTC](https://forum.opencv.org/t/connect-pycharm-with-unity-game/15647 "2025-03-27T06:17:58Z")

</div>

I have now finished coding the computer vision part on Pycharm, now I want to connect to the game project I created in Unity, how can I do that, everyone, I want to link to play the game by raising my hand. Through the c…

---

## [MultiTracker\_create not in module of openCV vers 4.11.0 (openCV\_contrib\_python)](https://forum.opencv.org/t/multitracker-create-not-in-module-of-opencv-vers-4-11-0-opencv-contrib-python/20625)

<div class="topic-metadata">

**Author:** [@Thorvaldur\_Petursson](https://forum.opencv.org/u/Thorvaldur_Petursson)\
**Replies:** 10\
**Last updated:** [March 26, 2025, 11:18am UTC](https://forum.opencv.org/t/multitracker-create-not-in-module-of-opencv-vers-4-11-0-opencv-contrib-python/20625 "2025-03-26T11:18:47Z")

</div>

even though the documentation of openCV 4.11.0 says it has the class / function MultiTracker\_create() , the cv2.getBuildInformation() says AttributeError: module ‘cv2’ has no attribute ‘MultiTracker\_create’ How come th…

---

## [Contour hierarchy issue with cv2.RETR\_CCOMP: Circle inside square not recognized as child](https://forum.opencv.org/t/contour-hierarchy-issue-with-cv2-retr-ccomp-circle-inside-square-not-recognized-as-child/20632)

<div class="topic-metadata">

**Author:** [@Pawel\_Lukowicz](https://forum.opencv.org/u/Pawel_Lukowicz)\
**Replies:** 1\
**Last updated:** [March 25, 2025, 10:32pm UTC](https://forum.opencv.org/t/contour-hierarchy-issue-with-cv2-retr-ccomp-circle-inside-square-not-recognized-as-child/20632 "2025-03-25T22:32:44Z")

</div>

I’m using cv2.findContours with cv2.RETR\_CCOMP to get the contour hierarchy. Both the circle and the square are detected as contours. Since these are just outlines, each shape has both an inner and an outer contour, mean…

---

## [Comparing Two Methods for ArUco Marker Relative Pose Estimation in OpenCV](https://forum.opencv.org/t/comparing-two-methods-for-aruco-marker-relative-pose-estimation-in-opencv/20620)

<div class="topic-metadata">

**Author:** [@Volo-Ro](https://forum.opencv.org/u/Volo-Ro)\
**Replies:** 3\
**Last updated:** [March 25, 2025, 3:12pm UTC](https://forum.opencv.org/t/comparing-two-methods-for-aruco-marker-relative-pose-estimation-in-opencv/20620 "2025-03-25T15:12:19Z")

</div>

Overview I have been working on a project that involves estimating the relative pose between multiple ArUco markers using OpenCV. I’ve implemented two different methods for computing the transformation matrices between …

---

## [Brightness differences in stiching](https://forum.opencv.org/t/brightness-differences-in-stiching/20583)

<div class="topic-metadata">

**Author:** [@Popeye](https://forum.opencv.org/u/Popeye)\
**Replies:** 0\
**Last updated:** [March 20, 2025, 3:13pm UTC](https://forum.opencv.org/t/brightness-differences-in-stiching/20583 "2025-03-20T15:13:24Z")

</div>

Hello everyone, I am facing a specific issue during image stitching. The stitching method provided by OpenCV doesn’t work properly in my case, likely due to insufficient overlap between the images. To address this issu…

---

## [Rectification of dissimilar stereo images](https://forum.opencv.org/t/rectification-of-dissimilar-stereo-images/20572)

<div class="topic-metadata">

**Author:** [@Faryal\_Noori](https://forum.opencv.org/u/Faryal_Noori)\
**Replies:** 0\
**Last updated:** [March 19, 2025, 12:14pm UTC](https://forum.opencv.org/t/rectification-of-dissimilar-stereo-images/20572 "2025-03-19T12:14:39Z")

</div>

I have three cameras: two similar VIS cameras and one SWIR camera. The calibration and rectification work well with the VIS cameras, but when I try to rectify the images from the SWIR and VIS cameras, I get only black im…

---

## [Timeout when grabbing frame from RTSP stream, from inside WSL2](https://forum.opencv.org/t/timeout-when-grabbing-frame-from-rtsp-stream-from-inside-wsl2/20558)

<div class="topic-metadata">

**Author:** [@T\_Thanh](https://forum.opencv.org/u/T_Thanh)\
**Replies:** 5\
**Last updated:** [March 19, 2025, 4:16am UTC](https://forum.opencv.org/t/timeout-when-grabbing-frame-from-rtsp-stream-from-inside-wsl2/20558 "2025-03-19T04:16:58Z")

</div>

Hi guys I am having problem with reading frames from rtsp link. I can open stream by doing ffplay -rtsp\_transport tcp -i "rtsp://admin:Admin123456\*@@192.168.8.191:554/cam/realmonitor?channel=1&subtype=0" or open it wi…

---

## [Reviewing My Approach for Relative Transformation Between ArUco Markers in OpenCV](https://forum.opencv.org/t/reviewing-my-approach-for-relative-transformation-between-aruco-markers-in-opencv/20549)

<div class="topic-metadata">

**Author:** [@Volo-Ro](https://forum.opencv.org/u/Volo-Ro)\
**Replies:** 2\
**Last updated:** [March 18, 2025, 6:07pm UTC](https://forum.opencv.org/t/reviewing-my-approach-for-relative-transformation-between-aruco-markers-in-opencv/20549 "2025-03-18T18:07:11Z")

</div>

I am working on estimating the relative transformation between ArUco markers using OpenCV. My setup consists of multiple markers placed in a scene, and I compute their rotation and translation matrices relative to a refe…

---

## [TIMVX (Amlogic 311D2 NPU on Khadas Vim3)](https://forum.opencv.org/t/timvx-amlogic-311d2-npu-on-khadas-vim3/20554)

<div class="topic-metadata">

**Author:** [@mjasner](https://forum.opencv.org/u/mjasner)\
**Replies:** 3\
**Last updated:** [March 17, 2025, 8:18pm UTC](https://forum.opencv.org/t/timvx-amlogic-311d2-npu-on-khadas-vim3/20554 "2025-03-17T20:18:44Z")

</div>

I’m trying to use the TIMVX support in OpenCV to run an ONNX model via python, but it doesn’t look like it’s actually running on the NPU at all. When I run the model the CPU usage goes to 400% (quad core device) and the …

---

## [Pac-man Effect when using warpPerspective](https://forum.opencv.org/t/pac-man-effect-when-using-warpperspective/17116)

<div class="topic-metadata">

**Author:** [@HeadTriXz](https://forum.opencv.org/u/HeadTriXz)\
**Replies:** 29\
**Last updated:** [March 16, 2025, 8:24am UTC](https://forum.opencv.org/t/pac-man-effect-when-using-warpperspective/17116 "2025-03-16T08:24:34Z")

</div>

Hello! I’m using a ChArUco board to calibrate three cameras. The input of the cameras will be used to create a stitched top-down view. So far, everything seems to work fine, except for one part: the perspective warping. …

---

## [Make: fatal error: too many errors emitted, stopping now](https://forum.opencv.org/t/make-fatal-error-too-many-errors-emitted-stopping-now/20527)

<div class="topic-metadata">

**Author:** [@executive](https://forum.opencv.org/u/executive)\
**Replies:** 3\
**Last updated:** [March 16, 2025, 5:56am UTC](https://forum.opencv.org/t/make-fatal-error-too-many-errors-emitted-stopping-now/20527 "2025-03-16T05:56:31Z")

</div>

I am having a really hard time compiling opencv. I’ve been at this for hours. cmake seems to complete fine, but make fails with many errors. If anybody could help me figure out the next step I would be really grateful p…

---

## [How can I determine the color uniformity in an image?](https://forum.opencv.org/t/how-can-i-determine-the-color-uniformity-in-an-image/20524)

<div class="topic-metadata">

**Author:** [@joseph\_trigos11](https://forum.opencv.org/u/joseph_trigos11)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 8:02pm UTC](https://forum.opencv.org/t/how-can-i-determine-the-color-uniformity-in-an-image/20524 "2025-03-14T20:02:32Z")

</div>

I’m trying to determine how uniform the color is across the top of a mandarin (the mandarin is already segmented). I’m working with the CIELAB color space. I tried a statistical analysis using standard deviation, so the …

---

## [CUDA Decoder issues](https://forum.opencv.org/t/cuda-decoder-issues/20514)

<div class="topic-metadata">

**Author:** [@gabrielgq](https://forum.opencv.org/u/gabrielgq)\
**Replies:** 4\
**Last updated:** [March 14, 2025, 6:33pm UTC](https://forum.opencv.org/t/cuda-decoder-issues/20514 "2025-03-14T18:33:36Z")

</div>

I am trying to build OpenCV with CUDA support, it worked but now I wanted to add cudacodec as well, however I am having issues with installing the NVIDIA Video Codec SDK and get errors for the headers and libraries. I am…

---

## [Unable to create tracker](https://forum.opencv.org/t/unable-to-create-tracker/20427)

<div class="topic-metadata">

**Author:** [@steerman](https://forum.opencv.org/u/steerman)\
**Replies:** 3\
**Last updated:** [March 13, 2025, 11:03pm UTC](https://forum.opencv.org/t/unable-to-create-tracker/20427 "2025-03-13T23:03:54Z")

</div>

I am trying to track an object over time using opencv’s object tracking features. I can successfully read a graphic with imread() and display it with imshow() and select a target with selectROI(). But when I try to cre…

---

## [Seeking Python Script for Mapping Equirectangular Key Points to Cubemap Faces](https://forum.opencv.org/t/seeking-python-script-for-mapping-equirectangular-key-points-to-cubemap-faces/20499)

<div class="topic-metadata">

**Author:** [@AbrahamE](https://forum.opencv.org/u/AbrahamE)\
**Replies:** 0\
**Last updated:** [March 12, 2025, 6:05am UTC](https://forum.opencv.org/t/seeking-python-script-for-mapping-equirectangular-key-points-to-cubemap-faces/20499 "2025-03-12T06:05:09Z")

</div>

Hi everyone, I’m working on a project where I’ve identified key points on an equirectangular image and then exported the image into cubemap faces (using a 90° field of view) to create several perspective views. My chall…

---

## [VideoCapture from webcam stuck in black and white instead of color](https://forum.opencv.org/t/videocapture-from-webcam-stuck-in-black-and-white-instead-of-color/20469)

<div class="topic-metadata">

**Author:** [@wire\_forest](https://forum.opencv.org/u/wire_forest)\
**Replies:** 6\
**Last updated:** [March 11, 2025, 7:28am UTC](https://forum.opencv.org/t/videocapture-from-webcam-stuck-in-black-and-white-instead-of-color/20469 "2025-03-11T07:28:29Z")

</div>

OpenCV version 4.11.0, python library opencv-python-headless = "^4.11.0.86" I am using the following code to capture a single still from a USB webcam and to write it to a file. I am expecting that the .jpg be in color a…

---

## [Bottle Cap Defect Detection](https://forum.opencv.org/t/bottle-cap-defect-detection/20492)

<div class="topic-metadata">

**Author:** [@xiaohua\_meng](https://forum.opencv.org/u/xiaohua_meng)\
**Replies:** 1\
**Last updated:** [March 11, 2025, 7:20am UTC](https://forum.opencv.org/t/bottle-cap-defect-detection/20492 "2025-03-11T07:20:54Z")

</div>

Hello everyone, Objective: We are researching how to achieve accurate defect detection using a small number of high-quality defect-rich samples. Our focus is on detecting defects on bottle caps, such as black spots, hai…

---

## [Cv2.error: OpenCV(4.11.0) 👎 error: (-5:Bad argument) in function 'inRange' \> Overload resolution failed: \> - lowerb is not a numpy array, neither a scalar \> - Expected Ptr\<cv::UMat\> for argument 'lowerb'](https://forum.opencv.org/t/cv2-error-opencv-4-11-0-error-5-bad-argument-in-function-inrange-overload-resolution-failed-lowerb-is-not-a-numpy-array-neither-a-scalar-expected-ptr-cv-umat-for-argument-lowerb/20480)

<div class="topic-metadata">

**Author:** [@deadpool](https://forum.opencv.org/u/deadpool)\
**Replies:** 1\
**Last updated:** [March 10, 2025, 2:48pm UTC](https://forum.opencv.org/t/cv2-error-opencv-4-11-0-error-5-bad-argument-in-function-inrange-overload-resolution-failed-lowerb-is-not-a-numpy-array-neither-a-scalar-expected-ptr-cv-umat-for-argument-lowerb/20480 "2025-03-10T14:48:38Z")

</div>

import cv2 import numpy as np def detect\_bucket(frame, lower\_color, upper\_color): # Convert frame to HSV hsv = cv2.cvtColor(frame, cv2.COLOR\_BGR2HSV) # Create mask for the given color range mask = c…

---

## [Why I am not getting the same FPS for YuNet model](https://forum.opencv.org/t/why-i-am-not-getting-the-same-fps-for-yunet-model/20458)

<div class="topic-metadata">

**Author:** [@KamalLagh](https://forum.opencv.org/u/KamalLagh)\
**Replies:** 0\
**Last updated:** [March 8, 2025, 1:48am UTC](https://forum.opencv.org/t/why-i-am-not-getting-the-same-fps-for-yunet-model/20458 "2025-03-08T01:48:20Z")

</div>

Hello everyone, I’m running a face detection application using OpenCV’s official YuNet model (face\_detection\_yunet\_2023mar.onnx). First Approach: I use cv2.FaceDetectorYN.create() and call .detect(). Second Approach: …

---

## [Volume analysis of objects from an image and identification of each object what it is](https://forum.opencv.org/t/volume-analysis-of-objects-from-an-image-and-identification-of-each-object-what-it-is/20430)

<div class="topic-metadata">

**Author:** [@efitnotification](https://forum.opencv.org/u/efitnotification)\
**Replies:** 0\
**Last updated:** [March 5, 2025, 11:37pm UTC](https://forum.opencv.org/t/volume-analysis-of-objects-from-an-image-and-identification-of-each-object-what-it-is/20430 "2025-03-05T23:37:46Z")

</div>

I used capturing objects in the room each by itself I want to calculate volume for each relative to the real world and not relative to pixels and to catalog each one under a category or even a product name Do such func…

---

## [How to detect custom arrow shapes in OpenCV?](https://forum.opencv.org/t/how-to-detect-custom-arrow-shapes-in-opencv/20416)

<div class="topic-metadata">

**Author:** [@jon](https://forum.opencv.org/u/jon)\
**Replies:** 1\
**Last updated:** [March 5, 2025, 10:59am UTC](https://forum.opencv.org/t/how-to-detect-custom-arrow-shapes-in-opencv/20416 "2025-03-05T10:59:29Z")

</div>

The problem As shown in the image, I am trying to detect road marking arrows in images using OpenCV. The arrows are always of the same size and shape but can appear in different orientations. These are the five possibl…

[Previous page](https://forum.opencv.org/c/python/7.md?page=3)

[Next page](https://forum.opencv.org/c/python/7.md?page=5)
