A method, device, electronic device and storage medium for coloring point cloud
By obtaining the reflection intensity value of the lidar point cloud and determining the color, the problem of inability to distinguish objects after visualization of point clouds is solved, and efficient labeling is achieved and labeling costs are reduced.
Patent Information
- Application Number
- CN202111535269.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-12-15
AI Technical Summary
After point cloud visualization, it is impossible to distinguish specific objects, resulting in increased annotation costs.
By obtaining the first reflection intensity value of the point cloud and the second reflection intensity value of each point in the area to be colored, the color of the area to be colored is determined, and the area to be colored is colored according to the color.
After realizing point cloud visualization, it can clearly distinguish different objects, improve labeling efficiency and reduce labeling costs.
Smart Images

Figure CN114445547B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing, and specifically relates to a method, device, electronic device and storage medium for point cloud coloring. Background Art
[0002] Laser Radar (English: Laser Radar) is a radar system that emits laser beams to detect the position, speed and other characteristic quantities of the target. Its working principle is to emit a detection signal (laser beam) to the target, and then compare the received signal reflected from the target (target echo) with the transmitted signal. After appropriate processing, relevant information about the target can be obtained, such as target distance, direction, height, speed, and attitude.
[0003] LiDAR uses laser as a signal source. The pulsed laser emitted by the laser hits the trees, roads, bridges and buildings on the ground, causing scattering. Part of the light wave will be reflected to the receiver of the LiDAR. According to the principle of laser ranging, the distance from the LiDAR to the target point is calculated. The pulsed laser continuously scans the target object to obtain the data of all the target points on the target object. Point cloud data is composed of a series of points with three-dimensional coordinates. It is usually collected by LiDAR, but the laser point clouds usually obtained are pure colors, which makes it impossible to distinguish different objects after the point cloud is visualized; for example, it is difficult for the labeler to mark the lane line separately on the point cloud, which will greatly increase the labeling cost. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for point cloud coloring, which can solve the problem that specific objects cannot be distinguished after point cloud visualization, so that different objects can be distinguished after point cloud visualization.
[0005] In a first aspect, an embodiment of the present application provides a method for coloring a point cloud, the method comprising: obtaining a first reflection intensity value of a point cloud; obtaining a second reflection intensity value of each point in an area to be colored in the point cloud; determining a color corresponding to the area to be colored based on the first reflection intensity value and the second reflection intensity value; and coloring the area to be colored based on the color corresponding to the area to be colored.
[0006] In second aspect, an embodiment of the present application provides a device for coloring a point cloud, the device comprising: a statistical module for obtaining a first reflection intensity value of a point cloud; an acquisition module for obtaining a second reflection intensity value of each point in an area to be colored in the point cloud; a calculation module for determining a color corresponding to the area to be colored based on the first reflection intensity value and the second reflection intensity value; and a coloring module for coloring the area to be colored based on the color corresponding to the area to be colored.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0009] In an embodiment of the present application, by obtaining a first reflection intensity value of the point cloud and a second reflection intensity value of each point in the area to be colored in the point cloud, the color corresponding to the area to be colored is determined according to the first reflection intensity value and the second reflection intensity value, and the area to be colored is colored according to the color corresponding to the area to be colored, thereby achieving the ability to distinguish different areas by color and solving the problem of being unable to distinguish specific objects after point cloud visualization. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of a method for coloring a point cloud provided in an embodiment of the present application;
[0011] Figure 2 It is a flowchart of another method for coloring a point cloud provided in an embodiment of the present application;
[0012] Figure 3 It is a flowchart of another method for coloring a point cloud provided in an embodiment of the present application;
[0013] Figure 4 It is a flowchart of another method for coloring a point cloud provided in an embodiment of the present application;
[0014] Figure 5 It is a flowchart of another method for coloring a point cloud provided in an embodiment of the present application;
[0015] Figure 6 It is a structural schematic diagram of a point cloud coloring device provided in an embodiment of the present application;
[0016] Figure 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0017] Figure 8 It is a schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0020] In the following, in combination with the accompanying drawings, a method, device, electronic device and storage medium for point cloud coloring provided by an embodiment of the present application are described in detail through specific embodiments and their application scenarios. Figure 1 A method for coloring a point cloud provided by an embodiment of the present invention is shown. The method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device, wherein the terminal device may be, for example, a vehicle-mounted terminal or a mobile phone terminal. In other words, the method can be executed by software or hardware installed in the electronic device, and the method includes the following steps:
[0021] Step 102: Obtain a first reflection intensity value of the point cloud.
[0022] Specifically, a point cloud consists of a series of points with three-dimensional coordinates, which are usually collected by lidar.
[0023] Specifically, the physical substance has reflection intensity, that is, the physical points constituting the point cloud have corresponding reflection intensity values. Here, obtaining the first reflection intensity value of the point cloud means obtaining the first reflection intensity value corresponding to the physical points constituting the point cloud.
[0024] Optionally, when obtaining the first reflection intensity value of the point cloud, the reflection intensity value of each point in the point cloud output by the laser radar can be obtained, and the first reflection intensity value corresponding to the point cloud can be obtained based on the reflection intensity value of each point in the point cloud.
[0025] Of course, it should be noted that the first reflection intensity value of the point cloud can also be obtained by other methods, such as selecting part of the point cloud data in the point cloud, and obtaining the first reflection intensity value corresponding to the point cloud according to the reflection intensity value of the part of the point cloud.
[0026] Step 104: Obtain a second reflection intensity value of each point in the area to be colored in the point cloud.
[0027] In this step, the electronic device may obtain a second reflection intensity value of each point in the area to be colored.
[0028] Optionally, the object to be annotated can be located in the point cloud, and the area to be colored can be the area in the point cloud that includes the object to be annotated. Of course, it can be understood that the area to be colored can also be any area in the point cloud, can also be an area selected by the user in the point cloud, or can also be the entire point cloud, which is not specifically limited here.
[0029] Specifically, the electronic device obtains the second reflection intensity value of each point in the area to be colored, and due to the principle of consistency of interval values of reflection intensity of the same material, different objects can be distinguished by the second reflection intensity values.
[0030] Step 106: Determine the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value.
[0031] Specifically, after the electronic device obtains the first reflection intensity value and the second reflection intensity value, it can determine the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value.
[0032] According to the working principle of lidar, the reflection intensity range of the same substance is consistent. Therefore, when determining the color corresponding to the area to be colored based on the first reflection intensity value and the second reflection intensity value, the color of the same substance should also be consistent, that is, the color of the area representing the same substance in the area to be colored is consistent, so that different objects can be distinguished by color.
[0033] Step 108: Coloring the area to be colored according to the color corresponding to the area to be colored.
[0034] Specifically, the area to be colored can be colored according to the color corresponding to the area to be colored. In this way, the same annotated object in the area to be colored is colored with the same color, so that different objects can be distinguished after the point cloud is visualized.
[0035] The point cloud coloring method provided in the embodiment of the present application obtains the first reflection intensity value of the point cloud and the second reflection intensity value of each point in the area to be colored in the point cloud, determines the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value, and colors the area to be colored according to the color corresponding to the area to be colored, so that the outline of the object to be labeled can be clearly displayed after the point cloud is visualized, which can solve the problem of being unable to distinguish specific objects after the point cloud is visualized, improves the labeling efficiency, and reduces the labeling cost.
[0036] In one implementation, obtaining a first reflection intensity value of a point cloud includes: selecting at least one random area from the point cloud, obtaining a reflection intensity interval of each area, and determining the first reflection intensity value according to at least one of the reflection intensity intervals.
[0037] By obtaining at least one random area in the point cloud, obtaining the reflection intensity interval of each random area, and determining the first reflection intensity value according to the reflection intensity interval of each random area, wherein the reflection intensity interval of each random area includes the maximum reflection intensity value and the minimum reflection intensity value in the random area.
[0038] In one implementation, Figure 2 As shown, determining the first reflection intensity value according to at least one reflection intensity interval comprises the following steps;
[0039] Step 202: Obtain the maximum reflection intensity value and the minimum reflection intensity value of each reflection intensity interval.
[0040] The reflection intensity interval of each random area includes a maximum reflection intensity value and a minimum reflection intensity value in the random area, and the electronic device obtains the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area.
[0041] Step 204: Determine a weight corresponding to each of the reflection intensity intervals according to a size range ratio between at least one of the random regions.
[0042] According to the ratio of the size ranges between the acquired random areas, the weight corresponding to each reflection intensity interval is determined. For example, the acquired random areas are area L, area M, and area N, and the size range ratio between area L, area M, and area N is area L: area M: area N = D: E: F; then the weight corresponding to the reflection intensity interval of area L is D, the weight corresponding to the reflection intensity interval of area M is E, and the weight corresponding to the reflection intensity interval of area N is F.
[0043] Step 206: According to the maximum reflection intensity value, the minimum reflection intensity value of each reflection intensity interval, and the weight corresponding to each reflection intensity interval, obtain a weighted average value of all the maximum reflection intensity values and the minimum reflection intensity values.
[0044] Specifically, the weight corresponding to each reflection intensity interval is the weight of the maximum reflection intensity value and the minimum reflection intensity value within the reflection intensity interval. According to the maximum reflection intensity value, the minimum reflection intensity value of each reflection intensity interval, and the weight corresponding to the reflection intensity interval, a weighted average algorithm is used to obtain the weighted average of the maximum reflection intensity value and the minimum reflection intensity value.
[0045] For example, the random areas obtained are area L, area M, and area N, and the weighted average of the maximum reflection intensity value and the minimum reflection intensity value is calculated by the following formula:
[0046] x=(L_1*D+L_2*D+M_1*E+M_2*E+N_1*F+N_2*F) / D+D+E+E+F+F;
[0047] x represents the weighted average of the maximum reflection intensity value and the minimum reflection intensity value, L_1 represents the maximum reflection intensity value within the reflection intensity interval of area L, L_2 represents the minimum reflection intensity value within the reflection intensity interval of area L, M_1 represents the maximum reflection intensity value within the reflection intensity interval of area M, M_2 represents the minimum reflection intensity value within the reflection intensity interval of area M, N_1 represents the maximum reflection intensity value within the reflection intensity interval of area N, N_2 represents the minimum reflection intensity value within the reflection intensity interval of area N, D represents the weight corresponding to the reflection intensity interval of area L, E represents the weight corresponding to the reflection intensity interval of area M, and F represents the weight corresponding to the reflection intensity interval of area N.
[0048] Step 208: Determine the weighted average value as the first reflection intensity value.
[0049] Specifically, the weighted average of all maximum reflection intensity values and minimum reflection intensity values is the first reflection intensity value.
[0050] In the embodiment of the present application, by selecting at least one random area in the point cloud, obtaining the reflection intensity interval of each of the random areas, and determining the first reflection intensity value according to the reflection intensity interval of each of the random areas.
[0051] In one implementation, Figure 3 As shown, determining the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value includes the following steps:
[0052] Step 302: Determine the color corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value.
[0053] The color corresponding to each point in the area to be colored is determined according to the first reflection intensity value and the second reflection intensity value.
[0054] In addition, the reflection intensity range of the same material is consistent, so the colors corresponding to the points of the same material in the point cloud are also consistent.
[0055] Step 304: Determine the color corresponding to the area to be colored according to the color corresponding to each point in the area to be colored.
[0056] The color corresponding to the area to be colored can be determined by the color corresponding to each point in the area to be colored.
[0057] In the embodiment of the present application, the color of each point in the area to be colored can be determined according to the first reflection intensity value and the second reflection intensity value, and the color of the entire area to be colored can be determined according to the color of each point in the area to be colored.
[0058] In one implementation, Figure 4 As shown, determining the color corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value includes the following steps:
[0059] Step 402: Determine the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value.
[0060] Step 404: Determine the color corresponding to each point in the area to be colored according to the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored.
[0061] Usually, various colors are obtained by changing the three color channels of red, green and blue and superimposing them. Red, green and blue each have 256 levels of brightness, expressed in numbers from 0 to 255. Different colors can be combined according to the different brightness of red, green and blue.
[0062] The red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored are obtained, and the color corresponding to each point in the area to be colored can be determined based on the color formed by the combination of the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored.
[0063] In an embodiment of the present application, the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored can be determined through the first reflection intensity value and the second reflection intensity value. According to the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored, the color corresponding to each point in the area to be colored can be determined.
[0064] In one implementation, determining the red brightness value, the green brightness value, and the blue brightness value corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value includes:
[0065] For any point in the area to be colored, the red brightness value, blue brightness value, and yellow brightness value corresponding to the point are calculated using the following formulas;
[0066]
[0067]
[0068]
[0069] Wherein, r represents the red brightness value, g represents the green brightness value, b represents the blue brightness value, c represents the first reflection intensity value, and x represents the second reflection intensity value of the point. It means rounding down. The question mark function means that if the result of the expression before the question mark is true, the result of the first expression after the question mark is taken. The colon function means that if the result of the expression before the question mark is false, the result of the expression after the colon is taken.
[0070] For example, ( Taking the formula as an example, if The result is true, then the value of r is ( like If the result of is false, the value of r is 0.
[0071] In an embodiment of the present application, the red brightness value, blue brightness value, and green brightness value of any point in the area to be colored can be calculated based on the first reflection intensity value and the second reflection intensity value. According to the red brightness value, blue brightness value, and green brightness value of any point in the area to be colored, the color of any point in the area to be colored can be determined.
[0072] In one implementation, after coloring the area to be colored according to the color corresponding to the area to be colored, the method further includes:
[0073] The colored point cloud is displayed.
[0074] By displaying the colored point cloud, the labeler can clearly observe the outline of the object to be labeled, solving the problem of the labeler being unable to label specific objects, improving efficiency and saving resources.
[0075] Optional, combine the following Figure 5 , an embodiment of the present application is described, and the embodiment includes the following steps:
[0076] Step 502: Select at least one random area from the point cloud and obtain the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area.
[0077] At least one random area is selected from the point cloud. The size of each random range can be different. The reflection intensity interval of each random area includes the maximum reflection intensity value and the minimum reflection intensity value of the reflection intensity value of the area. The maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area are obtained.
[0078] Step 504: Determine a first reflection intensity value according to the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area.
[0079] The weight corresponding to the reflection intensity interval of each random area is determined according to the size range ratio of each random area. For example, the random areas obtained are area L, area M, and area N, and the size range ratio between area L, area M, and area N is: area L: area M: area N = D: E: F; then the weight corresponding to the reflection intensity interval of area L is D, the weight corresponding to the reflection intensity interval of area M is E, and the weight corresponding to the reflection intensity interval of area N is F. According to the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area and the weight corresponding to the reflection intensity interval of each random area, the weighted average of the maximum reflection intensity value and the minimum reflection intensity value is determined by the following formula, and the weighted average is the first reflection intensity value.
[0080] x=(L_1*D+L_2*D+M_1*E+M_2*E+N_1*F+N_2*F) / D+D+E+E+F+F;
[0081] For example, x represents the weighted average of the maximum reflection intensity value and the minimum reflection intensity value, that is, x represents the first reflection intensity value, L_1 represents the maximum reflection intensity value in the reflection intensity interval of area L, L_2 represents the minimum reflection intensity value in the reflection intensity interval of area L, M_1 represents the maximum reflection intensity value in the reflection intensity interval of area M, M_2 represents the minimum reflection intensity value in the reflection intensity interval of area M, N_1 represents the maximum reflection intensity value in the reflection intensity interval of area N, N_2 represents the minimum reflection intensity value in the reflection intensity interval of area N, D represents the weight corresponding to the reflection intensity interval of area L, E represents the weight corresponding to the reflection intensity interval of area M, and F represents the weight corresponding to the reflection intensity interval of area N.
[0082] Step 506: Obtain the second reflection intensity value of each point in the area to be marked, and determine the color of each point in the area to be marked according to the first reflection intensity value and the second reflection intensity value of each point in the area to be marked.
[0083] For any point in the area to be colored, the red brightness value, blue brightness value, and yellow brightness value corresponding to the point are calculated using the following formulas;
[0084]
[0085]
[0086]
[0087] Wherein, r represents the red brightness value, g represents the green brightness value, b represents the blue brightness value, c represents the first reflection intensity value, and x represents the second reflection intensity value of the point. It means rounding down. The question mark function means that if the result of the expression before the question mark is true, the result of the first expression after the question mark is taken. The colon function means that if the result of the expression before the question mark is false, the result of the expression after the colon is taken.
[0088] According to the red brightness value, blue brightness value, and green brightness value corresponding to any point in the area to be colored, the color of the point can be determined by combining the red brightness value, blue brightness value, and green brightness value.
[0089] Step 508: Color the area to be colored according to the color corresponding to each point in the area to be colored.
[0090] The color corresponding to each point in the area to be colored is obtained and assigned to each point in the area to be colored, so that the outline of the object to be labeled can be clearly displayed after the point cloud is visualized.
[0091] Step 510: Display the colored point cloud.
[0092] Visualize the colored point cloud.
[0093] In an embodiment of the present application, by selecting at least one random area from the point cloud and obtaining the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area, a first reflection intensity is determined according to the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval of each random area, a second reflection intensity value of each point in the area to be labeled is obtained, and the color of each point in the area to be labeled is determined according to the first reflection intensity value and the second reflection intensity value of each point in the area to be labeled, the area to be colored is colored according to the color corresponding to each point in the area to be colored, and the colored point cloud is visualized, thereby achieving the ability to distinguish different areas by color and solving the problem of being unable to distinguish specific objects after point cloud visualization.
[0094] It should be noted that the point cloud coloring method provided in the embodiment of the present application can be executed by a point cloud coloring device, or a control module in the point cloud coloring device for executing the point cloud coloring method. In the embodiment of the present application, the point cloud coloring method executed by the point cloud coloring device is taken as an example to illustrate the point cloud coloring device provided in the embodiment of the present application.
[0095] Figure 6 is a schematic diagram of the structure of a device for coloring point clouds according to an embodiment of the present application. Figure 6 As shown, the device 600 for coloring a point cloud includes: a statistical module 610 , an acquisition module 620 , a calculation module 630 , and a coloring module 640 .
[0096] The statistical module 610 is used to obtain the first reflection intensity value of the point cloud; the acquisition module 620 is used to obtain the second reflection intensity value of each point in the area to be colored in the point cloud; the calculation module 630 is used to determine the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value; the coloring module 640 is used to color the area to be colored according to the color corresponding to the area to be colored.
[0097] The device for coloring the point cloud in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0098] The device for coloring the point cloud in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0099] The point cloud coloring device provided in the embodiment of the present application can achieve Figures 1 to 5 To avoid repetition, the various processes implemented in the method embodiment are not described here.
[0100] Optional, such as Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned point cloud coloring method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0101] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0102] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0103] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810 and other components.
[0104] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently, which will not be described in detail here.
[0105] Processor 810 is used to obtain a first reflection intensity value of a point cloud; obtain a second reflection intensity value of each point in an area to be colored in the point cloud; determine a color corresponding to the area to be colored based on the first reflection intensity value and the second reflection intensity value; and color the area to be colored based on the color corresponding to the area to be colored.
[0106] In one implementation, the processor 810 is configured to select at least one random area from the point cloud; obtain a reflection intensity interval of each of the random areas; and determine the first reflection intensity value based on at least one of the reflection intensity intervals.
[0107] In one implementation, the processor 810 is used to obtain the maximum reflection intensity value and the minimum reflection intensity value of each of the reflection intensity intervals; determine the weight corresponding to each of the reflection intensity intervals based on the size range ratio between at least one of the random areas; obtain the weighted average of the maximum reflection intensity value and the minimum reflection intensity value of each of the reflection intensity intervals based on the maximum reflection intensity value, the minimum reflection intensity value, and the weight corresponding to each of the reflection intensity intervals; and determine the weighted average as the first reflection intensity value.
[0108] In one implementation, the processor 810 determines the color corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value; and determines the color corresponding to the area to be colored according to the color corresponding to each point in the area to be colored.
[0109] In one implementation, the processor 810 is used to determine the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored based on the first reflection intensity value and the second reflection intensity value; and determine the color corresponding to each point in the area to be colored based on the red brightness value, green brightness value, and blue brightness value corresponding to each point in the area to be colored.
[0110] In one implementation, the processor 810 is configured to calculate, for any point in the area to be colored, a red brightness value, a blue brightness value, and a yellow brightness value corresponding to the point by using the following formulas;
[0111]
[0112]
[0113]
[0114] Wherein, r represents the red brightness value, g represents the green brightness value, b represents the blue brightness value, c represents the first reflection intensity value, and x represents the second reflection intensity value of the point. It means rounding down. The question mark function means that if the result of the expression before the question mark is true, the result of the first expression after the question mark is taken. The colon function means that if the result of the expression before the question mark is false, the result of the expression after the colon is taken.
[0115] In one implementation, the processor 810 is configured to display the colored point cloud.
[0116] This embodiment can implement each process of the above-mentioned point cloud coloring method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here. It should be understood that in the embodiment of the present application, the input unit 804 may include a graphics processing unit (GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 809 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 810.
[0117] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned code protection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0118] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0119] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0121] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for coloring a point cloud, characterized in that: The method comprises: Get the first reflection intensity value of the point cloud; Obtain a second reflection intensity value of each point in the area to be colored in the point cloud; Determining a color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value; Coloring the area to be colored according to the color corresponding to the area to be colored; The step of obtaining a first reflection intensity value of the point cloud includes: Selecting at least one random region from the point cloud; Obtaining a reflection intensity interval of each of the random areas; Determining the first reflection intensity value according to at least one of the reflection intensity intervals; The determining the first reflection intensity value according to at least one reflection intensity interval includes: Obtaining the maximum reflection intensity value and the minimum reflection intensity value of each reflection intensity interval; Determining a weight corresponding to each of the reflection intensity intervals according to a size range ratio between at least one of the random areas; According to the maximum reflection intensity value, the minimum reflection intensity value of each reflection intensity interval, and the weight corresponding to each reflection intensity interval, a weighted average value of all the maximum reflection intensity values and the minimum reflection intensity values is obtained; wherein the weight corresponding to each reflection intensity interval is the weight of the maximum reflection intensity value and the minimum reflection intensity value in the reflection intensity interval, and according to the maximum reflection intensity value, the minimum reflection intensity value of each reflection intensity interval, and the weight corresponding to the reflection intensity interval, a weighted average value of the maximum reflection intensity value and the minimum reflection intensity value is obtained through a weighted average algorithm; Determine the weighted average value as the first reflection intensity value; The step of determining the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value includes: Determine the color corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value; The color corresponding to the area to be colored is determined according to the color corresponding to each point in the area to be colored.
2. The method according to claim 1, characterized in that The determining, according to the first reflection intensity value and the second reflection intensity value, a color corresponding to each point in the area to be colored includes: Determine, according to the first reflection intensity value and the second reflection intensity value, a red brightness value, a green brightness value, and a blue brightness value corresponding to each point in the area to be colored; The color corresponding to each point in the area to be colored is determined according to the red brightness value, the green brightness value, and the blue brightness value corresponding to each point in the area to be colored.
3. The method according to claim 2, characterized in that The determining, according to the first reflection intensity value and the second reflection intensity value, a red brightness value, a green brightness value, and a blue brightness value corresponding to each point in the area to be colored comprises: For any point in the area to be colored, the red brightness value, blue brightness value, and yellow brightness value corresponding to the point are calculated using the following formulas; Wherein, r represents the red brightness value, g represents the green brightness value, b represents the blue brightness value, c represents the first reflection intensity value, and x represents the second reflection intensity value of the point. It means rounding down. The question mark function means that if the result of the expression before the question mark is true, the result of the first expression after the question mark is taken. The colon function means that if the result of the expression before the question mark is false, the result of the expression after the colon is taken.
4. The method according to claim 1, characterized in that: After coloring the area to be colored according to the color corresponding to the area to be colored, the method further includes: The colored point cloud is displayed.
5. A point cloud coloring device, characterized in that: The device comprises: A statistical module, used to obtain a first reflection intensity value of a point cloud; specifically used to: select at least one random area from the point cloud; obtain a reflection intensity interval of each of the random areas; obtain a maximum reflection intensity value and a minimum reflection intensity value of each of the reflection intensity intervals; determine a weight corresponding to each of the reflection intensity intervals according to a size range ratio between at least one of the random areas; obtain a weighted average of all the maximum reflection intensity values and the minimum reflection intensity values according to the maximum reflection intensity value and the minimum reflection intensity value of each of the reflection intensity intervals and the weight corresponding to each of the reflection intensity intervals; wherein the weight corresponding to each reflection intensity interval is the weight of the maximum reflection intensity value and the minimum reflection intensity value within the reflection intensity interval, and according to the maximum reflection intensity value and the minimum reflection intensity value of each reflection intensity interval and the weight corresponding to the reflection intensity interval, obtain a weighted average of the maximum reflection intensity value and the minimum reflection intensity value through a weighted average algorithm; and determine the weighted average as the first reflection intensity value; An acquisition module, used for acquiring a second reflection intensity value of each point in the area to be colored in the point cloud; A calculation module, used to determine the color corresponding to the area to be colored according to the first reflection intensity value and the second reflection intensity value; specifically used to: determine the color corresponding to each point in the area to be colored according to the first reflection intensity value and the second reflection intensity value; determine the color corresponding to the area to be colored according to the color corresponding to each point in the area to be colored; The coloring module is used to color the area to be colored according to the color corresponding to the area to be colored.
6. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the point cloud coloring method as described in any one of claims 1 to 4.
7. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the point cloud coloring method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Point cloud rendering method and device, terminal and storage medium
CN109191553A
Semi-automatic polyline extraction from point cloud
US9406138B1
