How to identify the conjoint edge of two faces?

I want to identify the conjoint edge of two faces or polygons by pixel information, ie, given a pixel, I want to know if it is a pixel on an conjoint edge of two faces or polygons. Anyone can help me?

Treat the edge as a line segment and consider the ray from the camera through the pixel, both in 3D space. See if the closest point of the line segment to the ray is within some small epsilon, where the epsilon is a linear function of distance to compensate for perspective (ie, epsilon * distance). has a lot of testing algorithms if you don’t know how to do ray to line segment distance checks.

Render each polygon in a unique color, use glReadPixels to get the "local region of the pixel of interest, then check neighbor pixels for color difference.

Badda bing, badda boum

My way is faster

Thanks you all. Let me have a try.