Here is my target application. The rendered image with rendered meshes is used in an interactive application. A user may click or point the cursor to an object on the image. Information related to that object appears. So I need to know either
1) the coordinates of the polygon of the mesh silhouette on the rendered image
2) pixels on the rendered image surrounded by the silhouette.
I noticed the mesh silhouette is drawn by default in the object mode. But how to find its coordinates from python for the rendered image?
For the 1) my idea was to use bpy_extras.object_utils.world_to_camera_view(..) to find image coordinates of each vertex of the mesh. Then somehow compute the silhouette. For the sake of simplicity, let's neglect transparency and consider that the mesh doesn't have holes. If you can propose a solution for a general case for a mesh with holes (e.g. a torus), that would be great!
Any hint is appreciated