Ask Your Question

jads_96's profile - activity

2019-03-14 05:42:41 -0500 received badge  Notable Question (source)
2018-05-28 13:37:50 -0500 received badge  Popular Question (source)
2017-08-13 11:21:39 -0500 received badge  Student (source)
2016-09-28 18:20:04 -0500 answered a question What is the correct way of using the cv2.correctMatches in Python

Found the answer on another forum:

http://answers.opencv.org/question/34...

It was pretty simple, just had to reformat the arrays.

pt1 = np.reshape(pt1,(1,n,2))
pt2 = np.reshape(pt2,(1,n,2))
2016-09-21 07:43:59 -0500 received badge  Critic (source)
2016-09-21 07:39:04 -0500 received badge  Enthusiast
2016-09-20 23:48:00 -0500 asked a question What is the correct way of using the cv2.correctMatches in Python

I am trying to pass the corresponding image coordinates to the function and throws an error.

cv2.error: D:\OpenCV_3\opencv_8-18-16\modules\calib3d\src\triangulate.cpp:202: error: (-209) The point-matrices must have one row, and an equal number of columns in function cvCorrectMatches

I am passing some SHI-TOMASI features (cv2.goodFeaturetoTrack) and matching them with the KLT tracker ( cv2.calcOpticalFlowPyrLK).

This is the code producing the exception.

p1, st, err = cv2.calcOpticalFlowPyrLK(old_gray, frame_gray, p0, None, **lk_params)


# Select good points
good_new = p1[st==1]
good_old = p0[st==1]

arrayF = cv2.findFundamentalMat(good_new, good_old, cv2.FM_RANSAC)
F = arrayF[0]
better_new, better_old = cv2.correctMatches(F, good_new, good_old)
2016-09-05 12:42:30 -0500 commented question Python: Pyramids not working for calcOpticalFlowPyrLK

what do you mean from anywhere? If I input an image to buildOpticalFlowPyramid it returns the image without error, the problem is when I input the pyramid to the calcOptFlowPyrLK

2016-09-05 12:34:24 -0500 asked a question Python: Pyramids not working for calcOpticalFlowPyrLK

System information (version)

OpenCV => 3.1-dev

Operating System / Platform => Windows 64 Bit

Compiler => Visual Studio 2015

Detailed description:

When trying to run pyramids as the input for the cv2.calcOpticalFlowPyrLK function the program gives out an error. when I run the cv2.buildOpticalFlowPyramid method it returns a pyramid, without any errors but as soon as I use it as input it doesn't run.

Steps to reproduce:

lk_params = dict(winSize=(21, 21),  # Parameters used for cv2.calcOpticalFlowPyrLK (KLT tracker)
         maxLevel=3,
         criteria=(cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, 30, 0.01))

def KLT_featureTracking(image_ref, image_cur, px_ref):

   image_ref = cv2.buildOpticalFlowPyramid(image_ref, (512, 512), 2)
   image_cur = cv2.buildOpticalFlowPyramid(image_cur, (512, 512), 2)

   kp2, st, err = cv2.calcOpticalFlowPyrLK(image_ref, image_cur, px_ref, None, **lk_params)
   kp1, st, err = cv2.calcOpticalFlowPyrLK(image_cur, image_ref, kp2, None, **lk_params)

Error:

kp2, st, err = cv2.calcOpticalFlowPyrLK(image_ref, image_cur, px_ref, None, **lk_params)
TypeError: prevImg is not a numerical tuple
2016-08-20 13:30:04 -0500 received badge  Supporter (source)
2016-08-20 13:29:57 -0500 received badge  Scholar (source)
2016-08-20 13:28:58 -0500 commented answer Camera Calibration using ChArUco and Python

Thanks it worked

2016-07-17 17:22:27 -0500 asked a question Sparse Bundle Adjustment for Python in Windows

Hi,

I have been looking all over the web in order to find good a sparse bundle adjustment python code but haven't being able to. A constraint I have is that I am in windows. If any one can provide a code source or at least point me in the right direction I would greatly appreciate.

2016-07-17 17:15:50 -0500 commented answer Camera Calibration using ChArUco and Python

Thanks so much. I'll test it soon...

2016-07-15 22:34:57 -0500 asked a question Camera Calibration using ChArUco and Python

Hi everyone,

I've being looking for Python samples on how to calibrate a camera using the ChArUco methods, which are in the ArUco library inside the opencv_contrib, and have failed to find one. If someone can provide simple python script it will be of great benefit to me and the opencv-python community.