An image processing apparatus for executing a matching process for an input image of a plurality of items that are arranged regularly, comprising: first setting input means for receiving registration of a model from a user; second setting input means for receiving, from a user, a first setting of a reference area with any shape for defining a plurality of process target areas in the input image; third setting input means for receiving a second setting from a user for defining the plurality of process target areas, which are arranged regularly in the input image, the plurality of process target areas being defined within the reference area; fourth setting input means for receiving from a user a third setting related to activation or inactivation of each of the plurality of process target areas as an object of execution of the matching process; fifth setting input means for receiving a first condition from a user that is related to characteristics of the process target area to be satisfied in the matching process; sixth setting input means for receiving a second condition from a user regarding the number of process target areas having a specific result of determination related to the satisfaction of the first condition, among the plurality of process target areas; area defining means for defining, upon acquiring the input image, the plurality of process target areas in the acquired input image such that the process target areas satisfy the second setting; process executing means for executing the matching process on each of the plurality of process target areas using the model registered in advance so as to determine whether each of the plurality of process target areas satisfies the first condition, the model being rotated in the matching process; determination means for determining whether the results of determination of respective ones of the plurality of process target areas satisfy the second condition; and output means for outputting whether the second condition is satisfied, wherein the process executing means is configured to skip the matching process for any of the plurality of process target areas that are inactivated as the object of execution of the matching process. first setting input means for receiving registration of a model from a user; second setting input means for receiving, from a user, a first setting of a reference area with any shape for defining a plurality of process target areas in the input image; third setting input means for receiving a second setting from a user for defining the plurality of process target areas, which are arranged regularly in the input image, the plurality of process target areas being defined within the reference area; fourth setting input means for receiving from a user a third setting related to activation or inactivation of each of the plurality of process target areas as an object of execution of the matching process; fifth setting input means for receiving a first condition from a user that is related to characteristics of the process target area to be satisfied in the matching process; sixth setting input means for receiving a second condition from a user regarding the number of process target areas having a specific result of determination related to the satisfaction of the first condition, among the plurality of process target areas; area defining means for defining, upon acquiring the input image, the plurality of process target areas in the acquired input image such that the process target areas satisfy the second setting; process executing means for executing the matching process on each of the plurality of process target areas using the model registered in advance so as to determine whether each of the plurality of process target areas satisfies the first condition, the model being rotated in the matching process; determination means for determining whether the results of determination of respective ones of the plurality of process target areas satisfy the second condition; and output means for outputting whether the second condition is satisfied, wherein the process executing means is configured to skip the matching process for any of the plurality of process target areas that are inactivated as the object of execution of the matching process.