Anyone know how detect what vertex are in the edges of a mesh? Anyone know how detect what vertex are in the edges of a mesh?

I want math code, not a user interface procedure.

Really, I want the same function that Blender has when you select an object and you can see a small "focus" color around all the silhouette of the mesh.

Any idea, or advice (including where is defined the focus in C code) will be welcome.
The Blender Compositor can 


Identify, Blur or Dilate, a Pixel Selection to produce a silhouette.
The Pixel Selection can be a Rendered Object

Freestyle can outline objects as well


The above was done with Freestyle