An image processing program for causing a computer to execute a process comprising: extracting a plurality of candidate lines that are observed from a position of an imaging device that captures an image of an object from among a plurality of candidate lines included in computer aided design data of the object by using a provisional position specified in advance in a three dimensional space as the position of the imaging device, by extracting remaining candidate lines which remain after removing one or more hidden lines from the plurality of candidate lines included in the computer aided design data, and by extracting candidate lines indicating an outline edge of the object from among the remaining candidate lines as the observed plurality of candidate lines; generating association information indicating a prescribed number N of combinations obtained by associating N candidate lines (1711 to 1714) of the observed plurality of candidate lines with N feature lines (1701 to 1704) of a plurality of feature lines detected from the image, wherein N is smaller than a number of the plurality of candidate lines included in the computer-aided design data; calculating a total error for the generated association information; repeating a prescribed number of times a process of generating the association information and calculating the total error by changing a selection of N combinations; and determining an association result according to the selection of N combinations that minimizes the total error, wherein generating the association information extracts a plurality of feature lines that each include a portion included a portion included in a specified region within the image from among the plurality of feature lines detected from the image, and selects the N feature lines from the extracted plurality of feature lines. extracting a plurality of candidate lines that are observed from a position of an imaging device that captures an image of an object from among a plurality of candidate lines included in computer aided design data of the object by using a provisional position specified in advance in a three dimensional space as the position of the imaging device, by extracting remaining candidate lines which remain after removing one or more hidden lines from the plurality of candidate lines included in the computer aided design data, and by extracting candidate lines indicating an outline edge of the object from among the remaining candidate lines as the observed plurality of candidate lines; generating association information indicating a prescribed number N of combinations obtained by associating N candidate lines (1711 to 1714) of the observed plurality of candidate lines with N feature lines (1701 to 1704) of a plurality of feature lines detected from the image, wherein N is smaller than a number of the plurality of candidate lines included in the computer-aided design data; calculating a total error for the generated association information; repeating a prescribed number of times a process of generating the association information and calculating the total error by changing a selection of N combinations; and determining an association result according to the selection of N combinations that minimizes the total error, wherein generating the association information extracts a plurality of feature lines that each include a portion included a portion included in a specified region within the image from among the plurality of feature lines detected from the image, and selects the N feature lines from the extracted plurality of feature lines.