Search

CN-122023628-A - Mapping processing method and device and electronic equipment

CN122023628ACN 122023628 ACN122023628 ACN 122023628ACN-122023628-A

Abstract

The invention provides a mapping processing method which is characterized by comprising the steps of obtaining a single-channel gradual change mapping, converting the single-channel gradual change mapping into a pixel matrix, conducting gridding scanning on the pixel matrix based on a preset size, identifying standard unit cells with consistent tone scale values, detecting a gradual change area of the standard unit cells, determining a starting tone scale value and an ending tone scale value in the gradual change area, dividing the gradual change area into a plurality of continuous subareas according to distribution proportions of the starting tone scale value and the ending tone scale value in the gradual change area, and executing filling processing on pixels in the standard unit cells in the continuous subareas to obtain mapping processing results. The boundary and the characteristics of the gradual change region can be accurately identified through a gridding scanning technology, and the accurate region division is performed based on the distribution proportion of the initial tone scale value and the end tone scale value, so that the high-efficiency and high-quality processing of the single-channel gradual change mapping is realized.

Inventors

  • YAO BOHAN

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260512
Application Date
20260106

Claims (15)

  1. 1. A method of mapping, comprising: obtaining a single-channel gradual change map, and converting the single-channel gradual change map into a pixel matrix; Performing gridding scanning on the pixel matrix based on a preset size, and identifying standard unit cells with consistent tone scale values; detecting a gradual change area of the standard unit cell, and determining a starting tone scale value and an ending tone scale value in the gradual change area; Dividing the gradual change region into a plurality of continuous partitions according to the distribution proportion of the initial color level value and the ending color level value in the gradual change region; and performing filling processing on pixels in the standard unit cells in the continuous partitions to obtain a mapping processing result.
  2. 2. The method of claim 1, wherein the gridding the pixel matrix based on a preset size to identify standard cells with consistent tone scale values comprises: carrying out non-overlapping scanning on the pixel matrix according to the step length of the preset size; Checking whether the gray values of all pixels in each candidate region are the same; the candidate areas with the same gray values are marked as standard unit cells, and the coordinate positions of the candidate areas are recorded.
  3. 3. The method of claim 1, wherein detecting the fade area of the standard cell and determining the start and end tone values within the fade area comprises: Sliding detection is carried out by taking a preset number of continuous standard unit cells as detection windows; calculating the difference between the maximum value and the minimum value of the representative tone scale value of the standard unit cell in the detection window; And when the difference value is larger than 0 and does not exceed a preset threshold value and a plurality of different tone scale values exist in the detection window, marking the detection window as a gradual change area, determining the minimum value as a starting tone scale value, and determining the maximum value as an ending tone scale value.
  4. 4. A method according to claim 3, wherein the predetermined number is in the range of 5 to 15 standard cells.
  5. 5. The method according to claim 1, wherein dividing the gradation region into a plurality of consecutive sections according to a distribution ratio of the start gradation value and the end gradation value in the gradation region comprises: counting the number of standard unit cells corresponding to the initial tone scale value and the end tone scale value in the gradual change region; And dividing the gradual change area into continuous subareas along the gradual change direction based on the standard unit cell quantity ratio corresponding to the initial tone scale value.
  6. 6. The method of claim 5, wherein the progressive region is divided into 5 consecutive sections when the preset size is 2 x 2 pixel size and 10 consecutive sections when the preset size is 3 x 3 pixel size.
  7. 7. The method of claim 1, wherein the performing a fill process on pixels in standard cells within the continuous partition comprises: For the continuous subarea with dominant initial tone scale value, filling most pixels in a standard unit cell as the initial tone scale value, and filling a small part of pixels as the end tone scale value; for the continuous subarea with dominant ending tone scale value, filling most pixels in a standard unit cell as the ending tone scale value, and filling a small part of pixels as the starting tone scale value; And for the continuous subareas with the similar proportion of the initial color level value to the ending color level value, filling the pixels in the standard unit cell into the initial color level value and the ending color level value according to a preset pattern.
  8. 8. The method of claim 7, wherein the predetermined pattern comprises a diagonal distribution pattern, a checkerboard distribution pattern, and/or a center distribution pattern.
  9. 9. The method of claim 1, further comprising, after said detecting the graded region of the standard cell: when a plurality of independent gradual change areas are detected, processing the gradual change areas in parallel; and (3) carrying out boundary fusion processing on the overlapped parts of the adjacent gradual change regions by applying mixed weights to obtain a fusion processing result.
  10. 10. The method of claim 1, further comprising, prior to said dividing the graded region into a plurality of consecutive partitions: adjusting processing parameters according to the tone scale span of the gradual change region, wherein the processing parameters comprise the number of the continuous partitions and/or the size of a preset size; and when the tone scale span exceeds a first preset threshold value, increasing the number of the continuous partitions and/or lifting the preset size.
  11. 11. The method of claim 1, further comprising, prior to said obtaining the mapping result: Calculating the gradient change rate of the images before and after the filling operation to obtain a gradient change result; And when the gradient change result does not reach the preset standard, adjusting the filling parameters and re-executing the filling process.
  12. 12. The method of claim 1, further comprising, prior to the obtaining the single-channel fade map: Responding to a mapping processing request, wherein the mapping processing request comprises a mapping path to be processed; and loading the single-channel gradual change map according to the map path to be processed.
  13. 13. A map processing apparatus, comprising: the acquisition module is used for acquiring a single-channel gradual change map and converting the single-channel gradual change map into a pixel matrix; The identification module is used for carrying out gridding scanning on the pixel matrix based on a preset size and identifying standard unit grids with consistent tone scale values; The determining module is used for detecting the gradual change area of the standard unit cell and determining a starting tone scale value and an ending tone scale value in the gradual change area; the dividing module is used for dividing the gradual change area into a plurality of continuous partitions according to the distribution proportion of the initial color level value and the ending color level value in the gradual change area; And the filling module is used for executing filling processing on the pixels in the standard unit cells in the continuous partition so as to obtain a mapping processing result.
  14. 14. A computer readable storage medium, characterized in that a computer program is stored, which, when being executed by a processor, implements the method of any one of claims 1 to 12.
  15. 15. An electronic device, comprising: A memory storing a computer program; A processor executing the computer program to implement the method of any one of claims 1 to 12.

Description

Mapping processing method and device and electronic equipment Technical Field The present disclosure relates to the field of game technologies, and in particular, to a mapping processing method and apparatus, a storage medium, and an electronic device. Background In the fields of computer graphics and three-dimensional rendering, the mapping process is one of the key technologies for realizing realistic visual effects. The single-channel gradual change map is used as an important texture resource and is widely applied to material rendering, illumination simulation and visual special effect manufacturing. However, existing mapping processing methods face significant technical challenges when processing single-pass gradient mapping. On one hand, the traditional pixel-level processing mode often cannot accurately identify and position the boundary of the gradual change region, so that gradual change transitional effect is not natural enough to influence final rendering quality, on the other hand, the traditional method has higher calculation complexity and insufficient processing efficiency when processing large-size mapping, and is difficult to meet the performance requirement of real-time rendering application. Particularly, when processing a complex map including a plurality of independent gradation regions, the prior art lacks an effective region division and differentiation processing mechanism, and visual flaws such as gradation faults, tone jump and the like are easily generated. Therefore, how to improve the mapping processing efficiency and realize the precise identification and optimization processing of the gradual change region on the premise of ensuring the processing precision becomes a technical problem to be solved in the technical field. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art. Disclosure of Invention The present disclosure is directed to a mapping processing method and apparatus, a storage medium, and an electronic device that, at least in part, overcome one or more of the problems due to the limitations and disadvantages of the related art. According to one aspect of the present disclosure, there is provided a mapping processing method, the method further comprising: obtaining a single-channel gradual change map, and converting the single-channel gradual change map into a pixel matrix; Performing gridding scanning on the pixel matrix based on a preset size, and identifying standard unit cells with consistent tone scale values; detecting a gradual change area of the standard unit cell, and determining a starting tone scale value and an ending tone scale value in the gradual change area; Dividing the gradual change region into a plurality of continuous partitions according to the distribution proportion of the initial color level value and the ending color level value in the gradual change region; and performing filling processing on pixels in the standard unit cells in the continuous partitions to obtain a mapping processing result. In accordance with another aspect of the present disclosure, A map processing apparatus, the apparatus comprising: the acquisition module is used for acquiring a single-channel gradual change map and converting the single-channel gradual change map into a pixel matrix; The identification module is used for carrying out gridding scanning on the pixel matrix based on a preset size and identifying standard unit grids with consistent tone scale values; The determining module is used for detecting the gradual change area of the standard unit cell and determining a starting tone scale value and an ending tone scale value in the gradual change area; the dividing module is used for dividing the gradual change area into a plurality of continuous partitions according to the distribution proportion of the initial color level value and the ending color level value in the gradual change area; And the filling module is used for executing filling processing on the pixels in the standard unit cells in the continuous partition so as to obtain a mapping processing result. According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the mapping processing method of any one of the above. According to another aspect of the present disclosure, there is provided an electronic device including: processor, display device, and A memory for storing executable instructions of the processor; Wherein the processor is configured to perform the mapping method of any of the above via execution of the executable instructions. The mapping processing method is characterized by comprising the steps of obtaining a single-channel gradual c