A method and device for generating a lighting display effect diagram based on a two-dimensional image
By generating lamps and lighting effects in 2D images, it solves the difficulty of lighting effect display in 2D design and the complexity of 3D design, realizes automatic arrangement of lamps and real lighting display, and lowers the designer's operating threshold.
Patent Information
- Application Number
- CN202410790168.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-19
AI Technical Summary
In space design, 2D flat lighting effect design is difficult to display the lighting performance of lamps, and 3D lighting effect design operations are complicated, which increases the designer's threshold.
By receiving the two-dimensional image and lamp layout instructions input by the user, the point cloud information of the attachment surface and illumination surface of the lamp in the three-dimensional space is determined, the lighting display effect information of the lamp in the three-dimensional space is generated, and displayed in the 2D image.
It realizes the automatic arrangement of lamps and display of lighting effects in 2D images, lowers the learning threshold for designers, and automatically adjusts the range of light source illumination based on spatial information, showing more realistic lighting effects.
Smart Images

Figure CN118365839B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of space design technology, and in particular to a method and device for generating a lighting display effect diagram based on a two-dimensional image. Background Art
[0002] In the space design scenario, designers can achieve accurate lighting effect design through three-dimensional (3D) space design, but the operation is complicated and requires remodeling of the entire scene, resulting in a high threshold for operation. If 2D plane lighting effect design is used, designers can quickly check whether the style of the lamp matches the environment, but cannot understand the lighting performance of the lamp and cannot display the lighting effect. Summary of the invention
[0003] The present disclosure provides a method, device, equipment and storage medium for generating a light display effect diagram based on a two-dimensional image, so as to solve or alleviate one or more technical problems in the prior art.
[0004] In a first aspect, the present disclosure provides a method for generating a lighting display effect diagram based on a two-dimensional image, comprising:
[0005] Receive a two-dimensional image input by a user, where the two-dimensional image is a scene graph of a three-dimensional space;
[0006] Determine three-dimensional point cloud information of at least two surfaces in a three-dimensional space according to the two-dimensional image, wherein the at least two surfaces include a lamp attachment surface and a lamp irradiation surface;
[0007] Receive a lamp arrangement instruction from a user, where the lamp arrangement instruction at least includes the type, arrangement mode and lighting parameters of the lamps;
[0008] Generate light display effect information of the lamp in the three-dimensional space scene according to the type, arrangement and lighting parameters of the lamp, the three-dimensional point cloud information of the lamp attachment surface and the three-dimensional point cloud information of the lamp irradiation surface;
[0009] A lighting display effect diagram is displayed according to the effect information.
[0010] In a second aspect, the present disclosure provides a device for generating a light display effect diagram based on a two-dimensional image, comprising:
[0011] A receiving module, used to receive a two-dimensional image and a lamp arrangement instruction input by a user, wherein the two-dimensional image is a scene diagram of a three-dimensional space, and the lamp arrangement instruction at least includes the type, arrangement mode and lighting parameters of the lamps;
[0012] A processing module, configured to determine three-dimensional point cloud information of at least two surfaces in a three-dimensional space according to the two-dimensional image, wherein the at least two surfaces include a lamp attachment surface and a lamp illumination surface; and generate light display effect information of the lamp in the three-dimensional space scene according to the type, arrangement and lighting parameters of the lamp, the three-dimensional point cloud information of the lamp attachment surface and the three-dimensional point cloud information of the lamp illumination surface;
[0013] The display module is used to display the lighting display effect diagram according to the effect information.
[0014] In a third aspect, the present disclosure provides an electronic device, including:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.
[0018] In a fourth aspect, the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute any method according to the embodiments of the present disclosure.
[0019] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0020] The method for generating a lighting display effect diagram proposed in the present disclosure can generate a lighting fixture image and lighting effects in a 2D image, thereby realizing a lighting fixture design in a 2D plane.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments provided according to the present disclosure and should not be regarded as limiting the scope of the present disclosure.
[0023] Figure 1 It is a flowchart of a method for generating a light display effect diagram based on a two-dimensional image according to an embodiment of the present disclosure;
[0024] Figure 2 is a flowchart of a method for generating a lighting display effect diagram based on a two-dimensional image according to another embodiment of the present disclosure;
[0025] Figure 3 It is a schematic diagram of the structure of a device for generating a light display effect diagram based on a two-dimensional image according to an embodiment of the present disclosure;
[0026] Figure 4 is a schematic diagram of the structure of a device for generating a light display effect diagram based on a two-dimensional image according to another embodiment of the present disclosure;
[0027] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The present disclosure will be further described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0029] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.
[0030] The disclosed embodiment proposes a method for generating a lighting display effect diagram based on a two-dimensional image, which can generate lighting effects in a 2D space design, realize automatic lighting arrangement and display of lighting effects in a 2D image. Figure 1 The present invention is a flowchart of a method for generating a light display effect diagram based on a two-dimensional image according to an embodiment of the present invention, comprising the following steps:
[0031] S110, receiving a two-dimensional image input by a user, where the two-dimensional image is a scene graph of a three-dimensional space;
[0032] S120, determining three-dimensional point cloud information of at least two surfaces in a three-dimensional space according to the two-dimensional image, the at least two surfaces including a lamp attachment surface and a lamp irradiation surface;
[0033] S130, receiving a lamp arrangement instruction from a user, where the lamp arrangement instruction at least includes the type, arrangement method and lighting parameters of the lamps;
[0034] S140, generating light display effect information of the lamp in the three-dimensional space scene according to the type, arrangement and light parameters of the lamp, the three-dimensional point cloud information of the lamp attachment surface and the three-dimensional point cloud information of the lamp irradiation surface;
[0035] S150: Display a lighting display effect diagram according to the effect information.
[0036] The two-dimensional image may include an indoor picture. The two-dimensional image and the lamp arrangement instruction may be sent by the user through a client or an application. The user may input the two-dimensional image and the lamp arrangement instruction at the same time, or input the two-dimensional image and the lamp arrangement instruction in two messages respectively; the receiving of the two-dimensional image in step S110 and the receiving of the lamp arrangement instruction in step S130 may be performed simultaneously, or one after the other, and the present application does not limit the execution order of the two steps.
[0037] In some embodiments, the method for generating a light display effect diagram proposed in the embodiments of the present disclosure involves a light effect generation process and a light effect display process. In the light effect generation process, a two-dimensional image and a light fixture arrangement instruction sent by a user are received, and light display effect information of the light fixture in a three-dimensional space scene is generated based on the two-dimensional image and the light fixture arrangement instruction; in the light effect display process, a light display effect diagram is displayed in the two-dimensional image according to the effect information.
[0038] As can be seen from the above content, the method proposed in the embodiment of the present disclosure can realize the display of lighting effects in 2D pictures, thereby realizing automatic lighting in 2D pictures, without the need for complex lighting arrangement and lighting steps in 3D space, and reducing the learning threshold for designers. In addition, the embodiment of the present disclosure can automatically adjust and display the range illuminated by the light source according to the spatial information, which is more realistic than placing only one lighting legend.
[0039] In the method proposed in the embodiment of the present disclosure, the lamp can be attached (or installed) on the indoor ceiling, floor or wall, and the lamp irradiation position can also be on the indoor ceiling, floor or wall; accordingly, the three-dimensional point cloud of the lamp attachment surface can include at least one of the ceiling point cloud, floor point cloud and wall point cloud, and the three-dimensional point cloud of the lamp irradiation surface can include at least one of the ceiling point cloud, floor point cloud and wall point cloud; the lamp attachment surface can include at least one of the ceiling, floor and wall, and the lamp irradiation surface can include at least one of the ceiling, floor and wall. Among them, the ceiling, floor or wall can be a plane or a curved surface.
[0040] In some embodiments, in the above step S120, a three-dimensional point cloud corresponding to the two-dimensional image may be generated; and the three-dimensional point cloud information of at least two surfaces in the three-dimensional space may be divided from the three-dimensional point cloud using the two-dimensional image. In one example, at least one of a depth estimation method and a normal estimation method is used to generate a three-dimensional point cloud corresponding to the two-dimensional image, and the three-dimensional point cloud information of at least two surfaces in the three-dimensional space may be divided from the three-dimensional point cloud using the two-dimensional image.
[0041] For example, you can use the ZoeDepth neural network model for depth estimation. Or you can use the Point Cloud Library normal estimation method for normal estimation.
[0042] In some embodiments, using the two-dimensional image to divide three-dimensional point cloud information of at least two surfaces in the three-dimensional space from the three-dimensional point cloud includes:
[0043] Perform Manhattan segmentation on walls in 2D images;
[0044] Based on the wall information after Manhattan segmentation, each 3D coordinate point in the 3D point cloud is labeled, and the label includes top surface, ground surface or wall surface;
[0045] According to the tag, three-dimensional point cloud information of at least two surfaces in the three-dimensional space is divided from the three-dimensional point cloud, and the at least two surfaces include a lamp attachment surface and a lamp irradiation surface.
[0046] In one example, the NonCuboidRoom model is used to perform Manhattan segmentation on the wall in the two-dimensional image. The three-dimensional point cloud corresponding to the two-dimensional image includes multiple three-dimensional coordinate points. Using the wall information after Manhattan segmentation, a corresponding label is assigned to each three-dimensional coordinate point to mark whether the three-dimensional coordinate point belongs to the top surface, the ground or the wall. Then, according to the labels of each three-dimensional coordinate point, the three-dimensional point cloud of the lamp attachment surface and the three-dimensional point cloud of the lamp irradiation surface are divided from the three-dimensional point cloud.
[0047] In some implementations, step S140 includes:
[0048] In the first step, the three-dimensional point cloud of the lamp attachment surface and the three-dimensional point cloud of the lamp irradiation surface are respectively fitted to obtain the lamp attachment surface and the lamp irradiation surface;
[0049] The second step is to project the three-dimensional point cloud of the lamp attachment surface into the lamp attachment surface, and project the three-dimensional point cloud of the lamp illumination surface into the lamp illumination surface;
[0050] The third step is to determine the two-dimensional point position of the lamp in the lamp attachment surface based on the type and arrangement of the lamp, and determine the two-dimensional point position of the lamp irradiation point in the lamp irradiation surface;
[0051] The fourth step is to determine the three-dimensional point cloud as the adsorption point of the lamp from the lamp attachment surface using the two-dimensional point position of the lamp; and determine the three-dimensional point cloud as the illumination point of the lamp from the illumination surface of the lamp using the two-dimensional point position of the lamp illumination point;
[0052] The fifth step is to use the lamp adsorption points, light source lamp irradiation points and lighting parameters to generate the lighting display effect information of the lamp in the three-dimensional space scene.
[0053] For the first step above, for example, assuming that the lamp is attached to the top surface, the corresponding three-dimensional point cloud of the lamp attachment surface is the top surface point cloud, and the three-dimensional point cloud of the lamp attachment surface includes all three-dimensional coordinate points labeled as the top surface; for another example, assuming that the lamp illuminates the ground, the corresponding three-dimensional point cloud of the lamp illumination surface is the ground point cloud, and the three-dimensional point cloud of the lamp illumination surface includes all three-dimensional coordinate points labeled as the ground. Accordingly, the three-dimensional point cloud of the lamp attachment surface is surface fitted, and the obtained lamp attachment surface is the top surface; the three-dimensional point cloud of the lamp illumination surface is surface fitted, and the obtained lamp illumination surface is the ground. If the top surface and / or the ground is a plane, the above-mentioned surface fitting can adopt a plane fitting method, such as directly using a plane generated by a NonCuboidRoom model, or using a random sampling consensus (RANSAC) algorithm for plane fitting.
[0054] Regarding the third step above, in some implementations, the following process may be included:
[0055] Determine the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface within the lamp attachment surface, and determine the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface within the lamp illumination surface;
[0056] Based on the type and arrangement of the lamps, the two-dimensional point positions of the lamps are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface, and the two-dimensional point positions of the lamp illumination points are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface.
[0057] In some examples, if the lamp attachment surface is the top surface and the lamp illumination surface is the ground, the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface (i.e., the top surface point cloud) determined within the lamp attachment surface (i.e., the top surface) is consistent with the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface (i.e., the ground point cloud) determined within the lamp illumination surface (i.e., the ground). Therefore, in the above process, only the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface (i.e., the top surface point cloud) can be calculated, and the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface (i.e., the ground point cloud) can be determined based on the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface (i.e., the top surface point cloud).
[0058] In some examples, the types and arrangements of lamps may include: main lamps, "main lamps + U-shaped" lamps, lamp angles, etc. The lamp arrangement instruction includes at least the type, arrangement and lighting parameters of the lamps; it may also include lamp parameters (such as the height of the lamps), lamp 3D models and other information.
[0059] With respect to the fourth step, in some implementations, using the two-dimensional point position of the lamp, determining a three-dimensional point cloud as the lamp adsorption point from the lamp attachment surface includes:
[0060] Convert the 2D points of the lamp into 3D point cloud;
[0061] Using the three-dimensional point cloud of the lamp, the three-dimensional point cloud represented by the pixel point closest to the three-dimensional point cloud of the lamp is determined from the three-dimensional point cloud of the lamp attachment surface projected from the lamp attachment surface, and the determined three-dimensional point cloud is used as the lamp adsorption point.
[0062] Similarly, in some embodiments, using the two-dimensional point position of the lighting point of the lamp, a three-dimensional point cloud as the lighting point of the lamp is determined from the lighting surface of the lamp, including:
[0063] Convert the two-dimensional point position of the lighting fixture into a three-dimensional point cloud;
[0064] Using the three-dimensional point cloud of the lamp illumination point, the three-dimensional point cloud represented by the pixel point closest to the three-dimensional point cloud of the lamp illumination point is determined from the three-dimensional point cloud of the lamp illumination surface projected in the lamp illumination surface, and the determined three-dimensional point cloud is used as the lamp illumination point.
[0065] Based on the determination of the lamp adsorption point and the lamp irradiation point, the light display effect information of the lamp in the three-dimensional space scene can be determined. In some embodiments, the light display effect information of the lamp in the three-dimensional space scene is generated in the following manner:
[0066] The position of the light source is determined by using the lamp adsorption point and the lamp parameters; for example, the position of the light source is determined according to the lamp adsorption point and the height of the lamp;
[0067] Determine the direction of the light source according to the position of the light source and the illumination point of the lamp; for example, the direction of the light source may be a direction from the position of the light source to the illumination point of the lamp;
[0068] The lighting effect is determined according to the light source direction and lighting parameters; for example, according to the light source direction, lighting parameters (such as brightness, etc.), and other parameters (such as indoor installations and materials, etc.), the lighting display effect information of the lamp in the three-dimensional space scene is generated.
[0069] The following reference Figure 2 A specific implementation method of a method for generating a lighting display effect diagram based on a two-dimensional image is introduced. Figure 2 is a flowchart of a method for generating a light display effect diagram based on a two-dimensional image according to an embodiment of the present disclosure. Figure 2 In the example shown, the lamp adsorption point is located on the top of the room and the lamp irradiation point is located on the floor of the room. Figure 2 As shown, the following steps are included:
[0070] S201, receiving a background image, which is a two-dimensional image, and which may be an indoor image. The background image is an image sent by a user through a client or a related application.
[0071] S202: Generate a three-dimensional point cloud corresponding to the two-dimensional image using a depth estimation method and / or a normal estimation method.
[0072] Among them, the depth estimation method can use ZoeDepth neural network for depth estimation.
[0073] Normal estimation, you can use the pcl normal estimation method.
[0074] S203: performing wall segmentation on the two-dimensional image, for example, using the NonCuboidRoom model to perform Manhattan segmentation on the wall in the two-dimensional image, such as segmenting it into a top surface and a ground surface.
[0075] S204. Based on the wall information segmented in step S203, a label is assigned to each three-dimensional coordinate point in the three-dimensional point cloud generated in step S202, such as a top surface, a ground surface or a wall surface. In this way, the three-dimensional point cloud generated in step S202 is divided into a top surface point cloud and a ground point cloud.
[0076] S205, performing plane fitting on the top point cloud to obtain a top plane; performing plane fitting on the ground point cloud to obtain a ground plane. The top plane or the ground plane may be a plane in a 3D space.
[0077] When performing plane fitting, the plane generated by the NonCuboidRoom model can be directly used, but is not limited to this method. For example, RANSAC and other methods can be used for plane fitting.
[0078] S206 , projecting the top surface point cloud into the top surface plane, and projecting the ground point cloud into the ground plane.
[0079] S207, calculating the minimum bounding rectangle of the top point cloud in the top plane. Assuming that the bounding rectangle of the top point cloud is consistent with the bounding rectangle of the ground point cloud, the minimum bounding matrix of the ground point cloud in the ground plane can be determined based on the minimum bounding rectangle of the top point cloud in the top plane.
[0080] S208. According to the lamps and arrangement schemes selected by the user, the 2D positions of the lamps and the irradiation points are calculated within the minimum circumscribed matrix determined in step S207.
[0081] For example, if the user selects the "main light + U-shaped" lighting arrangement, the calculation process includes:
[0082] According to the size of the minimum circumscribed rectangle of the ground point cloud in the ground plane (such as length x meters and width y meters), IES beam angle (such as z degrees), and the height of the lamp from the ground (assuming a meter), the following calculation is performed:
[0083] a. First calculate the radius of the ring of IES beam shining on the ground b=a*tan(90-z / 2)
[0084] b. Calculate the distribution of lights without a main component, evenly place x / b lights without a main component in the length direction of the rectangle, and evenly place y / b lights without a main component in the width direction of the rectangle.
[0085] c. Leave the outermost non-main lights, delete the rest, and determine the position of the main light in the rectangle.
[0086] If the user selects the "rectangular array without main lamp" lamp arrangement scheme, the calculation process may include the above two steps a and b.
[0087] In addition, users can also choose other lighting arrangements; for other lighting arrangements, the 2D point positions of the lighting fixtures can be calculated within the minimum circumscribed matrix of the top surface point cloud, and the 2D point positions of the illumination points can be calculated within the minimum circumscribed matrix of the ground point cloud, based on the corresponding geometric algorithm.
[0088] S209, according to the 2D point position of the lamp calculated in step S208, find the nearest 3D point cloud from the top plane as the lamp adsorption point; according to the 2D point position of the irradiation point calculated in step S208, find the nearest 3D point cloud from the ground plane as the target irradiation point of the light source. In one example, the following steps are used to implement:
[0089] ① (1) Using the fitted plane information, convert the 2D point positions of the lamps into 3D point clouds, and convert the 2D point positions of the illumination points into 3D point clouds.
[0090] (2) Use the nearest neighbor search of the point cloud to find the 3D point cloud represented by the nearest pixel point of the 3D point cloud of the lamp as the lamp adsorption point; similarly, find the 3D point cloud represented by the nearest pixel point of the 3D point cloud of the illumination point as the lamp illumination point.
[0091] S210, calculating the position of the light source in combination with the height of the lamp, and determining the direction of the light source according to the position of the light source and the position of the lamp's irradiation point, where the direction of the light source is the vector direction from the light source position to the lamp's irradiation point.
[0092] For example, assuming that the height of the lamp is h meters, the position of the light source is the three-dimensional coordinate of h meters moved from the lamp adsorption point in the direction of the top plane normal vector.
[0093] S211, automatically placing the lamp image into the two-dimensional image, and calculating and generating the lighting display effect.
[0094] It should be noted that the two-dimensional image received in the above step S201 and the lamps and arrangement scheme selected by the user in the above step S208 can be achieved through the same receiving process or through two different receiving processes.
[0095] As can be seen from the above implementation, the disclosed embodiment can realize automatic arrangement of lamps in 2D pictures without the need for complex arrangement of lamps and lighting in 3D space, thus lowering the threshold for implementation. Moreover, the disclosed embodiment can automatically adjust and display the range illuminated by the light source according to the spatial information, and the display effect is realistic.
[0096] The disclosed embodiment also provides a device for generating a light display effect diagram based on a two-dimensional image. Figure 3 The present invention is a schematic diagram of a device for generating a light display effect diagram based on a two-dimensional image according to an embodiment of the present invention, comprising:
[0097] The receiving module 310 is used to receive a two-dimensional image and a lamp arrangement instruction input by a user, wherein the two-dimensional image is a scene diagram of a three-dimensional space, and the lamp arrangement instruction at least includes the type, arrangement mode and lighting parameters of the lamps;
[0098] The processing module 320 is used to determine the three-dimensional point cloud information of at least two surfaces in the three-dimensional space according to the two-dimensional image, wherein the at least two surfaces include the lamp attachment surface and the lamp illumination surface; and generate the light display effect information of the lamp in the three-dimensional space scene according to the type, arrangement and lighting parameters of the lamp, the three-dimensional point cloud information of the lamp attachment surface and the three-dimensional point cloud information of the lamp illumination surface;
[0099] The display module 330 is used to display the lighting display effect diagram according to the effect information.
[0100] like Figure 4 As shown, in some embodiments, the processing module 320 includes:
[0101] The projection submodule 321 is used to perform surface fitting on the three-dimensional point cloud of the lamp attachment surface and the three-dimensional point cloud of the lamp illumination surface to obtain the lamp attachment surface and the lamp illumination surface; project the three-dimensional point cloud of the lamp attachment surface into the lamp attachment surface, and project the three-dimensional point cloud of the lamp illumination surface into the lamp illumination surface;
[0102] The determination submodule 322 is used to determine the two-dimensional point position of the lamp in the lamp attachment surface based on the type and arrangement of the lamp, and determine the two-dimensional point position of the lamp illumination point in the lamp illumination surface; determine the three-dimensional point cloud as the lamp adsorption point from the lamp attachment surface using the two-dimensional point position of the lamp; and determine the three-dimensional point cloud as the light source lamp illumination point from the lamp illumination surface using the two-dimensional point position of the lamp illumination point;
[0103] The generation submodule 323 is used to generate the light display effect information of the lamp in the three-dimensional space scene by using the lamp adsorption point, the light source lamp irradiation point and the light parameters.
[0104] In some implementations, the determination submodule 322 is specifically configured to:
[0105] Determine the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface within the lamp attachment surface, and determine the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface within the lamp illumination surface;
[0106] Based on the type and arrangement of the lamps, the two-dimensional point positions of the lamps are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface, and the two-dimensional point positions of the lamp illumination points are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface.
[0107] In some implementations, the determination submodule 322 is specifically configured to:
[0108] Convert the 2D points of the lamp into 3D point cloud;
[0109] Using the 3D point cloud of the lamp, the 3D point cloud represented by the pixel point closest to the 3D point cloud of the lamp is determined from the 3D point cloud of the lamp attachment surface projected from the lamp attachment surface, and the determined 3D point cloud is used as the lamp adsorption point.
[0110] In some implementations, the determination submodule 322 is specifically configured to:
[0111] Convert the two-dimensional point position of the lighting fixture into a three-dimensional point cloud;
[0112] Using the three-dimensional point cloud of the lamp's illumination point, the three-dimensional point cloud represented by the pixel point closest to the three-dimensional point cloud of the lamp's illumination point is determined from the three-dimensional point cloud of the lamp's illumination surface projected on the lamp's illumination surface, and the determined three-dimensional point cloud is used as the light source lamp's illumination point.
[0113] In some implementations, the generation submodule 323 is used to:
[0114] Use the lamp adsorption points and lamp parameters to determine the position of the light source;
[0115] Determine the direction of the light source according to the position of the light source and the irradiation point of the light source lamp;
[0116] According to the light source direction and light parameters, the light display effect information of the lamp in the three-dimensional space scene is generated.
[0117] In some implementations, the determination submodule 322 is used to:
[0118] Generate a three-dimensional point cloud corresponding to the two-dimensional image;
[0119] The three-dimensional point cloud information of at least two surfaces in the three-dimensional space is divided from the three-dimensional point cloud by using the two-dimensional image.
[0120] In some implementations, the determination submodule 322 is specifically configured to:
[0121] At least one of a depth estimation method and a normal estimation method is used to generate a three-dimensional point cloud corresponding to the two-dimensional image.
[0122] In some implementations, the determination submodule 322 is specifically configured to:
[0123] Perform Manhattan segmentation on walls in 2D images;
[0124] Based on the wall information after Manhattan segmentation, each 3D coordinate point in the 3D point cloud is labeled, including top surface, ground surface or wall surface;
[0125] According to the labels, three-dimensional point cloud information of at least two surfaces in the three-dimensional space is divided from the three-dimensional point cloud.
[0126] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0127] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0128] Figure 5 FIG. 1 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Figure 5 As shown, the electronic device includes: a memory 510 and a processor 520, and the memory 510 stores a computer program that can be run on the processor 520. The number of memories 510 and processors 520 can be one or more. The memory 510 can store one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device executes the method provided by the above method embodiment. The electronic device may also include: a communication interface 530, which is used to communicate with external devices and perform data exchange transmission.
[0129] If the memory 510, the processor 520 and the communication interface 530 are implemented independently, the memory 510, the processor 520 and the communication interface 530 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0130] Optionally, in a specific implementation, if the memory 510, the processor 520 and the communication interface 530 are integrated on a chip, the memory 510, the processor 520 and the communication interface 530 can communicate with each other through an internal interface.
[0131] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.
[0132] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0133] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (for example: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (for example: infrared, Bluetooth, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. It is worth noting that the computer-readable storage medium mentioned in the present disclosure may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0134] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0135] In the description of the embodiments of the present disclosure, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0136] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0137] In the description of the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0138] The above description is only an exemplary embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating a lighting display effect diagram based on a two-dimensional image, comprising: Receiving a two-dimensional image input by a user, wherein the two-dimensional image is a scene graph of a three-dimensional space; Determine three-dimensional point cloud information of at least two surfaces in a three-dimensional space according to the two-dimensional image, wherein the at least two surfaces include a lamp attachment surface and a lamp irradiation surface; Receiving a lamp arrangement instruction from a user, wherein the lamp arrangement instruction at least includes the type, arrangement mode and lighting parameters of the lamps; Performing surface fitting on the three-dimensional point cloud of the lamp attachment surface and the three-dimensional point cloud of the lamp illumination surface respectively to obtain the lamp attachment surface and the lamp illumination surface; projecting the three-dimensional point cloud of the lamp attachment surface into the lamp attachment surface, and projecting the three-dimensional point cloud of the lamp illumination surface into the lamp illumination surface; determining the two-dimensional point position of the lamp in the lamp attachment surface based on the type and arrangement of the lamp, and determining the two-dimensional point position of the lamp illumination point in the lamp illumination surface; using the two-dimensional point position of the lamp, determining the three-dimensional point cloud as the lamp adsorption point from the lamp attachment surface; and using the two-dimensional point position of the lamp illumination point, determining the three-dimensional point cloud as the light source lamp illumination point from the lamp illumination surface; using the lamp adsorption point, the light source lamp illumination point and the light parameters, generating the light display effect information of the lamp in the three-dimensional space scene; A lighting display effect diagram is displayed according to the effect information.
2. The method according to claim 1, wherein: The step of determining the two-dimensional position of the lamp in the lamp attachment surface based on the type and arrangement of the lamp, and determining the two-dimensional position of the lamp irradiation point in the lamp irradiation surface includes: Determine the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface within the lamp attachment surface, and determine the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface within the lamp illumination surface; Based on the type and arrangement of the lamps, the two-dimensional point positions of the lamps are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp attachment surface, and the two-dimensional point positions of the lamp illumination points are determined within the circumscribed rectangle of the three-dimensional point cloud of the lamp illumination surface.
3. The method according to claim 1, wherein: The method of using the two-dimensional point position of the lamp to determine a three-dimensional point cloud as a lamp adsorption point from the lamp attachment surface includes: Converting the two-dimensional point position of the lamp into a three-dimensional point cloud; Using the three-dimensional point cloud of the lamp, the three-dimensional point cloud represented by the pixel point closest to the three-dimensional point cloud of the lamp is determined from the three-dimensional point cloud of the lamp attachment surface projected from the lamp attachment surface, and the determined three-dimensional point cloud is used as the lamp adsorption point.
4. The method according to claim 1, wherein: The method of using the two-dimensional point position of the illumination point of the lamp to determine a three-dimensional point cloud of the illumination point of the lamp as a light source from the illumination surface of the lamp includes: Converting the two-dimensional point position of the lighting fixture's illumination point into a three-dimensional point cloud; Using the three-dimensional point cloud of the lamp illumination point, the three-dimensional point cloud represented by the pixel point closest to the three-dimensional point cloud of the lamp illumination point is determined from the three-dimensional point cloud of the lamp illumination surface projected into the lamp illumination surface, and the determined three-dimensional point cloud is used as the light source lamp illumination point.
5. The method according to claim 1, wherein: The generating of the light display effect information of the lamp in the three-dimensional space scene by using the lamp adsorption point, the light source lamp irradiation point and the light parameter includes: Determine the position of the light source by using the lamp adsorption point and lamp parameters; Determine the direction of the light source according to the position of the light source and the irradiation point of the light source lamp; According to the light source direction and the light parameters, light display effect information of the lamp in the three-dimensional space scene is generated.
6. The method according to any one of claims 1 to 5, wherein: The step of determining three-dimensional point cloud information of at least two surfaces in a three-dimensional space according to the two-dimensional image comprises: Generating a three-dimensional point cloud corresponding to the two-dimensional image; The three-dimensional point cloud information of at least two surfaces in the three-dimensional space is divided from the three-dimensional point cloud by using the two-dimensional image.
7. The method according to claim 6, wherein: The generating a three-dimensional point cloud corresponding to the two-dimensional image includes: At least one of a depth estimation method and a normal estimation method is used to generate a three-dimensional point cloud corresponding to the two-dimensional image.
8. The method according to claim 6, wherein: The step of using the two-dimensional image to divide three-dimensional point cloud information of at least two surfaces in the three-dimensional space from the three-dimensional point cloud includes: Performing Manhattan segmentation on the wall in the two-dimensional image; Based on the wall information after Manhattan segmentation, assign a label to each three-dimensional coordinate point in the three-dimensional point cloud, wherein the label includes a top surface, a ground surface or a wall surface; According to the labels, three-dimensional point cloud information of at least two surfaces in the three-dimensional space is divided from the three-dimensional point cloud.
9. A device for generating a lighting display effect diagram based on a two-dimensional image, comprising: A receiving module, used to receive a two-dimensional image and a lamp arrangement instruction input by a user, wherein the two-dimensional image is a scene diagram of a three-dimensional space, and the lamp arrangement instruction at least includes the type, arrangement mode and lighting parameters of the lamps; A processing module, used to determine the three-dimensional point cloud information of at least two surfaces in the three-dimensional space according to the two-dimensional image, wherein the at least two surfaces include a lamp attachment surface and a lamp irradiation surface; perform surface fitting on the three-dimensional point cloud of the lamp attachment surface and the three-dimensional point cloud of the lamp irradiation surface respectively to obtain the lamp attachment surface and the lamp irradiation surface; project the three-dimensional point cloud of the lamp attachment surface into the lamp attachment surface, and project the three-dimensional point cloud of the lamp irradiation surface into the lamp irradiation surface; determine the two-dimensional point position of the lamp in the lamp attachment surface based on the type and arrangement of the lamp, and determine the two-dimensional point position of the lamp irradiation point in the lamp irradiation surface; determine the three-dimensional point cloud as the lamp adsorption point from the lamp attachment surface by using the two-dimensional point position of the lamp; and determine the three-dimensional point cloud as the light source lamp irradiation point from the lamp irradiation surface by using the two-dimensional point position of the lamp; generate the light display effect information of the lamp in the three-dimensional space scene by using the lamp adsorption point, the light source lamp irradiation point and the light parameters; A display module is used to display a lighting display effect diagram according to the effect information.
10. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
12. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Picture processing method and device
CN104268928A
Method for pre-arranging indoor lighting fixture based on BIM technology
CN107491590A
