CN116962855A - Image compensation method, device, electronic equipment and readable storage medium - Google Patents
Image compensation method, device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN116962855A CN116962855A CN202310920890.7A CN202310920890A CN116962855A CN 116962855 A CN116962855 A CN 116962855A CN 202310920890 A CN202310920890 A CN 202310920890A CN 116962855 A CN116962855 A CN 116962855A
- Authority
- CN
- China
- Prior art keywords
- image
- data
- calibration
- compensation
- offset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 91
- 238000012545 processing Methods 0.000 abstract description 7
- 230000006870 function Effects 0.000 description 31
- 239000011159 matrix material Substances 0.000 description 27
- 238000004364 calculation method Methods 0.000 description 20
- 238000003384 imaging method Methods 0.000 description 14
- 230000000694 effects Effects 0.000 description 12
- 230000003287 optical effect Effects 0.000 description 9
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000012887 quadratic function Methods 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- 238000003705 background correction Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 244000233534 Eugenia apiculata Species 0.000 description 1
- 241000699670 Mus sp. Species 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000003381 stabilizer Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/50—Constructional details
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/50—Constructional details
- H04N23/55—Optical parts specially adapted for electronic image sensors; Mounting thereof
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/70—Circuitry for compensating brightness variation in the scene
- H04N23/741—Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N25/00—Circuitry of solid-state image sensors [SSIS]; Control thereof
- H04N25/50—Control of the SSIS exposure
- H04N25/57—Control of the dynamic range
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Studio Devices (AREA)
Abstract
Description
技术领域Technical field
本申请属于图像处理技术领域,具体涉及一种图像补偿方法、装置、电子设备及可读存储介质。This application belongs to the field of image processing technology, and specifically relates to an image compensation method, device, electronic equipment and readable storage medium.
背景技术Background technique
目前,电子设备可以通过图像补偿数据(例如,镜头阴影补偿数据)对采集图像的亮度进行补偿,以提升成像质量。通常该图像补偿数据是基于电子设备中镜头的物理中心与图像传感器的物理中心对齐时标定出的亮度补偿数据计算得到的。Currently, electronic devices can compensate for the brightness of captured images through image compensation data (for example, lens shading compensation data) to improve imaging quality. Usually, the image compensation data is calculated based on the brightness compensation data calibrated when the physical center of the lens in the electronic device is aligned with the physical center of the image sensor.
然而,在采集图像的过程中,电子设备的抖动会使上述摄像头的物理中心发生偏移,从而导致进行图像补偿后会出现水波纹暗区的闪动和四角明暗闪烁问题。However, during the process of collecting images, the jitter of the electronic equipment will cause the physical center of the above-mentioned camera to shift, resulting in problems such as flickering of dark areas of water ripples and flickering of light and dark in the four corners after image compensation.
发明内容Contents of the invention
本申请实施例的目的是提供一种图像补偿方法、装置、电子设备及可读存储介质,能够解决相关技术中进行图像补偿后会出现水波纹暗区闪动或四角明暗闪烁的问题。The purpose of the embodiments of the present application is to provide an image compensation method, device, electronic equipment and readable storage medium, which can solve the problem in related technologies that water ripples flash in dark areas or four corners flicker after image compensation.
第一方面,本申请实施例提供了一种图像补偿方法,该方法由电子设备执行,电子设备包括摄像模组,摄像模组包括镜头,该方法包括:基于摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取第一图像的亮度补偿数据,第一物理偏移量在标定补偿数据对应的镜头的物理偏移范围内;基于亮度补偿数据,对第一图像的图像数据进行补偿。In a first aspect, embodiments of the present application provide an image compensation method. The method is executed by an electronic device. The electronic device includes a camera module, and the camera module includes a lens. The method includes: based on the camera module when collecting the first image. The first physical offset and the calibration compensation data are used to obtain the brightness compensation data of the first image. The first physical offset is within the physical offset range of the lens corresponding to the calibration compensation data; based on the brightness compensation data, the first image is image data for compensation.
第二方面,本申请实施例提供了一种图像补偿装置,该装置包括摄像模组,摄像模组包括镜头,该装置包括获取模块和补偿模块;获取模块,用于基于摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取第一图像的亮度补偿数据,第一物理偏移量在标定补偿数据对应的镜头的物理偏移范围内;补偿模块,用于基于获取模块获取的亮度补偿数据,对第一图像的图像数据进行补偿。In a second aspect, embodiments of the present application provide an image compensation device. The device includes a camera module. The camera module includes a lens. The device includes an acquisition module and a compensation module; the acquisition module is used to collect the first image based on the camera module. The first physical offset and calibration compensation data of the image are obtained to obtain the brightness compensation data of the first image, and the first physical offset is within the physical offset range of the lens corresponding to the calibration compensation data; the compensation module is used to obtain based on The brightness compensation data obtained by the module compensates the image data of the first image.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The programs or instructions are processed by the processor. When the processor is executed, the steps of the method described in the first aspect are implemented.
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the method described in the first aspect are implemented. .
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a fifth aspect, embodiments of the present application provide a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the first aspect. the method described.
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。In a sixth aspect, embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
在本申请实施例中,电子设备可以基于摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取第一图像的亮度补偿数据,第一物理偏移量在标定补偿数据对应的镜头的物理偏移范围内;并基于亮度补偿数据,对第一图像的图像数据进行补偿。通过该方案,由于电子设备在对采集的第一图像的图像数据进行补偿时采用的亮度补偿数据,是基于采集该第一图像时的实际物理偏移量以及标定补偿数据获取的,因此该亮度补偿数据可以有效避免镜头物理中心偏移对图像成像质量的影响,从而采用该亮度补偿数据对第一图像进行补偿,可以有效避免出现镜头物理中心偏移带来的水波纹暗区的闪动和四角明暗闪烁的问题。In the embodiment of the present application, the electronic device can obtain the brightness compensation data of the first image based on the first physical offset and calibration compensation data when the camera module collects the first image. The first physical offset is in the calibration compensation data. Within the physical offset range of the corresponding lens; and based on the brightness compensation data, the image data of the first image is compensated. Through this solution, since the brightness compensation data used by the electronic device to compensate the image data of the first image collected is obtained based on the actual physical offset and calibration compensation data when the first image is collected, the brightness The compensation data can effectively avoid the impact of the shift of the physical center of the lens on the image quality, so using this brightness compensation data to compensate the first image can effectively avoid the flickering and dark areas of water ripples caused by the shift of the physical center of the lens. The problem of flickering light and dark in the four corners.
附图说明Description of the drawings
图1是本申请实施例提供的图像补偿方法的流程图之一;Figure 1 is one of the flow charts of the image compensation method provided by the embodiment of the present application;
图2是本申请实施例提供的图像补偿方法的流程图之二;Figure 2 is the second flow chart of the image compensation method provided by the embodiment of the present application;
图3是本申请实施例提供的图像补偿方法的流程图之三;Figure 3 is the third flow chart of the image compensation method provided by the embodiment of the present application;
图4是本申请实施例提供的图像补偿方法中采用图像补偿数据对图像补偿的示意图;Figure 4 is a schematic diagram of image compensation using image compensation data in the image compensation method provided by the embodiment of the present application;
图5是本申请实施例提供的图像补偿方法的流程图之四;Figure 5 is the fourth flowchart of the image compensation method provided by the embodiment of the present application;
图6是本申请实施例提供的图像补偿方法中获取色彩补偿数据的示意图;Figure 6 is a schematic diagram of obtaining color compensation data in the image compensation method provided by the embodiment of the present application;
图7是本申请实施例提供的图像补偿方法的流程图之五;Figure 7 is the fifth flow chart of the image compensation method provided by the embodiment of the present application;
图8是本申请实施例提供的图像补偿方法中确定亮度补偿数据的示意图;Figure 8 is a schematic diagram of determining brightness compensation data in the image compensation method provided by the embodiment of the present application;
图9是本申请实施例提供的图像补偿装置的示意图;Figure 9 is a schematic diagram of an image compensation device provided by an embodiment of the present application;
图10是本申请实施例提供的电子设备的示意图;Figure 10 is a schematic diagram of an electronic device provided by an embodiment of the present application;
图11是本申请实施例提供的电子设备的硬件示意图。Figure 11 is a hardware schematic diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
本申请的说明书和权利要求书中的术语“至少一个(项)”、“至少之一”等指其包含对象中的任意一个、任意两个或两个以上的组合。例如,a、b、c中的至少一个(项),可以表示:“a”、“b”、“c”、“a和b”、“a和c”、“b和c”以及“a、b和c”,其中a,b,c可以是单个,也可以是多个。同理,“至少两个(项)”是指两个或两个以上,其表达的含义与“至少一个(项)”类似。The terms "at least one (item)", "at least one", etc. in the description and claims of this application refer to any one, any two or a combination of more than two of the included objects. For example, at least one (item) of a, b, c can represent: "a", "b", "c", "a and b", "a and c", "b and c" and "a , b and c", where a, b, c can be single or multiple. Similarly, "at least two (items)" refers to two or more than two, and its meaning is similar to "at least one (item)".
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像补偿方法、装置、电子设备及可读存储介质进行详细地说明。The image compensation method, device, electronic device and readable storage medium provided by the embodiments of the present application will be described in detail through specific embodiments and application scenarios with reference to the accompanying drawings.
光学防抖(Optical Image Stabilizer,OIS)的功能是通过镜头的浮动透镜来纠正光心偏移。OIS的原理是通过镜头内的陀螺仪侦测镜头的微小抖动,然后将侦测的信号传至微处理器,微处理器在接收到该信号之后,计算需要补偿的位移量,并通过补偿镜片组根据镜头的抖动方向及位移量加以补偿,从而有效地降低相机抖动带来的图像模糊和画面抖动程度。这种防抖技术的防抖效果较为明显,但对镜头设计制造的要求比较高,且成本也相对较高。通常情况下,电子设备开启OIS防抖功能可以降低2-3档快门速度,从而可以降低用户在手持拍摄时采集到模糊图像的概率。尤其是对于长焦镜头,在变焦较大时就算是极轻微的抖动也会影响成像质量,而采用OIS防抖功能可以明显提升成像质量,从而极大地提升用户的拍摄体验。The function of Optical Image Stabilizer (OIS) is to correct the optical center shift through the floating lens of the lens. The principle of OIS is to detect the slight shake of the lens through the gyroscope in the lens, and then transmit the detected signal to the microprocessor. After receiving the signal, the microprocessor calculates the amount of displacement that needs to be compensated, and compensates the lens through the compensation lens. The group compensates based on the direction and displacement of the lens, thereby effectively reducing image blur and screen shake caused by camera shake. The anti-shake effect of this anti-shake technology is relatively obvious, but the requirements for lens design and manufacturing are relatively high, and the cost is relatively high. Normally, turning on the OIS anti-shake function of an electronic device can reduce the shutter speed by 2-3 steps, thereby reducing the probability of users collecting blurry images when shooting handheld. Especially for telephoto lenses, even a slight shake will affect the imaging quality when the zoom is large. The use of OIS anti-shake function can significantly improve the imaging quality, thus greatly improving the user's shooting experience.
此外,电子设备在采集一张图像之后,可以通过镜头阴影(即Lens Shading)补偿数据对该图像的亮度和色彩进行补偿,以解决由于镜头对于光学折射不均匀导致的镜头周围出现阴影的问题,进一步提升电子设备拍摄的成像质量。该镜头阴影补偿数据可以分为亮度补偿部分(即Luma Shading)和色彩补偿部分(即Color Shading)两部分数据;其中,该亮度补偿部分的数据通常是在实验室的固定光源下标定出来的补偿数据,该亮度补偿部分的数据可以指示镜头的亮度衰减规律;该色彩补偿部分的数据通常是在图像的处理过程中,基于固定规格(例如,32×24)的镜头阴影校正统计数据(Lens Shading CorrectionStats,LSC Stats)实时计算出来的,该色彩补偿部分的数据可以指示镜头的色彩衰减规律。电子设备在获取上述两部分数据之后,可以通过该两部分数据最终形成R/Gr/Gb/B四个通道的四张补偿表格,以对采集的图像进行补偿。In addition, after the electronic device collects an image, it can compensate the brightness and color of the image through lens shading (i.e. Lens Shading) compensation data to solve the problem of shadows around the lens caused by uneven optical refraction of the lens. Further improve the imaging quality of electronic equipment. The lens shading compensation data can be divided into two parts: brightness compensation part (i.e. Luma Shading) and color compensation part (i.e. Color Shading); among them, the data of the brightness compensation part is usually the compensation calibrated under the fixed light source in the laboratory. The data in the brightness compensation part can indicate the brightness attenuation law of the lens; the data in the color compensation part is usually lens shading correction statistical data (Lens Shading) based on fixed specifications (for example, 32×24) during image processing. CorrectionStats, LSC Stats) are calculated in real time. The data in the color compensation part can indicate the color attenuation law of the lens. After the electronic device obtains the above two parts of data, it can finally form four compensation tables for the four channels of R/Gr/Gb/B through the two parts of data to compensate for the collected images.
具体地,电子设备通过镜头阴影补偿数据对图像进行补偿的过程大致可以包括两个模块:Specifically, the process of the electronic device compensating the image through the lens shading compensation data can roughly include two modules:
一个是计算模块,该计算模块可以使用每一帧图像的LSC Stats,以及标定的亮度补偿部分的数据作为输入,最终输出结果为R/Gr/Gb/B四个通道的四张补偿表格(即meshtable);对应于目前使用最多的图像比例4:3,每张补偿表格通常包括17×13个补偿数据,然后根据长方形图像均匀分块的规则将整个需补偿图像的画面均匀分成17×13个区域,按照区域位置分别对应17×13个补偿数据。例如,假设一张图像的图像尺寸为4096×3072,为了使该图像均分后的每个区域均包括整数个像素,可以以中心对齐的规则为准,宽度方向两边每边余出8个像素,高度方向两边每边余出2个像素,图像中心对齐参与补偿的像素4080×3068;然后可以将该图像均分为17×13个区域,每个区域补偿gain(即增益)值(通常为1倍到8倍之间的浮点数)对应240×236个像素,余出的像素补偿gain值等于最临近的区域的gain值。此外,该LSC Stats和该亮度补偿部分的数据在单通道补偿表格中的状态是相乘规律,该计算模块一旦输出两者无法分离。One is the calculation module, which can use the LSC Stats of each frame of image and the data of the calibrated brightness compensation part as input. The final output result is four compensation tables for the four channels of R/Gr/Gb/B (i.e. meshtable); corresponding to the currently most commonly used image ratio of 4:3, each compensation table usually includes 17×13 compensation data, and then the entire image to be compensated is evenly divided into 17×13 according to the rules of evenly dividing rectangular images into blocks. area, corresponding to 17×13 compensation data according to the area location. For example, assuming that the image size of an image is 4096×3072, in order to make each area of the image evenly divided include an integer number of pixels, the center alignment rule can be used, leaving 8 pixels on each side in the width direction. , leaving 2 pixels on each side in the height direction, and aligning the center of the image with the pixels participating in the compensation of 4080×3068; then the image can be divided into 17×13 areas, and each area is compensated with a gain value (usually A floating point number between 1x and 8x) corresponds to 240×236 pixels, and the remaining pixel compensation gain value is equal to the gain value of the nearest area. In addition, the status of the LSC Stats and the brightness compensation part data in the single-channel compensation table is a multiplication rule, and once the calculation module outputs the two, they cannot be separated.
另一个是补偿模块,该补偿模块可以将该计算模块计算得到的该四张补偿表格中的补偿数据补偿到采集的图像上。The other is a compensation module, which can compensate the compensation data in the four compensation tables calculated by the calculation module to the collected images.
下面对电子设备标定上述亮度补偿部分的数据的过程进行详细地说明。The process of the electronic device calibrating the data of the brightness compensation part will be described in detail below.
目前,电子设备标定上述亮度补偿部分的数据的过程如下:At present, the process of electronic equipment calibrating the data of the above-mentioned brightness compensation part is as follows:
1、锁定需要标定的摄像头位置;1. Lock the camera position that needs to be calibrated;
2、开启raw(即原始图像文件)获取命令,并采集一张raw图像,该raw图像为仅经过黑电平校正(Black Level Correction,BLS)模块校正后得到的图像,包含四个通道R/Gr/Gb/B,四个通道单独统计;2. Open the raw (original image file) acquisition command and collect a raw image. The raw image is an image obtained only after correction by the Black Level Correction (BLS) module and contains four channels R/ Gr/Gb/B, four channels are counted separately;
3、以中心对齐规则为准,将采集的raw图像两边空余出像素,均匀分为17×13个区域,每个区域对应240×236个像素;3. Based on the center alignment rules, the remaining pixels on both sides of the collected raw image are evenly divided into 17×13 areas, each area corresponding to 240×236 pixels;
4、计算每个区域的亮度平均值;4. Calculate the average brightness of each area;
5、以中心区域的亮度为准,将四周每个区域的亮度平均补偿到中心区域的亮度所需要的gain值倍率即为标定数据。5. Based on the brightness of the central area, the gain value magnification required to averagely compensate the brightness of each surrounding area to the brightness of the central area is the calibration data.
然而,上述亮度补偿部分的数据是电子设备中镜头的物理中心(即光心,也称为光轴)与图像传感器的物理中心对齐时标定出的数据,其补偿方式是:以该图像传感器的物理中心为补偿中心,进行固定位置的补偿。电子设备在无OIS防抖功能的情况下,由于电子设备中的摄像头和图像传感器是相对固定的,因此在实验室标定出来的固定摄像头位置的亮度衰减规律和采集图像时的实际亮度衰减规律基本一致,从而通过该亮度补偿部分的数据对图像进行补偿可以达到预定效果。但电子设备在具有OIS防抖功能的情况下,电子设备中的摄像头相对于图像传感器是浮动的。在采集图像的过程中,电子设备的抖动会使该摄像头的物理中心发生偏移,而该偏移会使上述固定的亮度补偿数据与该摄像头的实际亮度衰减规律不匹配,会出现以画面中心为中心的环状水波纹明暗交替区的闪烁和画面四角明暗闪烁的问题,尤其是在采集视频的过程中,会将此现象一并记录,严重影响成像效果和视频质量。However, the above-mentioned brightness compensation data is calibrated when the physical center of the lens (i.e. optical center, also called the optical axis) of the electronic device is aligned with the physical center of the image sensor. The compensation method is: based on the image sensor's physical center. The physical center is the compensation center, which performs fixed position compensation. In the case of electronic equipment without OIS anti-shake function, since the camera and image sensor in the electronic equipment are relatively fixed, the brightness attenuation law of the fixed camera position calibrated in the laboratory is basically the same as the actual brightness attenuation law when collecting images. Consistent, so that the predetermined effect can be achieved by compensating the image with the data in the brightness compensation part. However, when an electronic device has an OIS anti-shake function, the camera in the electronic device floats relative to the image sensor. During the process of collecting images, the jitter of the electronic equipment will cause the physical center of the camera to shift, and this shift will cause the fixed brightness compensation data to not match the actual brightness attenuation law of the camera, causing the center of the picture to appear. The problem of flickering in the alternating light and dark area of the annular water ripple in the center and the flickering of light and dark in the four corners of the picture, especially during the video collection process, will be recorded together, seriously affecting the imaging effect and video quality.
为了解决上述问题,本申请实施例提供一种图像补偿方法、装置、电子设备及可读存储介质,本申请实施例提供的图像补偿方法可以应用于具有OIS防抖功能的电子设备对采集的图像进行镜头阴影补偿的场景中。In order to solve the above problems, embodiments of the present application provide an image compensation method, device, electronic device and readable storage medium. The image compensation method provided by the embodiment of the present application can be applied to images collected by electronic devices with OIS anti-shake function. In scenes where lens shading compensation is performed.
示例性地,具有OIS防抖功能的电子设备可以基于摄像模组采集图像1时的物理偏移量和标定补偿数据,获取该图像1的亮度补偿数据,该物理偏移量在该标定补偿数据对应的镜头的物理偏移范围内;并可以基于该亮度补偿数据,对该图像1的图像数据进行补偿。For example, an electronic device with OIS anti-shake function can obtain the brightness compensation data of image 1 based on the physical offset and calibration compensation data when the camera module collects image 1. The physical offset is in the calibration compensation data. Within the physical offset range of the corresponding lens; and the image data of image 1 can be compensated based on the brightness compensation data.
如此,由于电子设备在对图像1的图像数据进行补偿时采用的亮度补偿数据,是基于采集该图像1时的实际物理偏移量以及标定补偿数据获取的,因此该亮度补偿数据可以有效避免镜头物理中心偏移对该图像1成像质量的影响,从而采用该亮度补偿数据对该图像1进行补偿,可以有效避免出现镜头物理中心偏移带来的水波纹暗区的闪动和四角明暗闪烁的问题,提升该图像1的成像效果。In this way, since the brightness compensation data used by the electronic device to compensate the image data of image 1 is obtained based on the actual physical offset and calibration compensation data when the image 1 is collected, the brightness compensation data can effectively avoid lens failure. The influence of the physical center shift on the imaging quality of the image 1, so that the brightness compensation data is used to compensate the image 1, which can effectively avoid the flickering of the dark areas of water ripples and the flickering of light and dark in the four corners caused by the shift of the physical center of the lens. Question, improve the imaging effect of image 1.
本申请实施例提供的图像补偿方法由电子设备执行,该电子设备包括摄像模组,该摄像模组包括镜头。图1示出了本申请实施例提供的图像补偿方法的流程图。如图1所示,本申请实施例提供的图像补偿方法可以包括下述的步骤101和步骤102。The image compensation method provided by the embodiment of the present application is executed by an electronic device. The electronic device includes a camera module, and the camera module includes a lens. Figure 1 shows a flow chart of an image compensation method provided by an embodiment of the present application. As shown in Figure 1, the image compensation method provided by the embodiment of the present application may include the following steps 101 and 102.
步骤101、电子设备基于摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取第一图像的亮度补偿数据。Step 101: The electronic device obtains brightness compensation data of the first image based on the first physical offset and calibration compensation data when the camera module collects the first image.
其中,上述第一物理偏移量在上述标定补偿数据对应的镜头的物理偏移范围内。Wherein, the first physical offset amount is within the physical offset range of the lens corresponding to the calibration compensation data.
在一些实施例中,上述镜头可以为电子设备中的传统光学镜头、红外镜头或飞行时间(Time of Flight,TOF)镜头等。In some embodiments, the above-mentioned lens may be a traditional optical lens, an infrared lens or a Time of Flight (TOF) lens in an electronic device, etc.
例如,以上述镜头为上述传统光学镜头为例,该镜头可以为长焦镜头、短焦镜头或变焦镜头等。For example, assuming that the above-mentioned lens is the above-mentioned traditional optical lens, the lens may be a telephoto lens, a short-focus lens, a zoom lens, etc.
在一些实施例中,上述第一图像可以为连续采集的多个视频帧中的一个视频帧。In some embodiments, the first image may be one video frame among multiple continuously collected video frames.
在一些实施例中,上述第一物理偏移量是指上述摄像模组在采集上述第一图像时的姿态相对于初始时刻姿态,在上下左右方向位移的像素数或偏转的角度数。In some embodiments, the first physical offset refers to the number of pixels displaced in the up, down, left and right directions or the number of angles deflected from the posture of the camera module when collecting the first image relative to the posture at the initial moment.
需要说明的是,本申请实施例中的上下左右,均是以电子设备的屏幕朝向用户为例进行示意的。It should be noted that the up, down, left and right in the embodiments of the present application are all illustrated by taking the screen of the electronic device facing the user as an example.
在一些实施例中,上述初始时刻姿态可以为:上述镜头的物理中心与电子设备中图像传感器的物理中心对齐时,该镜头的姿态。In some embodiments, the initial moment posture may be: the posture of the lens when the physical center of the lens is aligned with the physical center of the image sensor in the electronic device.
在一些实施例中,上述姿态即上述镜头在世界坐标系中的具体位置,包括在X轴的旋转量与平移量、在Y轴的旋转量与平移量,以及在Z轴的旋转量与平移量。In some embodiments, the above-mentioned posture is the specific position of the above-mentioned lens in the world coordinate system, including the amount of rotation and translation on the X-axis, the amount of rotation and translation on the Y-axis, and the amount of rotation and translation on the Z-axis. quantity.
在一些实施例中,上述第一物理偏移量可以为电子设备中的OIS模块获取的。In some embodiments, the above-mentioned first physical offset may be obtained by the OIS module in the electronic device.
在一些实施例中,上述物理偏移范围可以由上述摄像模组确定,不同摄像模组中的镜头可具有不同的物理偏移范围,物理偏移范围指示的是摄像模组的防抖范围。In some embodiments, the physical offset range can be determined by the camera module. Lenses in different camera modules can have different physical offset ranges. The physical offset range indicates the anti-shake range of the camera module.
在一些实施例中,上述第一图像的亮度补偿数据可以用于对该第一图像进行亮度补偿。In some embodiments, the brightness compensation data of the first image may be used to perform brightness compensation on the first image.
在一些实施例中,上述第一图像的亮度补偿数据可以为一个矩阵中的数据,该矩阵中的一个数据用于对该第一图像中的一个分块进行亮度补偿。In some embodiments, the brightness compensation data of the first image may be data in a matrix, and one data in the matrix is used to perform brightness compensation on a block in the first image.
在一些实施例中,上述标定补偿数据可以用于对上述摄像模组采集的图像进行亮度补偿。In some embodiments, the above-mentioned calibration compensation data can be used to perform brightness compensation on the images collected by the above-mentioned camera module.
在一些实施例中,上述标定补偿数据可以为一个矩阵中的数据,该矩阵中的数据数量多于上述第一图像的亮度补偿数据对应的矩阵中的数据数量。In some embodiments, the calibration compensation data may be data in a matrix, and the number of data in the matrix is greater than the number of data in the matrix corresponding to the brightness compensation data of the first image.
在一些实施例中,上述第一图像的亮度补偿数据可以为上述标定补偿数据中的数据。In some embodiments, the brightness compensation data of the first image may be the data in the calibration compensation data.
下面对电子设备获取上述第一图像的亮度补偿数据的具体方法进行详细地说明。The specific method for the electronic device to obtain the brightness compensation data of the above-mentioned first image will be described in detail below.
在一些实施例中,结合图1,如图2所示,上述步骤101具体可以通过下述的步骤101a和步骤101b实现。In some embodiments, as shown in FIG. 2 with reference to FIG. 1 , the above step 101 can be implemented through the following steps 101a and 101b.
步骤101a、电子设备根据第一物理偏移量,确定第一数据范围。Step 101a: The electronic device determines the first data range based on the first physical offset.
在一些实施例中,电子设备可以根据上述第一物理偏移量确定上述第一图像中像素的偏移方向,然后根据该偏移方向确定上述第一数据范围。In some embodiments, the electronic device may determine the offset direction of the pixels in the first image based on the first physical offset, and then determine the first data range based on the offset direction.
示例性地,假设上述标定补偿数据为19×15的矩阵(以下称为矩阵1)中的数据,那么:For example, assuming that the above calibration compensation data is the data in a 19×15 matrix (hereinafter referred to as matrix 1), then:
若电子设备根据上述第一物理偏移量确定的上述第一图像中像素的偏移方向为左上方,此时上述镜头左方和上方的第一行和第一列的部分不参与成像,则上述矩阵1中最上方的一行数据和最左方的一列数据不参与计算,同时该矩阵1中最下方的一行数据和最右方的一列数据会多出来参与计算;从而电子设备可以确定上述第一数据范围为(2:19,2:15),表示第2列到第19列的矩阵数据,以及第2行到第15行的矩阵数据;若电子设备根据上述第一物理偏移量确定的上述第一图像中像素的偏移方向为右下方,此时上述镜头最右方的一列和最下方的一行不参与成像,则上述矩阵1中最下方的一行数据和最右方的一列数据不参与计算,同时该矩阵1中最上方的一行数据和最左方的一列数据会多出来参与计算;从而电子设备可以确定上述第一数据范围为(1:18,1:14),表示第1列到第18列的矩阵数据,以及第1行到第14行的矩阵数据;If the offset direction of the pixels in the first image determined by the electronic device based on the first physical offset is upper left, and the first row and first column to the left and above the lens do not participate in imaging, then The top row of data and the leftmost column of data in the above matrix 1 are not involved in the calculation, and the bottom row of data and the rightmost column of data in the matrix 1 will be more involved in the calculation; thus the electronic device can determine the above-mentioned third A data range is (2:19, 2:15), indicating the matrix data from the 2nd column to the 19th column, and the matrix data from the 2nd row to the 15th row; if the electronic device determines based on the above-mentioned first physical offset The offset direction of the pixels in the above-mentioned first image is to the lower right. At this time, the rightmost column and the bottommost row of the above-mentioned lens do not participate in imaging, then the bottommost row of data and the rightmost column of data in the above-mentioned matrix 1 does not participate in the calculation, and at the same time, the top row of data and the leftmost column of data in the matrix 1 will be included in the calculation; thus the electronic device can determine that the above-mentioned first data range is (1:18, 1:14), which means that the first data range is (1:18, 1:14). Matrix data from column 1 to column 18, and matrix data from rows 1 to 14;
若电子设备根据上述第一物理偏移量确定的上述第一图像中像素的偏移方向为左方,此时上述镜头左方的一列和上方的一行不参与成像,则上述矩阵1中最上方的一行数据和最左方的一列数据不参与计算,同时该矩阵1中最右方的一列数据会多出来参与计算;从而电子设备可以确定上述第一数据范围为(2:19,2:14),表示第2列到第19列的矩阵数据,以及第2行到第14行的矩阵数据;If the offset direction of the pixels in the first image determined by the electronic device based on the first physical offset is to the left, and the column to the left and the row above the lens do not participate in imaging, then the topmost pixel in the matrix 1 One row of data and the leftmost column of data will not participate in the calculation, and at the same time, the rightmost column of data in the matrix 1 will be included in the calculation; thus the electronic device can determine that the above-mentioned first data range is (2:19, 2:14 ), represents the matrix data from column 2 to column 19, and the matrix data from row 2 to row 14;
若电子设备根据上述第一物理偏移量确定的上述第一图像中像素的偏移方向为右方,此时上述镜头右方的一列和上方的第一行不参与成像,则上述矩阵1中最上方的一行数据和最右方的一列数据不参与计算,同时该矩阵1中最下方的一行数据会多出来参与计算;从而电子设备可以确定上述第一数据范围为(2:18,2:15),表示第2列到第18列的矩阵数据,以及第2行到第15行的矩阵数据;If the offset direction of the pixels in the first image determined by the electronic device based on the first physical offset is to the right, and the column to the right of the lens and the first row above the lens do not participate in imaging, then in the matrix 1 The top row of data and the rightmost column of data are not involved in the calculation, and at the same time, the bottom row of data in the matrix 1 will be included in the calculation; thus the electronic device can determine that the above-mentioned first data range is (2:18, 2: 15), indicating the matrix data from column 2 to column 18, and the matrix data from row 2 to row 15;
如此,可以使确定的上述第一数据范围能够对应上述镜头在图像传感器上面的成像有效区域,以使该第一数据范围的数据可以匹配该镜头偏移之后的光线衰减规律。In this way, the determined first data range can correspond to the effective imaging area of the lens on the image sensor, so that the data in the first data range can match the light attenuation law after the lens is shifted.
步骤101b、电子设备从标定补偿数据中确定与第一数据范围对应的亮度补偿数据。Step 101b: The electronic device determines the brightness compensation data corresponding to the first data range from the calibration compensation data.
在一些实施例中,电子设备在确定上述第一数据范围之后,可以从上述标定补偿数据中确定该第一数据范围对应的数据,并将确定出的数据作为上述第一图像的亮度补偿数据。In some embodiments, after determining the first data range, the electronic device may determine the data corresponding to the first data range from the calibration compensation data, and use the determined data as the brightness compensation data of the first image.
在一些实施例中,由于电子设备是基于由上述第一物理偏移量确定的数据范围,从上述标定补偿数据中确定上述亮度补偿数据的,因此可以使确定出的该亮度补偿数据,与上述镜头因发生偏移改变的亮度衰减规律相匹配,以使该亮度补偿数据可以对不同偏移下的该镜头采集的图像进行图像补偿。In some embodiments, since the electronic device determines the above-mentioned brightness compensation data from the above-mentioned calibration compensation data based on the data range determined by the above-mentioned first physical offset, the determined brightness compensation data can be compared with the above-mentioned The brightness attenuation law changed by the lens due to the offset is matched, so that the brightness compensation data can perform image compensation on the images collected by the lens under different offsets.
步骤102、电子设备基于亮度补偿数据,对第一图像的图像数据进行补偿。Step 102: The electronic device compensates the image data of the first image based on the brightness compensation data.
在一些实施例中,电子设备在确定上述亮度补偿数据之后,可以将该亮度补偿数据送至电子设备中的补偿模块,并通过该补偿模块对上述第一图像的图像数据进行补偿,以提升该第一图像的成像质量。In some embodiments, after determining the brightness compensation data, the electronic device may send the brightness compensation data to a compensation module in the electronic device, and use the compensation module to compensate the image data of the first image to improve the brightness compensation data. The imaging quality of the first image.
在本申请实施例提供的图像补偿方法中,由于电子设备在对采集的第一图像的图像数据进行补偿时采用的亮度补偿数据,是基于采集该第一图像时的实际物理偏移量以及标定补偿数据获取的,因此该亮度补偿数据可以有效避免镜头物理中心偏移对图像成像质量的影响,从而采用该亮度补偿数据对第一图像进行补偿,可以有效避免出现镜头物理中心偏移带来的水波纹暗区的闪动和四角明暗闪烁的问题。In the image compensation method provided by the embodiment of the present application, the brightness compensation data used by the electronic device when compensating the image data of the first image collected is based on the actual physical offset and calibration when the first image is collected. The brightness compensation data is obtained by compensating the data. Therefore, the brightness compensation data can effectively avoid the impact of the physical center shift of the lens on the image quality. Therefore, the brightness compensation data is used to compensate the first image, which can effectively avoid the impact of the lens physical center shift. The problem of the flickering of dark areas of water ripples and the flickering of light and dark in the four corners.
在一些实施例中,电子设备可以将上述镜头分别向不同方向偏移最大物理偏移量,然后在该不同方向进行数据标定,进而确定上述标定补偿数据。In some embodiments, the electronic device can offset the above-mentioned lenses in different directions by maximum physical offsets, and then perform data calibration in the different directions, and then determine the above-mentioned calibration compensation data.
下面对电子设备获取上述标定补偿数据的具体方法进行详细地说明。The specific method for the electronic device to obtain the above calibration compensation data will be described in detail below.
在一些实施例中,上述摄像模组还可以包括图像传感器。示例性地,结合图1,如图3所示,在上述步骤101之前,本申请实施例提供的图像补偿方法还可以包括下述的步骤103至步骤106。In some embodiments, the above-mentioned camera module may further include an image sensor. For example, in conjunction with Figure 1, as shown in Figure 3, before the above-mentioned step 101, the image compensation method provided by the embodiment of the present application may also include the following steps 103 to 106.
步骤103、电子设备控制镜头的物理中心与图像传感器的物理中心对齐,并进行第一标定,得到第一标定数据。Step 103: The electronic device controls the physical center of the lens to be aligned with the physical center of the image sensor, and performs first calibration to obtain first calibration data.
在一些实施例中,上述第一标定的过程如下:电子设备在将上述镜头的物理中心与上述图像传感器的物理中心对齐之后,开启raw图像获取命令,并采集一张raw图像;然后电子设备以中心对齐规则为准,将采集的该raw图像两边空余出像素,均匀分为17×13个区域;接着电子设备计算每个区域的亮度平均值,并以中心区域的亮度为准,将四周每个区域的亮度平均补偿到中心区域的亮度所需要的gain值倍率。In some embodiments, the first calibration process is as follows: after aligning the physical center of the lens with the physical center of the image sensor, the electronic device starts a raw image acquisition command and collects a raw image; then the electronic device Based on the center alignment rules, the free pixels on both sides of the collected raw image are evenly divided into 17×13 areas; then the electronic device calculates the average brightness of each area, and based on the brightness of the central area, divides each surrounding area The gain value magnification required to averagely compensate the brightness of each area to the brightness of the central area.
在一些实施例中,上述第一标定数据的数据规格可以为17×13。In some embodiments, the data specification of the first calibration data may be 17×13.
步骤104、电子设备控制镜头向第一方向偏移第二物理偏移量,并进行第二标定,得到第二标定数据。Step 104: The electronic device controls the lens to shift a second physical shift amount in the first direction, and performs a second calibration to obtain second calibration data.
其中,上述第二物理偏移量为上述物理偏移范围内的最大物理偏移量。Wherein, the second physical offset is the maximum physical offset within the physical offset range.
在一些实施例中,上述第一方向可以为上述图像传感器的两个对角线方向中的一个方向。In some embodiments, the first direction may be one of two diagonal directions of the image sensor.
在一些实施例中,上述第二标定的过程如下:电子设备在将上述镜头向上述第一方向偏移上述第二物理偏移量之后,开启raw图像获取命令,并采集一张raw图像;然后电子设备以中心对齐规则为准,将采集的该raw图像两边空余出像素,均匀分为17×13个区域;接着电子设备计算每个区域的亮度平均值,并以中心区域的亮度为准,将四周每个区域的亮度平均补偿到中心区域的亮度所需要的gain值倍率。In some embodiments, the second calibration process is as follows: after the electronic device shifts the lens to the first direction by the second physical offset, the electronic device starts a raw image acquisition command and collects a raw image; then Based on the center alignment rule, the electronic device divides the free pixels on both sides of the collected raw image into 17×13 areas evenly; then the electronic device calculates the average brightness of each area, and takes the brightness of the central area as the standard. The gain value magnification required to averagely compensate the brightness of each surrounding area to the brightness of the central area.
在一些实施例中,上述第二标定数据的数据规格可以为17×13。In some embodiments, the data specification of the second calibration data may be 17×13.
步骤105、电子设备控制镜头向第二方向偏移第二物理偏移量,并进行第三标定,得到第三标定数据。Step 105: The electronic device controls the lens to shift the second physical shift amount in the second direction, and performs a third calibration to obtain third calibration data.
其中,上述第一方向和上述第二方向分别为:上述图像传感器的同一对角线上相反的两个方向。Wherein, the above-mentioned first direction and the above-mentioned second direction are respectively two opposite directions on the same diagonal line of the above-mentioned image sensor.
例如,上述图像传感器的对角线包括对角线1和对角线2,且对角线1为左上角与右下角间的对角线,对角线2为右上角与左下角间的对角线;那么上述第一方向可以为该对角线1上向左上角的方向,上述第二方向可以为该对角线1上向右下角的方向;或者,该第一方向可以为该对角线2上向右上角的方向,该第二方向可以为该对角线2上向左下角的方向。For example, the diagonal line of the above image sensor includes diagonal line 1 and diagonal line 2, and diagonal line 1 is the diagonal line between the upper left corner and the lower right corner, and diagonal line 2 is the diagonal line between the upper right corner and the lower left corner. diagonal line; then the above-mentioned first direction can be the direction toward the upper left corner on the diagonal line 1, and the above-mentioned second direction can be the direction toward the lower right corner on the diagonal line 1; or, the first direction can be the direction toward the pair of diagonal lines 1. The second direction may be the direction on the diagonal line 2 toward the upper right corner, and the second direction may be the direction on the diagonal line 2 toward the lower left corner.
在一些实施例中,上述第三标定的过程如下:电子设备在将上述镜头向上述第二方向偏移上述第二物理偏移量之后,开启raw图像获取命令,并采集一张raw图像;然后电子设备以中心对齐规则为准,将采集的该raw图像两边空余出像素,均匀分为17×13个区域;接着电子设备计算每个区域的亮度平均值,并以中心区域的亮度为准,将四周每个区域的亮度平均补偿到中心区域的亮度所需要的gain值倍率。In some embodiments, the third calibration process is as follows: after the electronic device shifts the lens to the second direction by the second physical offset, the electronic device starts a raw image acquisition command and collects a raw image; then Based on the center alignment rule, the electronic device divides the free pixels on both sides of the collected raw image into 17×13 areas evenly; then the electronic device calculates the average brightness of each area, and takes the brightness of the central area as the standard. The gain value magnification required to averagely compensate the brightness of each surrounding area to the brightness of the central area.
在一些实施例中,上述第三标定数据的数据规格可以为17×13。In some embodiments, the data specification of the third calibration data may be 17×13.
步骤106、电子设备根据第一标定数据、第二标定数据和第三标定数据,确定标定补偿数据。Step 106: The electronic device determines calibration compensation data based on the first calibration data, the second calibration data and the third calibration data.
在一些实施例中,上述标定补偿数据的数据规格可以为19×15。In some embodiments, the data specification of the above-mentioned calibration compensation data may be 19×15.
在一些实施例中,上述标定补偿数据可以为19×15的矩阵中的数据。In some embodiments, the above-mentioned calibration compensation data may be data in a 19×15 matrix.
在一些实施例中,电子设备可以先根据上述第一标定数据、上述第二标定数据和上述第三标定数据,确定19×15的目标数据basetable-new,表示如下:In some embodiments, the electronic device may first determine the 19×15 target data basetable-new based on the above-mentioned first calibration data, the above-mentioned second calibration data, and the above-mentioned third calibration data, which is expressed as follows:
basetable-new(2:18,2:14,m)=basetable-1(1:17,1:13,m)basetable-new(2:18,2:14,m)=basetable-1(1:17,1:13,m)
basetable-new(19:19,2:14,m)=basetable-2(17:17,1:13,m)basetable-new(19:19,2:14,m)=basetable-2(17:17,1:13,m)
basetable-new(2:18,15:15,m)=basetable-2(1:17,13:13,m)basetable-new(2:18,15:15,m)=basetable-2(1:17,13:13,m)
basetable-new(2:18,1:1,m)=basetable-3(1:17,1:1,m)basetable-new(2:18,1:1,m)=basetable-3(1:17,1:1,m)
basetable-new(1:1,2:14,m)=basetable-3(1:1,1:13,m);basetable-new(1:1,2:14,m)=basetable-3(1:1,1:13,m);
其中,basetable-1为上述第一标定数据,basetable-2为上述第二标定数据,basetable-3为上述第三标定数据,m为通道。Among them, basetable-1 is the above-mentioned first calibration data, basetable-2 is the above-mentioned second calibration data, basetable-3 is the above-mentioned third calibration data, and m is the channel.
在一些实施例中,电子设备在确定上述标定补偿数据basetable-new之后,可以根据该标定补偿数据basetable-new,使用二次函数进行拟合,确定上述19×15的矩阵中四个角点数据。In some embodiments, after the electronic device determines the above-mentioned calibration compensation data basetable-new, it can use a quadratic function to perform fitting based on the calibration compensation data basetable-new to determine the four corner point data in the above-mentioned 19×15 matrix. .
在一些实施例中,对于上述四个角点数据中的每个角点数据,均存在相邻的一行数据和一列数据,分别将每个角点数据相邻的一行数据和一列数据进行二次函数拟合,该二次函数为:f(x)=ax^2+bx+c,得到每个角点数据对应的两个预测值,取该两个预测值的平均值即得到对应角点数据的值。In some embodiments, for each corner point data in the above four corner point data, there is an adjacent row of data and a column of data, and the adjacent row of data and column of data of each corner point data are processed twice. Function fitting, the quadratic function is: f(x)=ax^2+bx+c, get two predicted values corresponding to each corner point data, take the average of the two predicted values to get the corresponding corner point The value of the data.
示例性地,如图4所示,以上述四个角点数据中b1角点数据为例,电子设备可以使用A1和A4两组数据和最小二乘法,进行二次函数拟合,得到两个最优二次函数;然后对b1角点数据的值进行预测,得到两个预测值,对该两个预测值求平均值即为b1角点数据的值。For example, as shown in Figure 4, taking the b1 corner point data among the above four corner point data as an example, the electronic device can use two sets of data A1 and A4 and the least squares method to perform quadratic function fitting to obtain two The optimal quadratic function; then predict the value of the b1 corner point data to obtain two predicted values. The average of the two predicted values is the value of the b1 corner point data.
需要说明的是,上述各个数据的数据规格与标定过程中对图像划分的区域数量相关,本申请实施例中,均是以对图像划分的区域为17×13个进行示例的,实际实现中,对图像划分的区域可以为任意的区域,本申请实施例不作限定。It should be noted that the data specifications of each of the above data are related to the number of areas divided into the image during the calibration process. In the embodiments of this application, the area divided into the image is 17×13 as an example. In actual implementation, The area divided into the image can be any area, which is not limited in the embodiment of this application.
在一些实施例中,由于电子设备可以分别在上述镜头的物理中心与上述图像传感器的物理中心对齐,以及该镜头向上述第一方向和上述第二方向偏移最大物理偏移量时,进行数据标定,并根据不同情况下得到的标定数据确定上述标定补偿数据,因此可以使确定出的该标定补偿数据能够匹配该镜头的任意偏移,扩大该标定补偿数据的补偿范围。In some embodiments, the electronic device can perform data processing when the physical center of the lens is aligned with the physical center of the image sensor, and when the lens is displaced by a maximum physical offset in the first direction and the second direction. Calibration, and determines the above-mentioned calibration compensation data based on the calibration data obtained under different circumstances, so that the determined calibration compensation data can match any offset of the lens and expand the compensation range of the calibration compensation data.
在一些实施例中,结合图1,如图5所示,在上述步骤102之前,本申请实施例提供的图像补偿方法还可以包括下述的步骤107和步骤108,且上述步骤102具体可以通过下述的步骤102a实现。In some embodiments, as shown in Figure 5 in conjunction with Figure 1, before the above step 102, the image compensation method provided by the embodiment of the present application can also include the following steps 107 and 108, and the above step 102 can be specifically performed by The following step 102a is implemented.
需要说明的是,图5中仅是以上述步骤107和步骤108在上述步骤101之后执行进行示意的,实际实现中,该步骤107和步骤108还可以在该步骤101之前执行,本申请实施例不作限定。It should be noted that Figure 5 only illustrates that the above-mentioned step 107 and step 108 are executed after the above-mentioned step 101. In actual implementation, this step 107 and step 108 can also be executed before this step 101. Embodiments of the present application Not limited.
步骤107、电子设备将第一物理偏移量转换为第一图像中像素的像素偏移量。Step 107: The electronic device converts the first physical offset into a pixel offset of the pixels in the first image.
在一些实施例中,上述像素偏移量可以包括:在X轴方向(包括正方向或负方向)上的像素偏移量,以及在Y轴方向(包括正方向或负方向)上的像素偏移量。In some embodiments, the above-mentioned pixel offset may include: a pixel offset in the X-axis direction (including the positive direction or the negative direction), and the pixel offset in the Y-axis direction (including the positive direction or the negative direction). Shift amount.
在一些实施例中,电子设备可以通过下述的方式一或方式二,将上述第一物理偏移量转换为上述第一图像中像素的像素偏移量。In some embodiments, the electronic device may convert the first physical offset into a pixel offset of the pixels in the first image through the following manner 1 or 2.
方式一method one
在一些实施例中,电子设备可以直接将上述第一物理偏移量映射为上述像素偏移量。In some embodiments, the electronic device may directly map the first physical offset to the pixel offset.
例如,若上述第一物理偏移量为向左偏移a毫米,且a毫米为b个像素的长度,则电子设备转换得到的上述像素偏移量为:在X轴方向上b个像素的长度;其中,a和b均为正整数。For example, if the above-mentioned first physical offset is a millimeter to the left, and a millimeter is the length of b pixels, then the above-mentioned pixel offset converted by the electronic device is: b pixels in the X-axis direction Length; where a and b are both positive integers.
方式二Method 2
在一些实施例中,电子设备可以将上述第一物理偏移量以第一比例映射为上述像素偏移量。In some embodiments, the electronic device may map the first physical offset into the pixel offset at a first ratio.
在一些实施例中,上述第一比例可以为系统预设的,或可以为用户根据实际使用需求任意设置的。In some embodiments, the above-mentioned first ratio may be preset by the system, or may be arbitrarily set by the user according to actual usage requirements.
例如,若上述第一物理偏移量为向上偏移c毫米,且c毫米为d个像素的长度,上述第一比例为1/2,则电子设备转换得到的上述像素偏移量为:在Y轴方向上d/2个像素的长度;其中,c和d均为正整数。For example, if the above-mentioned first physical offset is an upward offset of c mm, and c mm is the length of d pixels, and the above-mentioned first ratio is 1/2, then the above-mentioned pixel offset converted by the electronic device is: The length of d/2 pixels in the Y-axis direction; where c and d are both positive integers.
步骤108、电子设备在像素偏移量大于或等于第一阈值的情况下,根据像素偏移量以及第一图像中像素的偏移方向,获取第一图像的色彩补偿数据。Step 108: When the pixel offset is greater than or equal to the first threshold, the electronic device obtains the color compensation data of the first image according to the pixel offset and the offset direction of the pixels in the first image.
在一些实施例中,上述色彩补偿数据可以用于对上述第一图像进行色彩补偿。In some embodiments, the above-mentioned color compensation data may be used to perform color compensation on the above-mentioned first image.
在一些实施例中,上述色彩补偿数据可以为一个矩阵中的数据,该矩阵中的一个数据用于对上述第一图像中的一个分块进行色彩补偿。In some embodiments, the color compensation data may be data in a matrix, and one data in the matrix is used to perform color compensation on a block in the first image.
在一些实施例中,上述色彩补偿数据可以为上述第一图像的LSC Stats。In some embodiments, the color compensation data may be LSC Stats of the first image.
在一些实施例中,电子设备可以通过LSC Stats提取模块获取上述LSC Stats。In some embodiments, the electronic device can obtain the above-mentioned LSC Stats through the LSC Stats extraction module.
在一些实施例中,像素偏移量大于或等于上述第一阈值的像素偏移可以称为有效偏移。In some embodiments, a pixel offset with a pixel offset greater than or equal to the above-mentioned first threshold may be called an effective offset.
在一些实施例中,上述第一阈值可以为系统预设的,或可以为用户根据实际使用需求任意设置的。In some embodiments, the above-mentioned first threshold may be preset by the system, or may be arbitrarily set by the user according to actual usage requirements.
例如,以上述第一阈值为用户根据实际使用需求任意设置的为例,该第一阈值可以被设置为80像素、90像素或95像素等。For example, taking the above-mentioned first threshold as arbitrarily set by the user according to actual usage requirements, the first threshold may be set to 80 pixels, 90 pixels, or 95 pixels, etc.
在一些实施例中,若上述第一阈值为系统预设的,则电子设备可以根据电子设备中图像传感器的防抖最大偏移量设置;该防抖最大偏移量越大,则电子设备设置的该第一阈值也越大。In some embodiments, if the above-mentioned first threshold is preset by the system, the electronic device can be set according to the anti-shake maximum offset of the image sensor in the electronic device; the larger the anti-shake maximum offset, the electronic device will set The first threshold is also larger.
在一些实施例中,电子设备可以通过下述的公式(1)确定上述第一阈值N:In some embodiments, the electronic device can determine the above-mentioned first threshold N through the following formula (1):
N=min(x-offset,y-offset)/5; (1)N=min(x-offset,y-offset)/5; (1)
其中,x-offset为上述图像传感器在X轴方向上的防抖最大偏移量,y-offset为该图像传感器在Y轴方向上的防抖最大偏移量。Among them, x-offset is the maximum anti-shake offset of the above-mentioned image sensor in the X-axis direction, and y-offset is the maximum anti-shake offset of the image sensor in the Y-axis direction.
需要说明的是,若上述像素偏移量小于上述第一阈值,则可以认为上述物理偏移量较小,此时上述镜头的光线衰减规律并不会有较大的变化,无需对上述第一图像进行补偿。It should be noted that if the above-mentioned pixel offset is less than the above-mentioned first threshold, it can be considered that the above-mentioned physical offset is small. At this time, the light attenuation law of the above-mentioned lens will not change significantly, and there is no need to modify the above-mentioned first threshold. image to compensate.
在一些实施例中,电子设备在根据上述像素偏移量以及上述像素的偏移方向,获取上述色彩补偿数据之前,可以先根据该像素偏移量确定该偏移方向。In some embodiments, before acquiring the color compensation data based on the pixel offset and the offset direction of the pixel, the electronic device may first determine the offset direction based on the pixel offset.
示例性地,若上述像素在X轴方向上的像素偏移量为0,且在Y轴的正方向上存在像素偏移量,则该像素的偏移方向为上方;若该像素在X轴方向上的像素偏移量为0,且在Y轴的负方向上存在像素偏移量,则该像素的偏移方向为下方;若该像素在Y轴方向上的像素偏移量为0,且在X轴的负方向上存在像素偏移量,则该像素的偏移方向为左方;若该像素在Y轴方向上的像素偏移量为0,且在X轴的正方向上存在像素偏移量,则该像素的偏移方向为右方。For example, if the pixel offset of the above pixel in the X-axis direction is 0, and there is a pixel offset in the positive direction of the Y-axis, the offset direction of the pixel is upward; if the pixel is in the X-axis direction The pixel offset on is 0, and there is a pixel offset in the negative direction of the Y-axis, then the offset direction of the pixel is downward; if the pixel offset of the pixel in the Y-axis direction is 0, and If there is a pixel offset in the negative direction of the X-axis, the offset direction of the pixel is to the left; if the pixel offset of the pixel in the Y-axis direction is 0, and there is a pixel offset in the positive direction of the shift amount, the offset direction of the pixel is to the right.
又示例性地,若上述像素在X轴的正方向和Y轴的正方向存在像素偏移量,则该像素的偏移方向为右上方;若该像素在X轴的负方向和Y轴的负方向存在像素偏移量,则该像素的偏移方向为左下方;若该像素在X轴的正方向和Y轴的负方向存在像素偏移量,则该像素的偏移方向为右下方;若该像素在X轴的负方向和Y轴的正方向存在像素偏移量,则该像素的偏移方向为左上方。For another example, if the above pixel has a pixel offset in the positive direction of the X-axis and the positive direction of the Y-axis, the offset direction of the pixel is the upper right; If there is a pixel offset in the negative direction, the offset direction of the pixel is the lower left; if the pixel has a pixel offset in the positive direction of the X-axis and the negative direction of the Y-axis, the offset direction of the pixel is the lower right ; If the pixel has a pixel offset in the negative direction of the X-axis and the positive direction of the Y-axis, the offset direction of the pixel is the upper left.
在一些实施例中,电子设备在获取上述偏移方向之后,可以先根据上述像素偏移量以及该偏移方向,确定上述色彩补偿数据的数据规格(例如,33×25或34×26等),然后根据该数据规格获取上述色彩补偿数据。In some embodiments, after obtaining the offset direction, the electronic device may first determine the data specification of the color compensation data (for example, 33×25 or 34×26, etc.) based on the pixel offset amount and the offset direction. , and then obtain the above color compensation data according to the data specification.
示例性地,以上述镜头向左上方偏移为例,如图6所示,该镜头的物理中心从位置a偏移至了该位置a左上方的a1,那么电子设备可以先通过电子设备中的OIS模块获取该镜头的物理偏移量,然后将该物理偏移量直接映射为该镜头采集的图像中像素的像素偏移量,并根据该像素偏移量确定出该图像中像素的偏移方向为左上方;之后电子设备根据该像素偏移量和该偏移方向,将提取上述色彩补偿数据的数据规格由初始规格32×24变更为33×25,从而可以获取该图像33×25个色彩补偿数据。其中,图6中的实线分块为该镜头的物理中心未发生偏移时,32×24大小的色彩补偿数据分块;图6中的虚线分块和阴影部分为该镜头的物理中心偏移至该位置a1时,32×25大小的色彩补偿数据分块。For example, taking the above-mentioned lens shifting to the upper left as an example, as shown in Figure 6, the physical center of the lens shifts from position a to a1 on the upper left side of position a. Then the electronic device can first pass through the electronic device. The OIS module obtains the physical offset of the lens, and then directly maps the physical offset to the pixel offset of the pixels in the image captured by the lens, and determines the offset of the pixels in the image based on the pixel offset. The moving direction is the upper left; then the electronic device changes the data specification for extracting the above color compensation data from the initial specification of 32×24 to 33×25 based on the pixel offset and the offset direction, so that the image 33×25 can be obtained color compensation data. Among them, the solid line blocks in Figure 6 are the 32×24 size color compensation data blocks when the physical center of the lens does not shift; the dotted line blocks and the shaded part in Figure 6 are the physical center deviation of the lens. When moving to this position a1, the color compensation data of 32×25 size is divided into blocks.
可以看出,上述镜头向左上方偏移后,获取的上述色彩补偿数据多出了一行和一列,从而可以与该镜头的偏移相匹配,以适应此时该镜头的色彩衰减规律,从而可以提升该色彩补偿数据的补偿效果。It can be seen that after the above-mentioned lens is shifted to the upper left, the above-mentioned color compensation data obtained has one more row and one column, so that it can match the shift of the lens to adapt to the color attenuation law of the lens at this time, so that it can Improve the compensation effect of the color compensation data.
步骤102a、电子设备根据亮度补偿数据和色彩补偿数据,对第一图像的图像数据进行补偿。Step 102a: The electronic device compensates the image data of the first image according to the brightness compensation data and the color compensation data.
在一些实施例中,电子设备在获取上述色彩补偿数据及上述亮度补偿数据之后,可以将该色彩补偿数据和该亮度补偿数据送至电子设备中的计算模块,以确定上述第一图像的图像补偿数据,并通过该图像补偿数据对该第一图像的图像数据进行补偿。In some embodiments, after acquiring the color compensation data and the brightness compensation data, the electronic device may send the color compensation data and the brightness compensation data to a computing module in the electronic device to determine the image compensation of the first image. data, and compensate the image data of the first image through the image compensation data.
在一些实施例中,由于电子设备可以基于第一图像中像素的像素偏移量和偏移方向,获取与镜头的第一物理偏移量匹配的色彩补偿数据,并根据上述亮度补偿数据和该色彩补偿数据对第一图像的图像数据进行补偿,因此可以进一步提升对第一图像的补偿效果。In some embodiments, because the electronic device can obtain color compensation data that matches the first physical offset of the lens based on the pixel offset and offset direction of the pixel in the first image, and based on the above brightness compensation data and the The color compensation data compensates the image data of the first image, so the compensation effect on the first image can be further improved.
在一些实施例中,结合图5,如图7所示,上述步骤102a具体可以通过下述的步骤102a1至步骤102a3实现。In some embodiments, as shown in FIG. 7 in conjunction with FIG. 5 , the above step 102a may be implemented through the following steps 102a1 to 102a3.
步骤102a1、电子设备基于第一图像的各个通道在色彩补偿数据中对应的数据,计算第一图像中各个图像区域对应的像素均值。Step 102a1: The electronic device calculates the pixel mean value corresponding to each image area in the first image based on the corresponding data of each channel of the first image in the color compensation data.
在一些实施例中,电子设备可以先从上述色彩补偿数据中,确定出R、Gr、Gb、B四个通道的亮度值,然后再计算出上述各个图像区域中该四个通道中的每个通道的亮度平均值,以得到上述各个图像区域对应的像素均值。In some embodiments, the electronic device can first determine the brightness values of the four channels of R, Gr, Gb, and B from the above-mentioned color compensation data, and then calculate each of the four channels in the above-mentioned image areas. The average brightness of the channel is used to obtain the average pixel value corresponding to each of the above image areas.
步骤102a2、电子设备基于各个图像区域的像素均值和亮度补偿数据,确定各个图像区域对应的图像补偿数据。Step 102a2: The electronic device determines the image compensation data corresponding to each image area based on the pixel mean value and brightness compensation data of each image area.
在一些实施例中,电子设备可以对上述亮度补偿数据进行插值计算,以将该亮度补偿数据的数量扩充至与上述第一图像中的图像区域相同的数量,以便于对该第一图像的图像数据进行补偿。In some embodiments, the electronic device can perform interpolation calculations on the above-mentioned brightness compensation data to expand the amount of the brightness compensation data to the same number as the image areas in the above-mentioned first image, so as to facilitate the image processing of the first image. data for compensation.
示例性地,假设上述第一图像中的图像区域的数量为32×25个,上述亮度补偿数据的数量为19×15个,那么电子设备可以对该19×15个亮度补偿数据进行插值计算,得到32×25个新的亮度补偿数据,从而实现数据的扩充。For example, assuming that the number of image areas in the first image is 32×25 and the number of brightness compensation data is 19×15, then the electronic device can perform interpolation calculations on the 19×15 brightness compensation data, 32×25 new brightness compensation data are obtained, thereby achieving data expansion.
需要说明的是,插值计算可以在离散数据的基础上补插连续函数,使得这条连续曲线通过全部给定的离散数据点;插值计算是离散函数逼近的重要方法,利用插值计算可以通过函数在有限个点处的取值状况,估算出函数在其他点处的近似值。It should be noted that interpolation calculation can interpolate a continuous function on the basis of discrete data, so that this continuous curve passes through all given discrete data points; interpolation calculation is an important method of discrete function approximation, and interpolation calculation can be used to pass functions in The value situation at a limited number of points can be used to estimate the approximate value of the function at other points.
在一些实施例中,上述插值计算即通过插值法进行计算,该插值法可以为拉格朗日插值、牛顿插值、埃尔米特插值、分段插值或样条插值等。In some embodiments, the above interpolation calculation is performed by an interpolation method, which may be Lagrangian interpolation, Newton interpolation, Hermitian interpolation, piecewise interpolation or spline interpolation, etc.
需要说明的是,上述插值法也可称为内插法或直线插入法,其原理是根据未知函数f(x)在某区间内若干点的函数值,作出在该若干点的函数值与f(x)值相等的特定函数来近似原函数f(x),进而可用此特定函数算出该区间内其他各点的原函数f(x)的近似值。该插值法按照特定函数的性质,可以分为有线性内插、非线性内插等;按照引数(自变量)的个数,可以分为单内插、双内插和三内插等。It should be noted that the above-mentioned interpolation method can also be called interpolation method or straight-line interpolation method. Its principle is to calculate the function value of the unknown function f(x) at several points in a certain interval and f (x) are equal to a specific function to approximate the original function f(x), and then this specific function can be used to calculate the approximate value of the original function f(x) at other points in the interval. The interpolation method can be divided into linear interpolation, nonlinear interpolation, etc. according to the properties of the specific function; according to the number of arguments (independent variables), it can be divided into single interpolation, double interpolation, triple interpolation, etc.
对上述插值计算的具体描述,可以参照相关技术中的相关描述,为了避免重复,此处不再赘述。For the specific description of the above interpolation calculation, you can refer to the relevant description in the related art. In order to avoid repetition, it will not be described again here.
在一些实施例中,电子设备对于上述第一图像中的每个图像区域,可以基于一个图像区域的像素均值,计算该一个图像区域对应的两个比值(即R/Gr和B/Gb),以得到该每个图像区域对应的两个比值。In some embodiments, for each image area in the first image, the electronic device can calculate two ratios (i.e., R/Gr and B/Gb) corresponding to an image area based on the mean pixel value of the image area, To obtain the two ratios corresponding to each image area.
示例性地,电子设备可以将上述色彩补偿数据和上述亮度补偿数据输入动态颜色阴影校正算法,并通过该算法将该色彩补偿数据和该亮度补偿数据相乘后,计算得到上述每个图像区域对应的两个比值,即R/Gr,B/Gb;然后可以根据一定规则算法对该每个图像区域对应的两个比值进行微调,并将调整比例系数乘以该亮度补偿数据得到该每个图像区域对应的图像补偿数据。For example, the electronic device can input the above color compensation data and the above brightness compensation data into a dynamic color shading correction algorithm, and multiply the color compensation data and the brightness compensation data through the algorithm to calculate the above corresponding image area. The two ratios, namely R/Gr, B/Gb; then the two ratios corresponding to each image area can be fine-tuned according to a certain rule algorithm, and the adjustment scale coefficient is multiplied by the brightness compensation data to obtain each image. Image compensation data corresponding to the area.
步骤102a3、电子设备基于各个图像区域对应的图像补偿数据,对第一图像的图像数据进行补偿。Step 102a3: The electronic device compensates the image data of the first image based on the image compensation data corresponding to each image area.
在一些实施例中,上述图像补偿数据可以对上述每个图像区域中的R值和B值进行微调,以实现对上述第一图像的图像数据的精准补偿。In some embodiments, the above image compensation data can fine-tune the R value and B value in each of the above image areas to achieve accurate compensation of the image data of the above first image.
在一些实施例中,电子设备在确定上述图像补偿数据之后,可以将该图像补偿数据送至电子设备中的补偿模块,并通过该补偿模块对上述第一图像的图像数据(包括亮度数据和色彩数据)进行补偿,以提升该第一图像的成像质量。In some embodiments, after the electronic device determines the image compensation data, the image compensation data can be sent to a compensation module in the electronic device, and the image data (including brightness data and color) of the first image can be processed by the compensation module. data) to improve the imaging quality of the first image.
在一些实施例中,由于电子设备可以基于由上述各个图像区域的像素均值和上述亮度补偿数据确定的图像补偿数据,从通道层面对该第一图像的图像数据进行微调,因此可以进一步提升对第一图像的图像数据的补偿效果。In some embodiments, since the electronic device can fine-tune the image data of the first image from the channel level based on the image compensation data determined by the pixel average value of each image area and the brightness compensation data, the image data of the first image can be further improved. Compensation effect of image data of an image.
在一些实施例中,电子设备在确定上述图像补偿数据之后,可以对该图像补偿数据进行线性插值计算,将该图像补偿数据等比例缩小至与上述亮度补偿数据相同的数据规格,并存储为第一补偿表格,以便于之后上述摄像模组再次偏移上述第一物理偏移量时,对采集的图像的图像数据进行补偿。In some embodiments, after determining the above image compensation data, the electronic device can perform linear interpolation calculation on the image compensation data, scale down the image compensation data to the same data specification as the above brightness compensation data, and store it as the first A compensation table is used to compensate the image data of the collected image when the camera module is offset again by the first physical offset amount.
需要说明的是,线性插值是指插值函数为一次多项式的插值方式,其在插值节点上的插值误差为零;线性插值相比其他插值方式(例如抛物线插值),具有简单、方便的特点;线性插值可以用来近似代替原函数,也可以用来计算得到查表过程中表中没有的数值。线性插值的基本思想是:再原始数据点之间插入一些新的数据点,从而使得数据点之间的距离变得更加均匀;具体地,可以通过计算相邻数据点之间的斜率,确定新插入的数据点的位置和数值。线性插值可以在保持数据趋势和规律的同时,将数据等比例缩小至任意大小。It should be noted that linear interpolation refers to an interpolation method in which the interpolation function is a linear polynomial, and its interpolation error at the interpolation node is zero; linear interpolation is simpler and more convenient than other interpolation methods (such as parabolic interpolation); linear interpolation Interpolation can be used to approximately replace the original function, and can also be used to calculate values that are not in the table during table lookup. The basic idea of linear interpolation is to insert some new data points between the original data points, so that the distance between the data points becomes more uniform; specifically, the new data points can be determined by calculating the slope between adjacent data points. The position and value of the inserted data point. Linear interpolation can scale down data to any size while maintaining data trends and patterns.
对上述线性插值计算的具体描述,可以参照相关技术中的相关描述,为了避免重复,此处不再赘述。For a specific description of the above linear interpolation calculation, please refer to the relevant description in the related art. To avoid repetition, it will not be described again here.
下面对本申请实施例提供的图像补偿方法进行示例性地说明。The image compensation method provided by the embodiment of the present application is exemplarily described below.
示例性地,以上述镜头向左上方偏移为例,假设上述第一图像中图像区域的数量为17×13个;如图8所示,该镜头的物理中心从位置b偏移至了该位置b左上方的b1,那么电子设备可以先通过电子设备中的OIS模块获取该镜头的物理偏移量,并根据该物理偏移量从上述标定补偿数据中确定该第一图像的亮度补偿数据;然后将该物理偏移量直接映射为该第一图像中像素的像素偏移量,并根据该像素偏移量确定出该第一图像中像素的偏移方向为左上方,并根据该像素偏移量和该偏移方向,确定出该第一图像的色彩补偿数据;并根据该亮度补偿数据和该色彩补偿数据,对该第一图像的图像数据进行补偿。For example, taking the above-mentioned lens shifting to the upper left as an example, assume that the number of image areas in the above-mentioned first image is 17×13; as shown in Figure 8, the physical center of the lens shifts from position b to b1 in the upper left corner of position b, then the electronic device can first obtain the physical offset of the lens through the OIS module in the electronic device, and determine the brightness compensation data of the first image from the above-mentioned calibration compensation data based on the physical offset. ;Then the physical offset is directly mapped to the pixel offset of the pixel in the first image, and based on the pixel offset, it is determined that the offset direction of the pixel in the first image is the upper left, and based on the pixel The offset amount and the offset direction determine the color compensation data of the first image; and based on the brightness compensation data and the color compensation data, the image data of the first image is compensated.
上述各个方法实施例,或者各个方法实施例中的各种可能的实现方式可以单独执行,或者,在不存在矛盾的前提下,也可以相互结合执行,具体可以根据实际使用需求确定,本申请实施例对此不做限制。Each of the above method embodiments, or various possible implementations in each method embodiment, can be executed individually, or, provided there is no contradiction, they can also be executed in combination with each other. The details can be determined according to actual usage requirements. This application implements There is no restriction on this.
本申请实施例提供的图像补偿方法,执行主体可以为图像补偿装置。本申请实施例中以图像补偿装置执行图像补偿方法为例,说明本申请实施例提供的图像补偿装置。For the image compensation method provided by the embodiments of the present application, the execution subject may be an image compensation device. In the embodiment of the present application, the image compensation method performed by the image compensation device is used as an example to illustrate the image compensation device provided by the embodiment of the present application.
如图9所示,本申请实施例提供一种图像补偿装置90,该图像补偿装置90包括摄像模组,该摄像模组包括镜头,该图像补偿装置90可以包括获取模块91和补偿模块92。As shown in FIG. 9 , this embodiment of the present application provides an image compensation device 90 . The image compensation device 90 includes a camera module. The camera module includes a lens. The image compensation device 90 may include an acquisition module 91 and a compensation module 92 .
其中,获取模块91,可以用于基于上述摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取该第一图像的亮度补偿数据,该第一物理偏移量在该标定补偿数据对应的镜头的物理偏移范围内。补偿模块92,可以用于基于获取模块91获取的该亮度补偿数据,对该第一图像的图像数据进行补偿。Among them, the acquisition module 91 can be used to acquire the brightness compensation data of the first image based on the first physical offset and calibration compensation data when the camera module collects the first image. The first physical offset is in the The calibration compensation data corresponds to the physical offset range of the lens. The compensation module 92 may be configured to compensate the image data of the first image based on the brightness compensation data obtained by the acquisition module 91 .
一种可能的实现方式中,上述摄像模组还包括图像传感器。获取模块91,还可以用于在基于上述摄像模组采集上述第一图像时的上述第一物理偏移量和上述标定补偿数据,获取该第一图像的亮度补偿数据之前,控制上述镜头的物理中心与该图像传感器的物理中心对齐,并进行第一标定,得到第一标定数据;且控制该镜头向第一方向偏移第二物理偏移量,并进行第二标定,得到第二标定数据;且控制该镜头向第二方向偏移该第二物理偏移量,并进行第三标定,得到第三标定数据;并根据该第一标定数据、该第二标定数据和该第三标定数据,确定该标定补偿数据。其中,该第二物理偏移量为上述物理偏移范围内的最大物理偏移量,该第一方向和该第二方向分别为:该图像传感器的同一对角线上相反的两个方向。In a possible implementation, the above camera module further includes an image sensor. The acquisition module 91 may also be used to control the physical movement of the lens before acquiring the brightness compensation data of the first image based on the first physical offset and the calibration compensation data when the camera module collects the first image. The center is aligned with the physical center of the image sensor, and the first calibration is performed to obtain the first calibration data; and the lens is controlled to offset the second physical offset in the first direction, and the second calibration is performed to obtain the second calibration data. ; And control the lens to offset the second physical offset in the second direction, and perform the third calibration to obtain the third calibration data; and based on the first calibration data, the second calibration data and the third calibration data , determine the calibration compensation data. Wherein, the second physical offset is the maximum physical offset within the above physical offset range, and the first direction and the second direction are respectively two opposite directions on the same diagonal line of the image sensor.
一种可能的实现方式中,获取模块91,具体可以用于根据上述第一物理偏移量,确定第一数据范围;并从上述标定补偿数据中确定与该第一数据范围对应的上述亮度补偿数据。In a possible implementation, the acquisition module 91 may be configured to determine the first data range according to the first physical offset; and determine the brightness compensation corresponding to the first data range from the calibration compensation data. data.
一种可能的实现方式中,获取模块91,还可以用于在补偿模块92基于上述亮度补偿数据,对上述第一图像的图像数据进行补偿之前,将上述第一物理偏移量转换为该第一图像中像素的像素偏移量;并在该像素偏移量大于或等于第一阈值的情况下,根据该像素偏移量以及该第一图像中像素的偏移方向,获取该第一图像的色彩补偿数据。补偿模块92,具体可以用于根据该亮度补偿数据和获取模块91获取的该色彩补偿数据,对该第一图像的图像数据进行补偿。In a possible implementation, the acquisition module 91 may also be configured to convert the first physical offset into the first physical offset before the compensation module 92 compensates the image data of the first image based on the brightness compensation data. The pixel offset of a pixel in an image; and when the pixel offset is greater than or equal to the first threshold, the first image is obtained based on the pixel offset and the offset direction of the pixel in the first image color compensation data. The compensation module 92 may be specifically configured to compensate the image data of the first image according to the brightness compensation data and the color compensation data obtained by the acquisition module 91 .
一种可能的实现方式中,补偿模块92,具体可以用于基于上述第一图像的各个通道在上述色彩补偿数据中对应的数据,计算该第一图像中各个图像区域对应的像素均值;且基于该各个图像区域的像素均值和上述亮度补偿数据,确定该各个图像区域对应的图像补偿数据;并基于该各个图像区域对应的图像补偿数据,对该第一图像的图像数据进行补偿。In one possible implementation, the compensation module 92 may be configured to calculate the pixel mean value corresponding to each image area in the first image based on the data corresponding to each channel of the first image in the color compensation data; and based on The pixel mean value of each image area and the brightness compensation data determine the image compensation data corresponding to each image area; and based on the image compensation data corresponding to each image area, the image data of the first image is compensated.
在本申请实施例提供的图像补偿装置中,由于该图像补偿装置在对采集的第一图像的图像数据进行补偿时采用的亮度补偿数据,是基于采集该第一图像时的实际物理偏移量以及标定补偿数据获取的,因此该亮度补偿数据可以有效避免镜头物理中心偏移对图像成像质量的影响,从而采用该亮度补偿数据对第一图像进行补偿,可以有效避免出现镜头物理中心偏移带来的水波纹暗区的闪动和四角明暗闪烁的问题。In the image compensation device provided by the embodiment of the present application, the brightness compensation data used by the image compensation device when compensating the image data of the first image collected is based on the actual physical offset when the first image is collected. And the calibration compensation data is obtained, so the brightness compensation data can effectively avoid the impact of the physical center shift of the lens on the image quality, so the brightness compensation data is used to compensate the first image, which can effectively avoid the physical center shift band of the lens. There are problems with the flickering of dark areas of water ripples and the flickering of light and dark in the four corners.
本申请实施例中的图像补偿装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtualreality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personalcomputer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personalcomputer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The image compensation device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR) Devices, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA), etc., can also be servers, network attached storage (Network Attached Storage, NAS) , personal computer (PC), television (TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
本申请实施例中的图像补偿装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为IOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The image compensation device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的图像补偿装置能够实现上述方法实施例实现的各个过程,达到相同的技术效果,为避免重复,这里不再赘述。The image compensation device provided by the embodiments of the present application can implement each process implemented by the above method embodiments and achieve the same technical effect. To avoid repetition, details will not be described here.
如图10所示,本申请实施例还提供一种电子设备100,包括处理器101和存储器102,存储器102上存储有可在所述处理器101上运行的程序或指令,该程序或指令被处理器101执行时实现如上述图像补偿方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。As shown in Figure 10, the embodiment of the present application also provides an electronic device 100, including a processor 101 and a memory 102. The memory 102 stores programs or instructions that can be run on the processor 101. The program or instructions are When the processor 101 executes, the steps of the above image compensation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, the details will not be described here.
需要说明的是,本申请实施例中的电子设备包括移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.
图11为实现本申请实施例的一种电子设备的硬件结构示意图。Figure 11 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
如图11所示,电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。As shown in Figure 11, the electronic device 1000 includes but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010 and other components.
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图11中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that the electronic device 1000 may also include a power supply (such as a battery) that supplies power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions. The structure of the electronic device shown in Figure 11 does not constitute a limitation on the electronic device. The electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
其中,电子设备1000包括摄像模组,该摄像模组包括镜头。处理器1010,可以用于基于上述摄像模组采集第一图像时的第一物理偏移量和标定补偿数据,获取该第一图像的亮度补偿数据,该第一物理偏移量在该标定补偿数据对应的镜头的物理偏移范围内。处理器1010,还可以用于基于获取的该亮度补偿数据,对该第一图像的图像数据进行补偿。Among them, the electronic device 1000 includes a camera module, and the camera module includes a lens. The processor 1010 may be configured to obtain the brightness compensation data of the first image based on the first physical offset and calibration compensation data when the camera module collects the first image. The first physical offset is used in the calibration compensation. The data corresponds to the physical offset range of the lens. The processor 1010 may also be configured to compensate the image data of the first image based on the obtained brightness compensation data.
一种可能的实现方式中,上述摄像模组还包括图像传感器。处理器1010,还可以用于在基于上述摄像模组采集上述第一图像时的上述第一物理偏移量和上述标定补偿数据,获取该第一图像的亮度补偿数据之前,控制上述镜头的物理中心与该图像传感器的物理中心对齐,并进行第一标定,得到第一标定数据;且控制该镜头向第一方向偏移第二物理偏移量,并进行第二标定,得到第二标定数据;且控制该镜头向第二方向偏移该第二物理偏移量,并进行第三标定,得到第三标定数据;并根据该第一标定数据、该第二标定数据和该第三标定数据,确定该标定补偿数据。其中,该第二物理偏移量为上述物理偏移范围内的最大物理偏移量,该第一方向和该第二方向分别为:该图像传感器的同一对角线上相反的两个方向。In a possible implementation, the above camera module further includes an image sensor. The processor 1010 may also be configured to control the physical movement of the lens before acquiring the brightness compensation data of the first image based on the first physical offset and the calibration compensation data when the camera module collects the first image. The center is aligned with the physical center of the image sensor, and the first calibration is performed to obtain the first calibration data; and the lens is controlled to offset the second physical offset in the first direction, and the second calibration is performed to obtain the second calibration data. ; And control the lens to offset the second physical offset in the second direction, and perform the third calibration to obtain the third calibration data; and based on the first calibration data, the second calibration data and the third calibration data , determine the calibration compensation data. Wherein, the second physical offset is the maximum physical offset within the above physical offset range, and the first direction and the second direction are respectively two opposite directions on the same diagonal line of the image sensor.
一种可能的实现方式中,处理器1010,具体可以用于根据上述第一物理偏移量,确定第一数据范围;并从上述标定补偿数据中确定与该第一数据范围对应的上述亮度补偿数据。In a possible implementation, the processor 1010 may be configured to determine the first data range according to the first physical offset; and determine the brightness compensation corresponding to the first data range from the calibration compensation data. data.
一种可能的实现方式中,处理器1010,还可以用于在基于上述亮度补偿数据,对上述第一图像的图像数据进行补偿之前,将上述第一物理偏移量转换为该第一图像中像素的像素偏移量;并在该像素偏移量大于或等于第一阈值的情况下,根据该像素偏移量以及该第一图像中像素的偏移方向,获取该第一图像的色彩补偿数据。处理器1010,具体可以用于根据该亮度补偿数据和获取的该色彩补偿数据,对该第一图像的图像数据进行补偿。In a possible implementation, the processor 1010 may also be configured to convert the first physical offset into the first image before compensating the image data of the first image based on the brightness compensation data. The pixel offset of the pixel; and when the pixel offset is greater than or equal to the first threshold, obtain the color compensation of the first image based on the pixel offset and the offset direction of the pixel in the first image data. The processor 1010 may be specifically configured to compensate the image data of the first image according to the brightness compensation data and the obtained color compensation data.
一种可能的实现方式中,处理器1010,具体可以用于基于上述第一图像的各个通道在上述色彩补偿数据中对应的数据,计算该第一图像中各个图像区域对应的像素均值;且基于该各个图像区域的像素均值和上述亮度补偿数据,确定该各个图像区域对应的图像补偿数据;并基于该各个图像区域对应的图像补偿数据,对该第一图像的图像数据进行补偿。In a possible implementation, the processor 1010 may be configured to calculate the pixel mean value corresponding to each image area in the first image based on the data corresponding to each channel of the first image in the color compensation data; and based on The pixel mean value of each image area and the brightness compensation data determine the image compensation data corresponding to each image area; and based on the image compensation data corresponding to each image area, the image data of the first image is compensated.
在本申请实施例提供的电子设备中,由于该电子设备在对采集的第一图像的图像数据进行补偿时采用的亮度补偿数据,是基于采集该第一图像时的实际物理偏移量以及标定补偿数据获取的,因此该亮度补偿数据可以有效避免镜头物理中心偏移对图像成像质量的影响,从而采用该亮度补偿数据对第一图像进行补偿,可以有效避免出现镜头物理中心偏移带来的水波纹暗区的闪动和四角明暗闪烁的问题。In the electronic device provided by the embodiment of the present application, the brightness compensation data used by the electronic device when compensating the image data of the first image collected is based on the actual physical offset and calibration when the first image is collected. The brightness compensation data is obtained by compensating the data. Therefore, the brightness compensation data can effectively avoid the impact of the physical center shift of the lens on the image quality. Therefore, the brightness compensation data is used to compensate the first image, which can effectively avoid the impact of the lens physical center shift. The problem of the flickering of dark areas of water ripples and the flickering of light and dark in the four corners.
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(GraphicsProcessing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042. The graphics processor 10041 is used for recording data generated by an image capture device (such as Process the image data of still pictures or videos obtained by the camera). The display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 . Touch panel 10071, also known as touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be described again here.
存储器1009可用于存储软件程序以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器,或者,存储器1009可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。Memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc. Additionally, memory 1009 may include volatile memory or nonvolatile memory, or memory 1009 may include both volatile and nonvolatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM) , SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 1009 in the embodiment of the present application includes, but is not limited to, these and any other suitable types of memory.
处理器1010可包括一个或多个处理单元;可选地,处理器1010集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1010.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图像补偿方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above image compensation method embodiment is implemented, and the same can be achieved. The technical effects will not be repeated here to avoid repetition.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图像补偿方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the above image compensation method embodiment. Each process can achieve the same technical effect. To avoid duplication, it will not be described again here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像补偿方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application provide a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the above image compensation method embodiment, and can achieve the same technical effect. , to avoid repetition, will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310920890.7A CN116962855A (en) | 2023-07-24 | 2023-07-24 | Image compensation method, device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310920890.7A CN116962855A (en) | 2023-07-24 | 2023-07-24 | Image compensation method, device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116962855A true CN116962855A (en) | 2023-10-27 |
Family
ID=88461488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310920890.7A Pending CN116962855A (en) | 2023-07-24 | 2023-07-24 | Image compensation method, device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116962855A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118274763A (en) * | 2024-06-04 | 2024-07-02 | 歌尔股份有限公司 | Compensation value measurement method, device, apparatus, medium, and product |
-
2023
- 2023-07-24 CN CN202310920890.7A patent/CN116962855A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118274763A (en) * | 2024-06-04 | 2024-07-02 | 歌尔股份有限公司 | Compensation value measurement method, device, apparatus, medium, and product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8712183B2 (en) | System and method for performing image correction | |
CN109194877B (en) | Image compensation method and apparatus, computer-readable storage medium, and electronic device | |
US10002436B2 (en) | Image processing device, image processing method, and solid-state imaging device | |
US9838614B1 (en) | Multi-camera image data generation | |
US10931901B2 (en) | Method and apparatus for selectively correcting fixed pattern noise based on pixel difference values of infrared images | |
US9641753B2 (en) | Image correction apparatus and imaging apparatus | |
US9367916B1 (en) | Method and system of run-time self-calibrating lens shading correction | |
US20150365612A1 (en) | Image capture apparatus and image compensating method thereof | |
US9509902B1 (en) | Methods and devices for correction of camera module sensitivity and flash color variation | |
US20090021603A1 (en) | Exposure adjustment methods and systems | |
CN116962855A (en) | Image compensation method, device, electronic equipment and readable storage medium | |
WO2018058476A1 (en) | Image correction method and device | |
WO2007075066A1 (en) | Image processor, apparatus and method for lens shading compensation | |
KR102282457B1 (en) | Method and apparatus for reducing color moire, and image processing apparatus | |
CN112393804A (en) | Image correction method and device | |
US11044396B2 (en) | Image processing apparatus for calculating a composite ratio of each area based on a contrast value of images, control method of image processing apparatus, and computer-readable storage medium | |
CN112637496A (en) | Image correction method and device | |
US20240357234A1 (en) | Image blur degree determining method and related device thereof | |
WO2023241495A1 (en) | Photographic method and apparatus | |
TWI723729B (en) | White balance adjustment method, image processing device and image processing system | |
CN113271450B (en) | White balance adjustment method, image processing device and image processing system | |
WO2023225825A1 (en) | Position difference graph generation method and apparatus, electronic device, chip, and medium | |
US9298319B2 (en) | Multi-touch recognition apparatus using filtering and a difference image and control method thereof | |
CN114025095B (en) | Brightness adjustment method and device and electronic equipment | |
US20240040248A1 (en) | Video Processing Method and Apparatus, and Electronic Device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |