The purpose of the present invention is to provide an image processing apparatus and a computer program such that correspondence points between design data and an edge line or between edge lines can be accurately identified for their matching. In an embodiment for achieving the purpose, when positioning between a first pattern formed by a first line segment and a second pattern formed by a second line segment is performed, a first correspondence point and a second correspondence point are set on the first line segment and the second line segment, respectively a degree of alignment for performing the positioning of the first pattern and the second pattern is calculated on the basis of the distance between the first correspondence point and the second correspondence point and the position of the first correspondence point and/or the second correspondence point is changed in accordance with a shape difference between the first line segment and the second line segment (see FIG. 2).