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; selecting a pattern of the reference image which corresponds to a template; determining an expected coordinate region within which to search for an edge of the pattern based on a matching reference coordinate that identifies a same reference location in relation to the selected pattern in both of the reference image and the optical image; detecting a first edge and a second edge in the selected pattern of the reference image in accordance with the parameter settings using the matching reference coordinate to search for at least one of the first edge and the second edge in the selected pattern of the reference image only within the determined expected coordinate region; detecting a first edge of a pattern of the optical image corresponding to the first edge of the selected pattern of the reference image and a second edge of a pattern of the optical image corresponding to the second edge of the selected pattern of the reference image; and determining an inspection value by acquiring the difference of the line width between the optical image and the reference image using the first and second edges of the pattern of the optical image and the first and second edges of the pattern of the reference image.