Search

CN-121563767-B - Collage generation method, collage generation device, computer equipment and readable storage medium

CN121563767BCN 121563767 BCN121563767 BCN 121563767BCN-121563767-B

Abstract

The application relates to a collage generation method, a collage generation device, computer equipment and a readable storage medium. The method comprises the steps of obtaining a discrete image block set and a collage prompt text, respectively rendering each image block in the discrete image block set to obtain a collage rendering result, determining rendering loss based on the collage rendering result and the collage prompt text, adjusting geometric parameters of the image blocks according to the rendering loss to obtain adjusted geometric parameters, determining a new pose of the image blocks based on the adjusted geometric parameters, and rendering the image blocks in the new pose to obtain a new collage rendering result until preset rendering conditions are met, and obtaining a target rendering result. By adopting the method, the accuracy of the collage image can be improved.

Inventors

  • XU PENGFEI
  • Shao Zefan
  • ZHOU JIN
  • YANG HONGLIANG

Assignees

  • 深圳大学

Dates

Publication Date
20260512
Application Date
20260116

Claims (10)

  1. 1. A method of collage generation, the method comprising: Acquiring a discrete image block set and a collage prompt text; rendering each image block in the discrete image block set respectively to obtain a collage rendering result; Determining the judging matching degree between the collage rendering result and the collage prompt text based on a text-to-text graph judging model, wherein the text-to-text graph judging model is used for generating a reference collage image corresponding to the collage prompt text and judging the matching degree between the reference collage image and the collage rendering result; Performing alignment prediction on the collage rendering result and the collage prompt text based on a scene distribution simulation model to obtain alignment confidence; the scene distribution simulation model is used for simulating scene distribution based on the collage prompt text and carrying out alignment prediction on the simulated scene distribution and the collage rendering result; determining semantic loss according to the discrimination matching degree and the alignment confidence degree; Determining a transparency accumulation value of each pixel point in the collage rendering result, and determining an overlap penalty value according to the transparency accumulation value; Determining a geometric constraint value according to the position relation between the center of the image block and a preset canvas area; Determining a rendering penalty based on the semantic penalty, the overlap penalty, and the geometric constraint value; adjusting the geometric parameters of the image block according to the rendering loss to obtain adjusted geometric parameters; and determining a new pose of the image block based on the adjusted geometric parameters, and rendering the image block in the new pose to obtain a new collage rendering result until a preset rendering condition is met, so as to obtain a target rendering result.
  2. 2. The method according to claim 1, wherein rendering each image block in the set of discrete image blocks to obtain a collage rendering result comprises: Detecting and removing the background of each image block in the discrete image block set respectively to obtain an image block comprising transparency information; and rendering the image blocks comprising the transparency information to obtain a collage rendering result.
  3. 3. The method according to claim 1, wherein rendering each image block in the set of discrete image blocks to obtain a collage rendering result comprises: Determining the position of a target pixel point of a target image block in the discrete image block set; determining a rendering area according to the position of the target pixel point and the Gaussian kernel size; Determining the distance between each pixel point in the rendering area and the target pixel point, and determining the rendering weight corresponding to each pixel point according to the distance; And rendering the pixels of the target pixel points according to the rendering weights and the pixel values corresponding to the pixel points in the rendering area to obtain a rendering result of the target pixel points.
  4. 4. The method of claim 1, wherein said determining a semantic loss based on said discriminant matching and said alignment confidence comprises: and taking the difference value between the alignment confidence and the discrimination matching degree as semantic loss.
  5. 5. The method of claim 1, wherein the determining a rendering penalty based on the semantic penalty, the overlap penalty value, and the geometry constraint value comprises: Carrying out weighted summation on the overlap penalty value and the geometric constraint value to obtain a structural loss; and carrying out weighted summation on the semantic loss and the structural loss to obtain a rendering loss.
  6. 6. The method according to claim 1, wherein rendering each image block in the set of discrete image blocks to obtain a collage rendering result comprises: rendering each image block in the discrete image block set through a Gaussian sputtering renderer to obtain a collage rendering result; After the preset rendering condition is met, the method further comprises: Acquiring target geometric parameters of the image block corresponding to the preset rendering conditions; And rendering the target geometric parameters through a high-definition renderer to obtain a high-definition rendering result.
  7. 7. A collage generating device, the device comprising: the data acquisition module is used for acquiring a discrete image block set and a collage prompt text; The image block rendering module is used for rendering each image block in the discrete image block set respectively to obtain a collage rendering result; The rendering loss determination module is used for determining the discrimination matching degree between the collage rendering result and the collage prompt text based on a text-generated graph discrimination model, wherein the text-generated graph discrimination model is used for generating a reference collage image corresponding to the collage prompt text and discriminating the matching degree between the reference collage image and the collage rendering result, performing alignment prediction on the collage rendering result and the collage prompt text based on a scene distribution simulation model to obtain alignment confidence degree, the scene distribution simulation model is used for simulating scene distribution based on the collage prompt text and performing alignment prediction on simulated scene distribution and the collage rendering result, determining semantic loss according to the discrimination matching degree and the alignment confidence degree, determining an overlap penalty value according to the transparency accumulation value, determining a geometric constraint value according to the position relation between the center of an image block and a preset canvas area, and determining rendering loss based on the semantic loss, the overlap penalty value and the geometric constraint value; the geometric parameter adjusting module is used for adjusting the geometric parameters of the image block according to the rendering loss to obtain adjusted geometric parameters; The rendering result obtaining module is used for determining a new pose of the image block based on the adjusted geometric parameters, rendering the image block in the new pose to obtain a new image block rendering result until a preset rendering condition is met, and obtaining a target rendering result.
  8. 8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
  9. 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.

Description

Collage generation method, collage generation device, computer equipment and readable storage medium Technical Field The present application relates to the field of visual design technology, and in particular, to a method, an apparatus, a computer device, a computer readable storage medium, and a computer program product for generating a collage. Background In the fields of digital art creation and visual design, the image collage is used as an expression form for recombining discrete visual elements into a unified semantic whole, and has wide application value. Traditional collage authoring processes are highly dependent on the personal aesthetic and manual operation of the creator, with very high thresholds for non-professional portals. With the development of the generated artificial intelligence, how to automatically generate the collage layout by using a calculation method becomes a research hotspot. In the related art, abstract semantics are difficult to understand by a geometric feature method, and a reasonable visual structure cannot be generated by only text prompt, so that the accuracy of the generated collage image is low. Disclosure of Invention In view of the foregoing, it is desirable to provide a collage generation method, apparatus, computer device, computer-readable storage medium, and computer program product that can accurately generate a collage image. In a first aspect, the present application provides a method for generating a collage, including: Acquiring a discrete image block set and a collage prompt text; rendering each image block in the discrete image block set respectively to obtain a collage rendering result; Determining rendering loss based on the collage rendering result and the collage prompt text; adjusting the geometric parameters of the image block according to the rendering loss to obtain adjusted geometric parameters; and determining a new pose of the image block based on the adjusted geometric parameters, and rendering the image block in the new pose to obtain a new collage rendering result until a preset rendering condition is met, so as to obtain a target rendering result. In a second aspect, the present application also provides a collage generating device, including: the data acquisition module is used for acquiring a discrete image block set and a collage prompt text; The image block rendering module is used for rendering each image block in the discrete image block set respectively to obtain a collage rendering result; the rendering loss determination module is used for determining rendering loss based on the collage rendering result and the collage prompt text; the geometric parameter adjusting module is used for adjusting the geometric parameters of the image block according to the rendering loss to obtain adjusted geometric parameters; The rendering result obtaining module is used for determining a new pose of the image block based on the adjusted geometric parameters, rendering the image block in the new pose to obtain a new image block rendering result until a preset rendering condition is met, and obtaining a target rendering result. In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the collage generation method provided in the first aspect when the computer program is executed by the processor. In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the collage generation method provided in the first aspect. In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the collage generation method provided in the first aspect. According to the collage generating method, the device, the computer equipment, the computer readable storage medium and the computer program product, through obtaining the discrete image block set and the collage prompt text, rendering is conducted on each image block in the discrete image block set to obtain a collage rendering result, based on the collage rendering result and the collage prompt text, rendering loss is determined, the geometric parameters of the image blocks are adjusted according to the rendering loss to obtain adjusted geometric parameters, a new pose of the image blocks is determined based on the adjusted geometric parameters, the image blocks in the new pose are rendered to obtain a new collage rendering result until preset rendering conditions are met, a target rendering result is obtained, semantic guidance through the collage prompt text can be achieved, discrete image block materials are automatically collaged into the collage conforming to text description under the condition that any preset shape template or reference image is not needed, accura