1. A method for inspecting a line width of a pattern on an object to be inspected with different types of patterns rendered thereon, comprising: imaging the object to be inspected and obtaining an optical image; creating a reference image from design pattern data; preparing an inspection recipe comprising one or more templates and parameter settings necessary for the inspection; checking the pattern and the template against each other, and selecting the reference image which corresponds to the template; detecting a first edge and a second edge in the selected reference image in accordance with the parameter settings using a standard coordinate; detecting a first edge of the optical image corresponding to the first edge of the selected reference image and a second edge of the optical image corresponding to the second edge of the selected reference image; and determining an inspection value by acquiring the difference between the line width of the optical image and the reference image using the first edge and second edges of the optical image and the first and second edges of the reference image.