Image generating method, device, equipment, and storage medium

The image generation method addresses the issue of unrealistic taillights in converted images by replacing non-matching lamp states with scene-compatible images, enhancing the authenticity and realism of the generated images.

JP7537034B2Active Publication Date: 2024-08-20SENSETIME GRP LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023559731
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-03-31
Filing Date
2022-01-26
Publication Date
2024-08-20
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

Traditional image generation methods fail to accurately convert daytime autonomous driving scenes into night scenes, resulting in unrealistic taillights on vehicles, which compromises the authenticity of the generated images.

Method used

An image generation method that detects illumination lamps in an original image, identifies those that do not match the scene information, and replaces them with images from a preset library or generates new images that match the scene information, ensuring the operational state of the lamps aligns with the target scene.

Benefits of technology

The method enhances the fidelity and realism of the generated images by accurately depicting lamp states in different lighting conditions, improving the authenticity and rationality of the converted images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007537034000004
    Figure 0007537034000004
  • Figure 0007537034000005
    Figure 0007537034000005
  • Figure 0007537034000008
    Figure 0007537034000008
Patent Text Reader

Abstract

The embodiments of the present disclosure provide an image generating method, an apparatus, a device, and a storage medium, the method including: detecting an illumination lamp of a target object in an original image; converting the original image into a target image in a specific scene; determining an illumination lamp in the target image whose motion state does not match scene information of the specific scene as a replacement target object; determining a replacement image including a replacement target object whose motion state matches the scene information based on the scene information and the replacement target object; and using the replacement image to replace an image of an area occupied by the replacement target object in the target image to generate a target image. In this way, by matching the motion state of an object in the target image with the scene information, the generated target image is more suitable for a real scene.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims priority to a Chinese patent application bearing application number 202110351897.2, filed with the China Patent Office on March 31, 2021, the entire contents of which are incorporated herein by reference.

[0002] The embodiments of the present disclosure relate to the field of intelligent driving technology, including, but not limited to, an image generating method, an apparatus, an instrument, and a storage medium. [Background technology]

[0003] In conventional image generation methods, when image generation needs to convert an image of a daytime autonomous driving scene into an image of a nighttime scene, the taillights of the cars in the converted image are also dark, so the credibility of the generated image is not high. Summary of the Invention [Problem to be solved by the invention]

[0004] In view of this, the embodiments of the present disclosure provide a technical solution for image generation. [Means for solving the problem]

[0005] The technical solutions of the embodiments of the present disclosure can be realized as follows.

[0006] An embodiment of the present disclosure provides an image generation method, the method including: detecting an illumination lamp of a target object in an original image; converting the original image into a processing target image of a specific scene; determining an illumination lamp in the processing target image whose operating state does not match scene information of the specific scene as a replacement target object; determining a replacement image including a replacement target object whose operating state matches the scene information based on the scene information and the replacement target object; and using the replacement image to replace an image of an area occupied by the replacement target object in the processing target image to generate a target image.

[0007] In some embodiments, determining a replacement image including a replacement object whose action state matches the scene information based on the scene information and the replacement object includes: determining attribute information of the replacement object; searching a target preset image including a preset object whose attribute matches the attribute information of the replacement object from a preset image library; and determining the searched target preset image as the replacement image, where the action state of the preset object in the replacement image matches the scene information. In this way, the fidelity and rationality of the replaced target image can be improved.

[0008] In some embodiments, the method further includes determining a distance between the object to be replaced and a device that collects the original image, and searching the preset image library for a target preset image including a preset object whose attribute matches the attribute information of the object to be replaced includes searching the preset image library for a target preset image including a preset object whose attribute matches the attribute information of the object to be replaced based on category information of the object to be replaced and the determined distance. In this way, by combining the category and distance of the object to be replaced to search for a target preset image from the preset image library, the accuracy of the searched target preset image can be improved.

[0009] In some embodiments, in response to the target preset image being unable to be retrieved from the preset image library, the method further includes: generating a target preset image including a preset object whose attributes match attribute information of the object to be replaced; and determining the generated target preset image as the replacement image. In this way, when the target image is unable to be retrieved, a target preset image is automatically generated, and the accuracy of the replacement image can be improved.

[0010] In some embodiments, generating a target preset image including a preset object whose attribute matches the attribute information of the replacement target object includes: determining an operation parameter of the preset object based on a distance between the replacement target object and a device that collects the original image; and generating a target preset image including the preset object based on the determined operation parameter. In this way, by replacing a non-illuminated car light image in a nighttime processing target image with an illuminating replacement image, the generated target image becomes more realistic.

[0011] In some embodiments, determining the distance between the object to be replaced and the device that collects the original image includes: determining size information of the object to be replaced based on category information of the object to be replaced; and determining the distance between the object to be replaced and the device that collects the original image based on the size information and the size of the object to be replaced in the image to be processed. In this way, by analyzing the size of the object to be replaced, the distance between the device and the object can be obtained more accurately.

[0012] In some embodiments, after the target preset image is generated, the image generating method further includes storing the target preset image in the preset image library, in this way the preset image library can be enriched, and it is convenient to search the target preset image from the preset image library in the future.

[0013] In some embodiments, the operation parameter of the preset object is a light intensity of a lighting lamp, and determining the operation parameter of the preset object based on a distance between the object to be replaced and a device that collects the original image includes determining a light intensity when the lighting lamp is in an operating state, and determining a light intensity of the lighting lamp that matches the distance based on the distance and the light intensity when the lighting lamp is in an operating state, and generating a target preset image including the preset object based on the determined operation parameter includes generating a target preset image including the preset object having a light intensity that matches the distance based on the light intensity that matches the distance. In this way, the degree of match between the finally obtained replacement object and scene information can be improved.

[0014] In some embodiments, using the replacement image to replace the image of the area occupied by the object to be replaced in the processing target image to generate a target image includes: determining size information of the replacement image; determining an area of ​​the area occupied by the object to be replaced in the processing target image; adjusting the size information of the replacement image according to the area to obtain an adjusted image; using the adjusted image to replace the image of the area occupied by the object to be replaced to generate a candidate image; and performing a smoothing process on the candidate image to generate the target image. In this way, the generated target image is more reasonable and clear.

[0015] In some embodiments, the target object includes a driving device, a street light.

[0016] An embodiment of the present disclosure provides an image generation device, comprising: an illumination lamp detection module configured to detect an illumination lamp of a target object in an original image; an image conversion module configured to convert the original image into a processing target image in a specific scene; an object determination module configured to determine an illumination lamp in the processing target image whose operational state does not match scene information of the specific scene as a replacement target object; a replacement image determination module configured to determine a replacement image including a replacement target object whose operational state matches the scene information based on the scene information and the replacement target object; and an image generation module configured to use the replacement image to replace an image of an area occupied by the replacement target object in the processing target image and generate a target image.

[0017] An embodiment of the present disclosure provides a computer storage medium storing computer-executable instructions, which, after execution of the computer-executable instructions, cause a computer to implement the above image generating method.

[0018] An embodiment of the present disclosure provides an electronic device comprising a memory storing computer-executable instructions and a processor, the processor performing the above-mentioned image generation method when executing the computer-executable instructions in the memory.

[0019] An embodiment of the present disclosure provides a computer program comprising computer readable code, which when executed on an electronic device causes a processor of the electronic device to perform the image generation method described in any one of the above.

[0020] An embodiment of the present disclosure provides an image generation method, apparatus, device, and storage medium, which first convert an original image into a target image for a specific scene, then use an illumination lamp of a target object in the target image whose operational state does not match the scene information of the specific scene as a replacement target object, and determine a replacement image including a replacement target object whose operational state matches the scene information based on the scene information and the replacement target object, and finally use the replacement image to replace an image of an area occupied by the replacement target object in the target image to generate a target image, and in this way, by matching the operational state of the object in the target image with the scene information, the generated target image is more suitable for the actual scene. [Brief description of the drawings]

[0021] [Figure 1A] FIG. 1 is a system architecture diagram to which an image generation method according to an embodiment of the present disclosure can be applied. [Figure 1B] 1 is a flowchart for implementing an image generation method according to an embodiment of the present disclosure. [Diagram 2] 13 is another flowchart for implementing an image generation method according to an embodiment of the present disclosure. [Figure 3A] FIG. 1 is a schematic structural diagram of an image generating system according to an embodiment of the present disclosure. [Figure 3B] FIG. 1 is a schematic diagram of an application scene of an image generation method according to an embodiment of the present disclosure. [Figure 4]FIG. 2 is an exemplary structural diagram for implementing an image generation method according to an embodiment of the present disclosure. [Diagram 5] FIG. 2 is a schematic diagram of another application scene of the image generation method according to an embodiment of the present disclosure. [Figure 6] FIG. 1 is a schematic structural diagram of an image generating device according to an embodiment of the present disclosure. [Figure 7] FIG. 2 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0022] The drawings herein are incorporated in and constitute a part of this specification, and these drawings illustrate embodiments consistent with the embodiments of the present disclosure, and together with the specification, are used to explain the technical solutions of the embodiments of the present disclosure.

[0023] In order to make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the specific technical solutions of the present invention will be described in more detail below with reference to the drawings of the embodiments of the present disclosure. The following embodiments are used to explain the present disclosure, but are not intended to limit the present disclosure.

[0024] In the following description, "some embodiments" refers to a subset of all possible embodiments, but it will be understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict.

[0025] In the following description, terms such as "first / second / third" are used only to distinguish between similar objects and do not limit a particular order, and "first / second / third" can be used to convert a particular order or order when appropriate, so that it will be understood that the embodiments of the present disclosure described in some embodiments can be performed in an order other than that illustrated or described in some embodiments.

[0026] Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art of this disclosure. The terms used herein are used only to describe the embodiments of this disclosure and are not intended to limit the disclosure.

[0027] Before describing the embodiments of the present disclosure in more detail, the nouns and terms related to the embodiments of the present disclosure will be explained. The nouns and terms related to the embodiments of the present disclosure will be explained as follows.

[0028] 1) Gaussian Blur: It is a low-pass filter for an image. The so-called "blur" can be understood as taking the average value of the surrounding pixels for each pixel.

[0029] 2) Ego vehicle: A vehicle equipped with sensors that sense the surrounding environment. The vehicle coordinate system is fixed to the ego vehicle, where the x-axis is in the forward direction of the vehicle, the y-axis points to the left of the forward direction of the vehicle, and the Z-axis is perpendicular to the ground and conforms to a right-handed coordinate system. The origin of the coordinate system is on the ground below the midpoint of the rear axle.

[0030] The following describes exemplary applications of the image generating device provided by the embodiment of the present disclosure. The device provided by the embodiment of the present disclosure may be implemented as various types of user terminals with image collection functions, such as notebook computers, tablet computers, desktop computers, cameras, mobile devices (e.g., personal digital assistants, dedicated messaging devices, and portable game consoles), or may be implemented as a server. The following describes exemplary applications when the device is implemented as a terminal or a server.

[0031] The image generation method can be applied to a computer device, and the functions realized by the method can be realized by a processor of the computer device calling a program code, and of course, the program code can be stored in a storage medium of the computer, and the computer device includes at least a processor and a storage medium.

[0032] 1A is a system architecture diagram to which the image generation method of the embodiment of the present disclosure can be applied. As shown in FIG. 1A, the system architecture includes an image collection device 131, a network 132, and an image generation terminal 133. To support an exemplary application, the image collection device 131 and the image generation terminal 133 establish a communication connection through the network 132, the image collection device 131 reports the original image collected through the network 202 (or the image generation terminal 133 automatically obtains the original image collected by the vehicle terminal 131) to the image generation terminal 133, and the image generation terminal 133, in response to the received original image, first detects the lighting lamps in the original image and converts the image into a processing target image in a specific scene, then finds the lighting lamps in an unreasonable operating state in the processing target image, and finally replaces the image area corresponding to the unreasonable lighting lamps with a replacement image whose operating state matches the scene information, thereby generating a target image, and outputs the target image to the image display interface of the image generation terminal 133. In this way, by matching the motion states of objects in the target image with the scene information, the generated target image is adapted to the actual scene.

[0033] As an example, the image collection device 131 may be a collection device including a camera, etc. The image generation terminal 133 may include a computer device with a specific computing function, and the computer device includes a terminal device, a server, or other processing devices, etc. The network 132 may adopt a wired or wireless connection method. Here, if the image generation terminal 133 is a server, the image collection device 131 may communicate with the server via a wired connection such as data communication via a bus, and if the image generation terminal 133 is a terminal device, the image collection device 131 may communicate with the image generation terminal 133 via a wireless network to perform data communication.

[0034] Or, in some scenes, the image generation terminal 133 may be a visual processing device with a video acquisition module, or a host with a camera. In this case, the image generation method according to the embodiment of the present application may be executed by the image generation terminal 133, and the above system architecture may not include the network 132 and the image acquisition device 131.

[0035] As shown in FIG. 1B, FIG. 1B is a flow chart for implementing an image generating method according to an embodiment of the present disclosure, which will be described in conjunction with the steps shown in FIG. 1B.

[0036] In step S101, the illumination lamp of the target object in the original image is detected.

[0037] In some embodiments, the original image may be an image collected in any scene, and may be an image with complex screen content or an image with simple screen content, for example, an image of a street scene collected at midnight or an image of a street scene collected during the day. The target object is an object having a lighting lamp such as a vehicle or a street lamp. The target object includes a device whose operating state can be changed, such as a drive device or a street lamp, and the device whose operating state can be changed includes a mobile device having at least two operating states, such as a vehicle with various functions (truck, automobile, motorcycle, bicycle, etc.), a vehicle with various numbers of wheels (four-wheeled vehicle, two-wheeled vehicle, etc.), and any mobile device (robot, aircraft, blind guide, smart furniture device, smart toy, etc.). Or, it includes a fixed device having at least two operating states, such as various road lighting lamps (high pole street lamp, mid-pole light, road light, garden light, lawn light, landscape light, etc.). In the following, a vehicle is used as an example. For example, the image to be processed may be a road image of a night scene, and the device whose operating state can be changed may be a lighting lamp of a vehicle traveling on the road.

[0038] In step S102, the original image is converted into a processing target image for a particular scene.

[0039] In some embodiments, scene information for a particular scene may include the light level in the scene, the location of the scene, objects in the scene, etc. For example, if the image to be processed is an image of a street in a late-night scene, scene information may include the lighting of the street, the location of the street, and objects such as vehicles and street lights on the street.

[0040] In some possible implementations, the images to be processed are images of a particular scene, where the particular scene can be any scene set, such as a late night scene, an evening scene, an early morning scene, etc.

[0041] In step S102, the conversion of the original image into a processing target image for a particular scene can be realized by the following steps.

[0042] In the first step, the original image is obtained.

[0043] In some possible implementations, the original images are images collected of an arbitrary scene, such as road images collected during the day or road images collected at night.

[0044] In the second step, the scene information of the original image is determined.

[0045] In some possible implementations, after an original image is obtained, a trained classifier is used to determine whether the scene information of the image is a specific scene, for example, if the scene information of the specific scene is a night scene, a classifier is used to determine whether the scene information of the image is a night scene.

[0046] In a third step, if the scene information does not match the scene information of the specific scene, transform the scene information of the original image according to the scene information of the specific scene to obtain a transformed image.

[0047] In some possible implementations, when the scene information is significantly different from the scene information of the specific scene, the scene information of the original image is transformed into the scene information of the specific scene, i.e., the original image is transformed into an image in the specific scene, thereby obtaining a transformed image. For example, when the scene information of the specific scene is a night scene and the original image is an image collected in a daytime scene, the original image collected in the daytime scene can be transformed into an image of the night scene, and the original image can be input to a generator to generate a corresponding nighttime image to be processed.

[0048] In some embodiments, the original image is determined to be the target image if its scene information matches that of the particular scene.

[0049] For example, if the scene information is the same as or very similar to the scene information of a specific scene, it means that the original image has the scene information of the specific scene, so the original image can be used as the processing target image without the need to perform image conversion on the original image. In a specific example, if the scene information of the specific scene is a late-night scene, and the original image is an image collected during a sunset scene, the scene is nighttime similar to the specific scene, the original image is determined as the processing target image.

[0050] In the fourth step, the transformed image is determined as the image to be processed.

[0051] After the original image is obtained by the above first to fourth steps, the scene information of the original image is determined, and if the scene information is not scene information of a specific scene, the scene information of the original image is converted, thereby obtaining a processing target image having scene information of the specific scene.

[0052] In step S103, in the image to be processed, an illumination lamp whose operating state does not match the scene information of a specific scene is determined as an object to be replaced.

[0053] In some embodiments, the operating state of the lighting lamp is associated with the scene information of a particular scene, and the operating state of the lighting lamp can be understood as changing according to the change of the scene information of the particular scene. For example, when the scene information of a particular scene is converted from a daytime scene to a nighttime scene, the operating state of the lighting lamp also changes accordingly. In a specific example, when the image to be processed is a road image having a nighttime scene, and the lighting lamp is a car light of a vehicle running in the image, in the actual situation, the lighting lamp (such as a tail light of a car) of the vehicle in the nighttime scene should be in a light-emitting state, and when the car light in the image to be processed is in a non-light-emitting state, the car light of the vehicle is determined as the object to be replaced. However, the car light of the vehicle in the daytime scene should be in a non-light-emitting state, and when the car light in the image to be processed is in a light-emitting state, the car light of the vehicle is determined as the object to be replaced. Or, when the object to be replaced is a street light, in the actual scene, the street light of the nighttime scene should be in a light-emitting state, and the street light of the daytime scene should be in a non-light-emitting state.

[0054] In another embodiment, the whole target object in the processing target image, including the illumination lamp whose operation state does not match the scene information of the specific scene, may be used as the replacement target object. For example, if the scene information of the specific scene is a night scene, the target object is a vehicle, and the vehicle includes a car light in a non-illuminating state, the vehicle can be used as the replacement target object.

[0055] In step S104, a replacement image including a replacement target object whose action state matches the scene information is determined based on the scene information and the replacement target object.

[0056] In some embodiments, the motion state of the object to be replaced included in the replacement image matches the scene information, i.e., the motion state of the lighting lamp included in the replacement image matches the scene information. The motion state of the object to be replaced in the processing target image does not match the scene information, which can be understood as the motion state of the object to be replaced is not a reasonable state in the scene, for example, the scene information is a night scene, the object to be replaced is a car light, and the motion state of the object to be replaced is in a non-light-emitting state, which means that the motion state of the object to be replaced does not match the scene information.

[0057] The motion state of the object to be replaced in the replacement image matches the scene information, which can be understood as the motion state of the object to be replaced in the replacement image being in a reasonable state in the scene. For example, if the scene information is a night scene and the object to be replaced is a car light, the motion state of the object to be replaced in the replacement image is a light-emitting state, and correspondingly, the replacement image is the collected image of the car light in a light-emitting state.

[0058] In step S105, the replaced image is used to replace the image in the area of ​​the processing target image occupied by the object to be replaced, thereby generating a target image.

[0059] In some embodiments, a replacement object in the to-be-processed image whose motion state does not match the scene information is determined, an area in the to-be-processed image occupied by the replacement object is determined, a replacement image corresponding to the replacement object whose motion state matches the scene information is used to replace the image in that area, and a smoothing process is performed on the replaced image, thereby generating a target image.

[0060] In a specific example, take the scene information as an example of a night scene. The image to be processed is a road image having a night scene, and the illumination lamp whose operating state changes according to the change of the scene is the car light of a vehicle. If the operating state of the car light is in a non-lighting state, the operating state does not match the night scene. In this case, based on the specifications of the car light, a replacement image including a preset car light with the same specifications as the car light is searched for from the preset image library, where the operating state of the object to be replaced in the replacement image matches the scene, that is, the operating state of the preset car light in the replacement image is in a light-emitting state. Finally, the replacement image is used to replace the image of the area where the car light is located in the image to be processed, thereby generating a target image. In this way, the operating state of the car light in the generated target image is in a light-emitting state and matches the night scene, so that the generated target image becomes more realistic.

[0061] In an embodiment of the present disclosure, a replacement target object whose action state does not match the scene information is determined in the processing target image, and then the replacement image is used to replace the image of the area occupied by the replacement target object, so that the generated target image includes a replacement target object whose action state matches the scene information, and the generated target image is more vivid and realistic.

[0062] In another embodiment, a replacement image including a replacement target object whose motion state matches the scene information is stored in a preset image library and used to render the replacement target object in real time, thereby generating a target image for video playback and improving the richness of the generated target image. The implementation process is as follows. In the embodiment of the present disclosure, the case where the replacement target object is a car light is taken as an example.

[0063] First, the operation mode of the object to be replaced is determined.

[0064] In some possible implementations, the car light refers to the illumination lamp of the vehicle, and may be a headlight, a fog light, a back-up light, a license plate light, etc. The operation modes of the car light include at least a flashing mode, a high beam mode, a low beam mode, etc.

[0065] When the operation mode is a preset operation mode, a preset image library is searched for a plurality of target preset images that include an object matching the object to be replaced and that change over time according to the preset operation mode, to obtain a target preset image set.

[0066] In some possible implementations, the preset operating mode can be set to a flashing mode, i.e., when the operating mode is a flashing mode, a plurality of target preset images that change according to a time sequence during the flashing process of the car light are determined from a preset image library to obtain a target preset image set.

[0067] Finally, real-time rendering is performed on the current object to be replaced based on a plurality of target preset images that change according to a time series, to generate a target moving image in which the object to be replaced is in a preset operation mode, and the generated target moving image is played back in a moving image format.

[0068] In the embodiment of the present disclosure, lamps are used instead of light emitting diodes (LEDs) for the object to be replaced, so that the car lights emit light of different colors and operate in different illumination modes, such as a flashing mode. In this case, the embodiment of the present disclosure can output not only a still target image, but also a moving target image. The replacement images including the objects whose motion states match the scene information are stored in a preset image library, so that the object to be replaced can be rendered through preset images that change according to time to generate and play the target moving image.

[0069] In some embodiments, in order to improve the accuracy of determining the object to be replaced, determining a target object from the image to be processed and using an illumination lamp whose operating state in the target object does not match the scene information as the object to be replaced can be achieved by the following steps.

[0070] In a first step, the illumination lamps whose operational states can be changed within the image to be processed are determined.

[0071] In some possible implementations, a lighting lamp whose operational state is related to the scene information is determined from a target object in the processing target image, and the operational state of the lighting lamp is related to the scene information but does not necessarily match the scene information.

[0072] In the second step, the illumination lamps whose operating states do not match the scene information are determined as objects to be replaced.

[0073] In some possible implementations, when the target object is a mobile device, the object to be replaced is a lighting lamp in the mobile device whose operation state does not match the scene information, for example, when the target object is a vehicle, the object to be replaced is a car light (such as a headlight, headlight or taillight) of the vehicle whose operation state does not match the scene information. When the target object is a fixed device, the object to be replaced is a lighting lamp in the fixed device whose operation state does not match the scene information, for example, when the target object is a high-pole street lamp, the object to be replaced is a lamp in the high-pole street lamp whose operation state does not match the scene information. The target object can also be a fixed lighting device, and the lighting lamp in the fixed lighting device whose operation state does not match the scene information is a lighting lamp, i.e., the object to be replaced is a lighting lamp of the fixed lighting device, and in the processing target image, the operation state of the lighting lamp is light-emitting or non-light-emitting, i.e., the lighting lamp in the processing target image may be in a light-emitting state or a non-light-emitting state.

[0074] In some possible implementations, take the fixed lighting equipment as an example of a high-pole street light and the object to be replaced as the lamp of the street light, when the scene information of the image to be processed is a daytime scene, for example, the image to be processed is an image of a daytime scene obtained after performing scene transformation on an original image of a street scene collected at night. If the street lights on the street in the original image are not lit, and after performing image transformation, the image to be processed is an image of a daytime scene, the street lights do not naturally need to be in a lit state, so in this case, there is no need to replace the street lights on the image to be processed; when the scene information of the image to be processed is a nighttime scene, for example, the image to be processed is an image of a nighttime scene obtained by performing scene transformation on an original image of a street scene collected during the day. If the street lights on the street in the original image are not lit, and after performing image transformation, the image to be processed is an image of a nighttime scene, the street lights need to be in a lit state, so in this case, a replacement image including a street light in a lit state needs to be determined, and the replacement image replaces the image of the area occupied by the object to be replaced in the image to be processed to generate a target image.

[0075] In some possible implementations, the target object may be a driving device, and the lighting lamp in the driving device whose operating state does not match the scene information is the lighting lamp of the driving device, for example, when the driving device is a vehicle, the object to be replaced is a car light, and in the processing target image, the operating state of the car light of the vehicle may be emitting or not emitting light, that is, the car light in the processing target image may be in a lit state or in a non-lit state. Take the case where the driving device is a vehicle and the object to be replaced is a car tail light as an example, when the scene information of the processing target image is a daytime scene, for example, the processing target image is an image of a daytime scene obtained by performing scene transformation on an original image of a street scene collected at night. If the headlights of a vehicle on a street in the original image are not lit, and after image conversion is performed, the image to be processed is an image of a daytime scene, the headlights do not need to be lit, and therefore, in this case, there is no need to replace the headlights in the image to be processed; if the scene information of the image to be processed is a nighttime scene, for example, the image to be processed is an image of a nighttime scene obtained by performing scene conversion on an original image of a street scene collected during the day, and the street lights on the street in the original image are not lit, and after image conversion is performed, the image to be processed is an image of a nighttime scene, the headlights need to be lit, and in this case, a replacement image including headlights that are lit needs to be determined, and the replacement image replaces the image in the area occupied by the object to be replaced in the image to be processed to generate a target image.

[0076] In an embodiment of the present disclosure, a target object having multiple motion states is determined from a processing target image, and a lighting lamp in the target object whose motion state does not match the scene information is replaced, so that the replaced target image better matches the scene information, and the screen content is more reasonable and vivid.

[0077] In some embodiments, the replacement target image may be retrieved from a preset image library, or may be generated by analyzing attribute information of the analyzed replacement target object. That is, in step S104, the replacement target image can be determined in the following two ways:

[0078] Method 1: Search for a replacement image from the preset image library that contains a preset object that matches the object to be replaced.

[0079] In some embodiments, the motion state of the preset object stored in the preset image library matches the scene information. For example, if the scene information is a night scene, the preset image library stores a car light image in a light-emitting state. The target preset image that matches the object to be replaced can be understood as a target preset image that has at least the same specifications or the same type as the object to be replaced. For example, if the object to be replaced is a car light, the target preset image is a car light image that has the same specifications as the car light.

[0080] In some possible implementations, a replacement image can be searched for from a preset image library by the following process, as shown in FIG. 2, which is another flowchart for realizing an image generation method according to an embodiment of the present disclosure, and step S104 can be realized by steps S201 to S203, which will be described in conjunction with the steps shown in FIG. 2.

[0081] In step S201, attribute information of an object to be replaced is determined.

[0082] In some possible implementations, in order to improve the accuracy of determining the replacement image, the replacement image can be searched by the trained second neural network, that is, the attribute information of the object to be replaced can be determined through the second neural network. Here, the attribute information of the object to be replaced is used to represent the specification and type of the object to be replaced, and is information used to describe the object to be replaced itself, for example, if the object to be replaced is a car light, the attribute information is the specification of the car light, the specific type of the car light, and the left and right sides of the car light, and the type of the car light includes rear light, left tail light, right tail light, headlight, etc.

[0083] In step S202, a target preset image including a preset object whose attributes match the attribute information of the object to be replaced is searched for from the preset image library.

[0084] In some possible implementations, a preset object whose attribute information is the same as that of the object to be replaced is searched for first, and then a target preset image containing the preset object is searched for from a preset image library.

[0085] In step S203, the retrieved target preset image is determined as the replacement image.

[0086] In some possible implementations, the operating state of the preset object in the replacement image matches the scene information. In a specific example, when the object to be replaced is two tail lights, one on the left and one on the right, a target preset image that is the same as the attribute information of the car light and includes tail lights in a light-emitting state is searched from the preset image library. Since the left tail light and the right tail light have the same appearance and shape, the determined target preset image can be an image of one frame, and can be two symmetrical images that are the same as the left tail light and the right tail light, respectively. When the target preset image is an image of one frame, when the target preset image is used to replace the area occupied by the object to be replaced, the target preset image is used to replace the area according to the shapes of the left and right tail lights, so that the left and right tail lights in the replaced target image remain symmetrical. Similarly, when the object to be replaced is a headlight or a rear light, when the target preset image is used to replace the area where the object to be replaced is located, the replaced target image becomes more reasonable and realistic by determining whether it is a headlight or a rear light according to the position information of the object to be replaced.

[0087] In the first method, in response to the object to be replaced being an illumination lamp in a target object whose operating state does not match the scene information, searching for a target preset image from a preset image library can be realized by the following process.

[0088] First, the distance between the object to be replaced and the device that collected the original image is determined.

[0089] In some embodiments, the target image is obtained by transforming the original image, i.e., the target image is obtained by performing an image transformation on the original image, for example the original image is a street image collected in a daytime scene, and the daytime scene is transformed into a nighttime scene to obtain the target image. First, the size of the object to be replaced is determined, and then the distance can be calculated based on the size, the number of pixels the object to be replaced occupies in the target image, and the focal distance of the device collecting the original image.

[0090] In one possible implementation, size information of the object to be replaced is determined based on category information of the object to be replaced, and the distance between the device that collects the original image and the object to be replaced is determined based on the size information of the object to be replaced and the size of the object to be replaced in the image to be processed.

[0091] In some possible implementations, the size information of the object to be replaced includes the length, width, and height of the object to be replaced. The category information of the object to be replaced includes the brand or type to which the object to be replaced belongs. For example, when the target object is a driving device, if the category information of the target object includes a passenger car, a suburban utility vehicle (SUV), a van, a small truck, a large truck, a large bus, a bus, or a box truck, the object to be replaced is a car light whose operating state does not match the scene information of a specific scene among the passenger car, the SUV, the van, the small truck, the large truck, the large bus, the bus, or the box truck. If the target object is a fixed lighting device and the category information of the target object includes various street lights, construction site lights, search lights, architectural lights, marine lights, and consumer lights, the object to be replaced is a lamp whose operating state does not match the scene information of a specific scene among the various street lights, construction site lights, search lights, architectural lights, marine lights, and consumer lights.

[0092] After the category information of the object to be replaced is determined, the specification of the target object can be determined, and thus the size information of the target object can be obtained. For example, the category information of the target object is determined to be a van, and further, the type and specification of the van can be determined, and thus the width of the van can be obtained. Take the target object as an example, after the actual width of the van is determined, the number of pixels corresponding to the true width of the object to be replaced (i.e., the car light of the van) in the processing target image can be determined, and then, together with the focal length of the image acquisition device (such as the focal length of the camera), the distance between the image acquisition device and the object to be replaced is estimated by the quotient of the number of pixels and the focal length.

[0093] Next, based on the category information of the object to be replaced and the determined distance, a target preset image including a preset object whose attributes match the attribute information of the object to be replaced is searched from the preset image library.

[0094] In some embodiments, since the replacement target object of different categories has different operation parameters of the replacement target object at different distances, the category and distance of the replacement target object are combined to search for a target preset image from a preset image library, thereby improving the accuracy of the searched target preset image. Taking a case where the target object is a fixed lighting device and the replacement target object is a lighting lamp of the fixed lighting device, or the target object is a drive device and the replacement target object is a lighting lamp on the drive device as an example, the distance between the image collecting device and the lighting lamp is different, and the light intensity of the lighting lamp is also different, and based on the light intensity at the distance, a lighting lamp with the same light intensity is searched from the preset image library, and the target preset image having the lighting lamp is used as a replacement image.

[0095] Method 2: In response to the target preset image not being able to be found in the preset image library, a target preset image including a preset object whose attributes match the attribute information of the object to be replaced can be generated, the generated target preset image can be used as a replacement image, and the preset image library can be updated based on the generated target preset image, which can be realized by the following process.

[0096] First, the distance between the object to be replaced and the device that collected the original image is determined.

[0097] In some embodiments, if the target object is a driving device, the determined distance is the distance between the lighting lamp of the driving device and the device that collects the original image, for example, if the driving device is a vehicle, the determined distance is the distance between the car light of the vehicle and the image collection device.

[0098] Next, the motion parameters of the preset object are determined based on the distance between the object to be replaced and the device that collected the original image.

[0099] In some embodiments, the operational parameters of a preset object include various data during normal operation of the preset object, and the category of the parameters corresponds to the category of the preset object, including the operating power and operating intensity of the preset object, for example, if the preset object is a lighting lamp (a lighting lamp of a drive equipment or a lighting lamp of a fixed lighting equipment), the operational parameters of the lighting lamp include at least the light intensity of the lighting lamp, and the light intensity of the lighting lamp differs with different distances, and the greater the distance, the weaker the light intensity of the lighting lamp, i.e., the smaller the operational parameters.

[0100] A target preset image including the preset object is then generated based on the determined motion parameters.

[0101] In some embodiments, after the operation parameters of the preset object are determined, a target preset image having an object in an operation state corresponding to the operation parameters is generated based on the operation parameters to obtain a replacement image. In a specific example, when the preset object is a lighting lamp and the operation parameter is the light intensity of the lighting lamp, a replacement image of a replacement target object having the light intensity is generated based on the light intensity. Here, after the light intensity at the distance is determined, a replacement image to be used for the replacement target object of the light intensity can be generated. After the replacement image is determined, the replacement image and the correspondence between the replacement image and the distance can be stored in a preset image library to obtain an updated preset image library.

[0102] Next, the area occupied by the object to be replaced is replaced with the target preset image to generate a target image.

[0103] In some possible implementations, after the replacement image is generated, first determine the size of the area occupied by the object to be replaced in the processing target image, and then adjust the size of the replacement image based on the size, so that the adjusted replacement image is adapted to the size of the area occupied by the object to be replaced, so that the generated target image has higher quality. In a specific example, the processing target image is a road image of a night scene, the target object is a vehicle driving on the road, the replacement target object is a non-illuminated car light in the target object, for example, a non-illuminated car tail light of the vehicle in the image of the night scene, and based on the distance between the image acquisition device and the illumination lamp of the target object, a replacement image of the car light with a light intensity matching the distance is generated, and the replacement image is used to replace the car tail light in the processing target image. In this way, the non-illuminated car light image in the night processing target image is replaced with an illuminating replacement image, so that the generated target image becomes more realistic.

[0104] Finally, the target preset image is stored in the preset image library.

[0105] In some embodiments, the size of the device can be determined by determining the category information of the object to be replaced, and thus the distance between the device and the image acquisition device can be determined. Based on this, an operation parameter that matches the distance can be determined from the relationship correspondence table based on the correspondence between the distance and the operation parameter of the preset object, and thus a target preset image having an object in an operation state corresponding to the operation parameter can be generated. Finally, the correspondence between the distance and the operation parameter, the correspondence between the category information and the size information of the object to be replaced, and the generated target preset image are all stored in a preset image library to update the preset image library. Thus, when it is necessary to search for a target preset image again from the preset image library, a richer set of preset objects can be provided for selection, and the accuracy of the selected target preset image can be improved.

[0106] In some possible implementation forms, when the target object is a drive equipment or a fixed lighting equipment, the preset object is a lighting lamp of the fixed lighting equipment or a lighting lamp of the drive equipment, and the operating parameter of the preset object is the light intensity of the lighting lamp, the process of generating a target preset image including the preset object by determining the operating parameter of the preset object can be realized by the following steps.

[0107] In a first step, the light intensity of the illumination lamp when it is in an operational state is determined.

[0108] In some embodiments, the illumination lamp may be any specification of illumination lamp, for example a low power street lamp or a high power searchlight, and determines the light intensity when the illumination lamp is in an operating state.

[0109] In a second step, a light intensity of the illumination lamp that matches the distance is determined based on the distance and the light intensity when the illumination lamp is in an active state.

[0110] In some embodiments, first determine the correspondence between the light intensity and the distance when the illumination lamp is in an active state, and then determine the light intensity of the illumination lamp at different distances based on the correspondence. The correspondence between the light intensity and the distance is such that the greater the distance, the smaller the light intensity, in other words, the light intensity of the collected object to be replaced is different because the distance between the image collecting device and the object to be replaced is different, and the light intensity is inversely proportional to the distance, that is, the greater the distance between the image collecting device and the object to be replaced, the smaller the light intensity of the collected object to be replaced. In this way, a relationship correspondence table of the correspondence between the light intensity and the distance can be created by measuring multiple distances and light intensities, and when it is necessary to determine the light parameters of the illumination lamp according to the distance, the light intensity that matches the distance can be searched from the table.

[0111] In a third step, a target preset image including a preset object having a light intensity matching the distance is generated based on the light intensity matching the distance.

[0112] In some embodiments, based on the light intensity, an image of a preset object having the light intensity, ie, a target preset image, is rendered and generated.

[0113] In the above method 1 and method 2, "determining a replacement image including a replacement target object whose operating state matches scene information" is realized, and attribute information of the replacement target object is determined through a second neural network, and a target preset image including a preset object having the same attribute information as the attribute information is searched for in the preset image library. If the target preset image cannot be searched for in the preset image library, the category information of the replacement target object and the distance between the device and the image collection device are comprehensively considered to determine operating parameters of a preset object that matches the distance, thereby generating a target preset image including a preset object having the operating parameters, and storing the target preset image in the preset image library to update the preset image library, thereby improving the matching degree between the replacement object and the scene information that is finally acquired.

[0114] In some embodiments, the above process of determining a replacement object can be realized through a neural network, which includes a first neural network and a second neural network, and the first neural network can be used to determine category information of a target object, and through the second neural network, based on the category information, determine a lighting lamp in the target object whose operating state does not match the scene information to obtain a replacement object, and the realization process is as follows:

[0115] A first neural network is used to detect target objects within the image to be processed.

[0116] In some possible implementations, the first neural network can be any type of neural network, such as a convolutional neural network, a residual network, etc. The image to be processed is input to the trained first neural network, and the first neural network outputs a detection frame and a category of the target object.

[0117] In some embodiments, the training process of the first neural network can be accomplished by the following steps.

[0118] In a first step, a training image is input to a first neural network to be trained to predict first position information of a target object in the training image.

[0119] In some possible implementations, a large number of training images are used to train the first neural network to be trained, i.e., a large number of training images are input to the first neural network to predict the location and category of a target object in the training images.

[0120] In a second step, a first prediction loss of a first position information is determined based on the labeled position information of the target object in the training image.

[0121] In some possible implementations, a difference between the labeled position information of the target object in the training image and the first position information of the target object is used to determine the first prediction loss.

[0122] In a third step, network parameters of the first neural network to be trained are adjusted based on the first prediction loss to obtain the first neural network.

[0123] In some possible implementations, the accuracy of each predicted first location information is determined by combining the labeled location information of the target object, and the accuracy is fed back to the neural network, so that the neural network adjusts network parameters such as weight parameters, thereby improving the accuracy of the neural network detection. The first prediction loss is a cross-entropy loss of positive samples and negative samples. The prediction loss is used to adjust parameters such as the weights of the neural network, so that the adjusted neural network prediction result is more accurate.

[0124] The above process is a process of training a first neural network, and by performing multiple iterations based on the predicted position of the target object and the labeling position of the target object, the first prediction loss of the first position information output by the trained first neural network meets the convergence condition, so that the accuracy of the target object detected by the first neural network is higher.

[0125] Based on the training process of the first neural network, the process of determining the object to be replaced from the target object is as follows:

[0126] First, category information of the target object is determined through the first neural network.

[0127] In some possible implementations, after the category information of the target object is predicted through a first neural network, the category information is input into a second neural network.

[0128] Then, via a second neural network, a replacement object within the target object is determined based on the category information.

[0129] In some possible implementations, the second neural network can be a trained network used to predict a replacement object in a target object, and the network can be any type of neural network. By inputting the category information of the target object into the second neural network, it can predict a replacement object in the target object that has an association relationship with the scene information of a particular scene.

[0130] In some embodiments, the training process of the second neural network can be accomplished by the following steps.

[0131] In a first step, the category information to which the target object in the training image belongs is labeled to obtain a labeled training image.

[0132] In a second step, the labeled image is input to a second neural network to be trained, and second position information of an object to be replaced by the target object is predicted based on the labeled category information.

[0133] In some possible implementations, the second neural network to be trained is used to predict the position of the object to be replaced in the target object. The labeled image is input to the second neural network to be trained, thereby predicting the second position information of the object to be replaced, i.e., predicting the position of the object to be replaced in the target object.

[0134] In a third step, a second prediction loss of the second position information is determined based on the labeled position information of the target object to be replaced with the target object.

[0135] The second prediction loss can be the same type of loss function as the first prediction loss, e.g., a cross-entropy loss function.

[0136] In a fourth step, network parameters of the second neural network to be trained are adjusted based on the second prediction loss to obtain the second neural network.

[0137] In some possible implementations, the network parameters of the second neural network to be trained include weights of neurons in the neural network, etc. The second prediction loss is used to adjust parameters such as weights of the second neural network to be trained, so that the detection results of the adjusted second neural network are more accurate.

[0138] The above process is a process of training a second neural network, and by performing multiple iterations based on the category information of the target object, the second prediction loss of the predicted position information of the object to be replaced output by the trained second neural network satisfies the convergence condition, so that the accuracy of the object to be replaced output by the second neural network is higher.

[0139] In some embodiments, replacing an image in an area occupied by the object to be replaced in the processing target image using the replacement image to generate a target image can be achieved by the following process.

[0140] First, size information of the replacement image is determined.

[0141] Next, the area of ​​the region that the object to be replaced occupies in the image to be processed is determined.

[0142] In some possible implementations, a first neural network is used to output a detection frame of the object to be replaced, and the area of ​​the detection frame can be used as the area of ​​the region occupied by the object to be replaced in the image to be processed.

[0143] Then, adjust size information of the replacement image based on the area to obtain an adjusted image.

[0144] In some possible implementations, size information of the replacement image is adjusted based on the area of ​​the region occupied by the object to be replaced in the image to be processed to obtain an adjusted image, so that the size information of the adjusted image fits the size of the region.

[0145] The adjusted image is then used to replace the image in the area occupied by the object to be replaced, to generate a candidate image.

[0146] In some possible implementations, the adjusted image is used to replace the image of the area occupied by the object to be replaced in the image to be processed, thereby obtaining a replaced image, i.e., a candidate image. In a specific example, when the scene information of a specific scene is a night scene, the image to be processed is a road image with a night scene, and the object to be replaced is a car light whose operating state does not match the night scene, i.e., a car light in a non-lighting state, it means that the display manner of the car light in the image is unreasonable, and the target preset image (i.e., the replacement image retrieved from the preset image library) is an image that includes the car light in a light-emitting state, and the adjusted image can be obtained by performing size adjustment on the target preset image, thereby using the adjusted image to replace the image of the area occupied by the object to be replaced to generate a target image that includes the car light in a light-emitting state.

[0147] Finally, a smoothing process is performed on the candidate images to generate the target image.

[0148] In some possible implementations, a target image is obtained by performing a smoothing operation on an area in the candidate image where the replacement operation is to be generated to remove noise from the image in that area, or by performing a smoothing operation on the entire candidate image to remove noise from the entire image, so that the generated target image is more rational and clear.

[0149] The following describes an exemplary application of an embodiment of the present disclosure in an actual application scene, taking as an example the case of converting a road image collected in a daytime scene into a nighttime scene, that is, the specific scene is a nighttime scene, the image to be processed is a nighttime processing image, the target object is a vehicle, and the object to be replaced is a car light.

[0150] The embodiments of the present disclosure provide a method for adding tail lights of a vehicle in a night scene based on image generation, target detection, and tail light matching, so that the vehicle in the generated night image is more realistic. The embodiments of the present disclosure can be applied to more image generation fields. For example, adding headlights, adding street lights, etc. to a vehicle in a night scene makes the tail lights of a vehicle in the generated image more realistic.

[0151] FIG. 3A is a schematic structural diagram of an image generation system (used to generate a processing target image) according to an embodiment of the present disclosure, which will be described below in conjunction with FIG. 3A.

[0152] The image generation system provided by the embodiment of the present disclosure includes a generator 301 and a discriminator 302. First, a daytime processing target image (corresponding to the original image in the above embodiment, such as the daytime processing target image 321 shown in FIG. 3B) is inputted as an input from an input terminal 303 to the generator 301; Next, a nighttime scene image (such as the nighttime scene image 322 shown in FIG. 3B, which corresponds to the processing target image in the above embodiment) is generated by a generator 301. The generated nighttime scene image is output to a discriminator 302 via an output terminal 304. In some possible implementations, the night scene images collected during the night scene and the generated night scene images are all input to the classifier 302 .

[0153] Next, the discriminator 302 distinguishes whether the night scene image is an actual night scene image or a generated night scene image, i.e., obtains the actual image 305 and the transformed image 306 respectively; Finally, by continuously optimizing the loss functions of the generator and the classifier, the night scenes generated by the generator become more realistic.

[0154] In some embodiments, after the night scene data is generated by the image generation system shown in FIG. 3B, fine-grained target detection and labeling is performed on the vehicles in the image, i.e., the vehicles in the image are surrounded by a rectangular frame, and the category information of each vehicle (such as passenger car, SUV, van, small truck, large truck, large bus, bus, box truck, etc.) is labeled. In addition, for each vehicle, the tail lights of each vehicle (corresponding to the object to be replaced in the above embodiment) are labeled, i.e., the position of the tail lights of the car is indicated by a rectangular frame. At the same time, according to the difference in the model of each vehicle, the car lights in the actual night scene are collected, i.e., the lighting area in the vehicle image collected in the night scene is cut out to form an image library (corresponding to the preset image library in the above embodiment) containing car light data, which is used for subsequent matching of the object to be replaced to obtain the tail lights of the car that match the object to be replaced (corresponding to the preset object that matches the object to be replaced in the above embodiment). The process of matching car taillights is as shown in FIG. 4, which is an exemplary structural diagram for implementing an image generation method according to an embodiment of the present disclosure, and will be described below in conjunction with FIG. 4.

[0155] The image acquisition module 401 is configured to perform target detection on the original image and label the targets using the labeling frame.

[0156] The vehicle detection network training module 402 is configured to use the labeling frame and the vehicle classification to train a corresponding rendition network to obtain a vehicle detection network (corresponding to the first neural network in the above embodiment).

[0157] The vehicle detection result output module 403 is configured to use a vehicle detection network to detect the original image, obtain a vehicle detection result (e.g., obtain the coordinates of the top left and bottom right corners of the vehicle in the image coordinate system (i.e., label a rectangular frame of the area where the vehicle is located)), and obtain the category to which the detected vehicle belongs, i.e., vehicle type 404, to prepare for car light matching during image generation.

[0158] The cropping module 409 is configured to crop a position corresponding to the rectangular frame from the original image based on the rectangular frame for detecting a vehicle in the vehicle detection result, and determine car light information of the vehicle within the rectangular frame.

[0159] The car light detection network training module 405 is configured to train a car light detection network (corresponding to the second neural network in the above embodiment) based on the car light information of the vehicle within the rectangular frame.

[0160] The car light detection result output module 406 is configured to detect the car lights in the original image through the car light detection network to obtain a car light detection result.

[0161] In some embodiments, the car light detection result includes a position of the car light corresponding to the vehicle and a magnitude of the car light, and in embodiments of the present disclosure, the car light detection network is not limited to a specific network.

[0162] The car light matching replacement module 408 is configured to perform car light matching replacement for the tail lights of the cars in the original image using sample tail light diagrams that match the tail lights of the cars in the original image retrieved from the car light library 407 after detecting the position and size of the car lights corresponding to the cars in the original image and the subcategories corresponding to the cars.

[0163] In some embodiments, an image matching method is used to search for tail light samples in night scenes of the corresponding category from the corresponding car light library 407, and obtain a sample tail light image of the sample tail light of the same size as the vehicle (i.e., a target preset image that matches the tail light of the vehicle) by stretching or shrinking the size of the tail light.

[0164] The final result output module 410 is configured to use the sample taillight image to replace the area where the car taillight is located in the original image, and use a smoothing technique to perform a smoothing process on the image around the car taillight area to obtain a target image, i.e., obtain the final image result of the glowing car taillight at night.

[0165] In some embodiments, after using the taillight images in the car light library to replace the car taillights in the original image, the image is as shown in FIG. 5 , which is a schematic diagram of another application scene of the image generation method according to the embodiments of the present disclosure, where the original image 501 (corresponding to the original image in the above embodiments) is an image collected in a daytime scene, and the generation process of the target image is as follows:

[0166] First, target detection is performed on the original image 501 to show vehicles 502, 503, and 504 in a rectangular frame.

[0167] Next, the areas indicated by the rectangular frames (i.e., vehicles 502, 503, and 504) are cropped, enlarged, and converted into night scene images to sequentially obtain night scene images 511, 512, and 513 (corresponding to the images to be processed in the above embodiment).

[0168] Finally, a sample taillight diagram that matches the vehicle taillights in the night scene images 511, 512, and 513 is determined from the preset image library, and the sample taillight diagram is used to replace the areas where the vehicle taillights are located in the night scene images 511, 512, and 513, to sequentially obtain night scene images 521, 522, and 523 after adding the luminous taillights, i.e., target images.

[0169] In the embodiment of the present disclosure, firstly, vehicle model is sub-classified simultaneously with vehicle detection, then vehicle detection result is used to perform vehicle taillight detection to obtain the position and size of the vehicle taillight, and finally, based on the classification result of the car model and the position and size of the vehicle taillight, sample taillights are matched in the library to obtain the final image with taillights. In this way, not only is the addition of taillights more natural, but the vehicle taillights that have been converted from the daytime scene image to the nighttime scene image are turned on, which is more in line with the authenticity of the nighttime scene.

[0170] An embodiment of the present disclosure provides an image generating device. FIG. 6 is a schematic structural diagram of an image generating device according to an embodiment of the present disclosure. As shown in FIG. 6, the device 600 includes: an illumination lamp detection module 601 configured to detect an illumination lamp of a target object in an original image; an image transformation module 602 configured to transform the original image into a target image for a particular scene; an object determination module 603 configured to determine, in the processing target image, a lighting lamp whose operating state does not match the scene information of the particular scene as a replacement target object; a replacement image determination module 604 configured to determine a replacement image including a replacement object whose motion state matches the scene information based on the scene information and the replacement object; and a target image generation module 605 configured to replace an image in a region occupied by the object to be replaced in the processing target image using the replacement image to generate a target image.

[0171] In the above device, the replacement image determination module 604 an attribute determination sub-module configured to determine attribute information of the object to be replaced; a target preset image search submodule configured to search a preset image library for a target preset image including a preset object whose attribute matches the attribute information of the object to be replaced; a replacement image determination sub-module configured to determine the retrieved target preset image as the replacement image, where an action state of the preset object in the replacement image matches the scene information.

[0172] In the above apparatus, the image generating device further comprises: a distance determination module configured to determine a distance between the object to be replaced and a device that acquires the original image; The target preset image search submodule further includes: The method is configured to search the preset image library for a target preset image including a preset object whose attributes match the attribute information of the object to be replaced, based on the category information of the object to be replaced and the determined distance.

[0173] In the above apparatus, in response to the target preset image not being able to be retrieved from the preset image library, the image generation device further comprises: The system further includes a target preset image generation module configured to generate a target preset image including a preset object whose attributes match attribute information of the object to be replaced, and to determine the generated target preset image as the replacement image.

[0174] In the above-mentioned device, the target preset image generation module includes: an operating parameter determination submodule configured to determine operating parameters of the preset object based on a distance between the object to be replaced and a device that collects the original image; a target preset image generation sub-module configured to generate a target preset image including the preset object based on the determined operational parameters.

[0175] In the above apparatus, the distance determination module comprises: a size information determination sub-first module configured to determine size information of the object to be replaced based on category information of the object to be replaced; a distance determination sub-module configured to determine a distance between a device acquiring the original image and the object to be replaced based on the size information and the size of the object to be replaced in the image to be processed.

[0176] In the above apparatus, after the target preset image is generated, the image generating apparatus further comprises: An image library update module configured to store the target preset image in the preset image library.

[0177] In the above-mentioned device, the operation parameter of the preset object is the light intensity of an illumination lamp; The operating parameter determination submodule includes: a first light intensity determination unit configured to determine a light intensity of the illumination lamp when the illumination lamp is in an operating state; and a second light intensity determination unit configured to determine a light intensity of the illumination lamp that matches the distance based on the distance and the light intensity of the illumination lamp when the illumination lamp is in an operating state; The target preset image generation sub-module is further configured to generate a target preset image including the preset object having a light intensity matching a distance based on the light intensity matching the distance.

[0178] In the above device, the target image generation module 605 includes: a size information determination sub-module configured to determine size information of the replacement image; an area determination sub-module configured to determine an area of ​​a region occupied by the object to be replaced in the image to be processed; a replacement image adjustment sub-module configured to adjust size information of the replacement image based on the area to obtain an adjusted image; a candidate image generation submodule configured to replace an image of an area occupied by the object to be replaced using the adjusted image to generate a candidate image; a target image generation sub-module configured to perform a smoothing operation on the candidate images to generate the target image.

[0179] In the above device, the target objects include driving equipment and street lights.

[0180] It should be noted that the above description of the apparatus embodiment is similar to the above description of the method embodiment, and has similar beneficial effects as the method embodiment. The technical details not disclosed in the apparatus embodiment of the present disclosure can be understood by referring to the description of the method embodiment of the present disclosure.

[0181] In addition, in the embodiments of the present disclosure, when the above image generating method is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, an essential part of the technical solution of the present disclosure, or a part of the contribution to the prior art, or a part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in one storage medium and includes several instructions for causing one computer device (which may be a terminal, a server, etc.) to execute all or some of the steps of the method according to each embodiment of the present disclosure. The aforementioned storage medium includes various media capable of storing program code, such as U disks, mobile hard disks, read only processors (ROMs), magnetic disks, or optical disks. In this way, the embodiments of the present disclosure are not limited to a specific combination of hardware and software.

[0182] Correspondingly, an embodiment of the present disclosure further provides a computer program product, the computer program product includes computer executable instructions, the computer executable instructions implement the steps of the image generation method provided by the embodiment of the present disclosure. Correspondingly, an embodiment of the present disclosure further provides a computer storage medium, the computer storage medium stores computer executable instructions, the computer executable instructions implement the steps of the image generation method provided by the embodiment of the present disclosure. Correspondingly, an embodiment of the present disclosure provides a computer device, and FIG. 7 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. As shown in FIG. 7, the computer device 700 includes a processor 701, at least one communication bus, a communication interface 702, at least one external communication interface, and a memory 703. Here, the communication interface 702 is configured to realize a connection communication between these components. Here, the communication interface 702 may include a display screen, and the external communication interface may include standard wired and wireless interfaces. The processor 701 executes an image processing program in the memory to realize the image generating method provided by the above embodiment.

[0183] The above description of the image generating apparatus, computer device, and storage medium embodiments is similar to the description of the above method embodiments, and has similar technical descriptions and beneficial effects to the corresponding method embodiments. Due to the limited number of pages, the description of the above method embodiments can be referred to, and will not be repeated here. Technical details not disclosed in the image generating apparatus, computer device, and storage medium embodiments of the present disclosure can be understood by referring to the description of the method embodiments of the present disclosure. It should be understood that "one embodiment" or "one embodiment" referred to throughout this specification means that a particular feature, structure, or characteristic associated with an embodiment is included in at least one embodiment of the present disclosure. Therefore, "in one embodiment" or "in one embodiment" in this specification does not necessarily refer to the same embodiment. Furthermore, these particular features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in each embodiment of the present disclosure, the magnitude of the sequence numbers of each of the above processes does not mean the order of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The numbers of the above embodiments of the present disclosure do not indicate superiority or inferiority of the embodiments, but are intended for convenience of explanation.

[0184] It should be noted that, as used herein, the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a set of elements includes not only those elements, but also other elements not expressly listed or inherent elements of such process, method, article, or apparatus. Unless otherwise limited, an element defined with the phrase "comprising..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0185] In some embodiments provided in the present disclosure, it should be understood that the disclosed methods can be realized in other ways. The above-described device embodiments are merely exemplary, and the division of the units is merely a logical division of functions. In actual implementation, other division methods may exist, for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented. Furthermore, the mutual coupling or direct coupling or communication connection between each component shown or described may be an indirect coupling or communication connection via some interfaces, devices or units, and may be in an electrical, mechanical or other form.

[0186] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units. That is, the units may be located in one place or distributed among multiple network units, and some or all of the units may be selected according to actual needs to achieve the objective of the technical solution of the present embodiment. In addition, each functional unit in each embodiment of the present disclosure may be integrated into one second processing unit, each unit may be used individually as one unit, or two or more units may be integrated into one unit. The integrated unit may be embodied in the form of hardware or in the form of a combination of hardware and software functional units. Those skilled in the art can understand that all or some of the steps of implementing the above method embodiments may be completed by hardware associated with program instructions, the program may be stored in a computer-readable storage medium, and when the program is executed, the steps of the above method embodiments are performed, and the storage medium may include various media that can store program code, such as removable storage, read-only memory (ROM), magnetic memory, or optical disk.

[0187] Alternatively, the above integrated units of the present disclosure may be realized in the form of a software functional module and stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essential part of the technical solution of the embodiments of the present disclosure or the part that contributes to the prior art may be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the processes in each of the implementation methods of the embodiments of the present disclosure. The above storage medium includes various media that can store program code, such as removable storage, ROM, magnetic memory, or optical disk. The above content is merely an embodiment of the present disclosure, and the protection scope of the present disclosure is not limited thereto. Any modifications or replacements that a person skilled in the art can easily think of within the technical scope disclosed in this disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims. [Industrial Applicability]

[0188] An embodiment of the present disclosure provides an image generation method, apparatus, device, and storage medium, which includes detecting an illumination lamp of a target object in an original image, converting the original image into a processing target image of a specific scene, determining an illumination lamp in the processing target image whose operating state does not match scene information of the specific scene as a replacement target object, determining a replacement image including a replacement target object whose operating state matches the scene information based on the scene information and the replacement target object, and using the replacement image to replace an image of an area occupied by the replacement target object in the processing target image to generate a target image.

Claims

1. 1. A method of image generation performed by an electronic device, comprising: Detecting an illumination lamp of a target object in an original image; Transforming the original image into a target image for a particular scene; determining, in the processing target image, an illumination lamp whose operating state does not match scene information of the specific scene as a replacement target object; determining a replacement image including a replacement target object whose motion state matches the scene information based on the scene information and the replacement target object; and replacing an image in an area of ​​the processing target image occupied by the object to be replaced with the replaced image to generate a target image.

2. Determining a replacement image including a replacement target object whose motion state matches the scene information based on the scene information and the replacement target object, determining attribute information of the object to be replaced; Searching for a target preset image including a preset object whose attributes match the attribute information of the object to be replaced from a preset image library; determining the retrieved target preset image as the replacement image, wherein an action state of the preset object in the replacement image matches the scene information; The image generating method according to claim 1 .

3. The image generating method includes: determining a distance between the object to be replaced and a device that acquires the original image; The step of searching the preset image library for a target preset image including a preset object whose attribute matches the attribute information of the object to be replaced includes: searching the preset image library for a target preset image including a preset object whose attributes match the attribute information of the object to be replaced based on the category information of the object to be replaced and the determined distance; The image generating method according to claim 2.

4. In response to the target preset image not being able to be retrieved from the preset image library, the image generating method further comprises: generating a target preset image including a preset object whose attributes match the attribute information of the object to be replaced; determining the generated target preset image as the replacement image.

4. The image generating method according to claim 2 or 3.

5. generating a target preset image including a preset object whose attribute matches attribute information of the object to be replaced, determining operational parameters of the preset object based on a distance between the object to be replaced and a device that collects the original image; generating a target preset image including the preset object based on the determined operational parameters. The image generating method according to claim 4.

6. Determining the distance between the object to be replaced and a device that acquires the original image includes: determining size information of the object to be replaced based on category information of the object to be replaced; determining a distance between a device that captures the original image and the object to be replaced based on the size information and a size of the object to be replaced in the image to be processed; 6. The image generating method according to claim 3.

7. After the target preset image is generated, the image generation method includes: storing the target preset image in the preset image library.

6. The image generating method according to claim 4 or 5.

8. The operation parameter of the preset object is the light intensity of the illumination lamp; Determining the operation parameters of the preset object based on the distance between the object to be replaced and a device that collects the original image includes determining a light intensity of the illumination lamp when the illumination lamp is in an active state, and determining a light intensity of the illumination lamp that matches the distance based on the distance and the light intensity of the illumination lamp when the illumination lamp is in an active state; generating a target preset image including the preset object based on the determined operational parameter includes generating a target preset image including the preset object having a light intensity matching a distance based on a light intensity matching the distance; The image generating method according to claim 5.

9. Using the replaced image to replace an image in an area occupied by the object to be replaced in the processing target image, to generate a target image, determining size information for the replacement image; determining an area of ​​a region occupied by the object to be replaced in the processing target image; adjusting size information of the replaced image based on the area to obtain an adjusted image; replacing an image in a region occupied by the object to be replaced with the adjusted image to generate a candidate image; and performing a smoothing operation on the candidate image to generate the target image.

9. The image generating method according to claim 1.

10. The target object includes a driving device and a street light. The image generating method according to claim 1 .

11. 1. An image generating device, comprising: an illumination lamp detection module configured to detect an illumination lamp of a target object in an original image; an image transformation module configured to transform the original image into a target image of a particular scene; an object determination module configured to determine, in the processing target image, a lighting lamp whose operating state does not match the scene information of the particular scene as a replacement target object; a replacement image determination module configured to determine a replacement image including a replacement target object whose motion state matches the scene information based on the scene information and the replacement target object; and an image generation module configured to use the replacement image to replace an image in a region occupied by the replacement target object in the processing target image, thereby generating a target image.

12. A computer storage medium having stored thereon computer executable instructions for causing a computer to carry out the image generating method of any one of claims 1 to 10.

13. a memory for storing computer executable instructions; A processor configured to execute the computer-executable instructions in the memory to perform the image generation method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Device and method for displaying three dimensional information

    JP2010246166A

  • Three-dimenisional object detection device

    US20150002672A1

  • Image processing device and image processing method

    WO2020039838A1

  • Image generation method and apparatus, electronic device, and storage medium

    WO2020220807A1