A boundary recess detection device comprising: a detection unit that detects a boundary recess being a cutout line formed at a boundary position between a plurality of packaging bags each of which packs a medicine and is connected to form a continuous packaging bag having a strip-like shape; a light irradiation unit that emits light toward a surface of an imaging target portion on which at least the boundary recess is located in the continuous packaging bag when an image of the surface of the imaging target portion is captured, which includes a first light emitting unit and a second light emitting unit that emit light in mutually opposite directions in a longitudinal direction of the continuous packaging bag and emit light diagonally toward the surface of the imaging target portion, an image capturing unit that captures an image of the surface of the imaging target portion a plurality of times while imaging conditions are changed when light is emitted toward the surface of the imaging target portion and when the capturing target portion is located between the first light emitting unit and the second light emitting unit, wherein the light irradiation unit changes a light emitting unit (17a, 17b) used at the time of light emission out of the first light emitting unit and the second light emitting unit when changing the imaging conditions such that the light emission of the second light emitting unit is stopped during the light emission of the first light emitting unit and the light emission of the first light emitting unit is stopped during the light emission of the second light emitting unit, the image capturing unit captures a first image of the surface of the imaging target portion while the light irradiation unit uses the first light emitting unit and captures a second image of the surface of the imaging target portion while the light irradiation unit uses the second light emitting unit, and the detection unit detects the boundary recess in the imaging target portion on the basis of the first image and the second image. a detection unit that detects a boundary recess being a cutout line formed at a boundary position between a plurality of packaging bags each of which packs a medicine and is connected to form a continuous packaging bag having a strip-like shape; a light irradiation unit that emits light toward a surface of an imaging target portion on which at least the boundary recess is located in the continuous packaging bag when an image of the surface of the imaging target portion is captured, which includes a first light emitting unit and a second light emitting unit that emit light in mutually opposite directions in a longitudinal direction of the continuous packaging bag and emit light diagonally toward the surface of the imaging target portion, an image capturing unit that captures an image of the surface of the imaging target portion a plurality of times while imaging conditions are changed when light is emitted toward the surface of the imaging target portion and when the capturing target portion is located between the first light emitting unit and the second light emitting unit, wherein the light irradiation unit changes a light emitting unit (17a, 17b) used at the time of light emission out of the first light emitting unit and the second light emitting unit when changing the imaging conditions such that the light emission of the second light emitting unit is stopped during the light emission of the first light emitting unit and the light emission of the first light emitting unit is stopped during the light emission of the second light emitting unit, the image capturing unit captures a first image of the surface of the imaging target portion while the light irradiation unit uses the first light emitting unit and captures a second image of the surface of the imaging target portion while the light irradiation unit uses the second light emitting unit, and the detection unit detects the boundary recess in the imaging target portion on the basis of the first image and the second image.