# \#numpy

**URL:** https://forum.opencv.org/tag/numpy/83.md

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

---

## [Using \`imread\` to read a image then multiply a number in one line, the value is wrong! BUG?](https://forum.opencv.org/t/using-imread-to-read-a-image-then-multiply-a-number-in-one-line-the-value-is-wrong-bug/16080)

<div class="topic-metadata">

**Author:** [@isJHan](https://forum.opencv.org/u/isJHan)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 1:36am UTC](https://forum.opencv.org/t/using-imread-to-read-a-image-then-multiply-a-number-in-one-line-the-value-is-wrong-bug/16080 "2024-01-08T01:36:42Z")

</div>

I use cv2.imread to read a depth map like depth = 200\*cv2.imread(path,-1)/65535. But I found the value is invalid! When I change my code to depth = 200.0\*cv2.imread(path,-1)/65535, it looks right. Besides, when I read th…

---

## [Error installing opencv python](https://forum.opencv.org/t/error-installing-opencv-python/6378)

<div class="topic-metadata">

**Author:** [@jcrex999](https://forum.opencv.org/u/jcrex999)\
**Replies:** 1\
**Last updated:** [November 23, 2021, 9:14am UTC](https://forum.opencv.org/t/error-installing-opencv-python/6378 "2021-11-23T09:14:10Z")

</div>

hello, some time ago I asked a question regarding the installation of opencv and it was in a 32 bit operating system and in a distro derived from devian, now I have a 64 bit operating system and with linux and I still ha…

---

## [OpenCV - Numpy Error](https://forum.opencv.org/t/opencv-numpy-error/11866)

<div class="topic-metadata">

**Author:** [@Dev\_101](https://forum.opencv.org/u/Dev_101)\
**Replies:** 5\
**Last updated:** [February 3, 2023, 10:32pm UTC](https://forum.opencv.org/t/opencv-numpy-error/11866 "2023-02-03T22:32:04Z")

</div>

Hello, I have been trying to plot a point on a frame in openCV. It is not working and I am getting this error: Traceback (most recent call last): File "/home/pi/Fair/Code/Software/Curve.py", line 84, in \<module\> …

---

## [(Python) just detect few corners instead of all from img, to optimize the speed](https://forum.opencv.org/t/python-just-detect-few-corners-instead-of-all-from-img-to-optimize-the-speed/10911)

<div class="topic-metadata">

**Author:** [@joyjj.socail.030](https://forum.opencv.org/u/joyjj.socail.030)\
**Replies:** 2\
**Last updated:** [November 14, 2022, 12:31am UTC](https://forum.opencv.org/t/python-just-detect-few-corners-instead-of-all-from-img-to-optimize-the-speed/10911 "2022-11-14T00:31:18Z")

</div>

My main purpose is to cut the original img in sticker size, and recognize img to text, find if is duplicate or print wrong. below python script can locate all sticker’s corner, and successfully OCR pytesseract img to te…

---

## [How to extract the value of v out of hsv inside polyline](https://forum.opencv.org/t/how-to-extract-the-value-of-v-out-of-hsv-inside-polyline/9792)

<div class="topic-metadata">

**Author:** [@jeong\_jihoon](https://forum.opencv.org/u/jeong_jihoon)\
**Replies:** 3\
**Last updated:** [August 16, 2022, 4:22am UTC](https://forum.opencv.org/t/how-to-extract-the-value-of-v-out-of-hsv-inside-polyline/9792 "2022-08-16T04:22:24Z")

</div>

How to extract the value of v out of hsv inside polyline or Is there a way to put 4 pairs of coordinate values?

---

## [\[Q\] Translate a set of coordinates into the same translated image space?](https://forum.opencv.org/t/q-translate-a-set-of-coordinates-into-the-same-translated-image-space/9774)

<div class="topic-metadata">

**Author:** [@weight\_theta](https://forum.opencv.org/u/weight_theta)\
**Replies:** 9\
**Last updated:** [August 9, 2022, 12:20pm UTC](https://forum.opencv.org/t/q-translate-a-set-of-coordinates-into-the-same-translated-image-space/9774 "2022-08-09T12:20:56Z")

</div>

Hello Everyone, I applied a random translation of up to 20 % of the original image size to an image, using a translation matrix T T = \[1, 0, t\_x\], \[0, 1, t\_y\], where t\_y and t\_y are sampled from a uniform with an upper …

---

## [Errors with inputs for computePhaseMap in python](https://forum.opencv.org/t/errors-with-inputs-for-computephasemap-in-python/1707)

<div class="topic-metadata">

**Author:** [@lnewton889](https://forum.opencv.org/u/lnewton889)\
**Replies:** 0\
**Last updated:** [February 22, 2021, 5:23pm UTC](https://forum.opencv.org/t/errors-with-inputs-for-computephasemap-in-python/1707 "2021-02-22T17:23:36Z")

</div>

Keep hitting TypeError when trying to computePhaseMap: TypeError: descriptor ‘computePhaseMap’ for ‘cv2.structured\_light\_SinusoidalPattern’ objects doesn’t apply to a ‘numpy.ndarray’ object From the C++ help this is a …

---

## [I want to convert the real-time image received by the camera and output it at the same time](https://forum.opencv.org/t/i-want-to-convert-the-real-time-image-received-by-the-camera-and-output-it-at-the-same-time/8952)

<div class="topic-metadata">

**Author:** [@rhendms97](https://forum.opencv.org/u/rhendms97)\
**Replies:** 2\
**Last updated:** [May 29, 2022, 1:21pm UTC](https://forum.opencv.org/t/i-want-to-convert-the-real-time-image-received-by-the-camera-and-output-it-at-the-same-time/8952 "2022-05-29T13:21:41Z")

</div>

I can upload (original, original) images and (gray, gray) images in one window using one camera. But when I try to upload the (original, gray) image to the window, I get an error. Please help me…

---

## [How to identify the correct coordinates for cropping image](https://forum.opencv.org/t/how-to-identify-the-correct-coordinates-for-cropping-image/8381)

<div class="topic-metadata">

**Author:** [@opencvnoob](https://forum.opencv.org/u/opencvnoob)\
**Replies:** 2\
**Last updated:** [April 13, 2022, 4:40pm UTC](https://forum.opencv.org/t/how-to-identify-the-correct-coordinates-for-cropping-image/8381 "2022-04-13T16:40:57Z")

</div>

I am using a face detection library(retina-face) to detect face on the following image The library being used is retina-face which gives bounding box coordinates in the format (x1,y1,x2,y2). The Bounding box for the…

---

## [Thresholding for grayscaled images](https://forum.opencv.org/t/thresholding-for-grayscaled-images/7032)

<div class="topic-metadata">

**Author:** [@K\_Miura](https://forum.opencv.org/u/K_Miura)\
**Replies:** 3\
**Last updated:** [January 8, 2022, 3:56am UTC](https://forum.opencv.org/t/thresholding-for-grayscaled-images/7032 "2022-01-08T03:56:09Z")

</div>

Is there a way to make it so that below a certain threshold; everything becomes black, but above it; the whiteness stays the same as the original? (For a grayscaled image)

---

## [Scaling a matrix or bgr values](https://forum.opencv.org/t/scaling-a-matrix-or-bgr-values/7028)

<div class="topic-metadata">

**Author:** [@Bob](https://forum.opencv.org/u/Bob)\
**Replies:** 1\
**Last updated:** [January 8, 2022, 1:10am UTC](https://forum.opencv.org/t/scaling-a-matrix-or-bgr-values/7028 "2022-01-08T01:10:26Z")

</div>

I am trying to multiply every pixel in a frame by a double. However each pixel is. bgr and uint8 def scaleVideo(bgr\_dataset, avgs, fit): print("Shape of bgr is ", bgr\_dataset.shape); nframes = bgr\_dataset.shape…

---

## [Input array from shape into shape error in cvzone](https://forum.opencv.org/t/input-array-from-shape-into-shape-error-in-cvzone/6322)

<div class="topic-metadata">

**Author:** [@Umesh\_Lab](https://forum.opencv.org/u/Umesh_Lab)\
**Replies:** 1\
**Last updated:** [November 20, 2021, 12:46pm UTC](https://forum.opencv.org/t/input-array-from-shape-into-shape-error-in-cvzone/6322 "2021-11-20T12:46:23Z")

</div>

from cv2 import cv2 import cvzone cap = cv2.VideoCapture(0) cascade = cv2.CascadeClassifier('haarcascade\_frontalface\_default.xml') overlay = cv2.imread('cool.png', cv2.IMREAD\_UNCHANGED) while True: \_, frame = cap.rea…

---

## [Composing perspective transforms](https://forum.opencv.org/t/composing-perspective-transforms/5112)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://forum.opencv.org/u/pauljurczak)\
**Replies:** 2\
**Last updated:** [September 9, 2021, 12:44am UTC](https://forum.opencv.org/t/composing-perspective-transforms/5112 "2021-09-09T00:44:12Z")

</div>

I have 2 matrices, such that: v1 = cv2.perspectiveTransform(v0, M0) v2 = cv2.perspectiveTransform(v1, M1) How can I get matrix M, such that: v2 = cv2.perspectiveTransform(v0, M) M0\*M1 or M1\*M0 doesn’t work.

---

## [Unable to perform color correction from opencv tutorial](https://forum.opencv.org/t/unable-to-perform-color-correction-from-opencv-tutorial/2141)

<div class="topic-metadata">

**Author:** [@gautam](https://forum.opencv.org/u/gautam)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 7:39pm UTC](https://forum.opencv.org/t/unable-to-perform-color-correction-from-opencv-tutorial/2141 "2021-05-28T19:39:48Z")

</div>

Hi all! I’m trying to use the example code in OpenCV: Color Correction Model but I want to do it in Python instead of C++. I see at least one other person with this issue: Converting Color Correction opencv module exa…

---

## [Blurring Number Plate](https://forum.opencv.org/t/blurring-number-plate/3115)

<div class="topic-metadata">

**Author:** [@Pinigseu](https://forum.opencv.org/u/Pinigseu)\
**Replies:** 6\
**Last updated:** [May 4, 2021, 3:15pm UTC](https://forum.opencv.org/t/blurring-number-plate/3115 "2021-05-04T15:15:54Z")

</div>

Hi everyone. Hello everyone, I’m trying to blur license plate on video for a project. I managed to create a rectangle which identifies the plate but I can’t blur the interior of this rectangle. I saw that we could use …

---

## [Correct Width and Height Gives Error in VideoWriter](https://forum.opencv.org/t/correct-width-and-height-gives-error-in-videowriter/3039)

<div class="topic-metadata">

**Author:** [@jdelahanty](https://forum.opencv.org/u/jdelahanty)\
**Replies:** 4\
**Last updated:** [April 29, 2021, 4:55pm UTC](https://forum.opencv.org/t/correct-width-and-height-gives-error-in-videowriter/3039 "2021-04-29T16:55:09Z")

</div>

Hello fellow open visualizers! I’m having trouble using the OpenCV video writer at the moment and can’t seem to find a solution. I’m using the package Harvesters for collecting images off an industrial camera. I can coll…

---

## [Help manipulating color levels](https://forum.opencv.org/t/help-manipulating-color-levels/2468)

<div class="topic-metadata">

**Author:** [@xrstokes](https://forum.opencv.org/u/xrstokes)\
**Replies:** 6\
**Last updated:** [March 31, 2021, 9:28am UTC](https://forum.opencv.org/t/help-manipulating-color-levels/2468 "2021-03-31T09:28:10Z")

</div>

Hi, I’m trying to filter an image that has a lot of over exposed reflective surfaces. It helps if i can lower the color levels after equalizing the histogram. It helps to show the color of the surface suffering the refle…

---

## [Build python libraries on Arm64 Apple M1 failed](https://forum.opencv.org/t/build-python-libraries-on-arm64-apple-m1-failed/1692)

<div class="topic-metadata">

**Author:** [@monkfood](https://forum.opencv.org/u/monkfood)\
**Replies:** 3\
**Last updated:** [February 24, 2021, 2:49am UTC](https://forum.opencv.org/t/build-python-libraries-on-arm64-apple-m1-failed/1692 "2021-02-24T02:49:10Z")

</div>

Hello, I recently got my new Apple M1 which is arm64 architecture and also the new OAK-D so I started getting the Software up and running. Meaning install opencv for python I installed without issues python 3.9.1 nat…

---

## [How to crop/zoom-on a video capture, by scaling the default capture resolution?](https://forum.opencv.org/t/how-to-crop-zoom-on-a-video-capture-by-scaling-the-default-capture-resolution/1564)

<div class="topic-metadata">

**Author:** [@Zedespook](https://forum.opencv.org/u/Zedespook)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 3:47pm UTC](https://forum.opencv.org/t/how-to-crop-zoom-on-a-video-capture-by-scaling-the-default-capture-resolution/1564 "2021-02-15T15:47:03Z")

</div>

I store the camera resolution like this: # Resolution of the camera capture & display. res\_w = 1440 res\_h = 1080 resolution = (res\_w, res\_h) How would I go about cropping the middle of the image (because my camera is a…

---

## [Create a multi-channel image from pixel coordinates extracted from another image](https://forum.opencv.org/t/create-a-multi-channel-image-from-pixel-coordinates-extracted-from-another-image/1112)

<div class="topic-metadata">

**Author:** [@Razvan](https://forum.opencv.org/u/Razvan)\
**Replies:** 5\
**Last updated:** [January 25, 2021, 9:06pm UTC](https://forum.opencv.org/t/create-a-multi-channel-image-from-pixel-coordinates-extracted-from-another-image/1112 "2021-01-25T21:06:18Z")

</div>

I have a list of mask images with the shape of(3100,3100,3), I want to create a new image with 5 channels ( 3100,3100,5) form each image to represent the different colours in each mask. I searched for the specific col…
