1. A hardness tester for determining hardness of a specimen, comprising: indenting means for forming a polygonal pyramidal indentation in a surface of a speciman; imaging means for forming an optical silhouette image of the speciman surface indentation; a solid state image sensor comprised of a plurality of photoelectric sensor elements, each photoelectric sensor element having a narrow elongated photoresponsive area and said plurality of photoelectric sensor elements being relatively positioned with their respective photoresponsive areas positioned along a straight line defining a major axis of said solid state image sensor and with the lengths of their respective photoresponsive areas transverse to the major axis of said solid state image sensor, and said solid state image sensor positioned with the optical image of the specimen surface indentation incident on the photoresponsive areas of said photoelectric sensor elements comprising said solid state image sensor with said photoelectric sensor elements developing respective electrical output signals each having an amplitude representing the intensity of the optical image incident thereon; and detecting means responsive to the differences in amplitude of the electrical output signals developed by said photoelectric sensor elements in the vicinity of the ends of the speciman surface indentation image for detectingthe diagonal length of the speciman surface indentation image along the major axis of said solid state image sensor.