Relative Content

Tag Archive for opencv

Compute Projection matrices with Uncalibrated Stereo using OpenCV

I am using stereoRectifyUncalibrated() method which generates two homography matrices H1 and H2 for image rectification. I have checked both H1 and H2 by displaying the results of the rectified images and seems good. However, I now need to compute the new rectified P1 and P2 matrices and thereafter the new Q matrix for 3D projection.
Here comes the issue: the rectification matrices R1 and R2 derived from R = invK * H * K is not a true rotation (R.T *R != Identity AND det R =1)
I am not able to compute the new projection centres pertaining to the Q matrix based on the computed homographies.

OpenCV Python: minArea parameter in get_contours function not taking effect

I am working on a project using OpenCV in Python to process images and detect contours. I have a function get_contours which takes several parameters, including minArea to filter out small contours. However, it seems that the minArea parameter is not taking effect when I call the function.
Here is my get_contours function in my_utils.py:
import cv2
import numpy as np

Image Rotation using OpenCV

I am trying to create a function using OpenCV that overlays an image onto a defined polygon (using 4 points) in another image. How can I handle the rotation of the image so that the overlay looks natural?
Example:
enter image description here
My code:

Extract text inside a rectangle in an image

I need code that extracts text inside the green rectangle below. Can someone please help me with it? I had to strike out some words in the middle, that would be some textual characters there.
enter image description here