Closed chen9544827 closed 2 months ago
I have the same issue. Any thoughts
It seems that something went wrong with points after applying homography matrix. Could you send me video fragment or one image where the error occured?
I got it fixed it @yastrebksv !
What i did was to change the homography.py, on line 28 by adding .squeeze at the end.
trans_kps = cv2.perspectiveTransform(refer_kps, matrix).squeeze(1)
Do you concur?
@mafiat can confirm, this solved the issue also for me
@mafiat Confirm, thank you!
Traceback (most recent call last): File "main.py", line 156, in
homography_matrices, kps_court = court_detector.infer_model(frames)
File "C:\Users\Aa954\OneDrive\桌面\tennis_bound\TennisProject-main\TennisProject-main\court_detection_net.py", line 50, in infer_model
matrix_trans = get_trans_matrix(points)
File "C:\Users\Aa954\OneDrive\桌面\tennis_bound\TennisProject-main\TennisProject-main\homography.py", line 34, in get_trans_matrix
dists.append(distance.euclidean(points[i], trans_kps[i]))
File "C:\Users\Aa954\anaconda3\envs\TtackNet\lib\site-packages\scipy\spatial\distance.py", line 520, in euclidean
return minkowski(u, v, p=2, w=w)
File "C:\Users\Aa954\anaconda3\envs\TtackNet\lib\site-packages\scipy\spatial\distance.py", line 464, in minkowski
v = _validate_vector(v)
File "C:\Users\Aa954\anaconda3\envs\TtackNet\lib\site-packages\scipy\spatial\distance.py", line 302, in _validate_vector
raise ValueError("Input vector should be 1-D.")
ValueError: Input vector should be 1-D.
I don't how to solve 。please give me answer,thanks。