Floodlight rendering method and device, equipment and medium

The pixel data of map elements is processed through downsampling and upsampling algorithms, which solves the problem of unnatural floodlight rendering effect in the existing technology, achieves natural halo rendering effect and contrast improvement, and improves user experience.

CN118644600APending Publication Date: 2024-09-13BEIJING AUTONAVI YUNMAP TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410620207.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

In the existing technology, the floodlight rendering effect is unnatural and cannot effectively improve the contrast and expressiveness of map elements, resulting in poor floodlight effects.

Method used

By obtaining the target pixel data of the target element, using downsampling and upsampling algorithms for multiple processes, and fusing the floodlight pixel data to achieve a natural halo rendering effect. Specific steps include obtaining the target pixel data, performing multiple downsampling based on the downsampling algorithm, and then performing multiple upsampling based on the upsampling algorithm, and fusing the two data.

Benefits of technology

A floodlight effect that naturally transitions around map elements is achieved, improving the user experience and ensuring the clear presentation of map elements and the naturalness of the halo rendering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644600A
    Figure CN118644600A
Patent Text Reader

Abstract

The invention relates to the technical field of electronic maps, in particular to a floodlight rendering method, device and equipment and a medium, and the floodlight rendering method comprises the steps: obtaining target pixel data of a target element to be subjected to floodlight rendering; performing down-sampling on the target pixel data for multiple times based on a down-sampling algorithm to obtain down-sampled pixel data; carrying out multiple times of up-sampling on the down-sampling pixel data based on an up-sampling algorithm to obtain up-sampling pixel data corresponding to the down-sampling pixel data; and performing data fusion on the target pixel data and the up-sampling pixel data to obtain fused pixel data of the target element as floodlight pixel data. According to the embodiment of the invention, when rendering is carried out according to the floodlight pixel data, the target element can be clearly presented in the image obtained by rendering, and a natural floodlight effect can be presented around the target element, so that the obtained floodlight effect is good, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of electronic maps, and in particular to a floodlight rendering method, device, equipment and medium. Background Art

[0002] With the advancement of technology, terminals equipped with display screens have begun to be widely used. Users can view maps through the screens on terminals (such as mobile phones, tablet computers, and vehicle-mounted devices) to obtain the required information. In recent years, as user requirements continue to increase, higher requirements have been placed on the rendering effect of the displayed maps.

[0003] Bloom is a common optical phenomenon, which generally refers to the halo overflow phenomenon that occurs when a physical camera shoots an object with higher brightness. In the process of realizing this application, the inventors found that by performing bloom processing on the target element, such as the map element in the map, the contrast of the map element can be visually improved, thereby enhancing the expressiveness of the map. In the related art, after the map element is rendered, the pixels around the map element are blurred or brightened to achieve a bloom effect, but the transition between the bloom effect and the map element obtained by such processing is unnatural, and a good bloom effect cannot be obtained. Summary of the invention

[0004] In order to solve the problems in the related art, the embodiments of the present disclosure provide a floodlight rendering method, device, equipment and medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a floodlight rendering method, including:

[0006] Get the target pixel data of the target element to be flood-rendered;

[0007] Downsampling the target pixel data multiple times based on a downsampling algorithm to obtain downsampled pixel data;

[0008] Upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data;

[0009] The target pixel data and the up-sampled pixel data are fused to obtain fused pixel data of the target element as the floodlight pixel data.

[0010] In one embodiment of the present disclosure, obtaining target pixel data of a target element to be flood-rendered includes:

[0011] Acquire an initial texture object and a target texture object, wherein the initial texture object and the target texture object store target pixel data of a target element;

[0012] The target pixel data is downsampled multiple times based on the downsampling algorithm to obtain downsampled pixel data, including:

[0013] Obtaining N texture objects based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object; N is a positive integer greater than or equal to 2;

[0014] Based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, the pixel data in the previous texture object is downsampled and drawn to the next texture object in sequence;

[0015] The pixel data on the last texture object in the order from largest to smallest size is determined as the downsampled pixel data.

[0016] In an embodiment provided by the present disclosure, based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, pixel data in the previous texture object is sequentially downsampled and drawn to the next texture object, including:

[0017] Based on the order of the sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, a plurality of rows of pixels are determined in the previous texture object in sequence, wherein each row of pixels includes a plurality of pixels, and a distance between any two adjacent rows of pixels is a preset pixel row spacing;

[0018] Determine a plurality of sampling pixels in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing;

[0019] Obtaining a sampling result corresponding to each sampling pixel according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel values ​​of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel;

[0020] Drawing is performed on the latter texture object according to the sampling results corresponding to each of the multiple sampling pixels.

[0021] In an implementation provided by the present disclosure, upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data includes:

[0022] After obtaining the downsampled pixel data, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, upsample the pixel data in the previous texture object and draw it on the next texture object in sequence;

[0023] Determines pixel data drawn to a destination texture object as upsampled pixel data.

[0024] In an implementation provided by the present disclosure, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, pixel data in the previous texture object is upsampled and drawn to the next texture object in sequence, including:

[0025] Based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, the pixel value of the inserted pixel corresponding to each pixel is obtained according to the pixel value of each pixel in the previous texture object and the weight value of the inserted pixel corresponding to each pixel;

[0026] Drawing is performed on the next texture object according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object.

[0027] In an implementation manner provided by the present disclosure, data fusion is performed on target pixel data and upsampled pixel data to obtain fused pixel data of the target element as floodlight pixel data, including:

[0028] Data fusion is performed on the initial texture object and the target texture object storing the upsampled pixel data to obtain fused pixel data of the target element as the floodlight pixel data.

[0029] In one embodiment of the present disclosure, obtaining target pixel data of a target element to be flood-rendered includes:

[0030] If the display type of the target element is floodlight display, the target pixel data of the target element is obtained.

[0031] In a second aspect, an embodiment of the present disclosure provides a floodlight rendering device, including:

[0032] A pixel data acquisition module is configured to acquire target pixel data of a target element to be flood-rendered;

[0033] A downsampling module is configured to perform multiple downsampling on the target pixel data based on a downsampling algorithm to obtain downsampled pixel data;

[0034] an upsampling module configured to perform multiple upsampling on the downsampled pixel data based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data;

[0035] The data fusion module is configured to perform data fusion on the target pixel data and the up-sampled pixel data to obtain fused pixel data of the target element as the floodlight pixel data.

[0036] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, and wherein the one or more computer instructions are executed by the processor to implement a method as described in any one of the first aspects.

[0037] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, a method as described in any one of the first aspects is implemented.

[0038] According to the technical solution provided by the embodiment of the present disclosure, target pixel data of a target element to be flood-rendered is obtained; the target pixel data is downsampled multiple times based on a downsampling algorithm to obtain downsampled pixel data, wherein, compared with the target pixel data of the target element, the downsampled pixel data will lose a part of pixel data; the downsampled pixel data is upsampled multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data, wherein, compared with the downsampled pixel data, corresponding pixels are added around each pixel in the upsampled pixel data, and the pixel value of the added pixel is related to the pixel value of each pixel, so if rendering is performed based on the upsampled pixel data, a relatively blurred target element can be obtained; the target pixel data and the upsampled pixel data are data-fused to obtain fused pixel data of the target element as flood-rendered pixel data, wherein when rendering is performed based on the flood-rendered pixel data, the rendered image can present the target element more clearly, and can present a naturally transitioned, halo-like rendering effect (i.e., flood-rendered effect) around the target element, so that the obtained flood-rendered effect is better, thereby improving the user experience.

[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0041] Figure 1 A flow chart of a floodlight rendering method according to an embodiment of the present disclosure is shown.

[0042] Figure 2a A schematic diagram showing a texture object according to an embodiment of the present disclosure.

[0043] Figure 2b A schematic diagram showing another texture object according to an embodiment of the present disclosure.

[0044] Figure 2cA schematic diagram showing yet another texture object according to an embodiment of the present disclosure.

[0045] Figure 3 A schematic diagram showing pixels in a texture object according to an embodiment of the present disclosure is shown.

[0046] Figure 4 A schematic diagram showing pixels in another texture object according to an embodiment of the present disclosure is shown.

[0047] Figure 5 A flow chart of another floodlight rendering method according to an embodiment of the present disclosure is shown.

[0048] Figure 6 A structural block diagram of a floodlight rendering device according to an embodiment of the present disclosure is shown.

[0049] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0050] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0051] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0052] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.

[0053] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0054] In the present disclosure, if it involves operations of obtaining user information or user data or displaying user information or user data to others, the operations are all authorized and confirmed by the user, or actively selected by the user.

[0055] In recent years, with the continuous improvement of user requirements, higher requirements have been placed on rendering effects.

[0056] In view of the problems in the prior art, the embodiments of the present disclosure provide a floodlight rendering method, device, equipment and medium.

[0057] According to the technical solution provided by the embodiment of the present disclosure, target pixel data of a target element to be flood-rendered is obtained; the target pixel data is downsampled multiple times based on a downsampling algorithm to obtain downsampled pixel data, wherein, compared with the target pixel data of the target element, the downsampled pixel data will lose a part of pixel data; the downsampled pixel data is upsampled multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data, wherein, compared with the downsampled pixel data, corresponding pixels are added around each pixel in the upsampled pixel data, and the pixel value of the added pixel is related to the pixel value of each pixel, so if rendering is performed based on the upsampled pixel data, a relatively blurred target element can be obtained; the target pixel data and the upsampled pixel data are data-fused to obtain fused pixel data of the target element as flood-rendered pixel data, wherein when rendering is performed based on the flood-rendered pixel data, the rendered image can present the target element more clearly, and can present a naturally transitioned, halo-like rendering effect (i.e., flood-rendered effect) around the target element, so that the obtained flood-rendered effect is better, thereby improving the user experience.

[0058] Figure 1 FIG. 1 is a flow chart of a floodlight rendering method according to an embodiment of the present disclosure. Figure 1 As shown, the floodlight rendering includes the following steps S101-S104:

[0059] In step S101, target pixel data of a target element to be flood-rendered is obtained;

[0060] In step S102, the target pixel data is downsampled multiple times based on a downsampling algorithm to obtain downsampled pixel data;

[0061] In step S103, upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data;

[0062] In step S104, data fusion is performed on the target pixel data and the up-sampled pixel data to obtain fused pixel data of the target element as floodlight pixel data.

[0063] In one implementation of the present disclosure, the target element may be understood as an element in an electronic map. For example, the target element may be a door, window, neon light, outdoor display screen, luminous billboard, etc. installed on a building in the electronic map, but it is certainly not limited thereto. Among them, considering that buildings such as office buildings, shopping malls, hotels, etc. have better lighting effects at night, the doors, windows, neon lights, outdoor display screens, luminous billboards, etc. installed on the building may have a self-luminous function, and will present a "halo"-like effect at night. Therefore, in order to ensure that the display effect of the electronic map is consistent with that in reality, the doors, windows, neon lights, outdoor display screens, luminous billboards, etc. on the building may have a floodlight effect in the electronic map, so that the user's experience when viewing the electronic map is closer to the experience when viewing the above objects in reality.

[0064] Alternatively, the target element may be a headlight, roof luminous sign, vehicle display screen, etc. installed on a motor vehicle in an electronic map. Considering that motor vehicles such as taxis, fire trucks, ambulances, etc. are easily noticed in reality, the headlights, roof luminous signs, vehicle display screens, etc. installed on the above-mentioned motor vehicles may have a self-luminous function, which will present a "halo" effect at night. Therefore, in order to ensure that the display effect of the electronic map is consistent with that in reality, the headlights, roof luminous signs, vehicle display screens, etc. installed on the motor vehicle may have a floodlight effect in the electronic map, so that the user's experience when viewing the electronic map is closer to the experience when viewing the above-mentioned objects in reality. Alternatively, the target element may also be a building in the electronic map, but it is of course not limited to this.

[0065] Target pixel data is the most basic unit of digital images, which can include pixel color and transparency information. Target pixel data can be stored and managed through texture objects. Among them, texture objects are data structures used to store and manage texture data in graphics processing units (GPUs). Texture objects can include texture maps, etc.

[0066] In one implementation of the present disclosure, downsampling the target pixel data may be understood as reducing the resolution of the target pixel data. For example, when downsampling the target pixel data, some pixels in the target pixel data may be deleted or some pixels in the target pixel data may be merged.

[0067] Exemplarily, downsampling the target pixel data may be performed by the following steps:

[0068] The pixels corresponding to the target pixel data can be divided into multiple rectangles of the same size, each rectangle including multiple pixels; the average value of the pixel values ​​of all or part of the pixels in each rectangle is calculated, and the average value is determined as the pixel value of the pixel corresponding to the rectangle; or the maximum pixel value or the minimum pixel value of all or part of the pixels in each rectangle is obtained, and the maximum pixel value or the minimum pixel value is determined as the pixel value of the pixel corresponding to the rectangle. Afterwards, according to the pixel value of the pixel corresponding to each rectangle in the multiple rectangles and the relative position relationship of the multiple rectangles, the pixel data obtained after downsampling the target pixel data once is generated.

[0069] In one implementation of the present disclosure, upsampling the downsampled pixel data can be understood as improving the resolution of the downsampled pixel data, wherein the downsampled pixel data can be upsampled based on algorithms such as nearest neighbor interpolation, bilinear interpolation, depooling or transposed convolution.

[0070] Exemplarily, upsampling the downsampled pixel data may be achieved by the following steps:

[0071] In the downsampled pixel data, new pixels are inserted every k pixels row by row, or new pixels are inserted every k pixels column by column, where k≥1, and the pixel value of the inserted pixel is set according to the pixel values ​​of the pixels surrounding the inserted pixel and the weights corresponding to each of the surrounding pixels, thereby generating pixel data obtained by upsampling the downsampled pixel data once.

[0072] According to the technical solution provided by the embodiment of the present disclosure, target pixel data of a target element to be flood-rendered is obtained; the target pixel data is downsampled multiple times based on a downsampling algorithm to obtain downsampled pixel data, wherein, compared with the target pixel data of the target element, the downsampled pixel data will lose a part of pixel data; the downsampled pixel data is upsampled multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data, wherein, compared with the downsampled pixel data, corresponding pixels are added around each pixel in the upsampled pixel data, and the pixel value of the added pixel is related to the pixel value of each pixel, so if rendering is performed based on the upsampled pixel data, a relatively blurred target element can be obtained; the target pixel data and the upsampled pixel data are data-fused to obtain fused pixel data of the target element as flood-rendered pixel data, wherein when rendering is performed based on the flood-rendered pixel data, the rendered image can present the target element more clearly, and can present a naturally transitioned, halo-like rendering effect (i.e., flood-rendered effect) around the target element, so that the obtained flood-rendered effect is better, thereby improving the user experience.

[0073] In one embodiment of the present disclosure, obtaining target pixel data of a target element to be flood-rendered includes:

[0074] Acquire an initial texture object and a target texture object, wherein the initial texture object and the target texture object store target pixel data of a target element;

[0075] The target pixel data is downsampled multiple times based on the downsampling algorithm to obtain downsampled pixel data, including:

[0076] Obtaining N texture objects based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object; N is a positive integer greater than or equal to 2;

[0077] Based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, the pixel data in the previous texture object is downsampled and drawn to the next texture object in sequence;

[0078] The pixel data on the last texture object in the order from largest to smallest size is determined as the downsampled pixel data.

[0079] In an implementation of the present disclosure, obtaining N texture objects may be understood as creating texture objects of different sizes that are smaller than the size of the target texture object, wherein the created N texture objects are all empty.

[0080] For example, the downsampling times are 4 times. Figure 2a A schematic diagram of a texture object according to an embodiment of the present disclosure is shown, Figure 2a As shown, texture object 201-texture object 204 are four texture objects obtained, wherein each texture object is square in shape, the size of texture object 201 is smaller than the size of the target texture object, the ratio of the area of ​​texture object 201 to that of texture object 202 is 2:1, the ratio of the area of ​​texture object 202 to that of texture object 203 is also 2:1, and the ratio of the area of ​​texture object 203 to that of texture object 204 is also 2:1.

[0081] Figure 2b A schematic diagram of another texture object according to an embodiment of the present disclosure is shown. In one implementation, in order to distinguish the texture objects corresponding to the upsampling and downsampling process, in the downsampling process, the texture object 201 can be represented by the texture 212 identifier, the texture object 202 can be represented by the texture object 213 identifier, the texture object 203 can be represented by the texture object 214 identifier, and the texture object 204 can be represented by the texture object 215 identifier.

[0082] like Figure 2bAs shown, in the downsampling process, the pixel data in the target texture object 211 can be downsampled and drawn to the texture object 212, the pixel data in the texture object 212 can be downsampled and drawn to the texture object 213, the pixel data in the texture object 213 can be downsampled and drawn to the texture object 214, and the pixel data in the texture object 214 can be downsampled and drawn to the texture object 2215. Thus, the downsampled pixel data on the texture object 215 is obtained.

[0083] According to the technical solution provided by the embodiments of the present disclosure, an initial texture object and a target texture object are obtained, and the initial texture object and the target texture object store target pixel data of a target element; N texture objects are obtained based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object; N is a positive integer greater than or equal to 2; based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, the pixel data in the previous texture object is downsampled and drawn to the next texture object in sequence; the pixel data on the last texture object in the size order from large to small is determined as the downsampled pixel data, which can simplify the process of obtaining the downsampled pixel data and help improve the efficiency of floodlight rendering.

[0084] In an embodiment provided by the present disclosure, based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, pixel data in the previous texture object is sequentially downsampled and drawn to the next texture object, including:

[0085] Based on the order of the sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, a plurality of rows of pixels are determined in the previous texture object in sequence, wherein each row of pixels includes a plurality of pixels, and a distance between any two adjacent rows of pixels is a preset pixel row spacing;

[0086] Determine a plurality of sampling pixels in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing;

[0087] Obtaining a sampling result corresponding to each sampling pixel according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel values ​​of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel;

[0088] Drawing is performed on the latter texture object according to the sampling results corresponding to each of the multiple sampling pixels.

[0089] For example, Figure 3 A schematic diagram of a pixel in a texture object according to an embodiment of the present disclosure is shown. Figure 3As shown, in the previous target texture object, pixel rows 301 to 304 can be determined, wherein each pixel row includes a plurality of pixels, and in pixel rows 301 to 304, the distance between two adjacent pixel rows is a preset pixel row spacing. Taking pixel row 302 as an example, sampling pixels 304 to 307 can be determined in pixel row 302, and the distance between any two adjacent sampling pixels in sampling pixels 304 to 307 is a preset first pixel spacing. Taking the sampling result corresponding to sampling pixel 305 as an example for explanation, the sampling result corresponding to sampling pixel 305 can be obtained by assigning a weight value of 1 / 2 to the pixel value of sampling pixel 305, assigning a weight value of 1 / 8 to the pixel values ​​of each pixel 308 to 311, and performing calculation based on the weight values ​​assigned to each sampling pixel 305 and pixels 308 to 311. A specific implementation method is to perform weighted calculation on the pixel values ​​based on the weight values ​​assigned to the sampling pixel 305 and the pixels 308 to 311 , and then sum the weighted results to obtain the sampling result corresponding to the sampling pixel 305 .

[0090] According to the technical solution provided by the embodiment of the present disclosure, based on the order of the sizes of the target texture object and N texture objects from large to small, starting from the first texture object, multiple rows of pixels are determined in the previous texture object in sequence, wherein each row of pixels includes multiple pixels, and the distance between any two adjacent rows of pixels is a preset pixel row spacing; multiple sampling pixels are determined in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing; the sampling result corresponding to each sampling pixel is obtained according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel value of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel; and drawing is performed on the next texture object according to the sampling results corresponding to each of the multiple sampling pixels. Under the premise of ensuring that the next texture object after drawing can save more image information in the previous texture object, the process of downsampling drawing can be simplified as much as possible, which helps to improve the efficiency of floodlight rendering.

[0091] In an implementation provided by the present disclosure, upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data includes:

[0092] After obtaining the downsampled pixel data, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, upsample the pixel data in the previous texture object and draw it on the next texture object in sequence;

[0093] Determines pixel data drawn to a destination texture object as upsampled pixel data.

[0094] For example, the number of downsampling is 4 times, and the number of upsampling corresponding to the embodiment of the present application is also 4 times, which is specifically the reverse process of downsampling. Figure 2c A schematic diagram showing another texture object according to an embodiment of the present disclosure is shown as follows: Figure 2b as well as Figure 2c As shown, Figure 2b is the downsampling process, Figure 2c The upsampling process includes a target texture object 211 and four other texture objects 212, 213, 214 and 215. The upsampling process includes a target texture object 219 and four other texture objects 218, 217, 216 and 215. In one implementation, the target texture object 211 and the target texture object 219 may be the same texture object, but the pixel data they carry is different in the upsampling process and the downsampling process; the texture object 212 and the texture object 218 are the same texture object, but the pixel data they carry is different in the upsampling process and the downsampling process; similarly, the texture object 213 and the texture object 217 are the same texture object, and the texture object 214 and the texture object 216 are the same texture object, but the pixel data they carry is different in the upsampling process and the downsampling process. That is, in order to distinguish the texture objects corresponding to upsampling and downsampling, different identifiers can be used for distinction.

[0095] For the upsampling process, the pixel data in the target texture object 215 is upsampled and drawn to the texture object 216, the pixel data in the texture object 216 is upsampled and drawn to the texture object 217, the pixel data in the texture object 217 is upsampled and drawn to the texture object 218, and the pixel data in the texture object 218 is upsampled and drawn to the target texture object 219. In the embodiment of the present application, the upsampling drawing method can be an overlay drawing method. For example, the pixel data in the texture object 216 is upsampled and drawn to the texture object 217, which means: the pixel data in the texture object 216 is upsampled to obtain 216 upsampled data, and then the pixel data carried on the texture object 217 is replaced by the 216 upsampled data.

[0096] According to the technical solution provided by the embodiment of the present disclosure, after obtaining the downsampled pixel data, based on the sizes of the target texture object and N texture objects in ascending order, starting from the last texture object, the pixel data in the previous texture object is upsampled and drawn to the next texture object in sequence, and the pixel data drawn to the target texture object is determined as the upsampled pixel data, so that the process of obtaining the upsampled pixel data can be simplified.

[0097] In an implementation provided by the present disclosure, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, pixel data in the previous texture object is upsampled and drawn to the next texture object in sequence, including:

[0098] Based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, the pixel value of the inserted pixel corresponding to each pixel is obtained according to the pixel value of each pixel in the previous texture object and the weight value of the inserted pixel corresponding to each pixel;

[0099] Drawing is performed on the next texture object according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object.

[0100] For example, Figure 4 A schematic diagram of pixels in another texture object according to an embodiment of the present disclosure is shown. Figure 4 As shown, in the previous texture object, the pixels around pixel 401 include pixels 402 to 409, pixel 402 is the nearest pixel to the upper left of pixel 401, pixel 403 is the nearest pixel to the upper right of pixel 401, pixel 404 is the nearest pixel to the lower left of pixel 401, pixel 405 is the nearest pixel to the lower right of pixel 401, pixel 406 is another pixel above pixel 401 and one pixel apart, pixel 407 is another pixel to the left of pixel 401 and one pixel apart, pixel 408 is another pixel below pixel 401 and one pixel apart, and pixel 409 is another pixel to the right of pixel 401 and one pixel apart. The pixel values ​​of pixels 402 to 405 are all assigned a weight value of 1 / 6, and the pixel values ​​of pixels 406 to 409 are all assigned a weight value of 1 / 12. Based on the weight values ​​assigned to pixels 402 to 409, the pixel value of the inserted pixel corresponding to pixel 401 can be obtained by calculation. A specific implementation method is to perform weighted calculation on the pixel values ​​based on the weight values ​​assigned to the pixels 402 to 409 , and then sum the weighted results to obtain the sampling result corresponding to the sampled pixel 401 .

[0101] According to the technical solution provided by the embodiment of the present disclosure, based on the size of the target texture object and N texture objects in ascending order, starting from the last texture object, the pixel value of the inserted pixel corresponding to each pixel is obtained according to the pixel value of each pixel in the previous texture object and the weight value of the inserted pixel corresponding to each pixel; according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object, drawing is performed on the next texture object. Under the premise of ensuring that the next texture object after drawing does not increase a lot of image information that does not appear in the previous texture object, the upsampling and drawing processes can be simplified as much as possible, which helps to improve the efficiency of floodlight rendering.

[0102] In an implementation manner provided by the present disclosure, data fusion is performed on target pixel data and upsampled pixel data to obtain fused pixel data of the target element as floodlight pixel data, including:

[0103] Data fusion is performed on the initial texture object and the target texture object storing the upsampled pixel data to obtain fused pixel data of the target element as the floodlight pixel data.

[0104] In an implementation provided by the present disclosure, data fusion is performed on an initial texture object and a target texture object storing upsampled pixel data. This can be understood as drawing based on the initial texture object on the target texture object storing upsampled pixel data, and the pixel data stored in the initial texture object after drawing is the fused pixel data of the target element.

[0105] Among them, when rendering the target element based on the floodlight pixel data, the texture object corresponding to the floodlight pixel data can be rendered to the frame buffer object (Frame Buffer Object, FBO) corresponding to the target element to achieve the purpose of off-screen rendering based on FBO. The data in FBO can be understood as the rendering result of the electronic map.

[0106] According to the technical solution provided in the embodiment of the present disclosure, by performing data fusion on the initial texture object and the target texture object storing upsampled pixel data, the fused pixel data of the target element is obtained as the floodlight pixel data, which can simplify the process of obtaining the floodlight pixel data and help improve the efficiency of floodlight rendering.

[0107] In one embodiment of the present disclosure, obtaining target pixel data of a target element to be flood-rendered includes:

[0108] If the display type of the target element is floodlight display, the target pixel data of the target element is obtained.

[0109] In one implementation of the present disclosure, the display type of the target element can be understood as reading the display type indication information stored in advance for indicating the display types of multiple elements in the electronic map, and obtaining the display type of the target element according to the display type indication information; it can also be understood as obtaining the display type indication information from other devices or systems, and obtaining the display type of the target element according to the display type indication information.

[0110] In an implementation of the present disclosure, the display type of the target element is a floodlight display, which can be understood as the target element must have a floodlight effect in the displayed electronic map.

[0111] According to the technical solution provided by the embodiment of the present disclosure, by obtaining the target pixel data of the target element when the display type of the target element is a floodlight display, the user can set the display type of the target element to achieve the purpose of controlling whether the target element in the displayed electronic map has a floodlight effect, thereby enabling the user to more conveniently modulate the display effect of the target element in the electronic map, thereby improving the user experience.

[0112] Figure 5 FIG. 4 is a flowchart of another floodlight rendering method according to an embodiment of the present disclosure. Figure 5 As shown, the floodlight rendering method includes the following steps S201-S211:

[0113] In step S201, if the display type of the target element is floodlight display, an initial texture object and a target texture object are obtained;

[0114] Wherein, the initial texture object and the target texture object store target pixel data of the target element;

[0115] In step S202, N texture objects are obtained based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object;

[0116] Wherein, N is a positive integer greater than or equal to 2;

[0117] In step S203, based on the sizes of the target texture object and the N texture objects in descending order, starting from the first texture object, a plurality of rows of pixels are determined in the previous texture object in sequence;

[0118] Each row of pixels includes a plurality of pixels, and the distance between any two adjacent rows of pixels is a preset pixel row spacing;

[0119] In step S204, a plurality of sampling pixels are determined in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing;

[0120] In step S205, a sampling result corresponding to each sampling pixel is obtained according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel values ​​of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel;

[0121] In step S206, drawing is performed on the next texture object according to the sampling results corresponding to each of the plurality of sampling pixels;

[0122] In step S207, the pixel data on the last texture object in the order from large to small is determined as downsampled pixel data;

[0123] In step S208, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, the pixel value of the interpolated pixel corresponding to each pixel is obtained according to the pixel value of each pixel in the previous texture object and the weight value of the interpolated pixel corresponding to each pixel;

[0124] In step S209, drawing is performed on the next texture object according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object;

[0125] In step S210, pixel data drawn onto the target texture object is determined as upsampled pixel data;

[0126] In step S211, data fusion is performed on the initial texture object and the target texture object storing upsampled pixel data to obtain fused pixel data of the target element as floodlight pixel data.

[0127] Figure 6 The structural block diagram of the floodlight rendering device according to the embodiment of the present disclosure is shown. The device can be implemented as part or all of the electronic device through software, hardware or a combination of both.

[0128] like Figure 6 As shown, the floodlight rendering device 500 includes:

[0129] The pixel data acquisition module 501 is configured to acquire target pixel data of a target element to be flood-rendered;

[0130] The downsampling module 502 is configured to perform multiple downsampling on the target pixel data based on a downsampling algorithm to obtain downsampled pixel data;

[0131] An upsampling module 503 is configured to perform multiple upsampling on the downsampled pixel data based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data;

[0132] The data fusion module 504 is configured to perform data fusion on the target pixel data and the up-sampled pixel data to obtain fused pixel data of the target element as the floodlight pixel data.

[0133] In an implementation manner provided by the present disclosure, the pixel data acquisition module 501 is specifically configured as follows:

[0134] Acquire an initial texture object and a target texture object, wherein the initial texture object and the target texture object store target pixel data of a target element;

[0135] The downsampling module 502 is specifically configured as follows:

[0136] Obtaining N texture objects based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object; N is a positive integer greater than or equal to 2;

[0137] Based on the size order of the target texture object and the N texture objects from large to small, starting from the first texture object, the pixel data in the previous texture object is downsampled and drawn to the next texture object in sequence;

[0138] The pixel data on the last texture object in the order from largest to smallest size is determined as the downsampled pixel data.

[0139] In an implementation manner provided by the present disclosure, the downsampling module 502 is specifically configured as follows:

[0140] Based on the order of the sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, a plurality of rows of pixels are determined in the previous texture object in sequence, wherein each row of pixels includes a plurality of pixels, and a distance between any two adjacent rows of pixels is a preset pixel row spacing;

[0141] Determine a plurality of sampling pixels in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing;

[0142] Obtaining a sampling result corresponding to each sampling pixel according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel values ​​of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel;

[0143] Drawing is performed on the latter texture object according to the sampling results corresponding to each of the multiple sampling pixels.

[0144] In an implementation manner provided by the present disclosure, the upsampling module 503 is specifically configured as follows:

[0145] After obtaining the downsampled pixel data, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, upsample the pixel data in the previous texture object and draw it on the next texture object in sequence;

[0146] Determines pixel data drawn to a destination texture object as upsampled pixel data.

[0147] In an implementation manner provided by the present disclosure, the upsampling module 503 is specifically configured as follows:

[0148] Based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, the pixel value of the inserted pixel corresponding to each pixel is obtained according to the pixel value of each pixel in the previous texture object and the weight value of the inserted pixel corresponding to each pixel;

[0149] Drawing is performed on the next texture object according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object.

[0150] In an implementation manner provided by the present disclosure, the data fusion module 504 is specifically configured as follows:

[0151] Data fusion is performed on the initial texture object and the target texture object storing the upsampled pixel data to obtain fused pixel data of the target element as the floodlight pixel data.

[0152] In an implementation manner provided by the present disclosure, the pixel data acquisition module 501 is specifically configured as follows:

[0153] If the display type of the target element is floodlight display, the target pixel data of the target element is obtained.

[0154] According to the technical solution provided by the embodiment of the present disclosure, target pixel data of a target element to be flood-rendered is obtained; the target pixel data is downsampled multiple times based on a downsampling algorithm to obtain downsampled pixel data, wherein, compared with the target pixel data of the target element, the downsampled pixel data will lose a part of pixel data; the downsampled pixel data is upsampled multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data, wherein, compared with the downsampled pixel data, corresponding pixels are added around each pixel in the upsampled pixel data, and the pixel value of the added pixel is related to the pixel value of each pixel, so if rendering is performed based on the upsampled pixel data, a relatively blurred target element can be obtained; the target pixel data and the upsampled pixel data are data-fused to obtain fused pixel data of the target element as flood-rendered pixel data, wherein when rendering is performed based on the flood-rendered pixel data, the rendered image can present the target element more clearly, and can present a naturally transitioned, halo-like rendering effect (i.e., flood-rendered effect) around the target element, so that the obtained flood-rendered effect is better, thereby improving the user experience.

[0155] The present disclosure also discloses an electronic device, Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0156] like Figure 7 As shown, the electronic device includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to an embodiment of the present disclosure.

[0157] The present disclosure provides a floodlight rendering method, including:

[0158] Get the target pixel data of the target element to be flood-rendered;

[0159] Downsampling the target pixel data multiple times based on a downsampling algorithm to obtain downsampled pixel data;

[0160] Upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data;

[0161] The target pixel data and the up-sampled pixel data are fused to obtain fused pixel data of the target element as the floodlight pixel data.

[0162] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the method according to an embodiment of the present disclosure is shown.

[0163] like Figure 8As shown, the computer system includes a processing unit, which can perform the various methods in the above-mentioned embodiments according to the program stored in the read-only memory (ROM) or the program loaded from the storage part into the random access memory (RAM). In the RAM, various programs and data required for the operation of the computer system are also stored. The processing unit, ROM and RAM are connected to each other through a bus. The input / output (I / O) interface is also connected to the bus.

[0164] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN card, a modem, etc. The communication part performs a communication process via a network such as the Internet. The drive is also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed. Among them, the processing unit can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0165] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the above method. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium.

[0166] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0167] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0168] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0169] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A floodlight rendering method, characterized in that: include: Get the target pixel data of the target element to be flood-rendered; Downsampling the target pixel data multiple times based on a downsampling algorithm to obtain downsampled pixel data; Upsampling the downsampled pixel data multiple times based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data; The target pixel data and the up-sampled pixel data are data-fused to obtain fused pixel data of the target element as floodlight pixel data.

2. The method according to claim 1, characterized in that The step of obtaining target pixel data of a target element to be flood-rendered includes: Acquire an initial texture object and a target texture object, wherein the initial texture object and the target texture object store target pixel data of the target element; The step of performing multiple downsampling on the target pixel data based on a downsampling algorithm to obtain downsampled pixel data includes: Acquire N texture objects based on the number of downsampling times N; the sizes of the N texture objects are different and smaller than the size of the target texture object; N is a positive integer greater than or equal to 2; Based on the order of the sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, sequentially downsample the pixel data in the previous texture object and draw it on the next texture object; The pixel data on the last texture object in the order from largest to smallest size is determined as the downsampled pixel data.

3. The method according to claim 2, characterized in that The method of downsampling pixel data in a previous texture object and drawing it to a subsequent texture object in order of sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, comprises: Based on the order of the sizes of the target texture object and the N texture objects from large to small, starting from the first texture object, a plurality of rows of pixels are determined in the previous texture object in sequence, wherein each row of pixels includes a plurality of pixels, and a distance between any two adjacent rows of pixels is a preset pixel row spacing; Determine a plurality of sampling pixels in each row of pixels, wherein the distance between any two adjacent sampling pixels in the same row of pixels is a first pixel spacing; Obtaining a sampling result corresponding to each sampling pixel according to the pixel value of each sampling pixel, the weight of each sampling pixel, the pixel values ​​of the adjacent pixels of each sampling pixel, and the weight value of the adjacent pixels of each sampling pixel; Drawing is performed on the latter texture object according to the sampling results corresponding to each of the multiple sampling pixels.

4. The method according to claim 2, characterized in that: The step of performing multiple upsampling on the downsampled pixel data based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data includes: After obtaining the downsampled pixel data, based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, sequentially upsample the pixel data in the previous texture object and draw it on the next texture object; The pixel data drawn to the target texture object is determined as upsampled pixel data.

5. The method according to claim 4, characterized in that The method of upsampling and drawing pixel data in a previous texture object to a subsequent texture object in order of sizes of the target texture object and the N texture objects from small to large, starting from the last texture object, comprises: Based on the sizes of the target texture object and the N texture objects in ascending order, starting from the last texture object, sequentially obtaining the pixel value of the interpolated pixel corresponding to each pixel according to the pixel value of each pixel in the previous texture object and the weight value of the interpolated pixel corresponding to each pixel; Drawing is performed on the next texture object according to the pixel value of each pixel in the previous texture object, the pixel value of the inserted pixel corresponding to each pixel, and the relative position relationship between each pixel and the corresponding inserted pixel in the next texture object.

6. The method according to claim 4, characterized in that The step of fusing the target pixel data and the upsampled pixel data to obtain the fused pixel data of the target element as the floodlight pixel data includes: Data fusion is performed on the initial texture object and the target texture object storing the upsampled pixel data to obtain fused pixel data of the target element as floodlight pixel data.

7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining target pixel data of a target element to be flood-rendered includes: If the display type of the target element is floodlight display, the target pixel data of the target element is obtained.

8. A floodlight rendering device, characterized in that: include: A pixel data acquisition module is configured to acquire target pixel data of a target element to be flood-rendered; A downsampling module is configured to perform multiple downsampling on the target pixel data based on a downsampling algorithm to obtain downsampled pixel data; an upsampling module, configured to perform multiple upsampling on the downsampled pixel data based on an upsampling algorithm to obtain upsampled pixel data corresponding to the downsampled pixel data; The data fusion module is configured to perform data fusion on the target pixel data and the up-sampled pixel data to obtain fused pixel data of the target element as floodlight pixel data.

9. An electronic device, wherein: The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 1 to 7.

10. A computer-readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the method steps of any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Method and device for rendering high dynamic range content

    CN119399349A