1. An apparatus for inspecting and measuring an object to be measured, the apparatus comprising: a distance measurement device that includes a light projection unit that projects a two-dimensional optical pattern onto a measurement target of an object to be measured, a plurality of imaging units, disposed in a stereoscopic arrangement, that image the measurement target of the object to be measured, and a driving unit configured to rotate a posture of at least one of the imaging units to control a parallax angle between the imaging units; a working distance control device that controls the driving unit and adjusts a position at which optical axes of the imaging units intersect by controlling focal lengths of the lenses based on correlation data that indicates a correlation between the parallax angle between the imaging units and focal lengths of lenses of the imaging units in accordance with the parallax angle between the imaging units; and a distance calculation device that includes a correspondence position calculation unit that determines a correspondence position at which a same region among images of the imaging units disposed in the stereoscopic arrangement is imaged, and a distance calculation unit that calculates a distance to a measurement target of an object to be measured based on a calculation result of the correspondence position calculation unit, the parallax angle between the imaging units, and focal lengths of the lenses that are controlled in accordance with the parallax angle between the imaging units.