Among other brands, this is one of many examples may be meeting your requirement, one factor is optical property of the pin to be measured. May be best to test a loaner unit before committed buy.
Mechanic touching sensor (caliper or the likes) is more tolerance to different type of objects. Optical can be more accurate, faster if it 'matches' the object property.
Dedicated micrometers or 'refined' caliper may be simple and better, but, since original poster ask for alternatives, optical worth trying out because if it 'matches' the object, it is higher accuracy, faster and clean (non touching).
You can buy off-the-shelf or if you want to design and make it yourself, the working principle is optical microscope with moving focusing. Focusing (as in turning the manual focus knob on traditional high-school microscope) is measured distance, but in highly refined version.
ZW-S30, measurement distance (sensor to object) is 27 to 33 mm, resolution 0.25 micro meter
This contacted type, from another brand, is 1 micro meter accuracy too. Does anyone know if its working principle is LDVT or like the above caliper?