简体   繁体   中英

How to map co-ordinates from the image to a 2D surface

I'm trying to map the badminton court coverage by a player. For detecting the player I used a faster RCNN deep learning model. It detects both the players. I've also extracted their position from the bounding boxes using xmin and xmax coordinates.

Now I'm planning to map the coordinates to a 2D map of a badminton court.



这是检测结果


Value of bounding box coordinates of PB class are
[ymin, xmin, ymax, xmax]
[0.4867423, 0.38700044, 0.7571616, 0.45828968]
I've no clue where to start with.

Will take a more substantial look at this when work clears up, and edit accordingly, but for now my instinct is that you should try a combination of Hough Transform and Ransac to find the corners of the badminton court, perform a perspective transform to get a top view of the court, and use the transformation on the center of the bottom edge of your bounding box as the player coordinate in the transformed court view.

For an approach to finding and transforming the badminton court, this response might prove handy.

Edit 1:

It strikes me that, if the camera is fixed (which I imagine it may very well be), the need for Hough+RANSAC is extraneous. You can simply identify the coordinates of the four corners of the court by hand, and then use OpenCV to transform the image perspective and resize the image to the dimensions of a badminton court. I whipped up a short notebook to demonstrate how to do this .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM