Outdoor image generation method, system and device and storage medium
By determining the lighting direction and spot characteristics, and generating and superimposing the spot onto the image, the problem of difficulty in generating images that conform to real outdoor scenes in the prior art is solved, and better model performance is achieved when identifying outdoor scenes.
Patent Information
- Application Number
- CN202510088604.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to effectively generate images that conform to real outdoor scenes, especially when the number of outdoor samples is insufficient, resulting in poor results in the model's performance when identifying outdoor scenes.
By determining the illumination direction of the target object, determining the shape and position of the light spot, and then determining the brightness distribution pattern of the light spot, the part is intercepted on the brightness distribution pattern to generate the light spot, and superimposed on the image, so that the generated image is more in line with the real outdoor scene.
The generated images are more in line with real outdoor scenes, which can effectively improve the performance of the model when identifying outdoor scenes, and solve the problem of insufficient outdoor samples.
Smart Images

Figure CN119941904A_ABST
Abstract
Description
Background Art
[0002] In the process of image model training, the selection and preparation of training samples undoubtedly play a pivotal role. The quality and diversity of training samples directly determine the model's final recognition ability, generalization performance, and performance in actual application scenarios. However, when collecting training samples, a series of challenges are often encountered, especially the imbalance between indoor and outdoor samples.
[0003] For indoor scenes, due to the controllability and stability of the environment, it is relatively easy to collect samples. We can easily obtain a large amount of indoor image data, covering various home layouts, decoration styles, and daily activity scenes. These rich indoor samples provide a solid foundation for model training, enabling the model to show high accuracy and robustness when recognizing indoor environments.
[0004] However, for outdoor scenes, the situation becomes more complicated. The uncontrollability and diversity of the outdoor environment poses a huge challenge to sample collection. On the one hand, the collection of outdoor samples needs to face complex weather conditions, such as sunny, cloudy, rainy, snowy, etc. These weather changes will have a significant impact on the color, brightness and contrast of the image. On the other hand, the vastness and variability of the outdoor environment also means that the number of samples we need to collect is much larger than that of the indoor environment to ensure that the model can learn sufficiently rich outdoor features.
[0005] Due to these difficulties, it is often difficult to obtain a sufficient number of outdoor samples, which results in poor performance of the trained model in recognizing outdoor scenes. The model may not be able to learn the unique characteristics of the outdoor environment due to the lack of sufficient outdoor data, resulting in recognition errors or performance degradation when facing outdoor images.
[0006] However, the actual effect of converting indoor images to outdoor images by existing technologies is not ideal. Due to the significant differences between indoor and outdoor environments, such as lighting conditions, color distribution, spatial structure, etc., it is difficult for existing image conversion technologies to accurately imitate the realism and details of outdoor scenes. Therefore, outdoor images obtained through these conversions are often of poor quality and difficult to use for model training and optimization.
[0007] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application. In the absence of clear evidence that the above content has been disclosed on the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0008] To this end, the present invention determines the lighting direction according to the target object, then determines the shape and position of the light spot, and then determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate a light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0009] In a first aspect, the present invention provides an outdoor image generation method, characterized by comprising:
[0010] Step S1: obtaining an indoor image, detecting a target object in the indoor image, and determining a lighting direction according to the target object;
[0011] Step S2: determining the shape and position of the light spot according to the illumination direction;
[0012] Step S3: determining a brightness distribution form according to the shape of the light spot, and cutting a portion of the brightness distribution form to generate the light spot, and superimposing it on the position.
[0013] Optionally, the outdoor image generation method is characterized in that step S1 comprises:
[0014] Step S11: Acquire indoor images;
[0015] Step S12: Detecting a target object on the indoor image using a target detection model;
[0016] Step S13: determining the illumination direction according to the brightness distribution of the target object.
[0017] Optionally, the outdoor image generation method is characterized in that step S2 comprises:
[0018] Step S21: determining the initial position of the light spot according to the shape of the target object and the illumination direction;
[0019] Step S22: determining the shape, position and number of the light spots according to the initial position and the geometric relationship of the target object.
[0020] Optionally, the outdoor image generation method is characterized in that step S3 comprises:
[0021] Step S31: determining the brightness distribution shape of the light spot according to the shape of the light spot;
[0022] Step S32: intercepting a portion in the brightness distribution form to determine the brightness distribution of the light spot;
[0023] Step S33: Generate the light spot, and superimpose the light spot on the position.
[0024] Optionally, the outdoor image generation method is characterized in that the brightness distribution form is multiple, and includes at least one of Gaussian distribution, exponential distribution, Poisson distribution, parabolic distribution, power-law distribution, Rayleigh distribution, lognormal distribution, Bessel distribution, and mixed distribution.
[0025] Optionally, the outdoor image generation method is characterized in that step S32 comprises:
[0026] Step S321: determining a backup center point on the brightness distribution form according to the brightness of the target object; the backup center point includes at least one point;
[0027] Step S322: selecting a center point from the backup center points according to the illumination direction;
[0028] Step S323: According to the shape of the light spot, a cut-off portion is determined with the central point as the center to obtain the brightness distribution of the light spot.
[0029] Optionally, the outdoor image generation method is characterized in that step S33 comprises:
[0030] Step S331: generating the light spot;
[0031] Step S332: setting transparency in a gradient form according to the brightness of the light spot;
[0032] Step S333: superimposing the light spot to the position.
[0033] In a second aspect, the present invention provides an outdoor image generation system, which is used to implement any of the above-mentioned outdoor image generation methods, and is characterized by comprising:
[0034] An acquisition module, used to obtain an indoor image, detect a target object in the indoor image, and determine a lighting direction according to the target object;
[0035] A light spot module, used to determine the shape and position of the light spot according to the illumination direction;
[0036] The superposition module is used to determine the brightness distribution form according to the shape of the light spot, and to intercept a part of the brightness distribution form to generate the light spot, and to superpose it to the position.
[0037] In a third aspect, the present invention provides an outdoor image generation device, characterized in that it includes:
[0038] processor;
[0039] a memory storing executable instructions of the processor;
[0040] The processor is configured to execute the steps of any of the aforementioned outdoor image generation methods by executing the executable instructions.
[0041] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a program, wherein the program, when executed, implements the steps of any of the aforementioned outdoor image generation methods.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The present invention determines the illumination direction according to the target object, then determines the shape and position of the light spot, and further determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate the light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings in the following descriptions are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes and advantages of the present invention will become more obvious:
[0045] Figure 1 A flowchart of a method for generating an outdoor image according to an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of a brightness distribution form in an embodiment of the present invention;
[0047] Figure 3 A flowchart of a step of determining a lighting direction in an embodiment of the present invention;
[0048] Figure 4 This is a flow chart of steps for determining the shape and position of a light spot in an embodiment of the present invention;
[0049] Figure 5 This is a flow chart of the steps of intercepting and superimposing light spots in an embodiment of the present invention;
[0050] Figure 6 This is a flow chart of steps for determining the brightness distribution of a light spot in an embodiment of the present invention;
[0051] Figure 7 This is a flow chart of steps for superimposing light spots in an embodiment of the present invention;
[0052] Figure 8is a structural schematic diagram of an outdoor image generation system in an embodiment of the present invention;
[0053] Fig. 9 is a schematic structural diagram of an outdoor image generating device in an embodiment of the present invention; and
[0054] Fig.10 Schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0056] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] An outdoor image generation method provided by an embodiment of the present invention is intended to solve the problems existing in the prior art.
[0058] The following specific embodiments are used to describe in detail the technical solutions of the present invention and how the technical solutions of the present application solve the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0059] The present invention determines the illumination direction according to the target object, then determines the shape and position of the light spot, and further determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate the light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0060] Figure 1 FIG. 1 is a flow chart of steps of a method for generating an outdoor image in an embodiment of the present invention. Figure 1As shown, the steps of an outdoor image generation method in an embodiment of the present invention include:
[0061] Step S1: obtaining an indoor image, detecting a target object in the indoor image, and determining a lighting direction according to the target object.
[0062] In this step, obtaining indoor images means using an image acquisition device (such as a camera) to shoot indoor scenes, or selecting indoor images from an existing image library. In the acquired indoor images, image processing techniques (such as edge detection, image segmentation, etc.) are used to identify and locate the target object. The target object can be any significant object in the room, such as furniture, people, windows, etc. Of course, specific target detection algorithms, such as face detection algorithms, palm detection algorithms, etc., can also be used to detect specific target objects. According to information such as the shadow, reflection, and color change of the target object, the position and illumination direction of the light source can be inferred. The illumination direction can be divided into three types: backlight, front light, and side light. In this step, it can be determined which type of illumination direction belongs to, and the specific illumination angle requirements do not need to be very precise.
[0063] Step S2: determining the shape and position of the light spot according to the illumination direction.
[0064] In this step, the shape and position of the light spot are a pair of variables that affect each other. Taking the palm as an example, when the light is irradiated from the back of the palm, multiple divergent light spots will be formed in the gaps between the fingers; when the light is irradiated from the side, a circular light spot will be formed. Based on the direction of the light and the area of the target object, the shape of the light spot and its position in the image can be determined.
[0065] Step S3: determining a brightness distribution form according to the shape of the light spot, and cutting a portion of the brightness distribution form to generate the light spot, and superimposing it on the position.
[0066] In this step, the brightness distribution of different light spot types is different. The brightness distribution of the light spot is usually uneven, with the center being brighter and the edge being darker. The brightness distribution of the light spot can be in various forms, Figure 2 A Gaussian distribution of brightness is shown in FIG. After the brightness distribution is determined, the brightness of a portion of the area is cut off from the brightness distribution as the brightness distribution of the light spot. Figure 2 The area [100,255] intercepted in the image is used as the brightness distribution of the light spot. The intercepted light spot area should have clear boundaries and natural brightness transitions. Finally, the generated light spot is superimposed on the previously determined image position. This usually involves pixel-level operations on the image to ensure that the light spot blends seamlessly with the surrounding environment. During the superposition process, the brightness, color and other parameters of the light spot also need to be adjusted to make it more coordinated with the photo.
[0067] Figure 3 FIG. 1 is a flow chart of a step of determining a lighting direction in an embodiment of the present invention. Figure 3 As shown, in an embodiment of the present invention, a step of determining a light direction includes:
[0068] Step S11: Acquire an indoor image.
[0069] In this step, raw data for subsequent processing, that is, images of indoor environments, are obtained. Indoor scenes can be photographed using a digital camera, a smartphone camera, or other image acquisition devices, or appropriate indoor images can be selected from existing image libraries or network resources.
[0070] Step S12: Detect the target object on the indoor image using the target detection model.
[0071] In this step, the target objects in the image are identified and located through the target detection model. These objects can be common indoor objects such as furniture, people, and electrical appliances. You can select or train a suitable target detection model, such as YOLO (You Only Look Once), Faster R-CNN, etc. Input the indoor image into the target detection model, and the model will output the bounding box and category label of the target object. According to the output of the model, mark the location of the target object on the image.
[0072] Step S13: determining the illumination direction according to the brightness distribution of the target object.
[0073] In this step, the direction in which the light illuminates the target object, that is, the illumination direction, is inferred by analyzing the brightness distribution of the target object. For each detected target object, the pixel brightness values within its bounding box are analyzed. Based on the distribution of brightness values, areas with higher brightness (usually areas directly illuminated by the light source) and areas with lower brightness (shadow areas) are identified. By comparing the brightness values of different areas, the approximate position of the light source and the illumination direction are inferred. This may require the application of some geometric and physical knowledge, such as the projection and reflection laws of light on a plane. Other image processing techniques, such as image gradient analysis, shadow detection, etc., can also be considered to more accurately determine the illumination direction.
[0074] This embodiment provides a process of indoor image processing and illumination direction determination. Through these steps, useful information can be extracted from the indoor image, providing a basis for subsequent outdoor image generation or other image processing tasks.
[0075] Figure 4 FIG. 1 is a flow chart of steps for determining the shape and position of a light spot in an embodiment of the present invention. Figure 4As shown, in an embodiment of the present invention, a step of determining the shape and position of a light spot includes:
[0076] Step S21: determining an initial position of the light spot according to the shape of the target object and the illumination direction.
[0077] In this step, the shape of the target object is analyzed, especially the part of its surface facing the light source. Combined with the direction of the light, the position where the light may directly illuminate the target object is inferred. This position is used as the initial position of the light spot. Usually, this position is located on the side of the target object facing the light source and has a relatively high brightness.
[0078] Step S22: determining the shape, position and number of the light spots according to the initial position and the geometric relationship of the target object.
[0079] In this step, the possible shape of the light spot is inferred based on the surface material and reflectivity of the target object, as well as the type and intensity of the light source. For example, if the target object is a smooth plane, the light spot may be circular or elliptical; if the target object has a textured or uneven surface, the shape of the light spot may be more complex. Based on the initial position, the position of the light spot is fine-tuned according to the geometry of the target object and the projection angle of the light source. Ensure that the light spot can accurately reflect the illumination of the light on the target object. Determine the number of light spots to be generated based on the number and distribution of target objects.
[0080] This embodiment can generate a more realistic and lifelike light spot effect, providing a basis for subsequent image processing tasks.
[0081] Figure 5 FIG. 1 is a flow chart of the steps of intercepting and superimposing light spots in an embodiment of the present invention. Figure 5 As shown, in an embodiment of the present invention, a step of intercepting light spots and superimposing light spots includes:
[0082] Step S31: determining the brightness distribution shape of the light spot according to the shape of the light spot.
[0083] In this step, the morphology of the light spot is analyzed, including its size, shape and edge features. There are many types of brightness distribution, including at least one of Gaussian distribution, exponential distribution, Poisson distribution, parabolic distribution, power law distribution, Rayleigh distribution, lognormal distribution, Bessel distribution and mixed distribution. Different light spot morphologies have different brightness distribution morphologies, so the brightness distribution morphology can be determined according to the light spot morphology.
[0084] Step S32: intercepting a portion in the brightness distribution form to determine the brightness distribution of the light spot.
[0085] In this step, a suitable interception area is determined in the brightness distribution form according to the actual size and shape of the light spot, ensuring that the interception area can completely contain the main brightness characteristics of the light spot while avoiding excessive background noise or irrelevant information.
[0086] Step S33: Generate the light spot, and superimpose the light spot on the position.
[0087] In this step, a spot image matching the spot shape and size is generated based on the brightness distribution of the intercepted area. The generated spot image is superimposed on the specified position of the original image. During the superposition process, it may be necessary to adjust the brightness, contrast and other parameters of the spot to ensure its integration and naturalness with the surrounding environment.
[0088] Figure 6 FIG. 1 is a flow chart of the steps of determining the brightness distribution of a light spot in an embodiment of the present invention. Figure 6 As shown, in an embodiment of the present invention, a step of determining the brightness distribution of a light spot includes:
[0089] Step S321: determining a backup center point on the brightness distribution pattern according to the brightness of the target object.
[0090] In this step, the brightness distribution of the target object is analyzed, especially those areas with higher brightness. By determining the brightest point in these areas, the brightness of the backup center point can be calculated according to the conversion coefficient. The conversion coefficient is a value greater than 1 and can be set according to specific needs. The backup center point includes at least one point. For most cases, there are usually at least 2 backup center points. Figure 2 Taking the Gaussian distribution in as an example, except for the high point, any brightness has two corresponding points, and these two points are the backup center points.
[0091] Step S322: selecting a center point from the backup center points according to the illumination direction.
[0092] In this step, the relative position relationship between the backup center point and the light source is analyzed in combination with the illumination direction. A more suitable center point can be selected from the backup center points. The brightness distribution around multiple different backup center points is different. Different brightness distributions indicate different illumination directions, so the center point can be determined by the illumination direction.
[0093] Step S323: According to the shape of the light spot, a cut-off portion is determined with the central point as the center to obtain the brightness distribution of the light spot.
[0094] In this step, a suitable interception area is determined based on the shape of the light spot with the selected center point as the center. Make sure that the interception area can completely contain the main brightness characteristics of the light spot while avoiding excessive background noise or irrelevant information. This area is intercepted from the brightness distribution form as the brightness distribution of the light spot.
[0095] This embodiment can accurately extract the brightness distribution of the light spot from the brightness distribution form, providing a basis for subsequent light spot generation and superposition.
[0096] Figure 7 FIG. 1 is a flow chart of the steps of superimposing light spots in an embodiment of the present invention. Figure 7 As shown, a step of superimposing light spots in an embodiment of the present invention includes:
[0097] Step S331: generating the light spot.
[0098] In this step, create a new image layer whose size and resolution should match the original image. Draw the light spot on the new image layer according to the brightness distribution of the light spot. Brighter colors can be used for areas with higher brightness, while darker colors can be used for areas with lower brightness. Make sure that the shape, size, and position of the light spot are consistent with the parameters determined previously. When generating the light spot, ensure that the color transition is natural and avoid obvious color discontinuities or mutations.
[0099] Step S332: setting transparency in a gradient according to the brightness of the light spot.
[0100] In this step, the brightness distribution of the light spot is analyzed to determine the central area with higher brightness and the edge area with lower brightness. A higher transparency (close to opaque) is set for the central area, while a lower transparency (close to completely transparent) is set for the edge area. A smooth transition zone can be set between the central area and the edge area to ensure that the change in transparency is continuous. Use image processing techniques (such as alpha channel adjustment) to apply the transparency gradient to the light spot image. The transparency setting should take into account the overall brightness and shape of the light spot to ensure that the superimposed effect is natural and realistic.
[0101] Step S333: superimposing the light spot to the position.
[0102] In this step, the spot image is superimposed on the specified position of the original image using image processing technology (such as image synthesis). During the superposition process, ensure that the transparency gradient of the spot is correctly integrated with the pixel value of the original image to avoid obvious stitching marks or color differences.
[0103] This embodiment can generate a light spot effect that is coordinated with the original image and naturally integrated.
[0104] Figure 8 FIG. 1 is a schematic diagram of the structure of an outdoor image generation system according to an embodiment of the present invention. Figure 8 As shown, an outdoor image generation system in an embodiment of the present invention includes:
[0105] An acquisition module, used to obtain an indoor image, detect a target object in the indoor image, and determine a lighting direction according to the target object;
[0106] A light spot module, used to determine the shape and position of the light spot according to the illumination direction;
[0107] The superposition module is used to determine the brightness distribution form according to the shape of the light spot, and to intercept a part of the brightness distribution form to generate the light spot, and to superpose it to the position.
[0108] This embodiment determines the lighting direction according to the target object, then determines the shape and position of the light spot, and then determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate the light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0109] An embodiment of the present invention further provides an outdoor image generation device, comprising a processor and a memory, wherein executable instructions of the processor are stored, wherein the processor is configured to execute the steps of an outdoor image generation method by executing the executable instructions.
[0110] As described above, this embodiment determines the lighting direction according to the target object, then determines the shape and position of the light spot, and then determines the brightness distribution form of the light spot, intercepts part of the brightness distribution form to generate the light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0111] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0112] Fig. 9 Schematic diagram of the structure of an outdoor image generation device in an embodiment of the present invention. Fig. 9 The electronic device 600 according to this embodiment of the present invention is described. Fig. 9 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0113] like Fig. 9As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0114] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps of various exemplary embodiments of the present invention described in the above-mentioned outdoor image generation method section of this specification. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .
[0115] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0116] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a grid environment.
[0117] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0118] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more grids (e.g., a local area network (LAN), a wide area network (WAN), and / or a public grid, such as the Internet) through a grid adapter 660. The grid adapter 660 may communicate with other modules of the electronic device 600 through the bus 630. It should be understood that although Fig. 9Not shown, other hardware and / or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0119] In an embodiment of the present invention, a computer-readable storage medium is further provided for storing a program, and when the program is executed, steps of a method for generating an outdoor image are implemented. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above-mentioned outdoor image generation method section of this specification.
[0120] As shown above, this embodiment determines the lighting direction according to the target object, then determines the shape and position of the light spot, and then determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate a light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0121] Fig.10 Schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. Fig.10 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0122] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0123] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0124] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of grid, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0125] This embodiment determines the lighting direction according to the target object, then determines the shape and position of the light spot, and then determines the brightness distribution form of the light spot, intercepts a part of the brightness distribution form to generate the light spot, and superimposes it on the image, so that the generated image is more consistent with the image of a real outdoor scene.
[0126] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the embodiments can be referred to each other. The above description of the disclosed embodiments enables professionals and technicians in this field to implement or use the present invention. Various modifications to these embodiments will be obvious to professionals and technicians in this field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this article, but will comply with the widest range consistent with the principles and novel features disclosed herein.
[0127] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for generating an outdoor image, characterized in that: include: Step S1: obtaining an indoor image, detecting a target object in the indoor image, and determining a lighting direction according to the target object; Step S2: determining the shape and position of the light spot according to the illumination direction; Step S3: determining a brightness distribution form according to the shape of the light spot, and cutting a portion of the brightness distribution form to generate the light spot, and superimposing it on the position.
2. The outdoor image generation method according to claim 1, characterized in that: Step S1 includes: Step S11: Acquire indoor images; Step S12: Detecting a target object on the indoor image using a target detection model; Step S13: determining the illumination direction according to the brightness distribution of the target object.
3. The outdoor image generation method according to claim 1, characterized in that: Step S2 includes: Step S21: determining the initial position of the light spot according to the shape of the target object and the illumination direction; Step S22: determining the shape, position and number of the light spots according to the initial position and the geometric relationship of the target object.
4. The outdoor image generation method according to claim 1, characterized in that: Step S3 includes: Step S31: determining the brightness distribution shape of the light spot according to the shape of the light spot; Step S32: intercepting a portion in the brightness distribution form to determine the brightness distribution of the light spot; Step S33: Generate the light spot, and superimpose the light spot on the position.
5. The outdoor image generation method according to claim 4, characterized in that: The brightness distribution has multiple forms, including at least one of Gaussian distribution, exponential distribution, Poisson distribution, parabolic distribution, power-law distribution, Rayleigh distribution, lognormal distribution, Bessel distribution, and mixed distribution.
6. The outdoor image generation method according to claim 4, characterized in that: Step S32 includes: Step S321: determining a backup center point on the brightness distribution form according to the brightness of the target object; the backup center point includes at least one point; Step S322: selecting a center point from the backup center points according to the illumination direction; Step S323: According to the shape of the light spot, a cut-off portion is determined with the central point as the center to obtain the brightness distribution of the light spot.
7. The outdoor image generation method according to claim 4, characterized in that: Step S33 includes: Step S331: generating the light spot; Step S332: setting transparency in a gradient form according to the brightness of the light spot; Step S333: superimposing the light spot to the position.
8. An outdoor image generation system, used to implement the outdoor image generation method according to any one of claims 1 to 7, characterized in that: include: An acquisition module, used to obtain an indoor image, detect a target object in the indoor image, and determine a lighting direction according to the target object; A light spot module, used to determine the shape and position of the light spot according to the illumination direction; The superposition module is used to determine the brightness distribution form according to the shape of the light spot, and to intercept a part of the brightness distribution form to generate the light spot, and to superpose it to the position.
9. An outdoor image generation device, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to execute the steps of the outdoor image generation method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the steps of the outdoor image generation method according to any one of claims 1 to 7 are implemented.