A component mounting machine comprising; a head that holds a nozzle capable of picking up a component so as to be movable upward and downward; a moving means (26, 30) for moving the head in a horizontal direction; a component supply means for supplying the component; a board holding means for holding a board on which the component is mounted; an imaging means provided between the component supply means and the board holding means for irradiating the component held by the nozzle with light to image the component from below; a storage means for storing an imageable range of the imaging means according to a type of component, wherein the imageable range is a range of heights according to the type of component from a reference position allowing to accurately determine the suitability of the component based on imaging the component using the imaging means; a setting means configured for obtaining a clearance height at which an obstacle between the imaging means and a predetermined mounting position on the board can be avoided, and configured for extracting the imageable range of a component to be mounted from the storage means, and for setting a target height of a lower surface of the component held by the nozzle when the nozzle passes above the imaging means such that the target height is closest to the clearance height within the imageable range; and a control means configured for controlling the nozzle, the head, and the moving means (26, 30) such that a component supplied by the component supply means is picked up by the nozzle, and configured for controlling the operation of lifting the nozzle such that a lower surface of the component held by the nozzle is located at the target height and the operation of moving the nozzle to the imaging means, such that these operations are performed in parallel or sequentially, and configured to move the nozzle, after the imaging using the imaging means, to the predetermined mounting position on the board such that the lower surface of the component held by the nozzle is located at the clearance height, or at the target height or the clearance height when the target height is equal to or more than the clearance height, and configured to control the mounting of the component on the mounting position. a head that holds a nozzle capable of picking up a component so as to be movable upward and downward; a moving means (26, 30) for moving the head in a horizontal direction; a component supply means for supplying the component; a board holding means for holding a board on which the component is mounted; an imaging means provided between the component supply means and the board holding means for irradiating the component held by the nozzle with light to image the component from below; a storage means for storing an imageable range of the imaging means according to a type of component, wherein the imageable range is a range of heights according to the type of component from a reference position allowing to accurately determine the suitability of the component based on imaging the component using the imaging means; a setting means configured for obtaining a clearance height at which an obstacle between the imaging means and a predetermined mounting position on the board can be avoided, and configured for extracting the imageable range of a component to be mounted from the storage means, and for setting a target height of a lower surface of the component held by the nozzle when the nozzle passes above the imaging means such that the target height is closest to the clearance height within the imageable range; and a control means configured for controlling the nozzle, the head, and the moving means (26, 30) such that a component supplied by the component supply means is picked up by the nozzle, and configured for controlling the operation of lifting the nozzle such that a lower surface of the component held by the nozzle is located at the target height and the operation of moving the nozzle to the imaging means, such that these operations are performed in parallel or sequentially, and configured to move the nozzle, after the imaging using the imaging means, to the predetermined mounting position on the board such that the lower surface of the component held by the nozzle is located at the clearance height, or at the target height or the clearance height when the target height is equal to or more than the clearance height, and configured to control the mounting of the component on the mounting position.