Image brightness alignment processing method and device and related equipment
By acquiring the brightness values of image feature pixels, calculating adjustment values, and adjusting the image brightness, the problem of inconsistent brightness after image iteration is solved, achieving fast and accurate brightness alignment and reducing the time and number of manual debugging steps.
Patent Information
- Application Number
- CN202310665266.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-06-06
AI Technical Summary
The problem of inconsistent brightness after image iteration in existing technologies leads to the need for multiple manual adjustments, which is time-consuming and results in unsatisfactory brightness alignment.
By acquiring the brightness values of multiple pixels in the target and the image to be processed, feature pixels are selected, brightness alignment adjustment values are calculated, and the brightness values of the image to be processed are adjusted accordingly, thus achieving fast and accurate brightness alignment.
It enables quick and accurate alignment of the brightness of the image to be processed with that of the target image without the need for multiple manual adjustments, resulting in more ideal brightness alignment and less time consumption.
Smart Images

Figure CN116596800B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to an image brightness alignment processing method, apparatus and related equipment. Background Technology
[0002] During the iteration process of camera images, inconsistencies in brightness may occur before and after the iteration. For example, the brightness of the image after iteration may be significantly higher than that before. The current method is for camera tuning engineers to manually adjust relevant parameters to ensure consistent brightness. However, this method relies heavily on the engineer's experience, ability, time, and luck. It may require multiple adjustments to align the brightness, and the alignment result may not be ideal. Furthermore, the brightness alignment process is often too time-consuming.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] This disclosure provides an image brightness alignment processing method, apparatus, and related equipment, which at least to some extent overcomes the technical problems in related technologies that may require multiple adjustments to align brightness, may result in unsatisfactory brightness alignment, and may take too long to align brightness.
[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0006] According to one aspect of this disclosure, an image brightness alignment processing method is provided, comprising:
[0007] Obtain the brightness values of multiple pixels in the target image;
[0008] Based on the brightness values of multiple pixels in the target image, the multiple pixels in the target image are filtered to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixels in the target image is the median of the brightness values of the multiple pixels in the target image;
[0009] Obtain the brightness values of multiple pixels in the image to be processed;
[0010] Based on the brightness values of multiple pixels in the image to be processed, the multiple pixels in the image to be processed are filtered to obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixels in the image to be processed is the median of the brightness values of the multiple pixels in the image to be processed.
[0011] Based on the brightness values of the feature pixels in the target image and the brightness values of the feature pixels in the image to be processed, an adjustment value is determined for brightness alignment processing of the image to be processed;
[0012] Based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain a brightness-aligned image.
[0013] In some embodiments, based on the brightness values of multiple pixels in a target image, multiple pixels in the target image are filtered to obtain feature pixels in the target image, including:
[0014] The brightness values of multiple pixels in the target image are sorted, and the median of the brightness values of multiple pixels in the target image is determined based on the sorting results.
[0015] The feature pixels in the target image are determined based on the median of the brightness values of multiple pixels in the target image.
[0016] In some embodiments, based on the brightness values of multiple pixels in the image to be processed, multiple pixels in the image to be processed are filtered to obtain feature pixels in the image to be processed, including:
[0017] The brightness values of multiple pixels in the image to be processed are sorted, and the median of the brightness values of multiple pixels in the image to be processed is determined based on the sorting results.
[0018] The feature pixels in the image to be processed are determined based on the median of the brightness values of multiple pixels in the image to be processed.
[0019] In some embodiments of this disclosure, determining a brightness alignment adjustment value based on feature pixels in the target image and feature pixels in the image to be processed includes:
[0020] Determine the first brightness value of the feature pixels in the target image;
[0021] Determine the second brightness value of the feature pixels in the image to be processed;
[0022] The difference between the first brightness value and the second brightness value is determined as the brightness alignment adjustment value.
[0023] Specifically, based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain a brightness-aligned image, including:
[0024] The brightness value of each pixel in the image to be processed is increased by the adjustment value to obtain a brightness-aligned image.
[0025] In some embodiments of this disclosure, the provided image brightness alignment processing method further includes, before obtaining the brightness values of multiple pixels in the target image:
[0026] Preprocessing is performed on the target image and the image to be processed.
[0027] Specifically, preprocessing is performed on the target image and the image to be processed, including:
[0028] Determine the edges of the target image and the image to be processed;
[0029] Image angle alignment is performed based on the edges of the target image and the image to be processed.
[0030] Based on the angle alignment result, the target image is cropped to obtain the preprocessed target image;
[0031] Based on the angle alignment result, the image to be processed is cropped to obtain the preprocessed image to be processed.
[0032] In some embodiments of this disclosure, determining the edges of the target image and the edges of the image to be processed includes:
[0033] Convert the target image to a first grayscale image, and convert the image to be processed to a second grayscale image;
[0034] Edge detection is performed on the first grayscale image and the second grayscale image to obtain the edges of the target image and the edges of the image to be processed.
[0035] According to another aspect of this disclosure, an image brightness alignment processing apparatus is also provided, comprising:
[0036] The first brightness value acquisition module is used to acquire the brightness values of multiple pixels in the target image;
[0037] The first feature pixel determination module is used to filter multiple pixels in the target image based on the brightness values of multiple pixels in the target image to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixel in the target image is the median of the brightness values of multiple pixels in the target image;
[0038] The second brightness value acquisition module is used to acquire the brightness values of multiple pixels in the image to be processed.
[0039] The second feature pixel determination module is used to filter multiple pixels in the image to be processed based on the brightness values of multiple pixels in the image to be processed, and obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixel in the image to be processed is the median value of the brightness values of multiple pixels in the image to be processed.
[0040] The adjustment value determination module is used to determine an adjustment value for brightness alignment processing of the image to be processed based on the brightness values of feature pixels in the target image and the brightness values of feature pixels in the image to be processed; and
[0041] The brightness adjustment module is used to adjust the brightness values of multiple pixels in the image to be processed based on the brightness alignment adjustment value, so as to obtain a brightness-aligned image.
[0042] According to another aspect of this disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the image brightness alignment processing method described in any one of the preceding claims by executing the executable instructions.
[0043] According to another aspect of this disclosure, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the image brightness alignment processing method described in any one of the preceding claims.
[0044] According to another aspect of this disclosure, a computer program product is also provided, including a computer program that, when executed by a processor, implements the image brightness alignment processing method of any one of the above.
[0045] The image brightness alignment processing method provided in the embodiments of this disclosure determines the brightness alignment adjustment value by identifying the feature pixels in the target image and the feature pixels in the image to be processed; based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain the brightness aligned image. This method can quickly and accurately align the brightness of the image to be processed with the brightness of the target image, without requiring multiple manual adjustments, resulting in a more ideal brightness alignment and less time consumption.
[0046] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0048] Figure 1 This diagram illustrates an exemplary application system architecture for the image brightness alignment processing method in this embodiment of the present disclosure.
[0049] Figure 2 This diagram illustrates a flowchart of an image brightness alignment processing method according to an embodiment of the present disclosure;
[0050] Figure 3 A flowchart illustrating the implementation process of S204 in some embodiments of this disclosure is shown.
[0051] Figure 4 A flowchart illustrating the implementation process of S208 in some embodiments of this disclosure is shown.
[0052] Figure 5 A flowchart illustrating the implementation process of S210 in some embodiments of this disclosure is shown.
[0053] Figure 6 The following is a flowchart illustrating the implementation process of image preprocessing in some embodiments of this disclosure;
[0054] Figure 7 A schematic diagram of an image brightness alignment processing apparatus according to an embodiment of the present disclosure is shown; and
[0055] Figure 8 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0056] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0057] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0058] The specific implementation methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0059] Figure 1 A schematic diagram of an exemplary application system architecture to which the image brightness alignment processing method of the embodiments of this disclosure can be applied is shown. For example... Figure 1As shown, the system architecture may include terminal device 101, network 102 and server 103.
[0060] Network 102 is a medium used to provide a communication link between terminal device 101 and server 103, and can be a wired network or a wireless network.
[0061] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPSec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0062] Terminal device 101 can be various electronic devices, including but not limited to smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, wearable devices, augmented reality devices, virtual reality devices, etc.
[0063] Optionally, the client of the application installed on different terminal devices 101 may be the same, or the client of the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client may also be different; for example, the application client may be a mobile client, a PC client, etc.
[0064] Server 103 can be a server that provides various services, such as a backend management server that supports the device operated by the user using terminal device 101. The backend management server can analyze and process received requests and other data, and feed the processing results back to the terminal device.
[0065] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0066] Those skilled in the art will know that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.
[0067] Under the above system architecture, this disclosure provides an image brightness alignment processing method, which can be executed by any electronic device with computing power.
[0068] In some embodiments, the image brightness alignment processing method provided in this disclosure can be executed by a terminal device of the system architecture described above; in other embodiments, the image brightness alignment processing method provided in this disclosure can be executed by a server in the system architecture described above; in still other embodiments, the image brightness alignment processing method provided in this disclosure can be implemented by the terminal device and the server in the system architecture described above through interaction.
[0069] Figure 2 This diagram illustrates a flowchart of an image brightness alignment processing method according to an embodiment of the present disclosure, as follows: Figure 2 As shown, it includes the following steps:
[0070] S202, Obtain the brightness values of multiple pixels in the target image;
[0071] It should be noted that the target image consists of multiple pixels, and the brightness value of each pixel is obtained. The target image is the standard image that the image is expected to become during image alignment processing; it is a pre-set reference.
[0072] S204, based on the brightness values of multiple pixels in the target image, filter the multiple pixels in the target image to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixels in the target image is the median of the brightness values of multiple pixels in the target image.
[0073] S206, Obtain the brightness values of multiple pixels in the image to be processed;
[0074] It should be noted that, as Figure 2 As shown, steps S202 and S204 combined, and steps S206 and S208 combined, can be performed simultaneously without any order. The image to be processed consists of multiple pixels, and the brightness value of each pixel is obtained. The image to be processed is the image whose brightness needs to be adjusted during image alignment processing, and the image obtained after processing is expected to have the same brightness as the target image.
[0075] S208, Based on the brightness values of multiple pixels in the image to be processed, the multiple pixels in the image to be processed are filtered to obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixels in the image to be processed is the median of the brightness values of multiple pixels in the image to be processed.
[0076] S210, determine the adjustment value for brightness alignment processing of the image to be processed based on the brightness values of the feature pixels in the target image and the brightness values of the feature pixels in the image to be processed;
[0077] S212, Based on the brightness alignment adjustment value, adjust the brightness values of multiple pixels in the image to be processed to obtain the brightness aligned image.
[0078] As can be seen from the above steps, the image brightness alignment processing method provided in this disclosure determines the brightness alignment adjustment value by identifying the feature pixels in the target image and the feature pixels in the image to be processed; based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain the brightness-aligned image. This method can quickly and accurately align the brightness of the image to be processed with the brightness of the target image, without requiring multiple manual adjustments, resulting in a more ideal brightness alignment and less time consumption.
[0079] In some embodiments of this disclosure, the implementation process of S204 is as follows: Figure 3 As shown, it includes the following steps:
[0080] S302, sort the brightness values of multiple pixels in the target image, and determine the median of the brightness values of multiple pixels in the target image based on the sorting results;
[0081] S304, Based on the median of the brightness values of multiple pixels in the target image, determine the feature pixels in the target image.
[0082] It's important to note that the median, also known as the middle value, is the middle number in a set of ordered data. It represents a value in a sample, population, or probability distribution, dividing the set of values into two equal parts. Therefore, when the number of pixels in the target image is odd, the median is one of the brightness values of the multiple pixels, and only one feature pixel is identified. When the number of pixels in the target image is even, the median is the average of the two middle brightness values among the ordered pixels. In this case, the pixel with the smallest difference between its brightness value and the median can be identified as the feature pixel; that is, the pixels corresponding to the two middle brightness values are identified as feature pixels, resulting in two feature pixels.
[0083] In some embodiments of this disclosure, the implementation process of S208 is as follows: Figure 4 As shown, it includes the following steps:
[0084] S402, sort the brightness values of multiple pixels in the image to be processed, and determine the median of the brightness values of multiple pixels in the image to be processed based on the sorting result;
[0085] S404, determine the feature pixels in the image to be processed based on the median of the brightness values of multiple pixels in the image to be processed.
[0086] It should be noted that when the number of pixels in the image to be processed is odd, the median is one of the brightness values of the multiple pixels, and only one feature pixel is determined. When the number of pixels in the image to be processed is even, the median is the average of the two middle brightness values among the sorted brightness values of the multiple pixels. In this case, the pixel with the smallest difference between its brightness value and the median can be determined as the feature pixel, that is, the pixel corresponding to the two middle brightness values is determined as the feature pixel, and two feature pixels are determined.
[0087] It should be noted that since the brightness distribution of the target image and the image to be processed are generally different, the positions of the pixels corresponding to the median brightness values of multiple pixels in the image are generally also different. For example, a feature pixel in the target image might be located above the left half of the target image, for example, with coordinates (10, 52). A feature pixel in the image to be processed might be located above the right half of the image to be processed, for example, with coordinates (60, 76) in the same coordinate system. Therefore, the relative positions of the feature pixels in the target image and the image to be processed may be different.
[0088] In some embodiments of this disclosure, the implementation process of S210 is as follows: Figure 5 As shown, it includes the following steps:
[0089] S502, determine the first brightness value of the feature pixel in the target image;
[0090] S504, Determine the second brightness value of the feature pixel in the image to be processed;
[0091] S506, The difference between the first brightness value and the second brightness value is determined as the brightness alignment adjustment value.
[0092] It should be noted that, in actual implementation, the brightness alignment adjustment value can be adjusted according to actual needs. The brightness alignment adjustment value can be obtained by appropriately increasing or decreasing the above difference, as long as the absolute value of the final brightness alignment adjustment value is less than or equal to the absolute value of the above difference.
[0093] In some other embodiments of this disclosure, when the brightness value of a feature pixel in the target image is not equal to the median brightness value of multiple pixels in the target image and / or the feature pixel in the image to be processed is not equal to the median brightness value of multiple pixels in the image to be processed, the implementation process of S210 may include: subtracting the median brightness value of multiple pixels in the target image from the median brightness value of multiple pixels in the image to be processed to obtain a difference, and determining this difference as the brightness alignment adjustment value. It should be noted that, in specific implementations, the size of the brightness alignment adjustment value can be adjusted according to actual needs. The brightness alignment adjustment value can be appropriately increased or decreased based on the above difference, as long as the absolute value of the final brightness alignment adjustment value is less than or equal to the absolute value of the above difference.
[0094] In some embodiments of this disclosure, based on the adjustment value determined in the above process, the implementation process of S212 includes: increasing the brightness value of each pixel in the multiple pixels of the image to be processed by the adjustment value to obtain a brightness-aligned image. For example, if the adjustment value is 10, then the brightness value of each pixel in the image to be processed is increased by 10 to obtain a brightness-aligned image. By increasing the brightness value of each pixel in the image to be processed by the same value, the brightness distribution in the brightness-aligned image is kept consistent with the brightness distribution of the image to be processed. That is, if most pixels in the image to be processed are too bright and only a small portion are too dark, the brightness-aligned image will still retain this characteristic, which means that the original characteristics of brightness transition, transformation, and boundary in the image to be processed are well preserved. In other words, the image contrast, saturation, and other parameters before and after the brightness alignment process are kept as stable as possible.
[0095] Furthermore, since the median represents the general level of a set of data, the aforementioned brightness alignment adjustment value can reflect the difference between the general level of pixel brightness values in the image to be processed and the general level of pixel brightness values in the target image. The brightness alignment adjustment value determined based on the median difference ensures that the brightness-aligned image is as close as possible to the target image, meaning the brightness correlation between the two is the highest. This significantly improves the accuracy of brightness alignment.
[0096] In some embodiments of this disclosure, the provided image brightness alignment processing method further includes preprocessing the target image and the image to be processed before obtaining the brightness values of multiple pixels in the target image.
[0097] Accordingly, S202 to S212 are changed as follows:
[0098] Obtain the brightness values of multiple pixels in the preprocessed target image;
[0099] Based on the brightness values of multiple pixels in the preprocessed target image, the multiple pixels in the preprocessed target image are filtered to obtain the feature pixels in the preprocessed target image; wherein, the brightness value of the feature pixels in the preprocessed target image is the median of the brightness values of multiple pixels in the preprocessed target image.
[0100] Obtain the brightness values of multiple pixels in the preprocessed image to be processed;
[0101] Based on the brightness values of multiple pixels in the preprocessed image to be processed, the multiple pixels in the preprocessed image to be processed are filtered to obtain the feature pixels in the preprocessed image to be processed; wherein, the brightness value of the feature pixels in the preprocessed image to be processed is the median of the brightness values of multiple pixels in the preprocessed image to be processed.
[0102] Based on the brightness values of the feature pixels in the preprocessed target image and the brightness values of the feature pixels in the preprocessed image to be processed, determine the adjustment value for brightness alignment processing of the preprocessed image to be processed.
[0103] Based on the brightness alignment adjustment values, the brightness values of multiple pixels in the preprocessed image to be processed are adjusted to obtain the brightness-aligned image.
[0104] Specifically, the preprocessing process for the target image and the image to be processed includes, for example... Figure 6 As shown, it includes the following steps:
[0105] S602, determine the edges of the target image and the edges of the image to be processed;
[0106] S604, performs image angle alignment based on the edges of the target image and the image to be processed;
[0107] S606, based on the angle alignment result, crop the target image to obtain the preprocessed target image;
[0108] S608, based on the angle alignment result, crops the image to be processed to obtain the preprocessed image to be processed.
[0109] When performing brightness alignment, the target image and the image to be processed are usually two images of the same subject or scene. However, in practice, it is impossible to ensure that the shooting angles of the two images are completely consistent. Therefore, in order to further improve the accuracy of the brightness alignment processing results, it is necessary to preprocess the two images to make their angles and image content as consistent as possible.
[0110] In specific implementation, the implementation process of S602 includes: converting the target image into a first grayscale image, converting the image to be processed into a second grayscale image; performing edge detection on the first grayscale image and the second grayscale image to obtain the edges of the target image and the image to be processed.
[0111] In some embodiments of this disclosure, edge detection is performed using a first grayscale image and a second grayscale image. By calculating the gradients of the first and second grayscale images, the area with the largest gradient, which represents the fastest decrease in brightness in the image, is identified as an edge. This transforms the first and second grayscale images into machine-recognizable edge maps, thereby detecting the edges of the image. In other embodiments of this disclosure, edge detection is performed using the first and second grayscale images by convolving them with the Laplacian edge operator. Based on the calculation results, edges can be automatically identified.
[0112] To better illustrate the image brightness alignment processing method provided in this embodiment of the invention, a specific example is provided for further explanation. This specific example provides two images, image A and image B, taken from the same scene but with different brightness levels.
[0113] Setting image A as the standard image means that we want image B to become the target image.
[0114] Image B is the image that needs to be modified; it is the insufficient image that needs to be changed, which is the image to be processed mentioned above.
[0115] Sort the brightness values of all pixels in image A from highest to lowest, find the median brightness value, and denote it as AB. Sort the brightness values of all pixels in image B from highest to lowest, find the median brightness value, and denote it as BB.
[0116] The calculation yields Δ1 = |A - B|, and the adjustment value for brightness alignment is determined to be Δ2, where Δ2 ≥ Δ1.
[0117] Then, perform a difference operation on the brightness values of all pixels in image B. That is, the brightness value of each pixel after processing is the brightness value of the pixel before processing plus or minus the brightness alignment adjustment value. Whether to add or subtract depends on the sign of A-B, thus obtaining image C.
[0118] The results show that image A is mostly brighter than image A, with a small portion being darker. Image C closely replicates the brightness of image A. Even in special scenes such as those with a central cutout, the brightness of the image remains as consistent as possible with image A. Furthermore, the brightness variations in image C are essentially the same as those in image B.
[0119] This demonstrates that determining the median brightness value in each image to identify its feature pixels, while the relative positions of these pixels may differ, better represents the brightness level of each image. Mapping the brightness values of the feature pixels in the image to be processed to those in the target image, and adjusting the brightness values of all pixels in the image to be processed based on this mapping, not only ensures that the processed image's brightness is aligned with the target image, maximizing the correlation between the two, but also maintains similar contrast, saturation, and other parameters as the original image, with largely consistent brightness variation characteristics.
[0120] Based on the same inventive concept, this disclosure also provides an image brightness alignment processing apparatus, as described in the following embodiments. Since the principle by which this apparatus solves the problem is similar to that of the method embodiments described above, the implementation of this apparatus embodiment can refer to the implementation of the method embodiments described above, and repeated details will not be repeated.
[0121] Figure 7 This diagram illustrates an image brightness alignment processing apparatus according to an embodiment of the present disclosure, such as... Figure 7 As shown, the device includes:
[0122] The first brightness value acquisition module 701 is used to acquire the brightness values of multiple pixels in the target image;
[0123] The first feature pixel determination module 702 is used to filter multiple pixels in the target image based on the brightness values of multiple pixels in the target image to obtain feature pixels in the target image; wherein, the brightness value of the feature pixel in the target image is the median of the brightness values of multiple pixels in the target image.
[0124] The second brightness value acquisition module 703 is used to acquire the brightness values of multiple pixels in the image to be processed;
[0125] The second feature pixel determination module 704 is used to filter multiple pixels in the image to be processed based on the brightness values of multiple pixels in the image to be processed, and obtain feature pixels in the image to be processed; wherein, the brightness value of the feature pixel in the image to be processed is the median of the brightness values of multiple pixels in the image to be processed.
[0126] The adjustment value determination module 705 is used to determine the adjustment value for brightness alignment processing of the image to be processed based on the brightness values of feature pixels in the target image and the brightness values of feature pixels in the image to be processed; and
[0127] The brightness value adjustment module 706 is used to adjust the brightness values of multiple pixels in the image to be processed based on the brightness alignment adjustment value, so as to obtain the brightness aligned image.
[0128] It should be noted that the first brightness value acquisition module 701, the first feature pixel determination module 702, the second brightness value acquisition module 703, the second feature pixel determination module 704, the adjustment value determination module 705, and the brightness value adjustment module 706 mentioned above correspond to S202 to S212 in the method embodiment. The examples and application scenarios implemented by the above modules and the corresponding steps are the same, but they are not limited to the content disclosed in the above method embodiment. It should be noted that the above modules, as part of the device, can be executed in a computer system such as a set of computer-executable instructions.
[0129] In some embodiments of this disclosure, the first feature pixel determination module 702 is specifically used to: sort the brightness values of multiple pixels in the target image, determine the median of the brightness values of multiple pixels in the target image based on the sorting result, and determine the feature pixels in the target image based on the median of the brightness values of multiple pixels in the target image.
[0130] In some embodiments of this disclosure, the second feature pixel determination module 704 is specifically used for: sorting the brightness values of multiple pixels in the image to be processed; determining the median of the brightness values of multiple pixels in the image to be processed based on the sorting result; and determining the feature pixels in the image to be processed based on the median of the brightness values of multiple pixels in the image to be processed.
[0131] In some embodiments of this disclosure, the adjustment value determination module 705 is specifically used to: determine a first brightness value of a feature pixel in a target image; determine a second brightness value of a feature pixel in an image to be processed; and determine the difference between the first brightness value and the second brightness value as the brightness alignment adjustment value.
[0132] In some embodiments of this disclosure, the brightness value adjustment module 706 is specifically used to: increase the brightness value of each pixel in a plurality of pixels of the image to be processed by an adjustment value to obtain a brightness-aligned image.
[0133] In some embodiments of this disclosure, an image brightness alignment processing apparatus is also provided. Figure 7 In addition to the above, it also includes a preprocessing module, which is used to preprocess the target image and the image to be processed.
[0134] Specifically, the preprocessing module is used to: determine the edges of the target image and the edges of the image to be processed; perform image angle alignment based on the edges of the target image and the image to be processed; crop the target image based on the angle alignment result to obtain the preprocessed target image; and crop the image to be processed based on the angle alignment result to obtain the preprocessed image to be processed.
[0135] In some embodiments of this disclosure, the preprocessing module is specifically used to: convert the target image into a first grayscale image, convert the image to be processed into a second grayscale image; perform edge detection on the first grayscale image and the second grayscale image to obtain the edges of the target image and the edges of the image to be processed.
[0136] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0137] The following reference Figure 8 To describe an electronic device 800 according to such an embodiment of the present disclosure. Figure 8 The electronic device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0138] like Figure 8 As shown, the electronic device 800 is manifested in the form of a general-purpose computing device. The components of the electronic device 800 may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including storage unit 820 and processing unit 810).
[0139] The storage unit stores program code that can be executed by the processing unit 810, causing the processing unit 810 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 810 can perform the following steps of the above method embodiments:
[0140] Obtain the brightness values of multiple pixels in the target image;
[0141] Based on the brightness values of multiple pixels in the target image, the multiple pixels in the target image are filtered to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixels in the target image is the median of the brightness values of multiple pixels in the target image;
[0142] Obtain the brightness values of multiple pixels in the image to be processed;
[0143] Based on the brightness values of multiple pixels in the image to be processed, the multiple pixels in the image to be processed are filtered to obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixels in the image to be processed is the median of the brightness values of multiple pixels in the image to be processed.
[0144] Based on the brightness values of the feature pixels in the target image and the brightness values of the feature pixels in the image to be processed, determine the adjustment value for brightness alignment processing of the image to be processed;
[0145] Based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain the brightness aligned image.
[0146] Storage unit 820 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 8201 and / or cache memory 8202, and may further include a read-only memory (ROM) 8203.
[0147] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0148] Bus 830 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0149] Electronic device 800 can also communicate with one or more external devices 840 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 800, and / or with any device that enables electronic device 800 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 850. Furthermore, electronic device 800 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 860. As shown, network adapter 860 communicates with other modules of electronic device 800 via bus 830. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0150] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0151] In particular, according to embodiments of this disclosure, the process described above with reference to the flowchart can be implemented as a computer program product, which includes a computer program that, when executed by a processor, implements the above-described image brightness alignment processing method.
[0152] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the methods described above is stored thereon. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0153] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0154] In this disclosure, a computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device.
[0155] Optionally, the program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0156] In practical implementation, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0157] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0158] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0159] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0160] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. An image brightness alignment processing method, characterized in that, include: Obtain the brightness values of multiple pixels in the target image; Based on the brightness values of multiple pixels in the target image, the multiple pixels in the target image are filtered to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixels in the target image is the median value of the brightness values of the multiple pixels in the target image after sorting. Obtain the brightness values of multiple pixels in the image to be processed; Based on the brightness values of multiple pixels in the image to be processed, the multiple pixels in the image to be processed are filtered to obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixels in the image to be processed is the median value of the brightness values of the multiple pixels in the image to be processed after sorting. Based on the brightness values of the feature pixels in the target image and the brightness values of the feature pixels in the image to be processed, an adjustment value is determined for brightness alignment processing of the image to be processed; Specifically, determining the adjustment value for brightness alignment processing of the image to be processed based on the brightness values of feature pixels in the target image and the brightness values of feature pixels in the image to be processed includes: Determine the first brightness value of the feature pixels in the target image; Determine the second brightness value of the feature pixels in the image to be processed; The difference between the first brightness value and the second brightness value is determined as the brightness alignment adjustment value; Based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain a brightness-aligned image.
2. The image brightness alignment processing method according to claim 1, characterized in that, Based on the brightness values of multiple pixels in the target image, the feature pixels in the target image are obtained by filtering the multiple pixels in the target image, including: The brightness values of multiple pixels in the target image are sorted, and the median of the brightness values of multiple pixels in the target image is determined based on the sorting results. The feature pixels in the target image are determined based on the median of the brightness values of multiple pixels in the target image.
3. The image brightness alignment processing method according to claim 1, characterized in that, Based on the brightness values of multiple pixels in the image to be processed, the feature pixels in the image to be processed are obtained by filtering the multiple pixels in the image to be processed, including: The brightness values of multiple pixels in the image to be processed are sorted, and the median of the brightness values of multiple pixels in the image to be processed is determined based on the sorting results. The feature pixels in the image to be processed are determined based on the median of the brightness values of multiple pixels in the image to be processed.
4. The image brightness alignment processing method according to claim 1, characterized in that, Based on the brightness alignment adjustment value, the brightness values of multiple pixels in the image to be processed are adjusted to obtain a brightness-aligned image, including: The brightness value of each pixel in the image to be processed is increased by the adjustment value to obtain a brightness-aligned image.
5. The image brightness alignment processing method according to claim 1, characterized in that, Before acquiring the brightness values of multiple pixels in the target image, the process also includes: Preprocessing is performed on the target image and the image to be processed.
6. The image brightness alignment processing method according to claim 5, characterized in that, Preprocessing of the target image and the image to be processed includes: Determine the edges of the target image and the image to be processed; Image angle alignment is performed based on the edges of the target image and the image to be processed. Based on the angle alignment result, the target image is cropped to obtain the preprocessed target image; Based on the angle alignment result, the image to be processed is cropped to obtain the preprocessed image to be processed.
7. The image brightness alignment processing method according to claim 6, characterized in that, Determine the edges of the target image and the image to be processed, including: Convert the target image to a first grayscale image, and convert the image to be processed to a second grayscale image; Edge detection is performed on the first grayscale image and the second grayscale image to obtain the edges of the target image and the edges of the image to be processed.
8. An image brightness alignment processing device, characterized in that, include: The first brightness value acquisition module is used to acquire the brightness values of multiple pixels in the target image; The first feature pixel determination module is used to filter multiple pixels in the target image based on the brightness values of multiple pixels in the target image to obtain the feature pixels in the target image; wherein, the brightness value of the feature pixel in the target image is the median value of the brightness values of multiple pixels in the target image after sorting. The second brightness value acquisition module is used to acquire the brightness values of multiple pixels in the image to be processed. The second feature pixel determination module is used to filter multiple pixels in the image to be processed based on the brightness values of multiple pixels in the image to be processed, and obtain the feature pixels in the image to be processed; wherein, the brightness value of the feature pixel in the image to be processed is the median value of the brightness values of multiple pixels in the image to be processed after sorting. The adjustment value determination module is used to determine an adjustment value for brightness alignment processing of the image to be processed based on the brightness values of feature pixels in the target image and the brightness values of feature pixels in the image to be processed; and A brightness value adjustment module is used to adjust the brightness values of multiple pixels in the image to be processed based on the brightness alignment adjustment value, so as to obtain a brightness-aligned image. The adjustment value determination module is configured as follows: Determine the first brightness value of the feature pixels in the target image; Determine the second brightness value of the feature pixels in the image to be processed; The difference between the first brightness value and the second brightness value is determined as the brightness alignment adjustment value.
9. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the image brightness alignment processing method according to any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image brightness alignment processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and device, computer equipment and storage medium
CN113012185A
Method for processing an input image, device, terminal equipment and associated computer program
US20200007839A1