CPC G06T 7/194 (2017.01) [G06N 20/00 (2019.01); G06T 3/02 (2024.01); G06T 5/70 (2024.01); G06T 5/75 (2024.01); G06T 7/12 (2017.01)] | 15 Claims |
1. A method for processing an input image, comprising:
obtaining an input image for processing;
generating a first mask image corresponding to the input image based on a machine-learning model and determining whether the input image has a foreground object, wherein
the foreground object comprises a product,
the machine-learning model is trained using supervision information from a plurality of positive sample images and a plurality of negative sample images, each positive sample image comprises a foreground object and each negative sample image includes no foreground object, and the supervision information comprises mask images of the plurality of positive sample images and the plurality of negative sample images, wherein pixel values of a mask image for each positive sample image have different grayscale values than pixel values of a mask image for each negative sample image, and
the determining whether the input image has the foreground object comprises:
obtaining a plurality of pixel groups by separating pixels of the input image according to depth information of the pixels; and
determining that the input image has the foreground object in response to that (1) a difference between the depth information of a target pixel group and the depth information of other pixel groups is greater than a set threshold, and (2) a size corresponding to the target pixel group is greater than the size corresponding to the other pixel groups;
in response to determining that the input image has the foreground object, setting pixels corresponding to the foreground object in the first mask image to a first grayscale value range, and setting pixels corresponding to one or more non-foreground objects in the first mask image to a second grayscale value range;
determining an outline corresponding to the foreground object in the input image according to a grayscale value range difference between the first grayscale value range of the foreground object and the second grayscale value range of the one or more non-foreground objects in the first mask image;
obtaining images of a plurality of items related to the foreground object;
displaying the images of the plurality of items related to the foreground object;
identifying one or more user-selected images from the displayed images of the plurality of items related to the foreground object;
generating a product release image corresponding to the product, wherein the product release image comprises both (1) the foreground object cut out from the input image according to the determined outline and (2) the one or more user-selected images.
|