Image processing method and device, electronic equipment and computer readable storage medium

By reducing and segmenting the image, determining the local neighborhood of edge pixels, and performing convolution and LUT adjustment, the problem of inconsistent boundaries in image enhancement is solved, improving computational efficiency and image quality.

CN121707845APending Publication Date: 2026-03-20TCL COMM TECH (CHENGDU) LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511799367.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing image enhancement techniques are inefficient due to inconsistent boundary effects and high computational resource consumption when processing in blocks.

Method used

By reducing the original image to a smaller image and dividing it into multiple sub-images, edge pixels and their local neighborhoods in the smaller and sub-images are determined. Convolution and lookup table (LUT) adjustment processes are then performed to obtain the target edge pixels.

Benefits of technology

This achieves improved consistency in boundary effects while reducing computational resource consumption and increasing processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121707845A_ABST
    Figure CN121707845A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring an original image, and shrinking the original image into a shrunk image; segmenting the original image into a plurality of block images; determining the size of a convolution kernel, and determining a plurality of edge pixel points in the plurality of block images according to the size of the convolution kernel; according to the coordinates of the edge pixel points and the size of the convolution kernel, determining a first local neighborhood of the edge pixel points in the block image and a second local neighborhood of the edge pixel points in the reduced image; performing convolution processing on the edge pixel points according to the first local neighborhood and the second local neighborhood, and performing lookup table LUT adjustment processing on the edge pixel points according to the reduced image to obtain target edge pixel points; and determining the target edge pixel points as the pixel points in the enhanced block image corresponding to the block image. According to the scheme, the problem of inconsistent boundary effects during image enhancement can be efficiently solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, specifically to an image processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Cameras and other devices strive to record the original appearance of what is being photographed as faithfully as possible. However, due to the limitations of the monitor's performance, it is impossible to fully reproduce all the information recorded at the time of image capture, resulting in blurred image details that we see. Therefore, image enhancement processing is necessary.

[0003] Image enhancement techniques typically segment an image into multiple blocks and enhance each block individually. However, this can lead to inconsistent boundary effects between blocks, resulting in segmentation lines when the image is displayed. To address this issue, some techniques process multiple adjacent blocks or all blocks together to resolve the boundary inconsistency problem; however, this approach requires significant computational resources and is inefficient. Summary of the Invention

[0004] This application provides an image processing method, apparatus, electronic device, and computer-readable storage medium that can efficiently solve the problem of inconsistent boundary effects during image enhancement.

[0005] In a first aspect, embodiments of this application provide an image processing method, including: Acquire the original image and reduce it to a smaller image; The original image is divided into multiple segmented images; the size of each segmented image is less than or equal to the size of the scaled-down image. Determine the kernel size, and based on the kernel size, determine multiple edge pixels in the multiple segmented images; Based on the coordinates of the edge pixels and the size of the convolution kernel, the first local neighborhood of the edge pixels in the block image and the second local neighborhood in the scaled-down image are determined. Based on the first local neighborhood and the second local neighborhood, the edge pixels are subjected to convolution processing, and based on the reduced image, the edge pixels are subjected to lookup table (LUT) adjustment processing to obtain the target edge pixels; The target edge pixel is determined as a pixel in the enhanced block map corresponding to the block map.

[0006] Secondly, embodiments of this application provide an image processing apparatus, including: An image acquisition module is used to acquire an original image and reduce the original image to a smaller image. A segmentation module is used to segment the original image into multiple block images; the size of each block image is less than or equal to the size of the scaled-down image. An edge determination module is used to determine the convolution kernel size and, based on the convolution kernel size, determine multiple edge pixels in multiple segmented images; The neighborhood determination module is used to determine the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image based on the coordinates of the edge pixel and the size of the convolution kernel. The processing module is configured to perform convolution processing on the edge pixels based on the first local neighborhood and the second local neighborhood, and to perform lookup table (LUT) adjustment processing on the edge pixels based on the scaled-down image to obtain the target edge pixels; The determination module is used to determine the target edge pixel as a pixel in the enhanced block map corresponding to the block map.

[0007] Thirdly, embodiments of this application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps in the image processing method described above.

[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the image processing method described above.

[0009] Fifthly, embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described in embodiments of this application.

[0010] The embodiments of this application have the following beneficial effects: When performing convolution processing on each edge pixel of each patch image, the second local neighborhood corresponding to each edge pixel can be obtained from the scaled-down image. The second local neighborhoods corresponding to adjacent edge pixels in the scaled-down image are also adjacent (or even partially overlapping). Therefore, the boundaries of each adjacent enhanced patch image obtained after convolution processing based on the second local neighborhood of each edge pixel will not have inconsistent effects. Furthermore, directly performing LUT adjustment processing on the pixels based on the scaled-down image can improve image quality while preserving the style of the scaled-down image. For each patch image, only two images, the patch image and the scaled-down image, are needed to complete the enhancement of the patch image, requiring less computational resources and being more efficient. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram of the steps of an image processing method provided in an embodiment of this application; Figure 2 This is a set of original images, reduced-size images, and block images provided in one embodiment of this application; Figure 3 This is a schematic diagram of a first local neighborhood provided in an embodiment of this application; Figure 4 This is a schematic diagram of a second local neighborhood provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0014] In one embodiment, such as Figure 1As shown, an image processing method is provided. Although the logical order of the steps is illustrated in the schematic diagram, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying drawings. Specifically, this image processing method can be applied to an electronic device, which may include a terminal or a server. The terminal may include, but is not limited to, one or more of smart TVs, smartphones, tablets, laptops, desktop computers, and in-vehicle computers. The server may be a physical server or a cloud server providing various cloud services. It is worth noting that this application does not limit the number of terminals or servers. Depending on the implementation needs, there may be any number of terminals or servers. For example, the server may be a single server or a server cluster composed of multiple servers, etc.

[0015] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.

[0016] according to Figure 1 The image processing method shown includes at least steps S110 to S160, which are described in detail below: In step S110, the original image is acquired and then reduced to a smaller image.

[0017] The original image can be any image. The original image can be reduced to a smaller image according to a preset reduction ratio. For example, if the original image is 3000×4000 pixels, and the reduction ratio is 1 / 16 (the horizontal and vertical pixels are each reduced by 1 / 4), then the smaller image will be 750×1000 pixels.

[0018] In step S120, the original image is divided into multiple block images.

[0019] The original image is divided into multiple blocks, and the size of each block can be smaller than or equal to the size of the scaled-down image.

[0020] Figure 2 This application provides a set of original images, reduced-size images, and block images according to one embodiment. Optionally, the number of block images can be determined by the reciprocal of the reduction ratio corresponding to the reduced image. For example, when the reduction ratio is 1 / 16, the original image can be divided into 16 block images.

[0021] In step S130, the convolution kernel size is determined, and based on the convolution kernel size, multiple edge pixels in the multiple block images are determined.

[0022] Image enhancement often involves convolution, typically 3×3 or 5×5. Convolution is a computational process that uses a sliding convolution kernel to perform weighted summation on local regions of the input data, extracting local features. By matching the parameters of the convolution kernel with local regions of the input data, convolution achieves feature aggregation and abstraction, and is widely used in image processing, deep learning, and other fields.

[0023] The kernel size corresponding to the convolution process can be obtained. The kernel size refers to the dimensions of the rectangular filter used to extract image features during the convolution operation, usually expressed in pixels (width x height) (e.g., 3x3, 5x5). The kernel size determines the range of input data covered in each convolution calculation, directly affecting the granularity of feature extraction and computational complexity. For each image block, the kernel size can be used to determine whether each pixel in the block is an edge pixel or a non-edge pixel.

[0024] In one embodiment, the edge distance can be determined based on the kernel size and parity. Pixels whose distance from the edge of the block image does not exceed this edge distance are identified as edge pixels. For example, if the kernel size is 5×5 (odd size), the edge distance can be determined as (5-1)÷2=2, and the pixels in the outermost two rings of the block image are edge pixels. When the kernel size is even, there is no pixel in the exact center as with odd-sized kernels. Therefore, different rules may result in different center pixels. The edge distance can be determined according to the corresponding rules, and pixels whose distance from the edge of the block image does not exceed this edge distance are identified as edge pixels.

[0025] In one embodiment, determining multiple edge pixels in multiple segmented images based on the convolution kernel size may include: when the center of the convolution kernel is located at a pixel in the segmented image, determining whether the area covered by the convolution kernel is entirely on the segmented image based on the convolution kernel size; when the area covered by the convolution kernel is not entirely on the segmented image, determining the pixel at the center of the convolution kernel as the edge pixel.

[0026] When the center of the convolution kernel is located at any pixel in the block image, the area covered by the convolution kernel is the entire area of ​​the block image, and the pixel is a non-edge pixel; if the area covered by the convolution kernel is not the entire area of ​​the block image, the pixel is an edge pixel.

[0027] like Figure 3As shown, when the convolution kernel size is 5×5, the area that the convolution kernel should cover is 25 pixels. When the center of the convolution kernel is located at the top left corner of the block image, only the bottom right 9 pixels (circled by the green rectangle) are located in the block image, and the remaining 16 pixels are not located in the block image. Therefore, the top left corner pixel is an edge pixel.

[0028] In this way, whether a pixel is an edge pixel or a non-edge pixel can be determined directly based on whether the area covered by the convolution kernel during convolution processing is entirely within the area of ​​the block image. This operation is simple, intuitive, and easy to understand.

[0029] In step S140, the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image are determined based on the coordinates of the edge pixel and the size of the convolution kernel.

[0030] For each edge pixel, its first coordinate in the corresponding block image and its second coordinate in the scaled-down image can be determined. Based on the kernel size and the first coordinate of the edge pixel in the corresponding block image, the first local neighborhood of the edge pixel in the block image can be determined. The first local neighborhood is the area covered by the kernel in the block image where the edge pixel is located, when the kernel center is located on the edge pixel. Figure 3 This is a schematic diagram of a first local neighborhood provided in an embodiment of this application; as shown Figure 3 As shown, when the convolution kernel size is 5×5, for the top left edge pixel of the block image, the image region containing the 9 pixels circled by the green rectangle in the figure can be determined as the first local neighborhood.

[0031] Based on the kernel size, the second coordinates of the edge pixel in the scaled-down image, and the region corresponding to the block image containing the edge pixel in the scaled-down image, the second local neighborhood of the edge pixel in the scaled-down image can be determined. The second local neighborhood is the difference between the region covered by the kernel in the scaled-down image and the region corresponding to the block image containing the edge pixel in the scaled-down image when the kernel center is located at the target pixel corresponding to the edge pixel in the scaled-down image. Figure 4 This is a schematic diagram of the second local neighborhood provided in an embodiment of this application. When the convolution kernel size is 5×5, for the edge pixel at the top left corner of the block image, the area outlined by the red line in the diagram is the second local neighborhood. The area corresponding to the 9 pixels at the bottom right corner of the 5×5 area covered by the convolution kernel in the reduced image overlaps with the area of ​​the block image where the edge pixel is located in the reduced image.

[0032] In step S150, the edge pixels are convolved based on the first local neighborhood and the second local neighborhood, and the edge pixels are adjusted using a lookup table (LUT) based on the zoomed-out image to obtain the target edge pixels.

[0033] One approach is to first convolve the edge pixels, then apply a look-up table (LUT) adjustment to the convolved edge pixels to obtain the target edge pixels. Alternatively, one can first apply a LUT adjustment to the edge pixels, then convolve the LUT-adjusted edge pixels to obtain the target edge pixels.

[0034] The LUT adjustment process for edge pixels based on the reduced image includes: obtaining an original lookup table; mapping the pixel values ​​of each pixel in the reduced image to multiple mapped pixel values ​​based on the original lookup table; adjusting the original lookup table to obtain a target lookup table; and mapping the pixel values ​​of edge pixels to target pixel values ​​based on the target lookup table, thereby obtaining the target edge pixels.

[0035] In step S160, the target edge pixel is determined as a pixel in the enhanced block map corresponding to the block map.

[0036] Image enhancement processing can be performed on non-edge pixels to obtain target non-edge pixels. The target edge pixels and target non-edge pixels are then identified as pixels at corresponding positions in the enhanced block map, thus obtaining the enhanced block map.

[0037] Using the technical solution of this application embodiment, when performing convolution processing on each edge pixel of each block image, the second local neighborhood corresponding to each edge pixel can be obtained from the reduced image. The second local neighborhoods corresponding to adjacent edge pixels in the reduced image are also adjacent (or even partially overlapping). Therefore, the boundaries of each adjacent enhanced block image obtained after convolution processing based on the second local neighborhood of each edge pixel will not have inconsistent effects. Furthermore, directly performing lookup table (LUT) adjustment processing on the pixels based on the reduced image can improve image quality while preserving the style of the reduced image. For each block image, only two images, the block image and the reduced image, are needed to complete the enhancement of the block image, requiring less computational resources and being more efficient.

[0038] Based on the above technical solution, as an embodiment, determining the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image according to the coordinates of the edge pixel and the size of the convolution kernel may include: when the center of the convolution kernel is located on the edge pixel, determining the area covered by the convolution kernel on the block image where the edge pixel is located as the first local neighborhood; determining the coordinates of the edge pixel in the scaled-down image; when the center of the convolution kernel is located on the target pixel corresponding to the edge pixel in the scaled-down image, determining the first area covered by the convolution kernel on the scaled-down image; based on the second area corresponding to the block image where the edge pixel is located in the scaled-down image; and determining the difference between the first area and the second area as the second local neighborhood.

[0039] The coordinates of an edge pixel can include the first coordinate of the edge pixel in the corresponding block image and the second coordinate of the edge pixel in the scaled-down image; for each edge pixel, the first coordinate of the edge pixel in the corresponding block image and the second coordinate of the edge pixel in the scaled-down image can be determined.

[0040] Based on the kernel size and the first coordinates of the edge pixel in the corresponding block map, the first local neighborhood of the edge pixel in the block map can be determined. The first local neighborhood is the area covered by the kernel in the block map where the edge pixel is located, when the kernel center is located at the edge pixel. For example... Figure 3 As shown, when the convolution kernel size is 5×5, for the top left edge pixel of the block image, the image region containing the 9 pixels circled by the green rectangle in the figure can be determined as the first local neighborhood.

[0041] Based on the kernel size, the second coordinates of the edge pixel in the scaled-down image, and the region corresponding to the block image containing the edge pixel in the scaled-down image, the second local neighborhood of the edge pixel in the scaled-down image can be determined. The second local neighborhood is the difference between the region covered by the kernel in the scaled-down image and the region corresponding to the block image containing the edge pixel in the scaled-down image when the kernel center is located at the target pixel corresponding to the edge pixel in the scaled-down image. For example... Figure 4 As shown, when the convolution kernel size is 5×5, for the top left edge pixel of the block image, the area outlined in red in the figure is the second local neighborhood; the area corresponding to the bottom right 9 pixels in the 5×5 area covered by the convolution kernel in the reduced image overlaps with the area of ​​the block image where the edge pixel is located in the reduced image; therefore, the second local neighborhood can be obtained by taking the difference between the area covered by the convolution kernel in the reduced image and the area of ​​the block image in the reduced image.

[0042] For example, when the kernel size is 3×3, for the bottom right edge pixel of the block image, the kernel coverage area includes 9 pixels. Among them, the top left 4 pixels should be in the block image, and the other 5 pixels should be in the scaled-down image. The area of ​​the block image in which the 4 pixels in the block image are located is the first local neighborhood, and the area of ​​the block image in which the 5 pixels in the scaled-down image are located is the second local neighborhood.

[0043] By adopting the technical solution of the embodiments of this application, for each block image, only the image and the block image need to be reduced to obtain the first local neighborhood and the second local neighborhood, thereby realizing the convolution processing of the block image, which can reduce the amount of computation, improve the computational efficiency, and ensure that the boundary effect of each adjacent enhanced block image is consistent.

[0044] Based on the above technical solution, as an embodiment, the method may further include: determining pixels other than the edge pixels on the block image as non-edge pixels; determining the local neighborhood of the non-edge pixels from the block image where the non-edge pixels are located; performing the convolution process on the non-edge pixels based on the local neighborhood of the non-edge pixels, and performing the LUT adjustment process on the non-edge pixels based on the scaled-down image to obtain target non-edge pixels; and determining the target non-edge pixels as pixels in the enhanced block image corresponding to the block image.

[0045] When the center of the convolution kernel is located at any pixel in the block image, the entire area covered by the kernel is the area of ​​that block image, and therefore that pixel is a non-edge pixel. Alternatively, after determining the edge pixels in each block image, the remaining pixels in that block image can be determined as non-edge pixels.

[0046] The local neighborhood of each non-edge pixel can be directly obtained from the block map containing the non-edge pixels. The local neighborhood of a non-edge pixel refers to the area covered by the convolution kernel when the center of the convolution kernel is located at that non-edge pixel.

[0047] The target non-edge pixels can be obtained by first convolving the non-edge pixels based on their local neighborhoods, and then applying a Local Unified Layer Transform (LUT) to the convolved non-edge pixels. Alternatively, the non-edge pixels can be LUT-adjusted first, and then convolved with the LUT-adjusted non-edge pixels. The target edge pixels can be the pixels at the corresponding positions in the enhanced block image of the block image.

[0048] The LUT adjustment process for non-edge pixels, based on the reduced image, includes: obtaining an original lookup table; mapping the pixel values ​​of each pixel in the reduced image to multiple mapped pixel values ​​using the original lookup table; adjusting the original lookup table to obtain a target lookup table; and mapping the pixel values ​​of non-edge pixels to target pixel values ​​based on the target lookup table, thereby obtaining the target non-edge pixels. It can be understood that when performing LUT adjustment on multiple pixels (including non-edge and edge pixels), the target lookup table can be calculated only once. After calculating the target lookup table, when performing LUT adjustment on each pixel, the calculated target lookup table can be directly used to map the pixel values.

[0049] Adjusting the original lookup table to obtain the target lookup table can include: statistically analyzing the original distribution of multiple mapped pixel values; determining the target distribution, which can be a uniform distribution; and adjusting the original lookup table based on the difference between the original and target distributions to obtain the target lookup table. This adjustment can be based on histogram equalization or piecewise linear adjustment methods.

[0050] By employing the technical solution of this application embodiment, image enhancement processing can be performed on non-edge pixels to obtain pixels at corresponding positions in the enhanced block image. Combined with image enhancement processing performed on edge pixels, overall image enhancement of the block image can be achieved.

[0051] Based on the above technical solution, as an embodiment, the method may further include: generating an enhanced segmented image corresponding to the segmented image based on the target edge pixels and the target non-edge pixels corresponding to each segmented image.

[0052] By modifying edge pixels in the segmented image to target edge pixels, and non-edge pixels in the segmented image to target non-edge pixels, the overall image of the segmented image can be enhanced, resulting in an enhanced segmented image. When users zoom in on the enhanced segmented image, it will still appear visually clear.

[0053] In one embodiment, the image processing method may be executed when the user zooms in on the original image, and one or more block images corresponding to the image region of the original image currently displayed on the screen when the original image is zoomed in are determined, and then image enhancement processing is preferentially performed on the one or more block images to convert the one or more block images into enhanced block images.

[0054] By employing the technical solution of this application embodiment, image enhancement processing can be performed on non-edge pixels and edge pixels respectively, thereby achieving overall image enhancement of the segmented image to meet user needs and bring users a good visual experience.

[0055] Based on the above technical solution, as an embodiment, the step of performing convolution processing on the edge pixels according to the first local neighborhood and the second local neighborhood, and performing lookup table (LUT) adjustment processing on the edge pixels according to the scaled-down image to obtain target edge pixels may include: performing convolution processing on the edge pixels according to the first local neighborhood and the second local neighborhood to obtain intermediate pixels; obtaining an original lookup table; mapping the pixel values ​​of each pixel in the scaled-down image according to the original lookup table to obtain multiple mapped pixel values; adjusting the original lookup table to obtain a target lookup table; and adjusting the pixel values ​​of the intermediate pixels based on the target lookup table to obtain the target edge pixels.

[0056] A Link-Use Table (LUT) is a commonly used mapping table for quickly converting input values ​​into output values. It is widely used in image processing, color correction, signal conversion, and other fields. In image processing, a LUT is often defined as an array (or list), where the index represents the input pixel value (such as a grayscale value or RGB component value between 0 and 255), and the array element represents the corresponding output pixel value. LUTs enable fast mapping of pixel values, avoiding the overhead of real-time computation.

[0057] In this embodiment, the edge pixels can be convolved first, and then the convolved edge pixels can be adjusted using a LUT to obtain the target edge pixels. Alternatively, the edge pixels can be convolved based on the first local neighborhood and the second local neighborhood to obtain the intermediate pixels.

[0058] Obtain the original lookup table; map the pixel values ​​of each pixel in the reduced image according to the original lookup table to obtain multiple mapped pixel values. Statistically analyze the original distribution of these mapped pixel values; determine the target distribution, which can be a uniform distribution. Adjust the original lookup table based on the difference between the original and target distributions to obtain the target lookup table. This adjustment can be based on histogram equalization or piecewise linear adjustment methods. Remap the pixel values ​​of intermediate pixels using the target lookup table to obtain the target pixel values, which are then defined as the pixel values ​​of the target non-edge pixels.

[0059] Using the technical solution of this application embodiment, convolution processing can prioritize processing the low-level features of the image, and then perform LUT adjustment processing to achieve efficient pixel-level mapping while preserving the convolution result. LUT adjustment processing is a pixel-by-pixel non-linear mapping. Performing LUT adjustment processing after convolution processing can accurately enhance the features after convolution and avoid the destruction of LUT non-linear features by convolution processing. For example, if the non-linear mapping of LUT (such as piecewise curves) is applied before convolution, the linear weighting of convolution will "blur" the contrast or color features created by LUT.

[0060] Based on the above technical solution, as an embodiment, the step of performing convolution processing on the edge pixels according to the first local neighborhood and the second local neighborhood, and performing lookup table (LUT) adjustment processing on the edge pixels according to the scaled-down image to obtain target edge pixels may include: obtaining an original lookup table; mapping the pixel values ​​of each pixel in the scaled-down image according to the original lookup table to obtain multiple mapped pixel values; adjusting the original lookup table to obtain a target lookup table; adjusting the pixel values ​​of pixels in the first local neighborhood and the second local neighborhood based on the target lookup table to obtain a target local neighborhood; and performing convolution processing on the edge pixels according to the target local neighborhood to obtain the target edge pixels.

[0061] In this embodiment, the edge pixels can be first subjected to LUT adjustment processing, and then the LUT-adjusted edge pixels can be convolved to obtain the target edge pixels. The LUT adjustment processing of the edge pixels includes: obtaining an original lookup table; mapping the pixel values ​​of each pixel in the reduced image according to the original lookup table to obtain multiple mapped pixel values; statistically analyzing the original distribution of the multiple mapped pixel values; determining the target distribution, which can be a uniform distribution; adjusting the original lookup table according to the difference between the original distribution and the target distribution to obtain a target lookup table; wherein, the original lookup table can be adjusted based on a histogram equalization method or a piecewise linear adjustment method to obtain the target lookup table; and remapping the pixel values ​​of each pixel (including pixels in the first and second local neighborhoods of the edge pixels) based on the target lookup table to obtain the target pixel values ​​of each pixel.

[0062] After mapping the pixel values ​​of pixels in the first and second local neighborhoods to their corresponding target pixel values ​​based on the target lookup table, the mapped first and second local neighborhoods can be obtained. The sum of the mapped first and second local neighborhoods is determined as the target local neighborhood. Based on the target local neighborhood, convolution processing is performed on the edge pixels to obtain the target edge pixels.

[0063] Using the technical solution of this application embodiment, LUT adjustment processing can prioritize the enhancement of image features, thereby improving convolution efficiency and accuracy. The core of LUT adjustment processing is to perform non-linear mapping on pixel values ​​(such as enhancing contrast or strengthening specific brightness ranges). By first applying LUT adjustment processing, key features can be "amplified," allowing subsequent convolution operations to more accurately target the target area. Convolution processing (especially linear convolution) is highly sensitive to the distribution of input pixel values. Applying LUT adjustment processing first can optimize the input distribution of convolution processing and avoid convolution "failure." For example, if the original image has a large number of low-contrast areas (such as a foggy image), direct convolution may not effectively enhance details due to the small difference in pixel values. Applying LUT adjustment processing first to stretch contrast (expand the range of pixel values) before convolution can significantly improve the sharpening effect.

[0064] To facilitate better implementation of the image processing method of this application, this application also provides an image processing apparatus based on the above-described image processing method. The meanings of the terms used are the same as in the image processing method described above, and specific implementation details can be found in the descriptions of the method embodiments.

[0065] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application, wherein the image processing apparatus includes: Image acquisition module 501 is used to acquire an original image and reduce the original image to a smaller image; The segmentation module 502 is used to segment the original image into multiple block images; the size of the block image is less than or equal to the size of the reduced image. Edge determination module 503 is used to determine the convolution kernel size and, based on the convolution kernel size, determine multiple edge pixels in multiple segmented images; The neighborhood determination module 504 is used to determine the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image based on the coordinates of the edge pixel and the size of the convolution kernel. The processing module 505 is used to perform convolution processing on the edge pixels based on the first local neighborhood and the second local neighborhood, and to perform lookup table (LUT) adjustment processing on the edge pixels based on the scaled-down image to obtain the target edge pixels. The determining module 506 is used to determine the target edge pixel as a pixel in the enhanced block map corresponding to the block map.

[0066] In one embodiment, the neighborhood determination module 504 is specifically used to perform: When the center of the convolution kernel is located on the edge pixel, the area covered by the convolution kernel on the block map where the edge pixel is located is determined as the first local neighborhood; Determine the coordinates of the edge pixels in the scaled-down image; When the center of the convolution kernel is located on the target pixel corresponding to the edge pixel in the scaled-down image, a first region covered by the convolution kernel in the scaled-down image is determined. According to the second region in the reduced image where the edge pixel is located in the block image; The difference between the first region and the second region is determined as the second local neighborhood.

[0067] In one embodiment, the edge determination module 503 is specifically used to perform: When the center of the convolution kernel is located at a pixel in the segmented image, determine whether the area covered by the convolution kernel is entirely the area on the segmented image based on the size of the convolution kernel; When the area covered by the convolution kernel is not entirely the area on the segmented map, the pixel point where the center of the convolution kernel is located is determined as the edge pixel point.

[0068] In one embodiment, the device further includes: The non-edge determination module is used to determine the pixels on the block image other than the edge pixels as non-edge pixels; The non-edge neighborhood determination module is used to determine the local neighborhood of the non-edge pixel from the block map where the non-edge pixel is located; The non-edge enhancement module is used to perform the convolution process on the non-edge pixels based on the local neighborhood of the non-edge pixels, and to perform the LUT adjustment process on the non-edge pixels based on the scaled-down image to obtain the target non-edge pixels; The target non-edge pixel determination module is used to determine the target non-edge pixel as a pixel in the enhanced block map corresponding to the block map.

[0069] In one embodiment, the device further includes: An enhanced segmented image generation module is used to generate an enhanced segmented image corresponding to the segmented image based on the target edge pixels and the target non-edge pixels corresponding to each segmented image.

[0070] In one embodiment, the processing module 505 is specifically used to perform: Based on the first local neighborhood and the second local neighborhood, the edge pixels are convolved to obtain the middle pixels; Retrieve the original lookup table; The pixel values ​​of each pixel in the reduced image are mapped according to the original lookup table to obtain multiple mapped pixel values; The original lookup table is adjusted to obtain the target lookup table; The pixel values ​​of the intermediate pixels are adjusted based on the target lookup table to obtain the target edge pixels.

[0071] In one embodiment, the processing module 505 is specifically used to perform: Retrieve the original lookup table; The pixel values ​​of each pixel in the reduced image are mapped according to the original lookup table to obtain multiple mapped pixel values; The original lookup table is adjusted to obtain the target lookup table; Based on the target lookup table, the pixel values ​​of the pixels in the first local neighborhood and the second local neighborhood are adjusted to obtain the target local neighborhood; Based on the target local neighborhood, the edge pixels are convolved to obtain the target edge pixels.

[0072] Using the technical solution of this application embodiment, when performing convolution processing on each edge pixel of each block image, the second local neighborhood corresponding to each edge pixel can be obtained from the reduced image. The second local neighborhoods corresponding to adjacent edge pixels in the reduced image are also adjacent (or even partially overlapping). Therefore, the boundaries of each adjacent enhanced block image obtained after convolution processing based on the second local neighborhood of each edge pixel will not have inconsistent effects. Furthermore, directly performing lookup table (LUT) adjustment processing on the pixels based on the reduced image can improve image quality while preserving the style of the reduced image. For each block image, only two images, the block image and the reduced image, are needed to complete the enhancement of the block image, requiring less computational resources and being more efficient.

[0073] For specific limitations regarding the image processing apparatus, please refer to the limitations on the image processing method above, which will not be repeated here. Each module in the aforementioned image processing apparatus can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the computer device, or stored in software in the memory of the computer device, so that the processor can call and execute the operations corresponding to each module.

[0074] In addition, this application also provides an electronic device, such as Figure 6 As shown, it illustrates the structural diagram of the electronic device involved in this application, specifically: The electronic device may include components such as a processor 601 with one or more processing cores and a memory 602 with one or more computer-readable storage media. Those skilled in the art will understand that... Figure 6 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, thereby providing overall monitoring of the electronic device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.

[0075] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0076] In one embodiment, the electronic device further includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power equipment debugging circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0077] In one embodiment, the electronic device may further include an input unit 604, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0078] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602, thereby implementing the steps in any of the image processing methods provided in the embodiments of this application.

[0079] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0080] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described in any embodiment of this application.

[0081] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in any embodiment of this application.

[0082] In some embodiments, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the methods described in any embodiment of this application.

[0083] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0084] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0085] Therefore, this application provides a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the image processing methods provided in this application.

[0086] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0087] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0088] Since the instructions stored in the computer-readable storage medium can execute the steps of any of the image processing methods provided in this application, the beneficial effects that any of the image processing methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0089] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0090] The foregoing has provided a detailed description of an image processing method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An image processing method, characterized in that, include: Acquire the original image and reduce it to a smaller image; The original image is divided into multiple segmented images; the size of each segmented image is less than or equal to the size of the scaled-down image. Determine the kernel size, and based on the kernel size, determine multiple edge pixels in the multiple segmented images; Based on the coordinates of the edge pixels and the size of the convolution kernel, the first local neighborhood of the edge pixels in the block image and the second local neighborhood in the scaled-down image are determined. Based on the first local neighborhood and the second local neighborhood, the edge pixels are subjected to convolution processing, and based on the reduced image, the edge pixels are subjected to lookup table (LUT) adjustment processing to obtain the target edge pixels; The target edge pixel is determined as a pixel in the enhanced block map corresponding to the block map.

2. The method according to claim 1, characterized in that, The step of determining the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image based on the coordinates of the edge pixel and the size of the convolution kernel includes: When the center of the convolution kernel is located on the edge pixel, the area covered by the convolution kernel on the block map where the edge pixel is located is determined as the first local neighborhood; Determine the coordinates of the edge pixels in the scaled-down image; When the center of the convolution kernel is located on the target pixel corresponding to the edge pixel in the scaled-down image, a first region covered by the convolution kernel in the scaled-down image is determined. According to the second region in the reduced image where the edge pixel is located in the block image; The difference between the first region and the second region is determined as the second local neighborhood.

3. The method according to claim 1, characterized in that, The step of determining multiple edge pixels in the multiple segmented images based on the convolution kernel size includes: When the center of the convolution kernel is located at a pixel in the segmented image, determine whether the area covered by the convolution kernel is entirely the area on the segmented image based on the size of the convolution kernel; When the area covered by the convolution kernel is not entirely the area on the segmented map, the pixel point where the center of the convolution kernel is located is determined as the edge pixel point.

4. The method according to claim 1, characterized in that, The method further includes: Pixels on the block image other than the edge pixels are defined as non-edge pixels; Determine the local neighborhood of the non-edge pixel from the block map where the non-edge pixel is located; Based on the local neighborhood of the non-edge pixel, the convolution process is performed on the non-edge pixel, and based on the scaled-down image, the LUT adjustment process is performed on the non-edge pixel to obtain the target non-edge pixel. The target non-edge pixel is determined as a pixel in the enhanced block map corresponding to the block map.

5. The method according to claim 4, characterized in that, The method further includes: An enhanced segmented image is generated based on the target edge pixels and target non-edge pixels corresponding to each segmented image.

6. The method according to claim 1, characterized in that, The step of performing convolution processing on the edge pixels based on the first local neighborhood and the second local neighborhood, and performing lookup table (LUT) adjustment processing on the edge pixels based on the scaled-down image to obtain the target edge pixels includes: Based on the first local neighborhood and the second local neighborhood, the edge pixels are convolved to obtain the middle pixels; Retrieve the original lookup table; The pixel values ​​of each pixel in the reduced image are mapped according to the original lookup table to obtain multiple mapped pixel values; The original lookup table is adjusted to obtain the target lookup table; The pixel values ​​of the intermediate pixels are adjusted based on the target lookup table to obtain the target edge pixels.

7. The method according to claim 1, characterized in that, The step of performing convolution processing on the edge pixels based on the first local neighborhood and the second local neighborhood, and performing lookup table (LUT) adjustment processing on the edge pixels based on the scaled-down image to obtain the target edge pixels includes: Retrieve the original lookup table; The pixel values ​​of each pixel in the reduced image are mapped according to the original lookup table to obtain multiple mapped pixel values; The original lookup table is adjusted to obtain the target lookup table; Based on the target lookup table, the pixel values ​​of the pixels in the first local neighborhood and the second local neighborhood are adjusted to obtain the target local neighborhood; Based on the target local neighborhood, the edge pixels are convolved to obtain the target edge pixels.

8. An image processing apparatus, characterized in that, include: An image acquisition module is used to acquire an original image and reduce the original image to a smaller image. A segmentation module is used to segment the original image into multiple block images; the size of each block image is less than or equal to the size of the scaled-down image. An edge determination module is used to determine the convolution kernel size and, based on the convolution kernel size, determine multiple edge pixels in multiple segmented images; The neighborhood determination module is used to determine the first local neighborhood of the edge pixel in the block image and the second local neighborhood in the scaled-down image based on the coordinates of the edge pixel and the size of the convolution kernel. The processing module is configured to perform convolution processing on the edge pixels based on the first local neighborhood and the second local neighborhood, and to perform lookup table (LUT) adjustment processing on the edge pixels based on the scaled-down image to obtain the target edge pixels; The determination module is used to determine the target edge pixel as a pixel in the enhanced block map corresponding to the block map.

9. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the image processing 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 a computer program that, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and computer readable storage medium

    CN114913084A

  • Image edge filling method and device

    CN114913193A

  • Image enhancement method, device and equipment and computer readable storage medium

    CN115880161A

  • Optimized transmission method for images acquired by unmanned aerial vehicle

    CN117952840A

  • Image generation method and device, nonvolatile storage medium and computer equipment

    CN120355835A