An inspection device comprising: a light emitter that emits light onto a product in which a plurality of objects each having a predetermined shape are contained; a light detector that detects light transmitted through the product; characterized in that the inspection device further comprises: a controller configured to inspect the number of the objects based on a transmission image obtained from the light transmitted through the product, the controller being configured to execute: a region specifier configured to specify an object region, in which one or more objects are determined to exist, in the transmission image based on the number of pixels occupied by each object; and a total-number calculator configured to calculate a total number of the objects contained as the product, wherein for the object region in which the region specifier determines that two or more of the objects exist, the number of the objects included in the object region is specified by either or both of the region specifier and the total-number calculator, the region specifier separating the object region into regions for the respective objects based on the number of pixels occupied by each object, the total-number calculator estimating a total mass of the objects included in the object region based on grayscale information on part of the transmission image corresponding to the object region and dividing the total mass estimated by a mass per object, and the total-number calculator calculates, when the region specifier has specified that a plurality of the object regions exist based on distribution of the object regions in the transmission image, the total number of the objects contained in the product by summing the number of the objects in the object regions specified by either or both of the region specifier and the total-number calculator. a light emitter that emits light onto a product in which a plurality of objects each having a predetermined shape are contained; a light detector that detects light transmitted through the product; characterized in that the inspection device further comprises: a controller configured to inspect the number of the objects based on a transmission image obtained from the light transmitted through the product, the controller being configured to execute: a region specifier configured to specify an object region, in which one or more objects are determined to exist, in the transmission image based on the number of pixels occupied by each object; and a total-number calculator configured to calculate a total number of the objects contained as the product, wherein for the object region in which the region specifier determines that two or more of the objects exist, the number of the objects included in the object region is specified by either or both of the region specifier and the total-number calculator, the region specifier separating the object region into regions for the respective objects based on the number of pixels occupied by each object, the total-number calculator estimating a total mass of the objects included in the object region based on grayscale information on part of the transmission image corresponding to the object region and dividing the total mass estimated by a mass per object, and the total-number calculator calculates, when the region specifier has specified that a plurality of the object regions exist based on distribution of the object regions in the transmission image, the total number of the objects contained in the product by summing the number of the objects in the object regions specified by either or both of the region specifier and the total-number calculator. a region specifier configured to specify an object region, in which one or more objects are determined to exist, in the transmission image based on the number of pixels occupied by each object; and a total-number calculator configured to calculate a total number of the objects contained as the product, wherein for the object region in which the region specifier determines that two or more of the objects exist, the number of the objects included in the object region is specified by either or both of the region specifier and the total-number calculator, the region specifier separating the object region into regions for the respective objects based on the number of pixels occupied by each object, the total-number calculator estimating a total mass of the objects included in the object region based on grayscale information on part of the transmission image corresponding to the object region and dividing the total mass estimated by a mass per object, and the total-number calculator calculates, when the region specifier has specified that a plurality of the object regions exist based on distribution of the object regions in the transmission image, the total number of the objects contained in the product by summing the number of the objects in the object regions specified by either or both of the region specifier and the total-number calculator.