Image processing method and device, and electronic equipment
By determining the region and feature point mapping relationship of viscera image and adjusting the pixel value, high-precision compensation of viscera images is achieved, which solves the problem of low viscera compensation accuracy and improves image quality.
Patent Information
- Application Number
- CN202411337449.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-17
AI Technical Summary
When shooting chessboard images, the aperture is smaller than the sensing chip and the four corners of the image are darker, resulting in high-precision compensation or low compensation accuracy in the viscera area, and it is impossible to effectively process through technologies such as automatic white balance and lens shadow correction.
By acquiring a viscera image, the first area and the second area are determined, the pixel point position and mapping relationship are determined according to the pixel value of the at least one feature point, the pixel value in the second area is adjusted, and the pixel smoothing process is performed on the boundary point of the first area. , to achieve high-precision compensation.
It can perform high-precision compensation for dark areas of viscera images, improve image quality, and solve the problem of low viscera compensation accuracy.
Smart Images

Figure CN119323528A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular, to an image processing method, device, and electronic device. Background Art
[0002] When shooting a chessboard char (character variable) image, the shooting aperture is smaller than the sensor chip, and the four corners of the image are darker. At this time, the dark areas in the four corners of the image cannot be compensated or the compensation accuracy is low, and the awb (Auto White Balance) and lsc (Lens shading correction) dirty spot tests cannot be passed.
[0003] Based on this, those skilled in the art are in urgent need of an image processing method so as to perform high-precision compensation for dark areas of vignetting images. Summary of the invention
[0004] The embodiments of the present application provide an image processing method, an apparatus, and an electronic device, which can perform high-precision compensation for dark areas of dark-angle images at least to a certain extent.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of an embodiment of the present application, a method for processing an image is provided, the method comprising: acquiring a dark-corner image, determining a first area and a second area of the dark-corner image, the image brightness of the first area being greater than that of the second area; determining a mapping relationship between pixel positions and corresponding pixel values within the first area based on the pixel values of at least one feature point in the dark-corner image; adjusting corresponding pixel values of each pixel within the second area based on the mapping relationship and the pixel positions within the second area, and then performing pixel smoothing processing on boundary pixels of the first area.
[0007] In some embodiments of the present application, the acquiring of the dark corner image includes: acquiring an original image to be processed, and sequentially performing binarization processing and image corrosion processing on the original image to generate a dark corner image.
[0008] In some embodiments of the present application, determining the first area and the second area of the dark-angle image includes: scanning the dark-angle image to determine the optical center of the dark-angle image; determining an area with the optical center as the center and a preset card control distance as the radius as the first area, and determining the remaining area of the dark-angle image except the first area as the second area.
[0009] In some embodiments of the present application, based on the aforementioned scheme, determining the mapping relationship between pixel positions and corresponding pixel values within the first area according to the pixel value of at least one feature point in the dark corner image includes: determining the initial mapping relationship between pixel positions and corresponding pixel values within the first area according to the pixel value of at least one feature point in the first area; obtaining pixel values corresponding to boundary pixels of the first area, and adjusting the initial mapping relationship to determine the mapping relationship between pixel positions and corresponding pixel values within the first area.
[0010] In some embodiments of the present application, based on the aforementioned scheme, determining the initial mapping relationship between the pixel point position and the corresponding pixel value in the first area according to the pixel value of at least one feature point in the first area includes: obtaining the normalized distance between at least one feature point in the first area and the optical center, and the normalized distance can be used to characterize the position of the pixel point in the dark corner image; performing polynomial fitting according to the normalized distance and pixel value corresponding to each feature point to determine the initial mapping relationship between the pixel point position and the corresponding pixel value in the first area.
[0011] In some embodiments of the present application, based on the aforementioned scheme, obtaining pixel values corresponding to the boundary pixel points of the first area and adjusting the initial mapping relationship include: obtaining pixel values and normalized distances corresponding to the boundary pixel points of the first area; and re-determining at least one polynomial coefficient based on the pixel values and normalized distances corresponding to the boundary pixel points of the first area to adjust the initial mapping relationship.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the corresponding pixel values of each pixel point in the second area are adjusted based on the mapping relationship and the pixel point positions in the second area, including: based on the pixel point positions in the second area, determining the target pixel values corresponding to each pixel point in the second area according to the mapping relationship, and adjusting the pixel values of each pixel point in the second area to the target pixel values.
[0013] In some embodiments of the present application, the pixel smoothing processing of the boundary pixels of the first area includes: obtaining an image copy of the dark corner image and blurring the image copy; based on the pixel values of the pixels in the image copy, correspondingly replacing the pixel values of the boundary pixels of the first area to complete the smoothing processing.
[0014] According to one aspect of an embodiment of the present application, an image processing device is provided, the device comprising: an acquisition unit, used to acquire a dark-angle image, determine a first area and a second area of the dark-angle image, the image brightness of the first area being greater than that of the second area; a determination unit, used to determine a mapping relationship between pixel positions and corresponding pixel values within the first area based on the pixel values of at least one feature point in the dark-angle image; an adjustment unit, used to adjust the corresponding pixel values of each pixel within the second area based on the mapping relationship and the pixel positions within the second area, and then perform pixel smoothing processing on the boundary pixels of the first area.
[0015] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the image processing method as described.
[0016] Based on the above scheme, this application has at least the following advantages or improvements:
[0017] In the technical solutions provided in some embodiments of the present application, a dark-corner image can be first acquired, and then a first area and a second area of the dark-corner image can be determined, and then the mapping relationship between the pixel position and the corresponding pixel value in the first area can be determined; based on the mapping relationship and the pixel position in the second area, the corresponding pixel value of each pixel in the second area is adjusted, and then pixel smoothing is performed on the boundary pixels of the first area. The present application can determine the mapping relationship between the pixel position and the corresponding pixel value in the first area by analyzing the pixel value characteristics in different areas of the dark-corner image, and then extend the mapping relationship to the remaining areas, so as to adjust the pixel value of the dark area, and can perform high-precision compensation for the dark area of the dark-corner image.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] In the attached picture:
[0022] Figure 1 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0023] Figure 2 shows a dark corner image according to an embodiment of the present application;
[0024] Figure 3 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0025] Figure 4 shows a dark corner image according to an embodiment of the present application;
[0026] Figure 5 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0027] Figure 6 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0028] Figure 7 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0029] Figure 8 A flowchart of an image processing method according to an embodiment of the present application is shown;
[0030] Fig. 9 shows a dark corner image according to an embodiment of the present application;
[0031] Fig.10 A simplified structural diagram of an image processing device according to an embodiment of the present application is shown;
[0032] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0037] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0038] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0039] See also Figure 1 .
[0040] Figure 1 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 1 As shown, the method may include steps S101-S103:
[0041] Step S101, acquiring a dark corner image, determining a first area and a second area of the dark corner image, wherein the image brightness of the first area is greater than that of the second area.
[0042] Step S102: determining a mapping relationship between pixel positions and corresponding pixel values in the first area according to the pixel value of at least one feature point in the dark corner image.
[0043] Step S103: Based on the mapping relationship and the positions of the pixels in the second area, the corresponding pixel values of the pixels in the second area are adjusted, and then pixel smoothing processing is performed on the boundary pixels of the first area.
[0044] In the present application, a dark-corner image can be acquired first, and then a first area and a second area of the dark-corner image can be determined, and then the mapping relationship between the pixel position and the corresponding pixel value in the first area can be determined; based on the mapping relationship and the pixel position in the second area, the corresponding pixel value of each pixel in the second area is adjusted, and then pixel smoothing is performed on the boundary pixels of the first area. The present application can determine the mapping relationship between the pixel position and the corresponding pixel value in the first area by analyzing the pixel value characteristics in different areas of the dark-corner image, and then extend the mapping relationship to the remaining areas, so as to adjust the pixel value of the dark area, and can perform high-precision compensation for the dark area of the dark-corner image.
[0045] In the present application, the method for acquiring a dark-corner image may include: acquiring an original image to be processed, and sequentially performing binarization processing and image corrosion processing on the original image to generate a dark-corner image.
[0046] In the present application, the original image can be firstly binarized. In digital image processing, binarization occupies a very important position. The binarization of the image can greatly reduce the amount of data in the original image, thereby highlighting the outline of the target. The binarization of the image is to set the gray value of the points on the image to 0 or 255, that is, to present the entire image with an obvious black and white effect. That is, the gray image of 256 brightness levels is selected through an appropriate threshold to obtain a binary image that can still reflect the overall and local features of the image. All pixels in the original image whose grayscale is greater than or equal to the threshold can be judged as belonging to a specific object, and the grayscale value is 255, otherwise these pixels are excluded from the object area, and the grayscale value is 0, indicating the background or exceptional object area.
[0047] In the present application, after the binarization processing, the original image can be subjected to image corrosion processing. The image corrosion processing can be performed on the original image using a convolution template. The template B is convolved with the original image to obtain the minimum value of the pixel points in the area covered by B, and this minimum value is used to replace the pixel value of the reference point. After the image corrosion processing, the highlight part of the original image is reduced, but the general outline is not changed.
[0048] For example, see Figure 2 , Figure 2 FIG. 4 shows a dark corner image according to an embodiment of the present application. Figure 2As shown in the figure, it is obvious that there are obvious black vignetting around the aperture, which cannot pass the awb and lsc dirty point tests. Therefore, it is necessary to compensate the black part outside the aperture to the point where the awb and lsc dirty point tests can be tested normally. In the compensation process, the dirty spots and dirt in the non-black vignetting area of the original image need to be retained and cannot be compensated. Therefore, it is necessary to compensate only the black vignetting.
[0049] See also Figure 3 .
[0050] Figure 3 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 3 As shown, the method for determining the first area and the second area of the dark corner image may include steps S301-S302:
[0051] Step S301, scanning the dark corner image to determine the optical center of the dark corner image.
[0052] Step S302: determine an area with the optical center as the center and the preset control distance as the radius as the first area, and determine the remaining area of the dark corner image except the first area as the second area.
[0053] In this application, only black vignetting needs to be compensated, so the vignetting image needs to be partitioned to determine the black vignetting area that needs to be compensated. Therefore, the area with the optical center of the vignetting image as the center and the preset card control distance as the radius can be determined as the first area, and the first area does not need to be compensated, and the remaining area is determined as the second area, and the second area needs to be compensated. For example, refer to Figure 4 , Figure 4 A dark corner image according to an embodiment of the present application is shown, wherein, after drawing a circle according to a preset card control distance, area A can be confirmed as the first area, and areas 1-4 can be confirmed as the second area, which need to be compensated.
[0054] See also Figure 5 .
[0055] Figure 5 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 5 As shown, the method for determining the mapping relationship between the pixel point position and the corresponding pixel value in the first area according to the pixel value of at least one feature point in the dark corner image may include steps S501-S502:
[0056] Step S501: determining an initial mapping relationship between pixel point positions and corresponding pixel values in the first area according to the pixel value of at least one feature point in the first area.
[0057] Step S502: acquiring pixel values corresponding to boundary pixels of the first region, and adjusting the initial mapping relationship to determine a mapping relationship between pixel positions and corresponding pixel values within the first region.
[0058] In the present application, the initial mapping relationship can be determined based on the pixel values and corresponding positions of multiple feature points in the first area, and the initial mapping relationship can be adjusted by correcting the pixel points on the boundary. The feature points can be selected from each pixel point on the horizontal axis and the vertical axis of the circle, and the initial mapping relationship can be a multi-order polynomial, and the polynomial coefficients are determined by the position information of multiple feature points and the corresponding pixel values.
[0059] See also Figure 6 .
[0060] Figure 6 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 6 As shown, the method for determining the initial mapping relationship between the pixel point position and the corresponding pixel value in the first area according to the pixel value of at least one feature point in the first area may include steps S601-S602:
[0061] Step S601: obtaining a normalized distance between at least one feature point in the first area and the optical center, wherein the normalized distance can be used to characterize a position of a pixel point in the dark corner image.
[0062] Step S602: performing polynomial fitting according to the normalized distance and pixel value corresponding to each feature point to determine an initial mapping relationship between the pixel point position and the corresponding pixel value in the first area.
[0063] In this application, the expression of the initial mapping relationship can be:
[0064] y=k1+k2x+k3x 3
[0065] y is the pixel value of the feature point, x is the distance from the feature point to the center of the circle divided by half of the diagonal of the dark corner image, that is, the normalized distance, k1, k2, k3 are polynomial coefficients, and the least squares method is used to calculate the initial polynomial coefficients and determine the initial mapping relationship.
[0066] See also Figure 7 .
[0067] Figure 7 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 7 As shown, the method of obtaining pixel values corresponding to boundary pixel points of the first area and adjusting the initial mapping relationship may include steps S701-S702:
[0068] Step S701: Obtain pixel values and normalized distances corresponding to boundary pixel points of the first area.
[0069] Step S702: re-determine at least one polynomial coefficient according to the pixel values and normalized distances corresponding to the boundary pixels of the first area to adjust the initial mapping relationship.
[0070] After determining the initial polynomial coefficients, the k1 value needs to be adjusted so that the pixel values at the boundary of the first region are equal, so that the pixel values inside and outside the circle do not appear to be different. It is necessary to obtain the pixel values and normalized distance (x, y) corresponding to the boundary pixel points at the boundary of the first region, and then establish an equation with the initial polynomial coefficients k2 and k3 and the known (x, y) at the boundary to calculate the re-determined k1.
[0071] In the present application, the method for adjusting the corresponding pixel values of each pixel point in the second area based on the mapping relationship and the pixel point position in the second area may include: based on the pixel point position in the second area, determining the target pixel value corresponding to each pixel point in the second area according to the mapping relationship, and adjusting the pixel value of each pixel point in the second area to the target pixel value.
[0072] In the present application, after determining that the mapping relationship is a cubic polynomial, the cubic polynomial can be used to redetermine the pixel points of each pixel point in the second area and adjust them. The normalized distance of the center of each pixel circle in the second area is used as x, and the y value is substituted into the cubic polynomial to obtain the pixel value of the point.
[0073] See also Figure 8 .
[0074] Figure 8 A flowchart of an image processing method according to an embodiment of the present application is shown. Figure 8 As shown, the pixel smoothing process for the boundary pixels of the first area may include steps S801-S802:
[0075] Step S801, obtaining an image copy of the dark corner image, and performing blur processing on the image copy.
[0076] Step S802: Based on the pixel values of the pixels in the image copy, the pixel values of the boundary pixels of the first area are correspondingly replaced to complete the smoothing process.
[0077] In the present application, after adjusting the pixel values of each pixel point in the second area, the pixel values inside and outside the circle at the boundary are equal after adjustment k1, but because the pixel values outside the circle are interpolated, the values at the boundary are the same, but the rate of change is different, so it can still be seen that the dark corner image has a boundary. Therefore, a copy of the same dark corner image can be copied, because the Fourier transform will change all the points, and then the image copy is Fourier transformed and the low-frequency part of the image is intercepted. The blurred image is obtained by inverse Fourier transform, and the pixel values at the boundary of the circle of the blurred image are replaced with the pixel values of the boundary pixels of the first area to complete the boundary smoothing.
[0078] For example, see Fig. 9 , Fig. 9 FIG. 4 shows a dark corner image according to an embodiment of the present application. Fig. 9 As shown in Figure 2, after compensation, Figure 2 , the boundary between the dark corner area and the highlight area becomes smooth, and the dark corner area is compensated to a certain extent.
[0079] Next, an embodiment of a device of the present application will be described in conjunction with the accompanying drawings.
[0080] See also Fig.10 .
[0081] Fig.10 An image processing device according to an embodiment of the present application is shown, wherein the device 1000 includes: an acquiring unit 1001 , a determining unit 1002 , and an adjusting unit 1003 .
[0082] Among them, the acquisition unit 1001 can be used to acquire a dark-corner image, determine a first area and a second area of the dark-corner image, and the image brightness of the first area is greater than that of the second area; the determination unit 1002 can be used to determine the mapping relationship between the pixel position and the corresponding pixel value in the first area according to the pixel value of at least one feature point in the dark-corner image; the adjustment unit 1003 can be used to adjust the corresponding pixel value of each pixel in the second area based on the mapping relationship and the pixel position in the second area, and then perform pixel smoothing processing on the boundary pixels of the first area.
[0083] In some embodiments of the present application, the acquisition unit 1001 may also be used to acquire an original image to be processed, and perform binarization processing and image corrosion processing on the original image in sequence to generate a dark corner image.
[0084] In some embodiments of the present application, the acquisition unit 1001 can also be used to scan the dark corner image and determine the optical center of the dark corner image; determine an area with the optical center as the center and a preset card control distance as the radius as the first area, and determine the remaining area of the dark corner image except the first area as the second area.
[0085] In some embodiments of the present application, the determination unit 1002 can also be used to determine the initial mapping relationship between the pixel point position and the corresponding pixel value within the first area based on the pixel value of at least one feature point within the first area; obtain the pixel value corresponding to the boundary pixel point of the first area, and adjust the initial mapping relationship to determine the mapping relationship between the pixel point position and the corresponding pixel value within the first area.
[0086] In some embodiments of the present application, based on the aforementioned scheme, the determination unit 1002 can also be used to obtain the normalized distance between at least one feature point in the first area and the optical center, and the normalized distance can be used to characterize the position of the pixel point in the dark corner image; according to the normalized distance and pixel value corresponding to each feature point, a polynomial fitting is performed to determine the initial mapping relationship between the pixel point position and the corresponding pixel value in the first area.
[0087] In some embodiments of the present application, based on the aforementioned scheme, the determination unit 1002 can also be used to obtain pixel values and normalized distances corresponding to the boundary pixel points of the first area; based on the pixel values and normalized distances corresponding to the boundary pixel points of the first area, re-determine at least one polynomial coefficient to adjust the initial mapping relationship.
[0088] In some embodiments of the present application, the adjustment unit 1003 can also be used to determine the target pixel value corresponding to each pixel point in the second area according to the mapping relationship based on the pixel point position in the second area, and adjust the pixel value of each pixel point in the second area to the target pixel value.
[0089] In some embodiments of the present application, the adjustment unit 1003 can also be used to obtain an image copy of the dark corner image and blur the image copy; based on the pixel values of the pixel points in the image copy, the pixel values of the boundary pixel points of the first area are replaced accordingly to complete the smoothing process.
[0090] See next Fig.11 .
[0091] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0092] It should be noted that Fig.11The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0093] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method described in the above embodiment. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102 and the RAM 1103 are connected to each other through the bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0094] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0095] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0096] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0097] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0099] As another aspect, the present application further provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image processing method described in the above embodiment.
[0100] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the image processing method described in the above embodiment.
[0101] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0102] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0103] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0104] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for processing an image, characterized in that: The method comprises: Acquire a dark corner image, determine a first area and a second area of the dark corner image, wherein the image brightness of the first area is greater than that of the second area; Determine a mapping relationship between a pixel point position and a corresponding pixel value in the first area according to a pixel value of at least one feature point in the dark corner image; Based on the mapping relationship and the positions of the pixels in the second area, the corresponding pixel values of the pixels in the second area are adjusted, and then pixel smoothing processing is performed on the boundary pixels of the first area.
2. The method according to claim 1, characterized in that The step of acquiring a dark corner image comprises: An original image to be processed is obtained, and binarization processing and image corrosion processing are performed on the original image in sequence to generate a dark corner image.
3. The method according to claim 1, characterized in that The determining of the first area and the second area of the dark corner image comprises: Scanning the dark corner image to determine the optical center of the dark corner image; An area with the optical center as the center and a preset control distance as the radius is determined as a first area, and a remaining area of the dark corner image except the first area is determined as a second area.
4. The method according to claim 3, characterized in that The determining, according to the pixel value of at least one feature point in the dark corner image, a mapping relationship between a pixel point position and a corresponding pixel value in the first area comprises: Determining an initial mapping relationship between pixel point positions and corresponding pixel values within the first area according to a pixel value of at least one feature point within the first area; Pixel values corresponding to boundary pixels of the first region are obtained, and the initial mapping relationship is adjusted to determine a mapping relationship between pixel positions and corresponding pixel values within the first region.
5. The method according to claim 4, characterized in that The determining, according to the pixel value of at least one feature point in the first area, an initial mapping relationship between a pixel point position and a corresponding pixel value in the first area includes: Acquire a normalized distance between at least one feature point in the first area and the optical center, where the normalized distance can be used to characterize a position of a pixel point in the dark corner image; Polynomial fitting is performed according to the normalized distance and pixel value corresponding to each feature point to determine an initial mapping relationship between the pixel point position and the corresponding pixel value in the first area.
6. The method according to claim 5, characterized in that The obtaining pixel values corresponding to the boundary pixel points of the first area and adjusting the initial mapping relationship includes: Obtaining pixel values and normalized distances corresponding to boundary pixel points of the first area; At least one polynomial coefficient is re-determined according to pixel values and normalized distances corresponding to boundary pixels of the first area to adjust the initial mapping relationship.
7. The method according to claim 1, characterized in that The adjusting corresponding pixel values of each pixel in the second area based on the mapping relationship and the positions of the pixels in the second area includes: Based on the positions of the pixels in the second area, the target pixel values corresponding to the pixels in the second area are determined according to the mapping relationship, and the pixel values of the pixels in the second area are adjusted to the target pixel values accordingly.
8. The method according to claim 1, characterized in that: The performing pixel smoothing processing on the boundary pixels of the first area includes: Obtaining an image copy of the dark corner image, and performing blur processing on the image copy; Based on the pixel values of the pixels in the image copy, the pixel values of the boundary pixels of the first area are correspondingly replaced to complete the smoothing process.
9. An image processing device, characterized in that: The device comprises: An acquisition unit is used to acquire a dark corner image, and determine a first area and a second area of the dark corner image, wherein the image brightness of the first area is greater than that of the second area; A determination unit, configured to determine a mapping relationship between a pixel point position and a corresponding pixel value in the first area according to a pixel value of at least one feature point in the dark corner image; The adjustment unit is used to adjust the corresponding pixel values of each pixel in the second area based on the mapping relationship and the pixel positions in the second area, and then perform pixel smoothing processing on the boundary pixels of the first area.
10. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the image processing method as described in any one of claims 1 to 8.
Citation Information
Cited By
Image vignetting processing method, device and equipment and readable storage medium
CN120450948A