An image processing device for a board comprising: an image acquisition unit that is configured to acquire image data by capturing an image of a first region including a fiducial mark disposed on an upper surface of the board; a detection unit that is configured to scan the image data using a first template indicating a shape of the fiducial mark to detect a position of the fiducial mark, wherein the positional relationship of the first template with a reference position of the board is known; a template acquisition unit that is configured to newly generate a second template or acquire an existing second template already generated in another board, wherein the second template indicates a distinctive portion of the board located outside the fiducial mark in the first region, when the position of the fiducial mark is not detected by scanning with the detection unit; and a position recognition unit that is configured to recognize the reference position of the board based on the detection of the position of the fiducial mark and is configured to recognize the reference position of the board using the second template, when the position of the fiducial mark is not detected by scanning with the detection unit, wherein a display unit is configured to display the acquired second template superimposed on the image data, and a setting receiving unit is configured to receive a setting of a relative position of the second template with respect to the image data, wherein the position recognition unit recognizes the reference position of the board based on content of the setting and a known positional relationship of the second template with the reference position of the board; the image processing device being further configured to be applied to a component mounting machine that mounts a plurality of electronic components on the board, and to execute the recognition process for recognizing the reference position a plurality of times during execution of the mounting process by the component mounting machine, wherein the template acquisition unit is further configured to acquire first image data, which is the image data used in the previous recognition process in which a position of the fiducial mark was detected, and to execute image processing for making the first image data transparent so that other image data displayed with the second template can be viewed or image processing for extracting an edge corresponding to the distinctive portion to generate the second template; wherein the template acquisition unit is further configured to execute image processing for removing a region including the fiducial mark in the first image data in the generation process for generating the second template. an image acquisition unit that is configured to acquire image data by capturing an image of a first region including a fiducial mark disposed on an upper surface of the board; a detection unit that is configured to scan the image data using a first template indicating a shape of the fiducial mark to detect a position of the fiducial mark, wherein the positional relationship of the first template with a reference position of the board is known; a template acquisition unit that is configured to newly generate a second template or acquire an existing second template already generated in another board, wherein the second template indicates a distinctive portion of the board located outside the fiducial mark in the first region, when the position of the fiducial mark is not detected by scanning with the detection unit; and a position recognition unit that is configured to recognize the reference position of the board based on the detection of the position of the fiducial mark and is configured to recognize the reference position of the board using the second template, when the position of the fiducial mark is not detected by scanning with the detection unit, wherein a display unit is configured to display the acquired second template superimposed on the image data, and a setting receiving unit is configured to receive a setting of a relative position of the second template with respect to the image data, wherein the position recognition unit recognizes the reference position of the board based on content of the setting and a known positional relationship of the second template with the reference position of the board; the image processing device being further configured to be applied to a component mounting machine that mounts a plurality of electronic components on the board, and to execute the recognition process for recognizing the reference position a plurality of times during execution of the mounting process by the component mounting machine, wherein the template acquisition unit is further configured to acquire first image data, which is the image data used in the previous recognition process in which a position of the fiducial mark was detected, and to execute image processing for making the first image data transparent so that other image data displayed with the second template can be viewed or image processing for extracting an edge corresponding to the distinctive portion to generate the second template; wherein the template acquisition unit is further configured to execute image processing for removing a region including the fiducial mark in the first image data in the generation process for generating the second template.