We need to build a workshop model in which we can relate the pixel coordinates (x, y) from the camera image to real objects in the three-dimensional space of the store. Camera images that will act as sources for creating such a model suffer from fisheye distortion. Consequently, straight lines actually appear as curves in camera images, and the walls do not seem to meet each other exactly at right angles.
We subdivide the region into polygons. Each polygon in the image refers to a specific region, such as a shelf, display area, statement counter, etc. When matching the pixels that fall into each polygon, we want to link them as belonging to the shelf corresponding to this area.
Any ideas how to do this?
Below is a sample image of a store with several polygons marked:

EDIT: We are not looking to find out the 3D coordinates, we just need to know which shelf any polygon is displayed on. Therefore, if the user clicks on the polygon, we can say that he clicked on which shelf.
We can control above for large polygons, as shown in the image, but the shelves from the camera can be as few pixels as possible, so we need some kind of probabilistic result telling if the user pressed at (x, y), what is the probability that he is trying to click on Shelf-A or what is the likelihood that he is trying to click on Shelf-B, etc.
Basically, what we are looking for is a probability function that will return the click probabilities of the nearest objects when a small polygon (or pixel) is clicked on a two-dimensional image.
EDIT2: One thing that is not obvious from the sample image is that the size of the polygon can be very small (just a few pixels), and the polygons, in turn, can be very close to each other.
In addition, the use case is that the customer in the store selects a product from one of the shelves. The user of the application clicked on a point in the image from which, in his opinion, the products would be obtained. Now, since the polygons are so small and so close, the user can only guess the exact pickup point, so we can only at best know that it can be any of 3-4 polygons close to the click point. So, the question is how to calculate the probabilities for these 3-4 polygons based on the click?
As shown here, the distance from the click from the center of the polygon and its region can be a parameter in calculating this probability, which is interesting to me if there is an algorithm for this.