An image processing apparatus for calculating quantitative information on an object in an image, the image processing apparatus comprising: an input unit configured to input an image; a segmentation unit configured to segment a foreground and a background of the image; a separation unit configured to separate a plurality of objects in contact with each other in the image; a classification unit configured to classify the objects into classes; and a quantitative calculation unit configured to generate quantitative information on the object, wherein, the input unit receives an image for which the quantitative information is to be calculated, the segmentation unit segments the image into a foreground region and a background region, the foreground region being a region in which an object in the image for which the quantitative information is to be calculated is shown, and the background region being a region other than the foreground region, the separation unit detects, with respect to a first object and a second object in contact with each other in the image, a contact point between the first object and the second object based on a region segmentation result output by the segmentation unit, and separates the first object and the second object by connecting two boundary reference pixels including a first boundary reference pixel that is a pixel in a background region closest to the contact point, and a second boundary reference pixel that is a pixel in a background region in a direction opposite to the first boundary reference pixel across the contact point, the classification unit classifies each object in the image into a class, and the quantitative calculation unit generates and outputs quantitative information on the object based on the region segmentation result output by the segmentation unit, a separation result output by the separation unit, and a classification result output by the classification unit. an input unit configured to input an image; a segmentation unit configured to segment a foreground and a background of the image; a separation unit configured to separate a plurality of objects in contact with each other in the image; a classification unit configured to classify the objects into classes; and a quantitative calculation unit configured to generate quantitative information on the object, wherein, the input unit receives an image for which the quantitative information is to be calculated, the segmentation unit segments the image into a foreground region and a background region, the foreground region being a region in which an object in the image for which the quantitative information is to be calculated is shown, and the background region being a region other than the foreground region, the separation unit detects, with respect to a first object and a second object in contact with each other in the image, a contact point between the first object and the second object based on a region segmentation result output by the segmentation unit, and separates the first object and the second object by connecting two boundary reference pixels including a first boundary reference pixel that is a pixel in a background region closest to the contact point, and a second boundary reference pixel that is a pixel in a background region in a direction opposite to the first boundary reference pixel across the contact point, the classification unit classifies each object in the image into a class, and the quantitative calculation unit generates and outputs quantitative information on the object based on the region segmentation result output by the segmentation unit, a separation result output by the separation unit, and a classification result output by the classification unit.