An image mapping method, an image mapping device and a computer device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AXERA TECH (SHANGHAI) CO LTD
- Filing Date
- 2026-02-14
- Publication Date
- 2026-06-19
Smart Images

Figure CN122243847A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image mapping method, an image mapping device, and a computer device. Background Technology
[0002] With the increasing demands for image quality in scenarios such as automotive imaging and consumer electronics imaging, local image mapping technology has become a core technology in the image processing workflow.
[0003] Currently, an image can be divided into multiple regions of equal size. By statistically analyzing the pixel brightness distribution in each region, the pixel brightness characteristics of each region can be captured. Based on the pixel brightness characteristics of each region, the original pixel brightness within the region can be mapped, thereby expanding the range of brightness variation in each region and thus improving the local contrast of the image.
[0004] However, when performing local image mapping using the above method, further improving local image contrast requires increasing the density of region divisions in the image. This significantly increases the statistical quantity of pixel brightness distribution, leading to higher hardware costs. In other words, existing technologies cannot balance the need for local image contrast with hardware costs. Summary of the Invention
[0005] This application provides an image mapping method, an image mapping device, and a computer equipment, which can prioritize the allocation of hardware resources to the user's area of interest, thereby improving the image mapping effect without increasing hardware costs.
[0006] According to a first aspect of the embodiments of this application, an image mapping method is provided, comprising: Obtain information about the user's region of interest in the target image; The region of interest to the user is uniformly divided into multiple first sub-regions, and based on the region of interest to the user, the region of non-interest to the user is non-uniformly divided into multiple second sub-regions. The size of the first sub-region is no larger than the size of any second sub-region. For each first sub-region, the cumulative distribution function of pixel brightness in the first sub-region is determined based on the pixel brightness of each pixel in the first sub-region. Based on the cumulative distribution function corresponding to each first sub-region, surface fitting is performed to obtain the cumulative distribution function corresponding to each second sub-region. For each sub-region, the pixel brightness mapping relationship corresponding to the sub-region is determined according to the cumulative distribution function of the sub-region. The sub-region includes the first sub-region and the second sub-region. For each pixel in the target image, a target pixel brightness mapping relationship is determined based on the sub-region where the pixel is located; based on the target pixel brightness mapping relationship, the target pixel brightness corresponding to the pixel brightness of the pixel is determined.
[0007] In some embodiments of this application, based on the user's region of interest, the non-user region of interest is non-uniformly divided into multiple second sub-regions, including: Extract texture features from regions of non-user interest; Based on the distance between the non-user interest region and the user interest region, as well as texture features, the non-user interest region is non-uniformly divided into multiple second sub-regions.
[0008] In some embodiments of this application, for each first sub-region, a cumulative distribution function of pixel brightness in the first sub-region is determined based on the pixel brightness of each pixel within the first sub-region, including: The preset pixel brightness range is divided into multiple pixel brightness levels; For each first sub-region, determine the number of pixels belonging to each pixel brightness level based on the pixel brightness of each pixel within the first sub-region; Based on the number of pixels belonging to each pixel brightness level and the total number of pixels in the first sub-region, the probability density distribution function of the pixel brightness in the first sub-region is determined. The probability density distribution function is used to represent the correspondence between pixel brightness levels and probability density values. For each pixel brightness level, the cumulative probability value corresponding to the pixel brightness level is determined based on the probability density value corresponding to the pixel brightness level when it is not higher than the pixel brightness level. Based on the cumulative probability value corresponding to each pixel brightness level, a cumulative distribution function of pixel brightness in the first sub-region is constructed. The cumulative distribution function is used to represent the correspondence between pixel brightness levels and cumulative probability values.
[0009] In some embodiments of this application, surface fitting is performed based on the cumulative distribution function corresponding to each first sub-region to obtain the cumulative distribution function corresponding to each second sub-region, including: For each pixel brightness level, a surface fitting is performed based on the cumulative probability value of the pixel brightness level in each first sub-region and the position information of each sub-region to obtain a global surface model corresponding to the pixel brightness level. The global surface model is used to represent the correspondence between the position information of each sub-region and the cumulative probability value of the pixel brightness level in each sub-region. Based on the global surface model, the cumulative probability value of the pixel brightness level in each second sub-region is determined. For each second sub-region, a cumulative distribution function is constructed based on the cumulative probability value corresponding to the brightness level of each pixel within the second sub-region.
[0010] In some embodiments of this application, for each sub-region, the pixel brightness mapping relationship corresponding to the sub-region is determined based on the cumulative distribution function of the sub-region, including: For each sub-region, the mapped pixel brightness corresponding to each pixel brightness level in the sub-region is determined based on the cumulative probability value and pixel brightness range. Based on the mapped pixel brightness corresponding to each pixel brightness level within a sub-region, a pixel brightness mapping relationship is constructed for the sub-region.
[0011] In some embodiments of this application, for each pixel in the target image, the target pixel brightness mapping relationship is determined based on the sub-region where the pixel is located, including: For each pixel in the target image, the sub-region adjacent to the sub-region where the pixel is located is determined as the target region, and the pixel brightness mapping relationship corresponding to the target region is determined as the target pixel brightness mapping relationship.
[0012] In some embodiments of this application, determining the target pixel brightness corresponding to the pixel brightness of a pixel based on the target pixel brightness mapping relationship includes: Determine the target pixel brightness level to which the pixel brightness belongs; Based on the target pixel brightness mapping relationship, determine the mapped pixel brightness corresponding to the target pixel brightness level; Determine the target pixel brightness based on the mapped pixel brightness.
[0013] According to a second aspect of the embodiments of this application, an image mapping apparatus is provided, comprising: The acquisition module is used to acquire information about the user's region of interest in the target image; The partitioning module is used to uniformly divide the user's region of interest into multiple first sub-regions, and based on the user's region of interest, to non-user's region of interest into multiple second sub-regions, wherein the size of the first sub-region is no larger than the size of the second sub-region. The determination module is used to determine the cumulative distribution function of pixel brightness of the first sub-region based on the pixel brightness of each pixel in the first sub-region; The fitting module is used to perform surface fitting based on the cumulative distribution function corresponding to each first sub-region to obtain the cumulative distribution function corresponding to each second sub-region; The determination module is also used to determine the pixel brightness mapping relationship corresponding to each sub-region based on the cumulative distribution function of the sub-region. The sub-region includes a first sub-region and a second sub-region. The determination module is also used to determine the target pixel brightness mapping relationship for each pixel in the target image based on the sub-region where the pixel is located; and to determine the target pixel brightness corresponding to the pixel brightness of the pixel based on the target pixel brightness mapping relationship.
[0014] According to a third aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one program, the at least one program being loaded by the processor and executed by any of the above-described image mapping methods.
[0015] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein at least one program is stored in the computer-readable storage medium, and the at least one program is loaded and executed by a processor to implement any of the above-described image mapping methods.
[0016] Therefore, the image mapping method described above can perform more detailed and uniform division of the user's region of interest (ROI) in the target image. By statistically analyzing the pixel brightness of each pixel within the first sub-region of the ROI, the cumulative distribution function of the first sub-region is determined. Then, based on the cumulative distribution function of each first sub-region, surface fitting is performed to obtain the cumulative distribution function of the non-uniformly divided second sub-region of the non-ROI. Finally, the corresponding pixel brightness mapping relationship can be determined based on the cumulative distribution functions of the first and second sub-regions. This pixel brightness mapping relationship is then used to determine the target pixel brightness corresponding to the current pixel brightness, thus completing the image mapping. In other words, this image mapping method eliminates the need for detailed division of the non-ROI and statistical analysis of pixel brightness in the divided regions to determine the pixel brightness mapping relationship. Instead, it uses surface fitting to determine the pixel brightness mapping relationship, significantly reducing the amount of data statistics and thus lowering the hardware cost of mapping the non-ROI. This allows hardware resources to be prioritized for the ROI, improving the image mapping effect without increasing hardware costs. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating an image mapping method provided in an embodiment of this application; Figure 2 A schematic diagram of a segmented target image provided in an embodiment of this application; Figure 3 A schematic diagram of the probability density distribution function of pixel brightness in a first sub-region provided in an embodiment of this application; Figure 4 A schematic diagram of the cumulative distribution function of pixel brightness in a first sub-region provided in an embodiment of this application; Figure 5 A schematic diagram of a global surface model provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an image mapping device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0020] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.
[0021] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various objects, these objects should not be limited by the terms.
[0022] These terms are simply used to distinguish one object from another. For example, without departing from the various examples, a first action can be called a second action, and similarly, a second action can be called a first action. Both the first and second actions can be actions, and in some cases, they can be separate and distinct actions.
[0023] "At least one" refers to one or more actions. For example, at least one action can be one action, two actions, three actions, or any integer number of actions greater than or equal to one. "Multiple" refers to two or more actions. For example, multiple actions can be two actions, three actions, or any integer number of actions greater than or equal to two.
[0024] With the increasing demands for image quality in scenarios such as automotive imaging and consumer electronics imaging, local image mapping technology has become a core technology in image processing workflows. Local image mapping technology enhances local image contrast, making image details and textures clearer and sharper, edges and contours more prominent, and mitigating image blur.
[0025] Currently, an image can be divided into multiple equally sized regions. By statistically analyzing the pixel brightness distribution within each region, the pixel brightness characteristics of each region are captured. The original pixel brightness within each region is then mapped based on these characteristics, thereby expanding the range of brightness variation in each region and improving local image contrast. However, when using this method for local image mapping, further improving local contrast requires increasing the region division density, which significantly increases the statistical analysis of pixel brightness distribution, leading to higher hardware costs. In other words, current technologies cannot balance the need for local image contrast with hardware costs.
[0026] To address the aforementioned technical problems, this application provides an image mapping method that can prioritize the allocation of hardware resources to areas of interest to the user, thereby improving the image mapping effect without increasing hardware costs.
[0027] Figure 1 This is a flowchart illustrating an image mapping method provided in an embodiment of this application. The following is a summary of the process. Figure 1 The image mapping method is described in detail below. The executing entity of the image mapping method can be a terminal device with image acquisition function, such as an in-vehicle smart camera, a smartphone, or a smart camera, or a server that communicates and connects with these terminal devices. The image mapping method described below only takes the terminal device as the executing entity. The image mapping method can include: S101 to S106, as follows.
[0028] S101, Obtain information about the region of interest in the target image.
[0029] S102, the user's region of interest is uniformly divided into multiple first sub-regions, and based on the user's region of interest, the non-user's region of interest is non-uniformly divided into multiple second sub-regions, wherein the size of the first sub-region is no larger than the size of any second sub-region.
[0030] The target image can be captured by terminal devices with image acquisition capabilities, such as in-vehicle smart cameras, smartphones, and smart cameras. For example, the target image can be a road condition map captured by an in-vehicle smart camera or a landscape image captured by a smart camera.
[0031] Users often pay varying degrees of attention to different areas within a target image, focusing more on specific regions and demanding higher image quality from them. For example, when viewing traffic images captured by in-vehicle smart cameras, users typically focus on lanes, vehicles, and traffic signs, demanding higher image quality from these areas, while having less stringent requirements for the road background, surrounding vegetation, and distant scenery. Similarly, when viewing landscape images captured by smart cameras, users typically focus on the main subject and people, demanding higher image quality from these areas, while having less stringent requirements for the background sky, road surface, and distant scenery.
[0032] Therefore, the target image can be divided into regions of interest and regions of non-interest, and processed differently. This can meet the user's visual needs while rationally allocating hardware resources and improving the overall efficiency of image mapping.
[0033] For example, areas of interest to users in a driving traffic map might include lanes, vehicles, and traffic signs, while areas of non-interest might include the road background and surrounding vegetation. Similarly, areas of interest to users in a landscape image might include the main scenery and people, while areas of non-interest might include the road surface and distant views.
[0034] The terminal device can first obtain information about the region of interest in the target image. The region of interest can be selected by the terminal user or preset by the developers, and no specific restrictions are made here.
[0035] Then, the terminal device can evenly divide the region of interest to obtain multiple first sub-regions, and based on the region of interest, non-user-interested regions can be non-uniformly divided to obtain multiple second sub-regions.
[0036] To balance the high image quality requirements of users for regions of interest (ROIs) with the overall efficiency of image mapping, and to achieve a reasonable allocation of hardware resources, hardware resources are prioritized for ROIs. When segmenting the target image, the segmentation density of ROIs is no greater than that of non-ROIs; that is, the size of the first sub-region within a ROI is no greater than the size of any second sub-region within any non-ROI.
[0037] S103, for each first sub-region, determine the cumulative distribution function of pixel brightness of the first sub-region based on the pixel brightness of each pixel in the first sub-region.
[0038] S104. Based on the cumulative distribution function corresponding to each first sub-region, perform surface fitting to obtain the cumulative distribution function corresponding to each second sub-region.
[0039] After the region of interest (ROI) is divided, the pixel brightness of each pixel within each sub-region can be statistically analyzed to determine the distribution characteristics of pixel brightness within that sub-region, facilitating subsequent image mapping. Specifically, for each sub-region, the terminal device can collect the pixel brightness of each pixel within that sub-region and determine the cumulative distribution function of pixel brightness for that sub-region. This cumulative distribution function can be used to represent the proportion of pixels within the sub-region whose brightness is not greater than a certain pixel brightness or a certain pixel brightness range out of the total number of pixels.
[0040] To further reduce hardware costs and improve the overall processing efficiency of image mapping for regions of non-user interest, the terminal device can directly perform surface fitting based on the cumulative distribution function corresponding to each first sub-region, instead of calculating the pixel brightness of each pixel in each second sub-region. This yields the cumulative distribution function for each second sub-region, which represents the proportion of pixels in the second sub-region whose brightness is no greater than a certain pixel brightness or a certain pixel brightness range. This method significantly reduces the computational workload of pixel statistics in regions of non-user interest, lowers hardware costs, and improves the overall processing efficiency of image mapping.
[0041] S105, for each sub-region, determine the pixel brightness mapping relationship corresponding to the sub-region based on the cumulative distribution function of the sub-region. The sub-region includes the first sub-region and the second sub-region.
[0042] S106, for each pixel in the target image, determine the target pixel brightness mapping relationship based on the sub-region where the pixel is located; determine the target pixel brightness corresponding to the pixel brightness of the pixel according to the target pixel brightness mapping relationship.
[0043] The sub-regions include a first sub-region and a second sub-region. After determining the cumulative distribution function of each sub-region, the pixel brightness mapping relationship corresponding to that sub-region can be determined based on the cumulative distribution function. The pixel brightness mapping relationship is used to map the pixel brightness of pixels in the target image to obtain the corresponding target pixel brightness, thereby realizing image mapping. Furthermore, one sub-region corresponds to one pixel brightness mapping relationship.
[0044] When performing image mapping on a target image, for each pixel in the target image, the terminal device can determine the target pixel brightness mapping relationship based on the sub-region where that pixel is located. The target pixel brightness mapping relationship is the pixel brightness mapping relationship corresponding to that sub-region. Then, the terminal device can determine the target pixel brightness corresponding to the pixel brightness of that pixel based on the target pixel brightness mapping relationship.
[0045] After determining the target pixel brightness for each pixel in the target image, the terminal device can update the brightness of each pixel in the target image, that is, assign the target pixel brightness to the corresponding pixel to obtain the mapped target image. Then, the mapped target image can be output, for example, outputting the mapped traffic map to the vehicle's display screen, or displaying the mapped landscape image on the LCD screen of a smart camera. Alternatively, the mapped target image can be stored for subsequent data analysis; for example, the mapped traffic map can be uploaded to a cloud platform via vehicle-to-everything (V2X) for traffic big data analysis.
[0046] Therefore, the image mapping method described above can perform more detailed and uniform division of the user's region of interest (ROI) in the target image. By statistically analyzing the pixel brightness of each pixel within the first sub-region of the ROI, the cumulative distribution function of the first sub-region is determined. Then, based on the cumulative distribution function of each first sub-region, surface fitting is performed to obtain the cumulative distribution function of the non-uniformly divided second sub-region of the non-ROI. Finally, the corresponding pixel brightness mapping relationship can be determined based on the cumulative distribution functions of the first and second sub-regions. This pixel brightness mapping relationship is then used to determine the target pixel brightness corresponding to the current pixel brightness, thus completing the image mapping. In other words, this image mapping method eliminates the need for detailed division of the non-ROI and statistical analysis of pixel brightness in the divided regions to determine the pixel brightness mapping relationship. Instead, it uses surface fitting to determine the pixel brightness mapping relationship, significantly reducing the amount of data statistics and thus lowering the hardware cost of mapping the non-ROI. This allows hardware resources to be prioritized for the ROI, improving the image mapping effect without increasing hardware costs.
[0047] In some embodiments of this application, S102 is involved, in which the terminal device can non-uniformly divide the non-user interest region into multiple second sub-regions based on the user's interest region. S102 may include S1021 and S1022, as follows.
[0048] S1021 Extract texture features from regions of non-user interest.
[0049] S1022, based on the distance between the non-user interest region and the user interest region and the texture features, the non-user interest region is non-uniformly divided into multiple second sub-regions.
[0050] Terminal devices can extract texture features from areas of non-user interest. Texture features can be used to represent the spatial arrangement of pixels in a target image, the distribution characteristics of pixel grayscale changes, such as the roughness of road surface texture, the textureless uniformity of the sky area, the dense texture distribution of roadside vegetation, etc.
[0051] Then, the terminal device can perform non-uniform division of the non-user interest region based on the distance between the non-user interest region and the user interest region, as well as texture features.
[0052] Specifically, the terminal device can initially divide the non-user interest region (NIRT) into non-uniform regions based on the distance between it and the user interest region (NIRT). The closer the NIRT is to the user interest region, the higher the division density; that is, the closer the NIRT is to the user interest region, the smaller the size of the second sub-region. For example, visual transition areas adjacent to the user interest region within the NIRT can be divided using the same size as the first sub-region, while other background areas far from the user interest region can be divided using integer multiples of the size of the first sub-region.
[0053] Then, the terminal device can adaptively correct the initial non-uniform partitioning. For example, if the texture is complex in a location far from the user's region of interest (e.g., dense fences, vegetation), the partitioning density at that location can be appropriately increased; that is, the size of the second sub-region at that location can be appropriately reduced, thus preserving the texture bytes at that location. Conversely, if the texture is simple in a location close to the user's region of interest (e.g., a blank sky, a smooth road surface), the partitioning density at that location can be appropriately decreased; that is, the size of the second sub-region at that location can be appropriately increased.
[0054] The segmented target image is as follows Figure 2 As shown, Figure 2 This is a schematic diagram of a segmented target image provided in an embodiment of this application.
[0055] like Figure 2 As shown, Figure 2 The red area represents the user's region of interest in the target image, which can be evenly divided into four first sub-regions. The blue area represents the visual transition area between the user's region of interest and the non-user region of interest, which can be divided according to the size of the first sub-regions to avoid visual distortion problems such as brightness jumps. The yellow area represents the background area far from the user's region of interest, which can be divided by using twice the size of the first sub-regions.
[0056] In some embodiments of this application, S103 is involved. The terminal device can determine the cumulative distribution function of the pixel brightness of the first sub-region based on the pixel brightness of each pixel in the first sub-region. S103 may include S1031 to S1035, as follows.
[0057] S1031 divides the preset pixel brightness range into multiple pixel brightness levels.
[0058] A preset pixel brightness range represents the entire value space of pixel brightness, which can include all possible pixel brightness values. The preset pixel brightness range is typically [0, 256]. The terminal device can divide the preset pixel brightness range into multiple pixel brightness levels. For example, the preset pixel brightness range can be divided into 32 sub-ranges with a pixel brightness interval of 8, such as [0, 8], [8, 16], [16, 24], etc. Each sub-range corresponds to one pixel brightness level; that is, the preset pixel brightness range can be divided into 32 pixel brightness levels. Of course, in practical applications, the preset pixel brightness range can be divided according to actual needs, which will not be listed here.
[0059] S1032, for each first sub-region, determine the number of pixels belonging to each pixel brightness level based on the pixel brightness of each pixel in the first sub-region.
[0060] For each first sub-region, the terminal device can count the pixel brightness of each pixel within that first sub-region, thereby determining the number of pixels belonging to each pixel brightness level. For example, the number of pixels with a brightness of [0, 8] in that first sub-region is 0, the number of pixels with a brightness of [8, 16] is 0, and the number of pixels with a brightness of [16, 24] is 120, etc.
[0061] S1033, Based on the number of pixels belonging to each pixel brightness level and the total number of pixels in the first sub-region, determine the probability density distribution function of the pixel brightness in the first sub-region. The probability density distribution function is used to represent the correspondence between pixel brightness levels and probability density values.
[0062] For each first sub-region, the terminal device can determine the proportion of pixels belonging to each brightness level to the total number of pixels in the first sub-region based on the number of pixels belonging to each brightness level and the total number of pixels in that first sub-region, and define this proportion as the probability density value corresponding to the brightness level. Furthermore, based on the probability density value corresponding to each brightness level, a probability density distribution function for the pixel brightness of the first sub-region can be constructed. The probability density distribution function is as follows: Figure 3 As shown, Figure 3 This is a schematic diagram of the probability density distribution function of pixel brightness in a first sub-region provided in an embodiment of this application.
[0063] Depend on Figure 3As can be seen, the horizontal axis of the probability density distribution function of pixel brightness in the first sub-region is the pixel brightness level, and the vertical axis is the probability density value. The probability density distribution function can be used to represent the correspondence between pixel brightness level and probability density value.
[0064] S1034, for each pixel brightness level, determine the cumulative probability value corresponding to the pixel brightness level based on the probability density value corresponding to the pixel brightness level when it is not higher than the pixel brightness level.
[0065] For each pixel brightness level, the terminal device can determine the cumulative probability value corresponding to the pixel brightness level based on the probability density value corresponding to the pixel brightness level, as shown in the following formula (1).
[0066] Formula (1) in, Indicates the first The probability density value corresponding to the brightness level of each pixel. Indicates the first The cumulative density value corresponding to each pixel brightness level Indicates the first - The cumulative density value corresponding to 1 pixel brightness level.
[0067] S1035, Based on the cumulative probability value corresponding to each pixel brightness level, construct the cumulative distribution function of the pixel brightness of the first sub-region. The cumulative distribution function is used to represent the correspondence between the pixel brightness level and the cumulative probability value.
[0068] The terminal device can construct a cumulative distribution function of pixel brightness for the first sub-region based on the cumulative probability value corresponding to each pixel brightness level. The specific cumulative distribution function is as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of the cumulative distribution function of pixel brightness in a first sub-region provided in an embodiment of this application.
[0069] Depend on Figure 4 As can be seen, the x-axis of the cumulative distribution function of pixel brightness in the first sub-region is the pixel brightness level, and the y-axis is the cumulative probability value. The cumulative distribution function can be used to represent the correspondence between pixel brightness level and cumulative probability value.
[0070] In some embodiments of this application, S104 is involved, in which the terminal device can perform surface fitting based on the cumulative distribution function corresponding to each first sub-region to obtain the cumulative distribution function corresponding to each second sub-region. S104 may include S1041 and S1042, as follows.
[0071] S1041, for each pixel brightness level, based on the cumulative probability value corresponding to the pixel brightness level in each first sub-region and the position information of each sub-region, perform surface fitting to obtain a global surface model corresponding to the pixel brightness level. The global surface model is used to represent the correspondence between the position information of each sub-region and the cumulative probability value corresponding to the pixel brightness level in each sub-region. Based on the global surface model, determine the cumulative probability value corresponding to the pixel brightness level in each second sub-region.
[0072] S1042, for each second sub-region, construct the cumulative distribution function corresponding to the second sub-region based on the cumulative probability value corresponding to the brightness level of each pixel in the second sub-region.
[0073] The terminal device can extract the location information of each sub-region. For example, it can determine the center coordinates of each sub-region and use them as the corresponding location information.
[0074] Then, for each pixel brightness level, the terminal device can perform surface fitting based on the cumulative probability value corresponding to that pixel brightness level within each first sub-region and the position information of each sub-region, thereby obtaining the global surface model corresponding to that pixel brightness level. The global surface model is a continuous three-dimensional surface model covering the entire target image space, constructed for a single pixel brightness level. That is, one pixel brightness level corresponds to one global surface model. The global surface model can be used to represent the correspondence between the position information of each sub-region and the cumulative probability value corresponding to the pixel brightness level within each sub-region. For details on the global surface model, please refer to [example missing]. Figure 5 , Figure 5 This is a schematic diagram of a global surface model provided in an embodiment of this application.
[0075] Depend on Figure 5 It can be seen that the planar dimension of the global surface model is used to represent the positional information of each sub-region, and the planar dimension of the global surface model is used to represent the cumulative probability value corresponding to the current pixel brightness level in each sub-region.
[0076] The surface fitting methods in the embodiments of this application are not limited to one or more of bicubic interpolation, spline interpolation, polynomial fitting, and neural network fitting.
[0077] Then, the terminal device can determine the cumulative probability value corresponding to each pixel brightness level in each second sub-region based on the global surface model corresponding to each pixel brightness level. Specifically, the center coordinates of each second sub-region can be substituted into the corresponding global surface model to determine the cumulative probability value corresponding to each pixel brightness level in each second sub-region.
[0078] For each second sub-region, the terminal device can construct a cumulative distribution function corresponding to the second sub-region based on the cumulative probability value corresponding to the brightness level of each pixel in the second sub-region. The cumulative distribution function can be used to represent the correspondence between the pixel brightness level and the cumulative probability value corresponding to the brightness level of each pixel in the second sub-region.
[0079] In some embodiments of this application, S105 is involved. For each sub-region, the terminal device can determine the pixel brightness mapping relationship corresponding to the sub-region according to the cumulative distribution function of the sub-region. S105 may include S1051 and S1052, as follows.
[0080] S1051, for each sub-region, determine the mapped pixel brightness corresponding to the pixel brightness level in the sub-region based on the cumulative probability value and pixel brightness range corresponding to the pixel brightness level in the sub-region.
[0081] S1052, construct the pixel brightness mapping relationship for the sub-region based on the mapped pixel brightness corresponding to each pixel brightness level within the sub-region.
[0082] For each sub-region, the terminal device can determine the mapped pixel brightness corresponding to that pixel brightness level within that sub-region based on the cumulative probability value corresponding to each pixel brightness level and the aforementioned preset pixel brightness range. This quantifies the cumulative probability value and yields the corresponding mapped pixel brightness. For example, the cumulative probability value can be multiplied by 256 and then rounded to obtain the corresponding mapped pixel brightness.
[0083] For each sub-region, the terminal device can construct a pixel brightness mapping relationship for that sub-region based on the mapped pixel brightness corresponding to each pixel brightness level within that sub-region. The pixel brightness mapping relationship is the mapping relationship between each pixel brightness level and the mapped pixel brightness within that sub-region.
[0084] In some embodiments of this application, S106 involves determining the target pixel brightness mapping relationship based on the sub-region where the pixel is located for each pixel in the target image. S106 may include: for each pixel in the target image, the terminal device may determine the sub-region adjacent to the sub-region where the pixel is located as the target region. For example, to facilitate the subsequent determination of the mapped pixel brightness using four-neighbor interpolation, the adjacent sub-regions in the four directions (up, down, left, and right) of the sub-region where the pixel is located may be determined as the target region.
[0085] In some embodiments of this application, eight-neighbor interpolation can also be used to determine the brightness of the mapped pixel. Based on this, the adjacent sub-regions in the four directions of top, bottom, left, and right of the sub-region where the pixel is located, as well as the adjacent sub-regions in the four directions of top left, top right, bottom left, and bottom right of the sub-region where the pixel is located, can be determined as the target region.
[0086] Then, the pixel brightness mapping relationship corresponding to the target area is determined as the target pixel brightness mapping relationship, which is used for subsequent image mapping.
[0087] In some embodiments of this application, S106 is involved. For each pixel in the target image, the terminal device can determine the target pixel brightness corresponding to the pixel brightness of that pixel according to the target pixel brightness mapping relationship. S106 may include: S1061 to S1063, as follows.
[0088] S1061, determine the target pixel brightness level to which the pixel brightness belongs.
[0089] S1062, Based on the target pixel brightness mapping relationship, determine the mapped pixel brightness corresponding to the target pixel brightness level.
[0090] S1063, determine the target pixel brightness based on the mapped pixel brightness.
[0091] For each pixel in the target image, the terminal device can first determine the target pixel brightness level to which the pixel brightness belongs. Continuing with the previous example, if the pixel brightness of the pixel is 18, and the pixel brightness of the pixel is 18, it belongs to the pixel brightness sub-interval [16, 24]. Then, the pixel brightness level corresponding to the pixel brightness sub-interval [16, 24] can be determined as the aforementioned target pixel brightness level.
[0092] The terminal device can determine the brightness of the mapped pixel corresponding to the brightness level of the target pixel based on the target pixel brightness mapping relationship, and determine the brightness of the target pixel based on the mapped pixel brightness.
[0093] Specifically, the terminal device can determine the distance between the current pixel and each target region, and based on the distance between the current pixel and each target region, determine the weight corresponding to each target region. The closer the target region is to the current pixel, the greater its weight, and vice versa. Then, based on the brightness mapping relationship of each target pixel, the mapped pixel brightness corresponding to the target pixel brightness level can be determined from the target pixel brightness mapping relationship. Based on the weight corresponding to each target region, the mapped pixel brightness corresponding to the target pixel brightness level determined from each target pixel brightness mapping relationship is weighted and summed to obtain the target pixel brightness.
[0094] Continuing with the previous example, the terminal device can use four-neighbor interpolation to determine the brightness of the mapped pixel. That is, the terminal device first determines the distance information between the current pixel and four target regions, then determines the weight corresponding to each target region based on this distance information, and performs a weighted sum of the mapped pixel brightness levels determined from the target pixel brightness mapping relationship to obtain the target pixel brightness. Alternatively, in this embodiment, two-neighbor interpolation, eight-neighbor interpolation, or other methods can also be used to determine the target pixel brightness. The specific interpolation method can be selected based on the actual mapping requirements.
[0095] Therefore, the image mapping method described above can perform more detailed and uniform division of the user's region of interest (ROI) in the target image. By statistically analyzing the pixel brightness of each pixel within the first sub-region of the ROI, the cumulative distribution function of the first sub-region is determined. Then, based on the cumulative distribution function of each first sub-region, surface fitting is performed to obtain the cumulative distribution function of the non-uniformly divided second sub-region of the non-ROI. Finally, the corresponding pixel brightness mapping relationship can be determined based on the cumulative distribution functions of the first and second sub-regions. This pixel brightness mapping relationship is then used to determine the target pixel brightness corresponding to the current pixel brightness, thus completing the image mapping. In other words, this image mapping method eliminates the need for detailed division of the non-ROI and statistical analysis of pixel brightness in the divided regions to determine the pixel brightness mapping relationship. Instead, it uses surface fitting to determine the pixel brightness mapping relationship, significantly reducing the amount of data statistics and thus lowering the hardware cost of mapping the non-ROI. This allows hardware resources to be prioritized for the ROI, improving the image mapping effect without increasing hardware costs.
[0096] Embodiments of this application also provide an image mapping device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of an image mapping device provided in an embodiment of this application. The image mapping device 600 can be deployed on terminal devices with image acquisition functions, such as in-vehicle smart cameras, smartphones, and smart cameras, or it can be deployed on a server that communicates with these terminal devices. The image mapping device 600 includes: The acquisition module 601 is used to acquire information about the region of interest of the user in the target image; The partitioning module 602 is used to uniformly divide the user's region of interest into multiple first sub-regions, and based on the user's region of interest, non-user's region of interest is non-uniformly divided into multiple second sub-regions, wherein the size of the first sub-region is not greater than the size of the second sub-region. The determining module 603 is used to determine the cumulative distribution function of pixel brightness of the first sub-region based on the pixel brightness of each pixel in the first sub-region for each first sub-region; The fitting module 604 is used to perform surface fitting based on the cumulative distribution function corresponding to each first sub-region to obtain the cumulative distribution function corresponding to each second sub-region; The determining module 603 is further configured to, for each sub-region, determine the pixel brightness mapping relationship corresponding to the sub-region based on the cumulative distribution function of the sub-region, wherein the sub-region includes a first sub-region and a second sub-region; The determining module 603 is further configured to, for each pixel in the target image, determine the target pixel brightness mapping relationship based on the sub-region where the pixel is located; and determine the target pixel brightness corresponding to the pixel brightness of the pixel according to the target pixel brightness mapping relationship.
[0097] In some embodiments of this application, the partitioning module 602 is further configured to extract texture features from the non-user interest region; and to non-uniformly partition the non-user interest region into multiple second sub-regions based on the distance between the non-user interest region and the user interest region and the texture features.
[0098] In some embodiments of this application, the determining module 603 is further configured to: divide a preset pixel brightness range into multiple pixel brightness levels; for each first sub-region, determine the number of pixels belonging to each pixel brightness level based on the pixel brightness of each pixel within the first sub-region; determine the probability density distribution function of the pixel brightness of the first sub-region based on the number of pixels belonging to each pixel brightness level and the total number of pixels within the first sub-region, wherein the probability density distribution function is used to represent the correspondence between pixel brightness levels and probability density values; for each pixel brightness level, determine the cumulative probability value corresponding to the pixel brightness level based on the probability density value corresponding to the pixel brightness level; and construct a cumulative distribution function of the pixel brightness of the first sub-region based on the cumulative probability value corresponding to each pixel brightness level, wherein the cumulative distribution function is used to represent the correspondence between pixel brightness levels and cumulative probability values.
[0099] In some embodiments of this application, the fitting module 604 is further configured to: for each pixel brightness level, perform surface fitting based on the cumulative probability value corresponding to the pixel brightness level in each first sub-region and the position information of each sub-region to obtain a global surface model corresponding to the pixel brightness level. The global surface model is used to represent the correspondence between the position information of each sub-region and the cumulative probability value corresponding to the pixel brightness level in each sub-region; determine the cumulative probability value corresponding to the pixel brightness level in each second sub-region based on the global surface model; and construct a cumulative distribution function corresponding to each second sub-region based on the cumulative probability value corresponding to each pixel brightness level in the second sub-region.
[0100] In some embodiments of this application, the determining module 603 is further configured to, for each sub-region, determine the mapped pixel brightness corresponding to the pixel brightness level in the sub-region based on the cumulative probability value and pixel brightness range corresponding to each pixel brightness level in the sub-region; and construct the pixel brightness mapping relationship corresponding to the sub-region based on the mapped pixel brightness corresponding to each pixel brightness level in the sub-region.
[0101] In some embodiments of this application, the determining module 603 is further configured to, for each pixel in the target image, determine the sub-region adjacent to the sub-region where the pixel is located as the target region, and determine the pixel brightness mapping relationship corresponding to the target region as the target pixel brightness mapping relationship.
[0102] In some embodiments of this application, the determining module 603 is further configured to: determine the target pixel brightness level to which the pixel brightness of the pixel belongs; determine the mapped pixel brightness corresponding to the target pixel brightness level based on the target pixel brightness mapping relationship; and determine the target pixel brightness based on the mapped pixel brightness.
[0103] Embodiments of this application also provide a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement any of the above-described image mapping methods.
[0104] Taking computer devices as terminals as an example, Figure 7 A schematic diagram of the structure of a terminal provided in an embodiment of this application is shown below. Figure 7 Terminal 700 can be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 700 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0105] Typically, terminal 700 includes a processor 701 and a memory 702.
[0106] In some embodiments of this application, processor 701 may include one or more processing cores, such as a 4-core processor, a 7-core processor, etc. Processor 701 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 701 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 701 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 701 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0107] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 702 are used to store at least one program code, which is executed by the processor 701 to implement the process of terminal execution in the method embodiments of this application.
[0108] In some embodiments, the terminal 700 may also optionally include a peripheral device interface 703 and at least one peripheral device. The processor 701, memory 702, and peripheral device interface 703 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 703 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of a display screen 704, a camera assembly 705, an audio circuit 706, and a power supply 707.
[0109] Peripheral device interface 703 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 701 and memory 702. In some embodiments, processor 701, memory 702 and peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 701, memory 702 and peripheral device interface 703 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.
[0110] Display screen 704 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 704 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 701 for processing. In this case, display screen 704 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 704, disposed on the front panel of terminal 700; in other embodiments, there may be at least two display screens 704, disposed on different surfaces of terminal 700 or in a folded design; in other embodiments, display screen 704 may be a flexible display screen, disposed on a curved or folded surface of terminal 700. Furthermore, display screen 704 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 704 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0111] The camera assembly 705 is used to acquire images or videos. In some embodiments, the camera assembly 705 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 705 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0112] The audio circuit 706 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals which are then input to the processor 701 for processing. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 700. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert the electrical signals from the processor 701 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 706 may also include a headphone jack.
[0113] Power supply 707 is used to power the various components in terminal 700. Power supply 707 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 707 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0114] Those skilled in the art will understand that Figure 7 The structure shown does not constitute a limitation on terminal 700, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0115] Taking computer equipment as a server as an example, Figure 8 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 800 can vary significantly due to different configurations or performance. It may include one or more processors 801 (Central Processing Units, CPUs) and one or more memories 802. The one or more memories 802 store at least one computer program, which is loaded and executed by the one or more processors 801 to implement the aforementioned data decompression method. Of course, the server 800 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 800 may also include other components for implementing device functions, which will not be elaborated upon here.
[0116] Embodiments of this application also provide a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the method described above. Optionally, the computer-readable storage medium may be read-only memory (ROM), random access memory (RAM), compact-disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0117] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0118] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An image mapping method, characterized in that, include: Obtain information about the user's region of interest in the target image; The region of interest is uniformly divided into multiple first sub-regions, and based on the region of interest, the region of non-interest is non-uniformly divided into multiple second sub-regions, wherein the size of the first sub-region is no larger than the size of any second sub-region. For each first sub-region, the cumulative distribution function of pixel brightness in the first sub-region is determined based on the pixel brightness of each pixel in the first sub-region. Based on the cumulative distribution function corresponding to each first sub-region, surface fitting is performed to obtain the cumulative distribution function corresponding to each second sub-region. For each sub-region, the pixel brightness mapping relationship corresponding to the sub-region is determined according to the cumulative distribution function of the sub-region, wherein the sub-region includes the first sub-region and the second sub-region; For each pixel in the target image, a target pixel brightness mapping relationship is determined based on the sub-region where the pixel is located; and the target pixel brightness corresponding to the pixel brightness of the pixel is determined according to the target pixel brightness mapping relationship.
2. The method according to claim 1, characterized in that, Based on the user's region of interest, the non-user region of interest is non-uniformly divided into multiple second sub-regions, including: Extract texture features from the non-user-interested region; Based on the distance between the non-user interest region and the user interest region, and the texture features, the non-user interest region is non-uniformly divided into multiple second sub-regions.
3. The method according to claim 1, characterized in that, For each first sub-region, based on the pixel brightness of each pixel within the first sub-region, a cumulative distribution function of the pixel brightness of the first sub-region is determined, including: The preset pixel brightness range is divided into multiple pixel brightness levels; For each first sub-region, the number of pixels belonging to each pixel brightness level is determined based on the pixel brightness of each pixel within the first sub-region. Based on the number of pixels belonging to each pixel brightness level and the total number of pixels in the first sub-region, the probability density distribution function of the pixel brightness in the first sub-region is determined. The probability density distribution function is used to represent the correspondence between pixel brightness levels and probability density values. For each pixel brightness level, the cumulative probability value corresponding to the pixel brightness level is determined based on the probability density value corresponding to the pixel brightness level that is not higher than the pixel brightness level. Based on the cumulative probability value corresponding to each pixel brightness level, a cumulative distribution function of pixel brightness in the first sub-region is constructed. The cumulative distribution function is used to represent the correspondence between pixel brightness levels and cumulative probability values.
4. The method according to claim 3, characterized in that, Based on the cumulative distribution function corresponding to each first sub-region, surface fitting is performed to obtain the cumulative distribution function corresponding to each second sub-region, including: For each pixel brightness level, based on the cumulative probability value corresponding to the pixel brightness level in each first sub-region and the position information of each sub-region, a surface fitting is performed to obtain a global surface model corresponding to the pixel brightness level. The global surface model is used to represent the correspondence between the position information of each sub-region and the cumulative probability value corresponding to the pixel brightness level in each sub-region. Based on the global surface model, the cumulative probability value corresponding to the pixel brightness level in each second sub-region is determined. For each second sub-region, a cumulative distribution function is constructed based on the cumulative probability value corresponding to the brightness level of each pixel within the second sub-region.
5. The method according to claim 4, characterized in that, For each sub-region, the pixel brightness mapping relationship corresponding to the sub-region is determined based on the cumulative distribution function of the sub-region, including: For each sub-region, the mapped pixel brightness corresponding to the pixel brightness level in the sub-region is determined based on the cumulative probability value corresponding to the pixel brightness level in the sub-region and the pixel brightness range; Based on the mapped pixel brightness corresponding to each pixel brightness level within the sub-region, a pixel brightness mapping relationship is constructed for the sub-region.
6. The method according to claim 1, characterized in that, For each pixel in the target image, based on the sub-region where the pixel is located, a target pixel brightness mapping relationship is determined, including: For each pixel in the target image, the sub-region adjacent to the sub-region where the pixel is located is determined as the target region, and the pixel brightness mapping relationship corresponding to the target region is determined as the target pixel brightness mapping relationship.
7. The method according to claim 5, characterized in that, Based on the target pixel brightness mapping relationship, the target pixel brightness corresponding to the pixel brightness of the pixel is determined, including: Determine the target pixel brightness level to which the pixel brightness belongs; Based on the target pixel brightness mapping relationship, determine the mapped pixel brightness corresponding to the target pixel brightness level; The target pixel brightness is determined based on the mapped pixel brightness.
8. An image mapping device, characterized in that, include: The acquisition module is used to acquire information about the user's region of interest in the target image; The partitioning module is used to uniformly divide the user's region of interest into multiple first sub-regions, and based on the user's region of interest, to non-user's region of interest into multiple second sub-regions, wherein the size of the first sub-region is not greater than the size of the second sub-region. The determination module is used to determine the cumulative distribution function of pixel brightness of the first sub-region based on the pixel brightness of each pixel in the first sub-region; The fitting module is used to perform surface fitting based on the cumulative distribution function corresponding to each first sub-region to obtain the cumulative distribution function corresponding to each second sub-region; The determining module is further configured to, for each sub-region, determine the pixel brightness mapping relationship corresponding to the sub-region based on the cumulative distribution function of the sub-region, wherein the sub-region includes the first sub-region and the second sub-region; The determining module is further configured to, for each pixel in the target image, determine a target pixel brightness mapping relationship based on the sub-region where the pixel is located; and determine the target pixel brightness corresponding to the pixel brightness of the pixel according to the target pixel brightness mapping relationship.
9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one program, the at least one program being loaded by the processor and executed as the image mapping method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one program, which is loaded and executed by a processor to implement the image mapping method as described in any one of claims 1 to 7.