Skip to content

Tag: opencv

numpy image float array, to int 0..255 value

I got 3 NumPy data arrays r,g,b represented as a 2D float64 array (720×1024) Essentially per row, each channel is a bunch of floats: What I would like to to do is making it a channel that I can use in cv2.merge((r,g,b)) So that the float64 values per row get multiplied by 255 and something that cv2.merge…

Avoid recursion error with cv2 and mouse callback

I have a class for opening up an image and drawing circles. The entire code can be found here: p1 and p2 store diametrically opposing points on a circle. These are capture with click and drag actions in _on_mouse_interact. It can be run with My issue is that I get Where is the recursion here? Answer Found som…

Drawing a simple image, displaying it, and closing it

I am trying to do some simple drawings. I wanted to use opencv (cv2) because on a second project I have to display a small animation (rectangle, size depending on a variable; updated every X seconds). However, I do not have experience with image processing libraries and opencv. I am running into a lot of prob…