A charged particle beam apparatus represented by a scanning electron microscope, or an optical inspection apparatus, which irradiates light such as laser light onto a sample, scans a beam on a target sample to obtain a pattern image of, for example, a semiconductor, an image sensor, or a display element.