CPC G06V 20/62 (2022.01) [G06F 16/951 (2019.01); G06T 7/11 (2017.01); G06T 7/187 (2017.01); G06T 11/203 (2013.01); G06V 30/15 (2022.01); G06V 30/18076 (2022.01); G06V 30/10 (2022.01)] | 15 Claims |
1. A method for generating an image of webpage content, the method comprising:
acquiring a screenshot of a webpage preloaded by a terminal as a source image;
recognizing connection areas in the source image, and generating first circumscribed rectangular frames outside outlines of the connection areas;
combining, in response determining that a distance between the connection areas is smaller than a preset distance threshold, the connection areas, and generating a second circumscribed rectangular frame outside outlines of the combined connection areas; and
generating, based on a nested relationship between the first circumscribed rectangular frames and the second circumscribed rectangular frame and pictures in the first circumscribed rectangular frames, a target image, wherein the generating, based on a nested relationship between the first circumscribed rectangular frames and the second circumscribed rectangular frame and pictures in the first circumscribed rectangular frames, a target image comprises:
obtaining an initial target image by combining, based on the nested relationship between the first circumscribed rectangular frames and the second circumscribed rectangular frame, the pictures in the first circumscribed rectangular frames;
determining a core area in the initial target image, wherein the core area in the initial target image is an area comprising a preset target in the initial target image;
segmenting, based on a preset clipping ratio and size, the initial target image to obtain segmented core area pictures; and
aggregating, based on feature information of the segmented core area pictures, the segmented core area pictures to obtain the target image, wherein the feature information comprises at least one of a size, an aspect ratio or a composition attribute of the pictures.
|