CN-121982130-A - Image processing method and device, electronic device, storage medium and program product
Abstract
The application provides an image processing method and device, electronic equipment, storage medium and program product, wherein the method comprises the steps of carrying out object edge detection on an image to be processed to obtain outer edge lines of a plurality of objects in the image to be processed; and generating a target edge line based on the outer edge lines of the plurality of objects, wherein the target edge line is formed by connecting the outer edge lines of at least two objects in the plurality of objects, and adding a tracing material along the target edge line in the image to be processed. The method is different from the method for enhancing the scenery and the person in the image in the related art, but carries out the edge tracing treatment on the target edge line formed by connecting the outer edge lines of a plurality of objects, so that the effect of image treatment is improved due to the edge tracing materials properly distributed on the target edge line, different objects can be combined more naturally and more attractive through the target edge lines of different objects, the types of image treatment are enriched, and the use experience of users is improved.
Inventors
- WANG PINGPING
Assignees
- 书行科技(北京)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241030
Claims (10)
- 1. An image processing method, the method comprising: performing object edge detection on an image to be processed to obtain outer edge lines of a plurality of objects in the image to be processed; generating a target edge line based on the outer edge lines of the plurality of objects, wherein the target edge line is formed by connecting the outer edge lines of at least two objects in the plurality of objects; and adding the edge tracing material along the target edge line in the image to be processed.
- 2. The image processing method according to claim 1, characterized in that the method further comprises: determining at least two target objects in the plurality of objects according to parameters of the outer edge line of each object in the plurality of objects; the generating a target edge line based on the outer edge lines of the plurality of objects includes: A target edge line is generated based on the outer edge lines of the at least two target objects.
- 3. The image processing method according to claim 1, wherein the generating a target edge line based on the outer edge lines of the plurality of objects includes: for each two adjacent objects, if the parameters at the intersection point of the outer edge lines of the two adjacent objects meet the preset requirements, connecting the outer edge lines of the two adjacent objects as target edge lines; If any two target edge lines relate to the edge line of the same object, and parameters of merging results of the two target edge lines meet preset requirements, merging the two target edge lines.
- 4. The image processing method according to claim 1, wherein the adding of the stroked material along the target edge line within the image to be processed includes: and moving the target edge line in the image to be processed in parallel towards a direction far away from or close to an object to which the target edge line belongs, and adding a tracing material along the moved target edge line.
- 5. The image processing method according to claim 4, wherein the moving the target edge line in parallel in the image to be processed in a direction away from or toward an object to which the target edge line belongs, comprises: and moving the target edge line in parallel along a first direction towards a direction far away from or close to an object to which the target edge line belongs in the image to be processed, wherein the first direction is a normal direction of a connecting line between a starting point and an ending point of the target edge line.
- 6. The image processing method of claim 1, wherein the stroked material comprises text material; the adding of the edge tracing material along the target edge line in the image to be processed comprises the following steps: and adding text materials along the target edge line in the image to be processed so as to uniformly distribute the text materials in the text materials on the target edge line.
- 7. The image processing method according to claim 6, wherein adding text material along the target edge line within the image to be processed so that text material in the text material is uniformly distributed on the target edge line, comprises: According to the number of characters of the text material and the length of the target edge line, determining the central position of each text box of the text material on the target edge line so that the central positions of the text boxes of the text material are uniformly distributed on the target edge line; determining the position of each text box of the text material according to the central position of each text box of the text material, the normal direction of the central position of each text box on the target edge line and the size of the text box; and correspondingly filling each text material of the text material into each text box of the text material.
- 8. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, realizes the steps of the method according to any one of claims 1 to 7.
- 9. An electronic device, comprising: A processor; A memory for storing processor-executable instructions; wherein the processor is configured to implement the method of any one of claims 1 to 7 by executing the executable instructions.
- 10. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 7.
Description
Image processing method and device, electronic device, storage medium and program product Technical Field One or more embodiments of the present application relate to the field of computer software technology, and in particular, to an image processing method and apparatus, an electronic device, a storage medium, and a program product. Background With the development of mobile internet technology, social media programs are more and more in variety and more in function, for example, users can share images, videos, texts and the like on the social media programs. The social media program can provide the processing functions of images and videos for users, such as beautifying the figures in the images and videos, so that the images and videos shared by the users are more attractive and distinctive. However, in the related art, the processing types of the social media program on the image and the video are single, and the expectation of the user on the processing effect cannot be met, so that the willingness of the user to use the social media program is reduced. Disclosure of Invention In view of this, one or more embodiments of the present specification provide an image processing method and apparatus, an electronic device, a storage medium, and a program product. In order to achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions: according to a first aspect of one or more embodiments of the present specification, there is provided an image processing method, the method comprising: performing object edge detection on an image to be processed to obtain outer edge lines of a plurality of objects in the image to be processed; generating a target edge line based on the outer edge lines of the plurality of objects, wherein the target edge line is formed by connecting the outer edge lines of at least two objects in the plurality of objects; and adding the edge tracing material along the target edge line in the image to be processed. In one or more possible embodiments of the present description, the method further comprises: determining at least two target objects in the plurality of objects according to parameters of the outer edge line of each object in the plurality of objects; the generating a target edge line based on the outer edge lines of the plurality of objects includes: A target edge line is generated based on the outer edge lines of the at least two target objects. In one or more possible embodiments of the present specification, the determining at least two target objects among the plurality of objects according to parameters of the outer edge line of each object of the plurality of objects includes: for an outer edge line of each object of the plurality of objects, determining a scoring value for the outer edge line according to at least one parameter of the outer edge line; and determining the object with the score value of the outer edge line not lower than a preset threshold value as a target object. In one or more possible embodiments of the present specification, the determining at least two target objects among the plurality of objects according to parameters of the outer edge line of each object of the plurality of objects includes: And aiming at the outer edge line of each object in the plurality of objects, determining the object to which the outer edge line belongs as a target object in response to at least one parameter of the outer edge line meeting a corresponding screening condition. In one or more possible embodiments of the present specification, the generating a target edge line based on the outer edge lines of the plurality of objects includes: for each two adjacent objects, if the parameters at the intersection point of the outer edge lines of the two adjacent objects meet the preset requirements, connecting the outer edge lines of the two adjacent objects as target edge lines; If any two target edge lines relate to the edge line of the same object, and parameters of merging results of the two target edge lines meet preset requirements, merging the two target edge lines. In one or more possible embodiments of the present specification, the adding the stroked material along the target edge line in the image to be processed includes: and moving the target edge line in the image to be processed in parallel towards a direction far away from or close to an object to which the target edge line belongs, and adding a tracing material along the moved target edge line. In one or more possible embodiments of the present disclosure, the moving the target edge line in parallel in the to-be-processed image in a direction away from or near to an object to which the target edge line belongs, and adding the stroked material along the moved target edge line includes: And moving the target edge line in the image to be processed in parallel to a direction far from or close to the object to which the edge line belongs by a first distance, and