Movatterモバイル変換


[0]ホーム

URL:


CN115086517A - Image acquisition method and device, electronic equipment and storage medium - Google Patents

Image acquisition method and device, electronic equipment and storage medium
Download PDF

Info

Publication number
CN115086517A
CN115086517ACN202210588469.6ACN202210588469ACN115086517ACN 115086517 ACN115086517 ACN 115086517ACN 202210588469 ACN202210588469 ACN 202210588469ACN 115086517 ACN115086517 ACN 115086517A
Authority
CN
China
Prior art keywords
image
pixel
comparison
photosensitive units
photosensitive
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
Application number
CN202210588469.6A
Other languages
Chinese (zh)
Inventor
刘富强
王宝来
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LCFC Hefei Electronics Technology Co Ltd
Original Assignee
LCFC Hefei Electronics Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by LCFC Hefei Electronics Technology Co LtdfiledCriticalLCFC Hefei Electronics Technology Co Ltd
Priority to CN202210588469.6ApriorityCriticalpatent/CN115086517A/en
Publication of CN115086517ApublicationCriticalpatent/CN115086517A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

The utility model provides an image acquisition method, device, electronic equipment and storage medium, including dividing the sensitization unit array of sensor into multiunit sensitization unit, evenly distributed between the sensitization unit of multiunit sensitization unit, every sensitization unit's of group quantity is the same, this method still includes: in response to image acquisition operation, each group of photosensitive units sequentially acquires images, and a plurality of groups of photosensitive units acquire a plurality of images; taking the image of the target area acquired by any group of photosensitive units as a reference image, taking the images of the target areas acquired by other groups of photosensitive units as comparison images, and respectively determining pixel areas with the same data attribute of each comparison image and the reference image; determining a pixel position offset and a pixel position offset type according to the pixel area, and correcting each comparative image; the corrected comparison image and the reference image are mapped so that the corresponding light receiving units are restored to the positions before grouping, and are fused into a target image.

Description

Translated fromChinese
一种图像采集方法、装置、电子设备及存储介质An image acquisition method, device, electronic device and storage medium

技术领域technical field

本公开涉及图像处理技术领域,尤其涉及一种图像采集方法、装置、电子设备及存储介质。The present disclosure relates to the technical field of image processing, and in particular, to an image acquisition method, device, electronic device and storage medium.

背景技术Background technique

使用相机采集图像是常用的图像采集方式之一,而想要采集到质量较好的图像也需要一定的条件。使用相机进行图像采集时,经常会存在因为相机抖动或者拍摄目标高速移动,导致最终的成像照片出现扭曲失真的现象,使得图像的质量较低。Using a camera to capture images is one of the commonly used image capture methods, and certain conditions are required to capture images with better quality. When using a camera for image acquisition, there is often a phenomenon that the final imaging photo is distorted due to camera shake or high-speed movement of the shooting target, resulting in lower image quality.

发明内容SUMMARY OF THE INVENTION

本公开提供一种图像采集方法、装置、电子设备及存储介质,以至少解决现有技术中存在的以上技术问题。The present disclosure provides an image acquisition method, device, electronic device, and storage medium to at least solve the above technical problems existing in the prior art.

本公开一方面提供一种图像采集方法,包括:One aspect of the present disclosure provides an image acquisition method, including:

将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同,该方法还包括:The photosensitive unit array of the sensor is divided into multiple groups of photosensitive units, the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and the number of photosensitive units of each group of photosensitive units is the same, and the method further includes:

响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像;In response to the image capturing operation, each group of photosensitive units sequentially captures images, and the multiple groups of photosensitive units capture multiple images;

以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域;Taking the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are comparison images, respectively determine the pixel areas with the same data attributes of each comparison image and the reference image;

根据所述像素区域,确定像素位置偏移量和像素位置偏移类型;According to the pixel area, determine the pixel position offset amount and the pixel position offset type;

根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正;correcting each comparison image according to the pixel position offset amount and the pixel position offset type;

将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。The corrected comparison image and the reference image are mapped by restoring the corresponding photosensitive units to the positions before grouping, and all the corrected comparison images and reference images are fused into the target image.

在一可实施方式中,所述数据属性包括感光单元的灰度值和组合关系,所述组合关系用于描述当前感光单元与其相邻感光单元之间的位置关系。In one possible implementation manner, the data attributes include grayscale values of the photosensitive units and a combination relationship, and the combination relationship is used to describe the positional relationship between the current photosensitive unit and its adjacent photosensitive units.

在一可实施方式中,所述确定每张比较图像与基准图像的数据属性相同的像素区域,包括:In a possible implementation manner, the determining of the pixel area with the same data attribute of each comparison image and the reference image includes:

通过逐行扫描、逐列扫描和/或滑动窗口扫描的方式,从比较图像上和基准图像上选取灰度值相同的区域,且灰度值对应的感光单元的组合关系在所述区域内也相同,确定该区域为像素区域。By row-by-row scanning, column-by-column scanning and/or sliding window scanning, an area with the same grayscale value is selected from the comparison image and the reference image, and the combination relationship of the photosensitive units corresponding to the grayscale value is also in the area. In the same way, the area is determined to be a pixel area.

在一可实施方式中,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:In a possible implementation manner, the determining a pixel position offset amount and a pixel position offset type according to the pixel area includes:

若所述像素区域的全部像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息全部发生变化且发生变化的像素位置偏移量一致,则确定所述像素位置偏移类型为第一偏移类型;If the position information of the photosensitive units corresponding to all the pixels in the pixel area in the comparison image are all changed compared with the position information of the corresponding photosensitive units in the reference image, and the changed pixel position offsets are consistent , then it is determined that the pixel position offset type is the first offset type;

确定所述像素区域在所述比较图像中对应的感光单元上的第一比较位置,确定所述像素区域在所述基准图像中对应的感光单元上的第一基准位置,则所述第一偏移类型对应的所述像素位置偏移量为所述第一比较位置相较于所述第一基准位置的第一偏移数据。Determine the first comparison position of the pixel area on the photosensitive unit corresponding to the comparison image, and determine the first reference position of the pixel area on the photosensitive unit corresponding to the reference image, then the first offset The pixel position offset corresponding to the shift type is first offset data of the first comparison position compared to the first reference position.

在一可实施方式中,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:In a possible implementation manner, the determining a pixel position offset amount and a pixel position offset type according to the pixel area includes:

若所述像素区域中的部分像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息发生变化,则确定所述像素位置偏移类型为第二偏移类型;If the position information of the corresponding photosensitive unit in the comparison image of some pixels in the pixel area is changed compared with the position information of the corresponding photosensitive unit in the reference image, the pixel position offset type is determined is the second offset type;

确定位置信息发生变化的部分像素为像素子区域,并确定所述像素子区域在所述比较图像中对应的感光单元上的第二比较位置,以及所述像素子区域在所述基准图像中对应的感光单元上的第二基准位置,则所述第二偏移类型对应的所述像素位置偏移量为所述第二比较位置相较于所述第二基准位置的第二偏移数据。It is determined that some pixels whose position information changes are pixel sub-regions, and the second comparison position of the pixel sub-region on the corresponding photosensitive unit in the comparison image, and the pixel sub-region corresponding to the reference image is determined. The second reference position on the photosensitive unit, the pixel position offset corresponding to the second offset type is the second offset data of the second comparison position compared to the second reference position.

在一可实施方式中,所述根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正,包括:In an optional implementation manner, the correction for each comparison image according to the pixel position offset amount and the pixel position offset type includes:

确定所述像素位置偏移类型为第一偏移类型,通过所述第一比较位置和所述第一偏移数据,确定所述像素区域在比较图像上对应的感光单元上的第一目标位置;Determine that the pixel position offset type is the first offset type, and determine the first target position of the pixel area on the photosensitive unit corresponding to the comparison image by using the first comparison position and the first offset data ;

将所述比较图像上所述像素区域的全部像素的数据属性,从所述第一比较位置对照修改到所述第一目标位置。The data attributes of all the pixels in the pixel area on the comparison image are compared and modified from the first comparison position to the first target position.

在一可实施方式中,确定所述像素位置偏移类型为第二偏移类型,通过所述第二比较位置和所述第二偏移数据,确定所述像素子区域在比较图像上映射到对应的感光单元上的第二目标位置;In an optional implementation manner, it is determined that the pixel position offset type is a second offset type, and it is determined that the pixel sub-region is mapped to the comparison image by using the second comparison position and the second offset data. the second target position on the corresponding photosensitive unit;

将所述比较图像上所述像素子区域的全部像素的数据属性,从所述第二比较位置对照修改到所述第二目标位置。The data attributes of all the pixels in the pixel sub-region on the comparison image are compared and modified from the second comparison position to the second target position.

本公开另一方面提供一种装置,包括:Another aspect of the present disclosure provides an apparatus, comprising:

构建模块,用于将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同;The building module is used to divide the photosensitive unit array of the sensor into multiple groups of photosensitive units, the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and the number of photosensitive units of each group of photosensitive units is the same;

获取模块,用于响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像;an acquisition module, configured to sequentially acquire images for each group of photosensitive units in response to an image acquisition operation, and the multiple groups of photosensitive units acquire multiple images;

所述获取模块,还用于以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域;The acquisition module is also used to take the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are the comparison images, and determine the data of each comparison image and the reference image respectively. Pixel areas with the same attributes;

处理模块,用于根据所述像素区域,确定像素位置偏移量和像素位置偏移类型;a processing module, configured to determine a pixel position offset amount and a pixel position offset type according to the pixel area;

所述处理模块,还用于根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正;The processing module is further configured to correct each comparison image according to the pixel position offset amount and the pixel position offset type;

计算模块,用于将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。The calculation module is used for mapping the corrected comparison image and the reference image by restoring the corresponding photosensitive units to the position before the grouping, and fuses all the corrected comparison images and the reference image into the target image.

本公开再一方面提供一种电子设备,包括:存储器和处理器,所述存储器存储由所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时实现上述图像采集方法。Yet another aspect of the present disclosure provides an electronic device, including: a memory and a processor, where the memory stores a computer program executable by the processor, and the processor implements the above-mentioned image acquisition method when the computer program is executed.

本公开还一方面提供一种存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被读取并执行时,实现上述图像采集方法。Another aspect of the present disclosure provides a storage medium, characterized in that, a computer program is stored on the storage medium, and when the computer program is read and executed, the above-mentioned image acquisition method is implemented.

基于上述方案,本公开提供一种图像采集方法,将传感器的感光单元划分,令每组感光单元的数量相同,分别采集目标区域的图像,使得采集到的每张图像的像素对应,确定任一图像为基准图像,其他图像为比较图像,确定数据属性相同的像素区域,并确定像素位置偏移量和像素位置偏移类型,对比较图像进行校正,通过多组感光单元复位的方式,将经过校正的比较图像和基准图像进行融合,使得得到的图像的质量较高。Based on the above solution, the present disclosure provides an image acquisition method, which divides the photosensitive units of a sensor so that the number of each group of photosensitive units is the same, and collects images of the target area respectively, so that the pixels of each collected image correspond to each other, and determine any one The image is the reference image, and the other images are the comparison images. Determine the pixel area with the same data attribute, determine the pixel position offset and the pixel position offset type, and correct the comparison image. The corrected comparison image and the reference image are fused, so that the quality of the obtained image is higher.

附图说明Description of drawings

图1所示为本公开一实施例提供的图像采集方法的流程示意图;FIG. 1 shows a schematic flowchart of an image acquisition method provided by an embodiment of the present disclosure;

图2所示为本公开一实施例提供的比较图像和基准图像的对比示意图;FIG. 2 is a schematic diagram of a comparison between a comparison image and a reference image provided by an embodiment of the present disclosure;

图3所示为本公开一实施例提供的感光单元阵列分组前后对比示意图;FIG. 3 is a schematic diagram showing a comparison before and after the photosensitive unit array grouping provided by an embodiment of the present disclosure;

图4所示为本公开一实施例提供的感光单元阵列分组前后运行对比示意图;FIG. 4 is a schematic diagram illustrating a comparison between operations before and after the photosensitive cell array is grouped according to an embodiment of the present disclosure;

图5所示为本公开另一实施例提供的比较图像和基准图像的对比示意图;FIG. 5 is a schematic diagram illustrating a comparison between a comparison image and a reference image provided by another embodiment of the present disclosure;

图6所示为本公开另一实施例提供的比较图像和基准图像的对比示意图;FIG. 6 is a schematic diagram illustrating a comparison between a comparison image and a reference image provided by another embodiment of the present disclosure;

图7所示为本公开再一实施例提供的比较图像及其映射的感光单元和基准图像及其映射的感光单元的对比示意图;FIG. 7 is a schematic diagram showing the comparison of a comparison image and its mapped photosensitive units and a reference image and its mapped photosensitive units according to still another embodiment of the present disclosure;

图8所示为本公开还一实施例提供的比较图像及其映射的感光单元和基准图像及其映射的感光单元的对比示意图;8 is a schematic diagram illustrating a comparison of a comparison image and its mapped photosensitive units and a reference image and its mapped photosensitive units according to still another embodiment of the present disclosure;

图9所示为本公开一实施例提供的图像采集装置示意图。FIG. 9 is a schematic diagram of an image capturing apparatus according to an embodiment of the present disclosure.

具体实施方式Detailed ways

为使本公开的目的、特征、优点能够更加的明显和易懂,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而非全部实施例。基于本公开中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, features and advantages of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present disclosure. The embodiments are only some, but not all, embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present disclosure.

为了提高图像的采集质量,如图1所示,本公开一实施例提供了一种方法,将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同,在一示例中,传感器包括感光单元阵列,将感光单元阵列中的感光单元划分为至少两组,即包括划分为两组、三组、四组或更多组的感光单元,每组感光单元采集一张图像,有几组感光单元则对应采集几张图像。每组感光单元的数量相同,以使采集相同目标区域的图像时,图像上的像素能够映射到相同位置的感光单元。In order to improve the quality of image acquisition, as shown in FIG. 1 , an embodiment of the present disclosure provides a method for dividing a photosensitive unit array of a sensor into multiple groups of photosensitive units, and the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and each photosensitive unit is evenly distributed. The number of photosensitive units in a group of photosensitive units is the same. In an example, the sensor includes a photosensitive unit array, and the photosensitive units in the photosensitive unit array are divided into at least two groups, that is, divided into two groups, three groups, four groups or more groups. Each group of photosensitive units collects one image, and there are several groups of photosensitive units to collect several images correspondingly. The number of photosensitive units in each group is the same, so that when capturing images of the same target area, pixels on the image can be mapped to photosensitive units at the same position.

在一示例中,为了更好的采集效果,每组感光单元之间可按照规律均匀分布,如交叉分布。In an example, for better acquisition effect, each group of photosensitive units may be uniformly distributed according to a rule, such as cross distribution.

该方法还包括:The method also includes:

步骤101,响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像。Step 101 , in response to the image capturing operation, each group of photosensitive units sequentially captures images, and the multiple groups of photosensitive units capture multiple images.

在一示例中,每张图像均为同一目标区域不同时间的成像图像,所有图像的采集时间的和等于拍摄该目标图像所用时间。例如,未对感光阵列进行分割时,由于感光阵列中的感光单元工作时是自上而下按行进行的,若原本图像采集的工作时长为t,则当感光阵列按照如上所述分割为两组时,则如图4中所示,先是都标为1的第一组感光单元按照自上而下逐行进行,工作时长为t/2,再为都标为2的第二组感光单元按照自上而下逐行进行,工作时长也为t/2,第二组感光单元的采集时间晚于第一组感光单元的采集时间,两者的采集时间的和等于未分组时拍摄该目标图像所用时间。In an example, each image is an imaging image of the same target area at different times, and the sum of the acquisition times of all the images is equal to the time used to capture the target image. For example, when the photosensitive array is not divided, since the photosensitive units in the photosensitive array work in rows from top to bottom, if the original image acquisition working time is t, when the photosensitive array is divided into two as described above As shown in Figure 4, the first group of photosensitive units marked as 1 proceed row by row from top to bottom, and the working time is t/2, and then the second group of photosensitive units marked as 2 It is carried out line by line from top to bottom, and the working time is also t/2. The acquisition time of the second group of photosensitive units is later than the acquisition time of the first group of photosensitive units, and the sum of the two acquisition times is equal to the target when the target is not grouped. Time spent in the image.

再例如,假设目标区域中存在从左向右的移动目标,且存在三组感光单元,则第一组感光单元在第一时间采集的图像中,该移动目标位于目标区域的左边,第二组感光单元在第二时间采集的图像中,该移动目标位于目标区域的中间,第三组感光单元在第三时间采集的图像中,该移动目标位于目标区域的右边。其中,第一时间结束后开始第二时间,第二时间结束后开始第三时间。For another example, assuming that there is a moving target from left to right in the target area, and there are three groups of photosensitive units, then in the image collected by the first group of photosensitive units at the first time, the moving target is located on the left of the target area, and the second group of photosensitive units is located on the left of the target area. In the image captured by the photosensitive unit at the second time, the moving target is located in the middle of the target area, and in the image captured by the third group of photosensitive units at the third time, the moving target is positioned to the right of the target area. The second time starts after the first time ends, and the third time starts after the second time ends.

通过传感器的感光单元分组采集,相较于未分组的传统采集方式从模糊的信息或者较少有用信息中推演和插值,本公开在总体采集时间不变的情况下,每组感光单元采集的图像更接近真实目标区域的景象,能够还原保留更多拍照细节。Through the grouping collection of photosensitive units of the sensor, compared with the traditional acquisition method that is not grouped, deduced and interpolated from fuzzy information or less useful information, the present disclosure under the condition that the overall acquisition time remains unchanged, the images collected by each group of photosensitive units The scene closer to the real target area can restore and retain more photo details.

步骤102,以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域。Step 102: Take the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are the comparison images, and determine the pixel areas with the same data attributes of each comparison image and the reference image respectively. .

感光单元又可称为传感器的像素,而图像通过感光单元获取,因此图像的像素与感光单元之间具有映射关系,感光单元的数据属性也为像素的数据属性。通过获取并确定每个感光单元的数据属性,能够确定图像上的像素区域的唯一性。The photosensitive unit can also be called the pixel of the sensor, and the image is obtained by the photosensitive unit, so there is a mapping relationship between the pixel of the image and the photosensitive unit, and the data attribute of the photosensitive unit is also the data attribute of the pixel. By acquiring and determining the data attributes of each photosensitive unit, the uniqueness of the pixel area on the image can be determined.

在一示例中,以任一组感光单元采集的目标区域的图像为基准图像,也可均以采集的第一张图像作为基准图像,例如假设若存在两组感光单元,则以第一组感光单元在第一时间采集的图像为基准图像,第二组感光单元在第二时间采集的图像为比较图像,第二时间晚于第一时间;若存在三组感光单元,则可以第一组感光单元采集的图像为基准图像,第二组和第三组感光单元采集的图像均为比较图像,以上仅为示例,具体在此不做限定。应该理解的是,当确定像素区域时,是每张比较图像与基准图像单独进行比较,如将第二组感光单元采集的比较图像与第一组感光单元采集的基准图像进行比较,以及将第三组感光单元采集的比较图像与第一组感光单元采集的基准图像进行比较。In an example, the image of the target area collected by any group of photosensitive units is used as the reference image, and the first image collected may also be used as the reference image. For example, if there are two groups of photosensitive units, the first group The image collected by the unit at the first time is the reference image, and the image collected by the second group of photosensitive units at the second time is the comparison image, and the second time is later than the first time; if there are three groups of photosensitive units, the first group of photosensitive units can be photosensitive. The images collected by the units are reference images, and the images collected by the second group and the third group of photosensitive units are all comparison images, and the above is only an example, which is not specifically limited here. It should be understood that, when determining the pixel area, each comparison image is compared with the reference image individually, for example, comparing the comparison images collected by the second group of photosensitive units with the reference images collected by the first group of photosensitive units, and comparing the first group of photosensitive units with the reference images. The comparison images collected by the three groups of photosensitive units are compared with the reference images collected by the first group of photosensitive units.

步骤103,根据所述像素区域,确定像素位置偏移量和像素位置偏移类型。Step 103: Determine a pixel position offset amount and a pixel position offset type according to the pixel area.

由于比较图像上的像素区域和基准图像上的像素区域之间,既有关联又有不同,因此可设定相应的条件,根据关联和不同,确定像素位置偏移类型以针对不同的情况,像素位置偏移量用于定量描述比较图像上相较于基准图像上的像素变化情况,而像素变化情况并非单一,因此需要通过像素位置偏移类型确定像素位置偏移量。Since there are both correlations and differences between the pixel area on the comparison image and the pixel area on the reference image, corresponding conditions can be set, and the type of pixel position offset can be determined according to the correlation and difference. The position offset is used to quantitatively describe the pixel change in the comparison image compared to the reference image, and the pixel change is not single, so the pixel position offset needs to be determined by the pixel position offset type.

步骤104,根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正。Step 104: Correct each comparison image according to the pixel position offset amount and the pixel position offset type.

根据步骤103可知,像素位置偏移类型用于描述不同的像素变化情况,像素偏移类型不同,校正的方式也应该有所区别,因此,确定基准图像,可根据对应的像素位置偏移量和像素位置偏移类型对比较图像进行校正。It can be seen from step 103 that the pixel position offset type is used to describe different pixel changes. Different pixel offset types have different correction methods. Therefore, to determine the reference image, it can be determined according to the corresponding pixel position offset and The Pixel Position Offset type corrects the comparison image.

步骤105,将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。Step 105: Map the corrected comparison image and the reference image by restoring their corresponding photosensitive units to their positions before grouping, and fuse all the corrected comparison images and reference images into a target image.

在一示例中,如图3和4所示,假设感光单元分为两组,第一组感光单元与第二组感光单元是通过将感光单元阵列分割的方式得到的,如将感光单元以1 2 1 2 1 2 1 2的方式进行分割,则得到的第一组感光单元为1 1 1 1,第二组感光单元为2 2 2 2,因此,将第一组感光单元和第二组感光单元复原为分组之前位置的方式为1 2 1 2 1 2 1 2。也可以将感光单元以1 1 2 2 1 1 2 2的方式进行分割。映射在图像上则使得比较图像和基准图像的像素也以该方式排列,相对于单张图像提高图像的精度。In an example, as shown in Figures 3 and 4, it is assumed that the photosensitive units are divided into two groups, and the first group of photosensitive units and the second group of photosensitive units are obtained by dividing the photosensitive unit array. 2 1 2 1 2 1 2, the obtained first group of photosensitive units is 1 1 1 1, and the second group of photosensitive units is 2 2 2 2. Therefore, the first group of photosensitive units and the second group of photosensitive units are The way the cell is restored to its pre-packet position is 1 2 1 2 1 2 1 2. The photosensitive unit can also be divided in a way of 1 1 2 2 1 1 2 2. Mapping on the image causes the pixels of the comparison image and the reference image to be arranged in this way, improving the accuracy of the image relative to a single image.

在一示例中,当感光阵列分割为三组时,还可以是1 2 3 1 2 3 1 2 3,则得到的第一组感光单元为1 1 1,第二组感光单元为2 2 2,第三组感光单元为3 3 3,当校正完毕后,将每组感光单元获取的图像的像素进行融合,应与上述原理相同,在此不予赘述。分割的组数越多,则融合后的目标图像的质量越好。In an example, when the photosensitive array is divided into three groups, it can also be 1 2 3 1 2 3 1 2 3, then the obtained first group of photosensitive units is 1 1 1, and the second group of photosensitive units is 2 2 2, The third group of photosensitive units is 3 3 3. After the correction is completed, the pixels of the images obtained by each group of photosensitive units are fused, which should be the same as the above principle, and will not be repeated here. The greater the number of divided groups, the better the quality of the fused target image.

基于上述方案,本公开提供的一种图像采集方法,将传感器的感光单元阵列划分成多组,令每组感光单元的数量相同,每组感光单元依次分别采集目标区域的图像,使得采集到的每张图像的像素对应,确定任一图像为基准图像,其他图像为比较图像,确定数据属性相同的像素区域,并确定像素位置偏移量和像素位置偏移类型,对比较图像进行校正,通过多组感光单元复位的方式,将经过校正的比较图像和基准图像进行融合,使得得到的图像的质量较高。Based on the above solution, the present disclosure provides an image acquisition method that divides the photosensitive unit array of the sensor into multiple groups, so that the number of photosensitive units in each group is the same, and each group of photosensitive units sequentially collects images of the target area, so that the collected The pixels of each image correspond, determine any image as the reference image, and other images as the comparison image, determine the pixel area with the same data attribute, and determine the pixel position offset and pixel position offset type, and correct the comparison image by In the way of resetting multiple groups of photosensitive units, the corrected comparison image and the reference image are fused, so that the quality of the obtained image is higher.

在一示例中,步骤102中,所述数据属性包括感光单元的灰度值和组合关系,所述组合关系用于描述当前感光单元与其相邻感光单元之间的位置关系。In an example, in step 102, the data attribute includes the gray value of the photosensitive unit and a combination relationship, and the combination relationship is used to describe the positional relationship between the current photosensitive unit and its adjacent photosensitive units.

数据属性可以直接获取,数据属性包括灰度值和组合关系,组合关系用于描述当前感光单元与其相邻感光单元之间的位置关系,应该理解的是,相邻感光单元具有多个,具体限定哪几个相邻的方向,根据实际需求决定。如当基准图像中某行的像素的灰度值依次为012345,则在以行为单位获取的像素中,隐含确定了该行中的每个像素的组合关系,只要在比较图像中找到另一行像素灰度值也依次为012345,即可将该行像素纳入像素区域。The data attributes can be obtained directly. The data attributes include the gray value and the combination relationship. The combination relationship is used to describe the positional relationship between the current photosensitive unit and its adjacent photosensitive units. It should be understood that there are multiple adjacent photosensitive units. Which adjacent directions are determined according to actual needs. For example, when the gray values of the pixels of a row in the reference image are 012345 in turn, then in the pixels obtained in units of rows, the combination relationship of each pixel in the row is implicitly determined, as long as another row is found in the comparison image The pixel gray value is also 012345 in turn, and the row of pixels can be included in the pixel area.

在一示例中,步骤102中,所述确定每张比较图像与基准图像的数据属性相同的像素区域,包括:In an example, in step 102, the determining of the pixel area with the same data attribute of each comparison image and the reference image includes:

通过逐行扫描、逐列扫描和/或滑动窗口扫描的方式,从比较图像上和基准图像上选取灰度值相同的区域,且灰度值对应的感光单元的组合关系在所述区域内也相同,确定该区域为像素区域。By row-by-row scanning, column-by-column scanning and/or sliding window scanning, an area with the same grayscale value is selected from the comparison image and the reference image, and the combination relationship of the photosensitive units corresponding to the grayscale value is also in the area. In the same way, the area is determined to be a pixel area.

在一示例中,按照逐行和逐列的方式,将比较图像上的行和列的像素的灰度值分别与基准图像上的行和列的像素的灰度值进行比较,找到灰度值及像素的位置顺序排列相同的行和列(排列顺序隐含了组合关系),形成数据属性相同的像素区域,以图2来说,左边为基准图像,右边为比较图像,以从左往右为顺序,基准图像的第一行的像素的灰度值依次为1和2,第二行的像素的灰度值依次为3和4,比较图像的第一行的像素的灰度值依次为2和5,第二行的像素的灰度值依次为4和6,可知两者没有灰度值以及像素的位置排列顺序相同的行数据;以从上往下为顺序,基准图像的第一列的像素的灰度值依次为1和3,第二列的像素的灰度值依次为2和4,比较图像的第一列的像素的灰度值依次为2和4,第二列的像素的灰度值依次为5和6,可知两者灰度值依次为2和4的列数据相同,即该区域的灰度值相同,且都是在2下方邻接有4,4上方邻接有2,像素的位置顺序在该区域内相同,像素映射于感光单元,即隐含的组合关系也相同,可以确定灰度值为2和4的像素为该比较图像和基准图像的像素区域。In an example, in a row-by-row and column-by-column manner, the gray values of the pixels in the rows and columns on the comparison image are compared with the gray values of the pixels in the rows and columns on the reference image, respectively, and the gray value is found. And the position of the pixels are arranged in the same row and column (the arrangement order implies the combination relationship) to form a pixel area with the same data attribute. For Figure 2, the left side is the reference image, and the right side is the comparison image, from left to right For the order, the gray values of the pixels in the first row of the reference image are 1 and 2, the gray values of the pixels in the second row are 3 and 4, and the gray values of the pixels in the first row of the comparison image are 2 and 5, the gray values of the pixels in the second row are 4 and 6 in turn. It can be seen that there is no row data with the same gray value and pixel position arrangement order; The grayscale values of the pixels in the column are 1 and 3 in sequence, the grayscale values of the pixels in the second column are 2 and 4 in sequence, the grayscale values of the pixels in the first column of the comparison image are 2 and 4 in sequence, and the grayscale values of the pixels in the second column are 2 and 4 in sequence. The gray values of the pixels are 5 and 6 in turn. It can be seen that the column data with the gray values of 2 and 4 are the same, that is, the gray values of the area are the same, and both are adjacent to 4 below 2, and adjacent to 4 above 4. 2. The position sequence of the pixels is the same in this area, and the pixels are mapped to the photosensitive unit, that is, the implied combination relationship is also the same. It can be determined that the pixels with grayscale values of 2 and 4 are the pixel areas of the comparison image and the reference image.

在上述步骤之后,为了避免比较图像中间相较于基准图像存在的、非整行和整列的一定面积的像素移动的情况,还需通过滑动窗口的形式对剩余的区域滑动选取像素块进行对比,具体滑动窗口的尺寸(即包含的像素量)以及滑动的步长等,可根据实际应用进行调整。需要注意的是,滑动窗口在比较图像和基准图像上需要同步,具体的,基准图像上的窗口可为主窗口,比较图像上的窗口为副窗口,两个窗口的大小、移动步长、起始点和移动方向等均相同。After the above steps, in order to avoid the movement of a certain area of pixels in the middle of the comparison image compared with the reference image, which is not an entire row or an entire column, it is also necessary to slide the remaining area in the form of a sliding window to select pixel blocks for comparison. The size of the specific sliding window (that is, the amount of pixels contained) and the sliding step size, etc., can be adjusted according to the actual application. It should be noted that the sliding window needs to be synchronized between the comparison image and the reference image. Specifically, the window on the reference image can be the main window, and the window on the comparison image is the sub-window. The starting point and moving direction are the same.

应该理解的是,使用滑动窗口的形式进行滑动选取时,可以仅滑动选取一次,也可以设置不同的尺寸滑动多次,不同尺寸的滑动窗口滑动的区域可以是相同区域,也可以是经过上一次滑动选取后剩下的区域,以达到尽量避免选取上遗漏的目的。同样的,按列或按行或通过滑动窗口进行选取和比较,或者先按列再按行再通过滑动窗口进行选取和比较,不限定具体的先后顺序,可根据实际情况任意组合和调整,只要能够实现尽可能全面的对比即可。It should be understood that when using the sliding window form for sliding selection, you can only slide the selection once, or you can set different sizes to slide multiple times. The sliding area of the sliding window of different sizes can be the same area, or it can be after the last time. Swipe the remaining area after selection, in order to avoid omission in the selection as much as possible. Similarly, select and compare by column or row or through a sliding window, or select and compare by column, then row, and then through a sliding window. The specific sequence is not limited, and can be arbitrarily combined and adjusted according to the actual situation It is sufficient to achieve as comprehensive a comparison as possible.

在一示例中,步骤103中,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:In an example, in step 103, the determining a pixel position offset amount and a pixel position offset type according to the pixel area includes:

若所述像素区域的全部像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息全部发生变化且发生变化的像素位置偏移量一致,则确定所述像素位置偏移类型为第一偏移类型;If the position information of the photosensitive units corresponding to all the pixels in the pixel area in the comparison image are all changed compared with the position information of the corresponding photosensitive units in the reference image, and the changed pixel position offsets are consistent , then it is determined that the pixel position offset type is the first offset type;

确定所述像素区域在所述比较图像中对应的感光单元上的第一比较位置,确定所述像素区域在所述基准图像中对应的感光单元上的第一基准位置,则所述第一偏移类型对应的所述像素位置偏移量为所述第一比较位置相较于所述第一基准位置的第一偏移数据。Determine the first comparison position of the pixel area on the photosensitive unit corresponding to the comparison image, and determine the first reference position of the pixel area on the photosensitive unit corresponding to the reference image, then the first offset The pixel position offset corresponding to the shift type is first offset data of the first comparison position compared to the first reference position.

在一示例中,如图5所示,左边展示的为基准图像,右边展示的为比较图像,分别获取两张图像每行像素按顺序排列的灰度值,如比较图像上对应的第一行的像素的灰度值依次为21345,获取基准图像上的所有以行为单位的像素并比较,并继续获取比较图像上其他行对应的像素与基准图像上的所有行对应的像素的灰度值进行比较,可知没有相同的以行为单位的像素。再分别获取两张图像每列像素的灰度值,以上述按行比较的情况进行类推,确定比较图像上的第1列至第4列与基准图像上的第2列至第5列相同,如图5中的斜纹填充区域所示,判定比较图像上的第1列至第4列对应的像素为比较图像的像素区域,基准图像上的第2列至第5列对应的像素为基准图像的像素区域。应该注意的是,每确定某列(或某行或某滑动窗口对应的区域)为可以纳入像素区域时,都计算该列在比较图像上映射到感光单元的位置信息与在基准图像上映射到感光单元的位置信息之间的像素位置偏移量,并确定像素位置偏移量一致,将这种情况确定为第一偏移类型。In an example, as shown in FIG. 5 , the reference image is shown on the left, and the comparison image is shown on the right, and the grayscale values of the pixels in each row of the two images are obtained in order, such as the first row corresponding to the comparison image. The grayscale values of the pixels are 21345 in turn, obtain all the pixels in the reference image and compare them, and continue to obtain the grayscale values of the pixels corresponding to other lines on the comparison image and the pixels corresponding to all the lines on the reference image. By comparison, it can be seen that there are no identical pixels in row units. Then obtain the gray value of the pixels in each column of the two images respectively, and by analogy with the above row-by-row comparison, it is determined that the 1st to 4th columns on the comparison image are the same as the 2nd to 5th columns on the reference image, As shown in the diagonally filled area in Fig. 5, it is determined that the pixels corresponding to the 1st to 4th columns on the comparison image are the pixel areas of the comparison image, and the pixels corresponding to the 2nd to 5th columns on the reference image are the reference image pixel area. It should be noted that each time a column (or a row or an area corresponding to a sliding window) is determined to be a pixel area that can be included in the pixel area, the position information of the column mapped to the photosensitive unit on the comparison image and the location information mapped to the photosensitive unit on the reference image are calculated. The pixel position offset between the position information of the photosensitive units is determined, and the pixel position offset is determined to be consistent, and this situation is determined as the first offset type.

在一示例中,第一偏移类型下,选取像素区域在比较图像上对应的感光单元的第一比较位置以及在基准图像上对应的感光单元的第一基准位置,计算第一比较位置与第一基准位置的偏移量作为第一偏移数据。In an example, under the first offset type, the first comparison position of the photosensitive unit corresponding to the pixel area on the comparison image and the first reference position of the photosensitive unit corresponding to the reference image are selected, and the first comparison position and the first reference position of the photosensitive unit are calculated. An offset amount of a reference position is used as the first offset data.

例如,以图5所示,像素区域在比较图像上对应的感光单元的第一比较位置为第1列至第4列的第1至5行,像素区域在基准图像上对应的感光单元的第一基准位置为第2列至第5列的第1至5行,或以像素区域中任一列对应的列数据为例,像素的灰度值依次为23307的列数据在比较图像中的第一比较位置为第1列的第1至5行,在基准图像中的第一基准位置为第2列的第1至5行,因此,此处的第一偏移数据为-1。For example, as shown in FIG. 5 , the first comparison position of the photosensitive unit corresponding to the pixel area on the comparison image is the 1st to 5th row of the 1st column to the 4th column, and the first comparison position of the photosensitive unit corresponding to the pixel area on the reference image A reference position is the 1st to 5th rows from the 2nd column to the 5th column, or taking the column data corresponding to any column in the pixel area as an example, the column data whose pixel grayscale value is 23307 in sequence is the first in the comparison image. The comparison positions arerows 1 to 5 of the first column, and the first reference position in the reference image is therows 1 to 5 of the second column, so the first offset data here is -1.

在一示例中,步骤103中,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:In an example, in step 103, the determining a pixel position offset amount and a pixel position offset type according to the pixel area includes:

若所述像素区域中的部分像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息发生变化,则确定所述像素位置偏移类型为第二偏移类型;If the position information of the corresponding photosensitive unit in the comparison image of some pixels in the pixel area is changed compared with the position information of the corresponding photosensitive unit in the reference image, the pixel position offset type is determined is the second offset type;

确定位置信息发生变化的部分像素为像素子区域,并确定所述像素子区域在所述比较图像中对应的感光单元上的第二比较位置,以及所述像素子区域在所述基准图像中对应的感光单元上的第二基准位置,则所述第二偏移类型对应的所述像素位置偏移量为所述第二比较位置相较于所述第二基准位置的第二偏移数据。It is determined that some pixels whose position information changes are pixel sub-regions, and the second comparison position of the pixel sub-region on the corresponding photosensitive unit in the comparison image, and the pixel sub-region corresponding to the reference image is determined. The second reference position on the photosensitive unit, the pixel position offset corresponding to the second offset type is the second offset data of the second comparison position compared to the second reference position.

在一示例中,例如,如图6所示,左边所展示的为基准图像,右边所展示的为比较图像,先逐行和逐列进行比较,比较图像上对应的第一行的像素的灰度值依次为12134,分别获取基准图像上的每一行的像素的灰度值并与12134做比较,确定基准图像上存在像素的灰度值依次为12134的行,以此类推,确定如图的第一行、第一列、第二行以及第五行的像素相同,如图6中的斜纹填充区域所示,则确定属于像素区域,且在比较图像上映射在感光单元的位置信息与在基准图像上映射在感光单元的位置信息相同没有发生偏移。再通过滑动窗口进行选取和比较,获取到比较图像上第3行至第4行的第4至5列所对应的像素也属于像素区域,如图6中的网格填充区域所示,且在比较图像上映射在感光单元的位置信息与在基准图像上映射在感光单元的位置信息发生了偏移,将该像素区域确定为像素子区域。In an example, for example, as shown in FIG. 6 , the reference image is shown on the left, and the comparison image is shown on the right. First, the comparison is performed row by row and column by column, and the gray levels of the pixels in the corresponding first row on the images are compared. The degree value is 12134 in turn, respectively obtain the gray value of each row of pixels on the reference image and compare it with 12134, and determine that the gray value of the pixel in the reference image is 12134 in turn, and so on, determine the line as shown in the figure The pixels in the first row, the first column, the second row and the fifth row are the same, as shown in the diagonally filled area in Fig. 6, it is determined to belong to the pixel area, and the position information mapped on the photosensitive unit on the comparison image is the same as the one in the benchmark. The position information mapped to the photosensitive unit on the image is the same and does not shift. Then select and compare through the sliding window, and obtain the pixels corresponding to the 4th to 5th columns from the 3rd row to the 4th row on the comparison image, which also belong to the pixel area, as shown in the grid filling area in Fig. The position information mapped on the photosensitive unit on the comparison image is offset from the position information mapped on the photosensitive unit on the reference image, and the pixel area is determined as a pixel sub-area.

其中,应该理解的是,滑动窗口可以选择长为两列、宽为一行尺寸的滑动窗口,也可以选择长为两列、宽为两列尺寸的滑动窗口等,此处仅为举例,具体滑动窗口的尺寸不做限定。可以单独使用一种滑动窗口,也可以选择多种不同尺寸的滑动窗口多次滑动比较。还需强调的是,不同尺寸的滑动窗口进行滑动时,既可以以整个比较图像和基准图像为待滑动区域,也可以以经过上一次扫描并确定像素区域后剩下的区域为待滑动区域,不同的扫描方式可以任意组合,只要能够尽量避免遗漏即可,以上仅为示例,具体方式在此不做限定。Among them, it should be understood that the sliding window can be a sliding window with a length of two columns and a width of one row, or a sliding window with a length of two columns and a width of two columns, etc. This is just an example. The size of the window is not limited. A single sliding window can be used, or multiple sliding windows of different sizes can be selected for multiple sliding comparisons. It should also be emphasized that when sliding windows of different sizes are slid, the entire comparison image and the reference image can be used as the area to be slid, or the area left after the last scan and the pixel area is determined as the area to be slid. Different scanning modes can be combined arbitrarily, as long as omissions can be avoided as much as possible, the above are only examples, and the specific modes are not limited here.

因此,若像素区域中存在像素子区域,即像素区域存在位置信息发生变化的部分像素以及位置信息没有发生变化的部分像素,则将这种情况确定为第二偏移类型。Therefore, if there are pixel sub-regions in the pixel region, that is, the pixel region has some pixels whose position information changes and some pixels whose position information does not change, then this situation is determined as the second offset type.

在一示例中,第二偏移类型下,选取像素子区域在比较图像上映射到感光单元的第二比较位置以及在基准图像上映射到感光单元的第二基准位置,计算第二比较位置与第二基准位置的偏移量作为第二偏移数据。In an example, under the second offset type, select the pixel sub-region mapped to the second comparison position of the photosensitive unit on the comparison image and the second reference position of the photosensitive unit on the reference image, and calculate the second comparison position and The offset amount of the second reference position is used as the second offset data.

例如,以图6所示,像素区域在比较图像上映射到感光单元的第一比较位置为第4列至第5列的第3至4行,像素区域在基准图像上映射到感光单元的第一基准位置为第2列至第3列的第3至4行,因此,此处的第二偏移数据为2。For example, as shown in FIG. 6 , the first comparison position of the pixel area mapped to the photosensitive unit on the comparison image is the 3rd to 4th row of the 4th column to the 5th column, and the pixel area is mapped to the first comparison position of the photosensitive unit on the reference image. A reference position is the 3rd to 4th rows of the 2nd to 3rd columns, so the second offset data here is 2.

应该理解的是,即便存在经过逐行、逐列和逐窗口比较的操作,也可能仍然存在个别像素未被纳入像素区域的情况,但由于正常的图像所包含的像素数量庞大,个别的像素即便被忽略也对整体精度几乎没有影响。It should be understood that even if there is a row-by-row, column-by-column and window-by-window comparison operation, there may still be cases where individual pixels are not included in the pixel area. Being ignored also has little effect on the overall accuracy.

在一示例中,步骤104中,所述根据所述像素位置偏移量和所述像素位置偏移类型,对所述比较图像进行校正,包括:In an example, instep 104, the correction of the comparison image according to the pixel position offset amount and the pixel position offset type includes:

确定所述像素位置偏移类型为第一偏移类型,通过所述第一比较位置和所述第一偏移数据,确定所述像素区域在比较图像上映射到对应的感光单元上的第一目标位置;It is determined that the pixel position offset type is the first offset type, and through the first comparison position and the first offset data, it is determined that the pixel area is mapped to the first position on the corresponding photosensitive unit on the comparison image target location;

将所述比较图像上所述像素区域的全部像素的数据属性,从所述第一比较位置对照修改到所述第一目标位置。The data attributes of all the pixels in the pixel area on the comparison image are compared and modified from the first comparison position to the first target position.

在一示例中,确定像素位置偏移类型满足上述步骤中的第一偏移类型,则计算第一偏移数据。获取像素区域在比较图像上映射到对应的感光单元上的第一比较位置、以及在基准图像上映射到对应的感光单元上的第一基准位置,将第一比较位置与第一基准位置相减,得到第一偏移数据,通过将第一比较位置减去第一偏移数据计算第一目标位置,将像素区域对应的所有像素移动至第一目标位置。In an example, it is determined that the pixel position offset type satisfies the first offset type in the above steps, and then the first offset data is calculated. Obtain the first comparison position of the pixel area mapped to the corresponding photosensitive unit on the comparison image, and the first reference position mapped to the corresponding photosensitive unit on the reference image, and subtract the first comparison position from the first reference position , obtain the first offset data, calculate the first target position by subtracting the first offset data from the first comparison position, and move all the pixels corresponding to the pixel area to the first target position.

例如,以图7所示,a为基准图像与其映射的感光单元,b1至b3均为同一比较图像,第一行各图像中的数字表示像素的灰度值,第二行中各图像的数字表示像素在该图像中的编号,以基准图像a为例,其像素11的像素值为1、像素12的灰度值为2。其中,b1为原始比较图像,未经过校正,b2、b3显示了比较图像的校正过程。For example, as shown in Figure 7, a is the reference image and its mapped photosensitive unit, b1 to b3 are the same comparison images, the numbers in each image in the first row represent the gray value of the pixel, and the numbers in each image in the second row Indicates the number of pixels in the image. Taking the reference image a as an example, the pixel value ofpixel 11 is 1, and the grayscale value ofpixel 12 is 2. Among them, b1 is the original comparison image, which has not been corrected, and b2 and b3 show the correction process of the comparison image.

根据上段内容,计算第一偏移数据,可知b1中的像素区域为从第1列到第4列的1至5行,a中的像素区域为从第2列到第5列的1至5行,因此计算得到第一偏移数据为一列。以该像素区域中第1行第1列的元素(即灰度值)为例,该元素的值为2,其在a中的像素位置为12(即第一基准位置),其在b1中的像素位置为11(即第一比较位置),则该元素的第一比较位置相较于第一基准位置12水平左移了一个位置,则可确定第一偏移数据为-1,因此,可将b1中的灰度值2(11)水平右移一个位置(即第一比较位置减去第一偏移数据等于11-(-1)=12),使得该元素在比较图像中的位置也为12(即该元素的第一目标位置),即可与基准图像相同,达到校正的目的。因此,通过计算第一目标位置,将比较图像上的像素区域的所有像素对应的属性数据对照修改到第一目标位置,即得到如b2中的校正效果。According to the content of the previous paragraph, the first offset data is calculated, and it can be seen that the pixel area in b1 is from 1 to 5 rows from the 1st column to the 4th column, and the pixel area in a is from 1 to 5 from the 2nd column to the 5th column. row, so the first offset data is calculated as one column. Take the element of the first row and the first column in the pixel area (that is, the gray value) as an example, the value of this element is 2, and its pixel position in a is 12 (that is, the first reference position), which is in b1 The pixel position of the element is 11 (ie, the first comparison position), then the first comparison position of the element is horizontally shifted to the left by one position compared with thefirst reference position 12, and the first offset data can be determined to be -1. Therefore, The gray value 2(11) in b1 can be shifted horizontally by one position to the right (that is, the first comparison position minus the first offset data is equal to 11-(-1)=12), so that the position of the element in the comparison image It is also 12 (that is, the first target position of the element), which can be the same as the reference image to achieve the purpose of correction. Therefore, by calculating the first target position, the attribute data corresponding to all the pixels in the pixel area on the comparison image are modified to the first target position by comparison, that is, the correction effect as in b2 is obtained.

在一示例中,上述校正完成后,由于像素区域整体相较于之前移动了第一偏移数据的距离,对于比较图像来说,由图7中的b1所展示的状态变为了b2所展示的状态,相对于比较图像来说,将像素区域由第一比较位置移动到第一目标位置后,第一比较位置所映射的像素便会存在非预期像素,因此也需要参照基准图像进行修改。从第一比较位置在比较图像上对应的感光单元的位置(即在b1中的像素编号)上获取与第一目标位置在比较图像上对应的感光单元的位置(即在b1中的像素编号)不同的像素编号。参照该像素编号映射在基准图像上的像素的数据属性,对映射在比较图像上的像素的数据属性进行修改,得到如b3所示的比较图像。In an example, after the above correction is completed, since the entire pixel area is moved by the distance of the first offset data compared to the previous one, for the comparison image, the state shown by b1 in FIG. 7 becomes the state shown by b2. Compared with the comparison image, after moving the pixel area from the first comparison position to the first target position, there will be unexpected pixels in the pixels mapped by the first comparison position, so it is also necessary to refer to the reference image for modification. Obtain the position of the photosensitive unit corresponding to the first target position on the comparison image (ie the pixel number in b1 ) from the position of the photosensitive unit corresponding to the first comparison position on the comparison image (ie the pixel number in b1 ) Different pixel numbers. With reference to the data attribute of the pixel mapped on the reference image by the pixel number, the data attribute of the pixel mapped on the comparison image is modified to obtain the comparison image as shown in b3.

仍以图7为例对上述内容进行说明,如根据a、b1和b2,获取第一比较位置上与第一基准位置的不同的像素编号为图中标注的11、21、31、41和51的五个位置,获取该五个位置映射在基准图像上的像素的数据属性,可知对应的灰度值分别为1、2、1、3和5,将比较图像的像素11、21、31、41和51的数据属性对照修改,体现在灰度值上则为修改为11、21、31、41和51。Still taking FIG. 7 as an example to illustrate the above content, for example, according to a, b1 and b2, the pixel numbers that are different from the first reference position at the first comparison position are obtained as 11, 21, 31, 41 and 51 marked in the figure. The five positions of , obtain the data attributes of the pixels mapped on the reference image by the five positions, it can be known that the corresponding gray values are 1, 2, 1, 3 and 5 respectively. The data attributes of 41 and 51 are compared and modified, and the gray value is modified to 11, 21, 31, 41 and 51.

通过对第一偏移类型的校正,能够改善抖动状态下采集的、目标区域的图像整体发生的偏移情况。By correcting the first offset type, it is possible to improve the overall offset situation of the image of the target area collected under the shaking state.

在一示例中,步骤104中,所述根据所述像素位置偏移量和所述像素位置偏移类型,对所述比较图像进行校正,包括:In an example, instep 104, the correction of the comparison image according to the pixel position offset amount and the pixel position offset type includes:

确定所述像素位置偏移类型为第二偏移类型,通过所述第二比较位置和所述第二偏移数据,确定所述像素子区域在比较图像上映射到对应的感光单元上的第二目标位置;It is determined that the pixel position offset type is the second offset type, and through the second comparison position and the second offset data, it is determined that the pixel sub-region is mapped to the first position on the corresponding photosensitive unit on the comparison image. two target locations;

将所述比较图像上所述像素子区域的全部像素的数据属性,从所述第二比较位置对照修改到所述第二目标位置。The data attributes of all the pixels in the pixel sub-region on the comparison image are compared and modified from the second comparison position to the second target position.

在一示例中,确定像素位置偏移类型满足上述步骤中的第二偏移类型,则计算第二偏移数据。获取像素子区域在比较图像上对应的感光单元上的第二比较位置以及在基准图像上对应的感光单元上的第二基准位置,将第二比较位置与第二基准位置相减,得到第二偏移数据,将比较图像上像素子区域对应的所有像素根据第二偏移数据,通过将第二比较位置减去第二偏移数据计算第二目标位置,将像素子区域对应的所有像素对应的属性数据对照修改到第二目标位置。In an example, it is determined that the pixel position offset type satisfies the second offset type in the above steps, and the second offset data is calculated. Obtain the second comparison position on the photosensitive unit corresponding to the pixel sub-region on the comparison image and the second reference position on the photosensitive unit corresponding to the reference image, and subtract the second comparison position from the second reference position to obtain the second comparison position. Offset data, all the pixels corresponding to the pixel sub-region on the comparison image are calculated according to the second offset data by subtracting the second offset data from the second comparison position, and all the pixels corresponding to the pixel sub-region correspond to the second target position. The attribute data is modified to the second target location.

例如,以图8所示,c为基准图像与其映射的感光单元,d1至d3均为同一比较图像,第一行各图像中的数字表示像素的灰度值,第二行中和图像的数字表示像素在该图像中的编号,以基准图像c为例,其像素32的像素值为3、像素33的灰度值为4,其中,d1为原始比较图像,未经过校正,b2、b3显示了比较图像的校正过程。根据上段内容,计算第二偏移数据,确定c中的像素子区域范围为第2列至第3列的第3至4行,确定d1中的像素子区域范围为第4列至第5列的第3至4行,计算第二偏移数据为2列。以该像素区域中第3行第2列的元素(即灰度值)为例,该元素的值为3,其在c中的像素位置为32(即第二基准位置),其在d1中的像素位置为34(即第二比较位置),则该元素的第二比较位置相较于第二基准位置32水平右移了两个位置(则确定第二偏移数据为2),因此,可将d1中的灰度值3(34)水平左移两个位置(即第二比较位置减去第二偏移数据等于34-2=32),使得该元素在比较图像中的位置也为32(即该像素的第二目标位置),即可与基准图像相同,达到校正的目的。因此,通过计算第二目标位置,将比较图像上的像素子区域的所有像素对应的属性数据对照修改到第二目标位置,即得到如d2中的校正效果。For example, as shown in Figure 8, c is the reference image and its mapped photosensitive unit, d1 to d3 are the same comparison image, the numbers in each image in the first row represent the gray value of the pixel, and the numbers in the second row of the neutral image Indicates the number of the pixel in the image. Taking the reference image c as an example, the pixel value ofpixel 32 is 3 and the gray value ofpixel 33 is 4. Among them, d1 is the original comparison image without correction, and b2 and b3 display The correction process for the comparison images is presented. According to the content of the previous paragraph, calculate the second offset data, determine that the pixel sub-region in c is in the 3rd to 4th row of the 2nd to 3rd column, and determine the pixel sub-region in d1 is in the 4th to 5th column. Forrows 3 to 4, calculate the second offset data for 2 columns. Take the element (that is, the grayscale value) of the third row and second column in the pixel area as an example, the value of this element is 3, and its pixel position in c is 32 (that is, the second reference position), which is in d1 The pixel position of the element is 34 (that is, the second comparison position), then the second comparison position of the element is horizontally shifted to the right by two positions compared with the second reference position 32 (the second offset data is determined to be 2), therefore, The gray value 3 (34) in d1 can be shifted horizontally by two positions to the left (that is, the second comparison position minus the second offset data is equal to 34-2=32), so that the position of this element in the comparison image is also 32 (that is, the second target position of the pixel), which can be the same as the reference image to achieve the purpose of correction. Therefore, by calculating the second target position, the attribute data corresponding to all the pixels in the pixel sub-regions on the comparison image are compared and modified to the second target position, that is, the correction effect as in d2 is obtained.

在一示例中,上述校正完成后,由于像素子区域整体相较于之前移动了第二偏移数据的距离,对于比较图像来说,由图8中的d1所展示的状态变为了d2所展示的状态,相对于比较图像来说,将像素区域由第二比较位置移动到第二目标位置后,第二比较位置所映射的像素变会存在非预期像素,因此也需要参照基准图像进行修改,从第二比较位置在比较图像上对应的感光单元的位置(即在d1中的像素编号)上获取与第二目标位置在比较图像上对应的感光单元的位置(即在d1中的像素编号)不同的像素编号,参照该像素编号映射在基准图像上的像素的数据属性,对映射在比较图像上的像素的数据属性进行修改,得到如d3所示的比较图像。In an example, after the above correction is completed, since the entire pixel sub-region has moved the distance of the second offset data compared to the previous one, for the comparison image, the state shown by d1 in FIG. 8 changes to that shown by d2. Compared with the comparison image, after moving the pixel area from the second comparison position to the second target position, there will be unexpected pixels in the pixels mapped by the second comparison position, so it is also necessary to refer to the reference image to modify, Obtain the position of the photosensitive unit corresponding to the second target position on the comparison image (ie the pixel number in d1 ) from the position of the photosensitive unit corresponding to the second comparison position on the comparison image (ie the pixel number in d1 ) For different pixel numbers, refer to the data attributes of the pixels mapped on the reference image by the pixel numbers, modify the data attributes of the pixels mapped on the comparison image, and obtain the comparison image as shown in d3.

仍以图8为例对上述内容进行说明,如根据c、d1和d2,获取第二比较位置中上与第二基准位置的不同的像素编号为图中标注34、35、44和45的四个位置,获取该四个位置映射在基准图像上的像素的数据属性,可知对应的灰度值分别为3、1、1和6,将比较图像的像素35、35、44和45的数据属性对照修改,体现在灰度值上则为修改为3、1、1和6。Still take FIG. 8 as an example to illustrate the above content. For example, according to c, d1 and d2, the pixel numbers that are different from the second reference position in the second comparison position are obtained as the four numbers marked 34, 35, 44 and 45 in the figure. The data attributes of the pixels mapped to the four positions on the reference image are obtained. It can be known that the corresponding gray values are 3, 1, 1, and 6, respectively. The data attributes ofpixels 35, 35, 44, and 45 of the image will be compared. Compared with the modification, the gray value is modified to 3, 1, 1 and 6.

通过对第二偏移类型的校正,能够改善拍摄的目标区域整体轮廓情况不变,但存在内部目标移动的偏移情况。By correcting the second offset type, it can be improved that the overall contour of the photographed target area remains unchanged, but there is an offset situation in which the internal target moves.

在一示例中,若还存在像素区域在比较图像中的位置信息相较于在基准图像中的位置信息都发生了偏移,但位置信息的偏移量不一致,则可能同时存在第一偏移类型和第二偏移类型,则对比较图像分别进行第一偏移类型和第一偏移类型对应的校正。In an example, if there is still a pixel area in the comparison image, the position information is offset compared to the position information in the reference image, but the offset of the position information is inconsistent, then there may be a first offset at the same time. type and the second offset type, respectively perform corrections corresponding to the first offset type and the first offset type on the comparison image.

此外,还需强调的是,由于图像上的像素映射到相同位置的感光单元,因此位置信息在每组感光单元上是通用的、对应的。In addition, it should be emphasized that since the pixels on the image are mapped to the photosensitive units at the same position, the position information is common and corresponding to each group of photosensitive units.

且上述仅为举例以进行说明,不做具体限定,实际上可能存在水平偏移、竖直偏移或水平和竖直兼有的偏移,但原理相同,在此不做具体的阐述。The above is only an example for illustration, and no specific limitation is made. In fact, there may be horizontal offset, vertical offset, or both horizontal and vertical offsets, but the principle is the same, and no specific description is given here.

本公开一实施例还提供了一种图像采集装置,如图9所示,该装置包括:An embodiment of the present disclosure further provides an image acquisition device, as shown in FIG. 9 , the device includes:

构建模块10,用于将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同。Thebuilding module 10 is used to divide the photosensitive unit array of the sensor into multiple groups of photosensitive units, the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and the number of photosensitive units of each group of photosensitive units is the same.

获取模块20,用于响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像。The acquisition module 20 is configured to, in response to the image acquisition operation, acquire images in sequence for each group of photosensitive units, and the multiple groups of photosensitive units acquire multiple images.

所述获取模块20,还用于以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域。The acquisition module 20 is further configured to use the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are all comparison images, and respectively determine the difference between each comparison image and the reference image. Pixel area with the same data attribute.

所述数据属性包括感光单元的灰度值和组合关系,所述组合关系用于描述当前感光单元与其相邻感光单元之间的位置关系。The data attributes include grayscale values of the photosensitive units and a combination relationship, where the combination relationship is used to describe the positional relationship between the current photosensitive unit and its adjacent photosensitive units.

所述获取模块20,还用于通过逐行扫描、逐列扫描和/或滑动窗口扫描的方式,从比较图像上和基准图像上选取灰度值相同的区域,且灰度值对应的感光单元的组合关系在所述区域内也相同,确定该区域为像素区域。The acquisition module 20 is also used to select an area with the same gray value from the comparison image and the reference image by row-by-row scanning, column-by-column scanning and/or sliding window scanning, and the photosensitive unit corresponding to the gray value. The combination relationship is also the same in the region, and the region is determined as a pixel region.

处理模块30,用于根据所述像素区域,确定像素位置偏移量和像素位置偏移类型。The processing module 30 is configured to determine a pixel position offset amount and a pixel position offset type according to the pixel area.

所述处理模块30,还用于根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正。The processing module 30 is further configured to correct each comparison image according to the pixel position offset amount and the pixel position offset type.

所述处理模块30,还用于若所述像素区域的全部像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息全部发生变化且发生变化的像素位置偏移量一致,则确定所述像素位置偏移类型为第一偏移类型。The processing module 30 is further configured to, if the position information of all the pixels in the pixel area corresponding to the photosensitive unit in the comparison image is changed compared with the position information of the corresponding photosensitive unit in the reference image, and If the changed pixel position offsets are consistent, the pixel position offset type is determined to be the first offset type.

确定所述像素区域在所述比较图像中对应的感光单元上的第一比较位置,确定所述像素区域在所述基准图像中对应的感光单元上的第一基准位置,则所述第一偏移类型对应的所述像素位置偏移量为所述第一比较位置相较于所述第一基准位置的第一偏移数据。Determine the first comparison position of the pixel area on the photosensitive unit corresponding to the comparison image, and determine the first reference position of the pixel area on the photosensitive unit corresponding to the reference image, then the first offset The pixel position offset corresponding to the shift type is first offset data of the first comparison position compared to the first reference position.

所述处理模块30,还用于若所述像素区域中的部分像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息发生变化,则确定所述像素位置偏移类型为第二偏移类型。The processing module 30 is further configured to, if the position information of the corresponding photosensitive units in the comparison image for some pixels in the pixel area is changed compared with the position information of the corresponding photosensitive units in the reference image, Then, it is determined that the pixel position offset type is the second offset type.

确定位置信息发生变化的部分像素为像素子区域,并确定所述像素子区域在所述比较图像中对应的感光单元上的第二比较位置,以及所述像素子区域在所述基准图像中对应的感光单元上的第二基准位置,则所述第二偏移类型对应的所述像素位置偏移量为所述第二比较位置相较于所述第二基准位置的第二偏移数据。It is determined that some pixels whose position information changes are pixel sub-regions, and the second comparison position of the pixel sub-region on the corresponding photosensitive unit in the comparison image, and the pixel sub-region corresponding to the reference image is determined. The second reference position on the photosensitive unit, the pixel position offset corresponding to the second offset type is the second offset data of the second comparison position compared with the second reference position.

所述处理模块30,还用于确定所述像素位置偏移类型为第一偏移类型,通过所述第一比较位置和所述第一偏移数据,确定所述像素区域在比较图像上对应的感光单元上的第一目标位置。The processing module 30 is further configured to determine that the pixel position offset type is the first offset type, and through the first comparison position and the first offset data, determine that the pixel area corresponds to the comparison image. the first target position on the photosensitive unit.

将所述比较图像上所述像素区域的全部像素的数据属性,从所述第一比较位置对照修改到所述第一目标位置。The data attributes of all the pixels in the pixel area on the comparison image are compared and modified from the first comparison position to the first target position.

所述处理模块30,还用于确定所述像素位置偏移类型为第二偏移类型,通过所述第二比较位置和所述第二偏移数据,确定所述像素子区域在比较图像上对应的感光单元上的第二目标位置。The processing module 30 is further configured to determine that the pixel position offset type is a second offset type, and determine that the pixel sub-region is on the comparison image through the second comparison position and the second offset data The second target position on the corresponding photosensitive unit.

将所述比较图像上所述像素子区域的全部像素的数据属性,从所述第二比较位置对照修改到所述第二目标位置。The data attributes of all the pixels in the pixel sub-region on the comparison image are compared and modified from the second comparison position to the second target position.

计算模块40,用于将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。The calculation module 40 is configured to map the corrected comparison image and the reference image by restoring the corresponding photosensitive units to their positions before grouping, and fuse all the corrected comparison images and reference images into a target image.

本发明还提供一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行本发明所述的图像采集方法。The present invention also provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program is used to execute the image acquisition method of the present invention.

本发明还一方面提供一种电子设备,包括:Another aspect of the present invention provides an electronic device, comprising:

处理器;processor;

用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;

所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现本发明所述的图像采集方法。The processor is configured to read the executable instructions from the memory and execute the instructions to implement the image acquisition method of the present invention.

除了上述方法和装置以外,本申请的实施例还可以是计算机程序产品,其包括计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本说明书上述“示例性方法”部分中描述的根据本申请各种实施例的方法中的步骤。In addition to the methods and apparatuses described above, embodiments of the present application may also be computer program products comprising computer program instructions that, when executed by a processor, cause the processor to perform the "exemplary method" described above in this specification Sections describe steps in methods according to various embodiments of the present application.

所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本申请实施例操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。The computer program product can write program codes for performing the operations of the embodiments of the present application in any combination of one or more programming languages, including object-oriented programming languages, such as Java, C++, etc. , also includes conventional procedural programming languages, such as "C" language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on.

此外,本申请的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本说明书上述“示例性方法”部分中描述的根据本申请各种实施例的方法中的步骤。In addition, embodiments of the present application may also be computer-readable storage media having computer program instructions stored thereon, the computer program instructions, when executed by a processor, cause the processor to perform the above-mentioned "Example Method" section of this specification Steps in methods according to various embodiments of the present application described in .

所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The computer-readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses or devices, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

以上结合具体实施例描述了本申请的基本原理,但是,需要指出的是,在本申请中提及的优点、优势、效果等仅是示例而非限制,不能认为这些优点、优势、效果等是本申请的各个实施例必须具备的。另外,上述公开的具体细节仅是为了示例的作用和便于理解的作用,而非限制,上述细节并不限制本申请为必须采用上述具体的细节来实现。The basic principles of the present application have been described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, advantages, effects, etc. mentioned in the present application are only examples rather than limitations, and these advantages, advantages, effects, etc., are not considered to be Required for each embodiment of this application. In addition, the specific details disclosed above are only for the role of example and the role of facilitating understanding, rather than limiting, and the above-mentioned details do not limit the application to be implemented by using the above-mentioned specific details.

本申请中涉及的器件、装置、设备、系统的方框图仅作为例示性的例子并且不意图要求或暗示必须按照方框图示出的方式进行连接、布置、配置。如本领域技术人员将认识到的,可以按任意方式连接、布置、配置这些器件、装置、设备、系统。诸如“包括”、“包含”、“具有”等等的词语是开放性词汇,指“包括但不限于”,且可与其互换使用。这里所使用的词汇“或”和“和”指词汇“和/或”,且可与其互换使用,除非上下文明确指示不是如此。这里所使用的词汇“诸如”指词组“如但不限于”,且可与其互换使用。The block diagrams of devices, apparatus, apparatuses, and systems referred to in this application are merely illustrative examples and are not intended to require or imply that the connections, arrangements, or configurations must be in the manner shown in the block diagrams. As those skilled in the art will appreciate, these means, apparatuses, apparatuses, systems may be connected, arranged, configured in any manner. Words such as "including", "including", "having" and the like are open-ended words meaning "including but not limited to" and are used interchangeably therewith. As used herein, the words "or" and "and" refer to and are used interchangeably with the word "and/or" unless the context clearly dictates otherwise. As used herein, the word "such as" refers to and is used interchangeably with the phrase "such as but not limited to".

还需要指出的是,在本申请的装置、设备和方法中,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本申请的等效方案。It should also be pointed out that in the apparatus, equipment and method of the present application, each component or each step can be decomposed and/or recombined. These disaggregations and/or recombinations should be considered as equivalents of the present application.

提供所公开的方面的以上描述以使本领域的任何技术人员能够做出或者使用本申请。对这些方面的各种修改对于本领域技术人员而言是非常显而易见的,并且在此定义的一般原理可以应用于其他方面而不脱离本申请的范围。因此,本申请不意图被限制到在此示出的方面,而是按照与在此公开的原理和新颖的特征一致的最宽范围。The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Therefore, this application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

为了例示和描述的目的已经给出了以上描述。此外,此描述不意图将本申请的实施例限制到在此公开的形式。尽管以上已经讨论了多个示例方面和实施例,但是本领域技术人员将认识到其某些变型、修改、改变、添加和子组合。The foregoing description has been presented for the purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the application to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims (10)

Translated fromChinese
1.一种图像采集方法,其特征在于,将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同,该方法还包括:1. An image acquisition method, characterized in that, the photosensitive unit array of the sensor is divided into multiple groups of photosensitive units, the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and the number of photosensitive units of each group of photosensitive units is the same, and the method also include:响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像;In response to the image capturing operation, each group of photosensitive units sequentially captures images, and the multiple groups of photosensitive units capture multiple images;以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域;Taking the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are comparison images, respectively determine the pixel areas with the same data attributes of each comparison image and the reference image;根据所述像素区域,确定像素位置偏移量和像素位置偏移类型;According to the pixel area, determine the pixel position offset amount and the pixel position offset type;根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正;correcting each comparison image according to the pixel position offset amount and the pixel position offset type;将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。The corrected comparison image and the reference image are mapped by restoring the corresponding photosensitive units to the positions before grouping, and all the corrected comparison images and reference images are fused into the target image.2.根据权利要求1所述的图像采集方法,其特征在于,所述数据属性包括感光单元的灰度值和组合关系,所述组合关系用于描述当前感光单元与其相邻感光单元之间的位置关系。2 . The image acquisition method according to claim 1 , wherein the data attributes include grayscale values of photosensitive units and a combination relationship, and the combination relationship is used to describe the relationship between the current photosensitive unit and its adjacent photosensitive units. 3 . Positional relationship.3.根据权利要求2所述的图像采集方法,其特征在于,所述确定每张比较图像与基准图像的数据属性相同的像素区域,包括:3. The image acquisition method according to claim 2, wherein the determining the pixel area with the same data attribute of each comparison image and the reference image comprises:通过逐行扫描、逐列扫描和/或滑动窗口扫描的方式,从比较图像上和基准图像上选取灰度值相同的区域,且灰度值对应的感光单元的组合关系在所述区域内也相同,确定该区域为像素区域。By row-by-row scanning, column-by-column scanning and/or sliding window scanning, an area with the same grayscale value is selected from the comparison image and the reference image, and the combination relationship of the photosensitive units corresponding to the grayscale value is also in the area. In the same way, the area is determined to be a pixel area.4.根据权利要求1所述的图像采集方法,其特征在于,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:4. The image acquisition method according to claim 1, wherein, determining a pixel position offset amount and a pixel position offset type according to the pixel area, comprising:若所述像素区域的全部像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息全部发生变化且发生变化的像素位置偏移量一致,则确定所述像素位置偏移类型为第一偏移类型;If the position information of the photosensitive units corresponding to all the pixels in the pixel area in the comparison image are all changed compared with the position information of the corresponding photosensitive units in the reference image, and the changed pixel position offsets are consistent , then it is determined that the pixel position offset type is the first offset type;确定所述像素区域在所述比较图像中对应的感光单元上的第一比较位置,确定所述像素区域在所述基准图像中对应的感光单元上的第一基准位置,则所述第一偏移类型对应的所述像素位置偏移量为所述第一比较位置相较于所述第一基准位置的第一偏移数据。Determine the first comparison position of the pixel area on the photosensitive unit corresponding to the comparison image, and determine the first reference position of the pixel area on the photosensitive unit corresponding to the reference image, then the first offset The pixel position offset corresponding to the shift type is first offset data of the first comparison position compared to the first reference position.5.根据权利要求1所述的图像采集方法,其特征在于,所述根据所述像素区域,确定像素位置偏移量和像素位置偏移类型,包括:5 . The image acquisition method according to claim 1 , wherein, determining a pixel position offset amount and a pixel position offset type according to the pixel area, comprising: 6 .若所述像素区域中的部分像素在所述比较图像中对应的感光单元的位置信息相较于在所述基准图像中对应的感光单元的位置信息发生变化,则确定所述像素位置偏移类型为第二偏移类型;If the position information of the corresponding photosensitive unit in the comparison image of some pixels in the pixel area is changed compared with the position information of the corresponding photosensitive unit in the reference image, the pixel position offset type is determined is the second offset type;确定位置信息发生变化的部分像素为像素子区域,并确定所述像素子区域在所述比较图像中对应的感光单元上的第二比较位置,以及所述像素子区域在所述基准图像中对应的感光单元上的第二基准位置,则所述第二偏移类型对应的所述像素位置偏移量为所述第二比较位置相较于所述第二基准位置的第二偏移数据。It is determined that some pixels whose position information changes are pixel sub-regions, and the second comparison position of the pixel sub-region on the corresponding photosensitive unit in the comparison image, and the pixel sub-region corresponding to the reference image is determined. The second reference position on the photosensitive unit, the pixel position offset corresponding to the second offset type is the second offset data of the second comparison position compared to the second reference position.6.根据权利要求4所述的图像采集方法,其特征在于,所述根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正,包括:6 . The image acquisition method according to claim 4 , wherein the correcting each comparison image according to the pixel position offset amount and the pixel position offset type comprises: 6 .确定所述像素位置偏移类型为第一偏移类型,通过所述第一比较位置和所述第一偏移数据,确定所述像素区域在比较图像上对应的感光单元上的第一目标位置;Determine that the pixel position offset type is the first offset type, and determine the first target position of the pixel area on the photosensitive unit corresponding to the comparison image by using the first comparison position and the first offset data ;将所述比较图像上所述像素区域的全部像素的数据属性,从所述第一比较位置对照修改到所述第一目标位置。The data attributes of all the pixels in the pixel area on the comparison image are compared and modified from the first comparison position to the first target position.7.根据权利要求5所述的图像采集方法,其特征在于,所述根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正,包括:7 . The image acquisition method according to claim 5 , wherein the correction of each comparison image according to the pixel position offset amount and the pixel position offset type comprises: 8 .确定所述像素位置偏移类型为第二偏移类型,通过所述第二比较位置和所述第二偏移数据,确定所述像素子区域在比较图像上映射到对应的感光单元上的第二目标位置;It is determined that the pixel position offset type is the second offset type, and through the second comparison position and the second offset data, it is determined that the pixel sub-region is mapped to the first position on the corresponding photosensitive unit on the comparison image. two target locations;将所述比较图像上所述像素子区域的全部像素的数据属性,从所述第二比较位置对照修改到所述第二目标位置。The data attributes of all the pixels in the pixel sub-region on the comparison image are compared and modified from the second comparison position to the second target position.8.一种图像采集装置,其特征在于,包括:8. An image acquisition device, comprising:构建模块,用于将传感器的感光单元阵列划分为多组感光单元,多组感光单元的感光单元之间均匀分布,每组感光单元的感光单元数量相同;The building module is used to divide the photosensitive unit array of the sensor into multiple groups of photosensitive units, the photosensitive units of the multiple groups of photosensitive units are evenly distributed, and the number of photosensitive units of each group of photosensitive units is the same;获取模块,用于响应于图像采集操作,每组感光单元依次采集图像,所述多组感光单元采集多张图像;an acquisition module, configured to sequentially acquire images for each group of photosensitive units in response to an image acquisition operation, and the multiple groups of photosensitive units acquire multiple images;所述获取模块,还用于以任一组感光单元采集的目标区域的图像为基准图像,其他组感光单元采集的目标区域的图像均为比较图像,分别确定每张比较图像与基准图像的数据属性相同的像素区域;The acquisition module is also used to take the image of the target area collected by any group of photosensitive units as the reference image, and the images of the target area collected by other groups of photosensitive units are the comparison images, and determine the data of each comparison image and the reference image respectively. Pixel areas with the same attributes;处理模块,用于根据所述像素区域,确定像素位置偏移量和像素位置偏移类型;a processing module, configured to determine a pixel position offset amount and a pixel position offset type according to the pixel area;所述处理模块,还用于根据所述像素位置偏移量和所述像素位置偏移类型,对每张比较图像进行校正;The processing module is further configured to correct each comparison image according to the pixel position offset amount and the pixel position offset type;计算模块,用于将校正后的比较图像与基准图像,通过将各自对应的感光单元复原为分组之前位置的方式进行映射,将校正后的所有比较图像和基准图像融合为目标图像。The calculation module is used for mapping the corrected comparison image and the reference image by restoring the corresponding photosensitive units to the position before the grouping, and fuses all the corrected comparison images and the reference image into the target image.9.一种电子设备,其特征在于,包括:存储器和处理器,所述存储器存储由所述处理器可执行的计算机程序,所述处理器执行所述计算机程序时实现上述权利要求1-7任一项所述的图像采集方法。9. An electronic device, comprising: a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the above claims 1-7 are implemented The image acquisition method of any one.10.一种存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被读取并执行时,实现上述权利要求1-7任一项所述的图像采集方法。10 . A storage medium, wherein a computer program is stored on the storage medium, and when the computer program is read and executed, the image acquisition method according to any one of claims 1 to 7 is implemented.
CN202210588469.6A2022-05-262022-05-26Image acquisition method and device, electronic equipment and storage mediumPendingCN115086517A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210588469.6ACN115086517A (en)2022-05-262022-05-26Image acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210588469.6ACN115086517A (en)2022-05-262022-05-26Image acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication NumberPublication Date
CN115086517Atrue CN115086517A (en)2022-09-20

Family

ID=83248292

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210588469.6APendingCN115086517A (en)2022-05-262022-05-26Image acquisition method and device, electronic equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN115086517A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116774302A (en)*2023-08-232023-09-19江苏尚飞光电科技股份有限公司Data conversion method and device, electronic equipment and imaging equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101690162A (en)*2007-05-102010-03-31爱西斯创新有限公司 Image capture device and method
CN101755448A (en)*2007-07-202010-06-23伊斯曼柯达公司Correcting imaging device motion during an exposure
CN106454289A (en)*2016-11-292017-02-22广东欧珀移动通信有限公司Control method, control device and electronic device
CN109194876A (en)*2018-10-312019-01-11Oppo广东移动通信有限公司Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111479035A (en)*2020-04-132020-07-31Oppo广东移动通信有限公司Image processing method, electronic device, and computer-readable storage medium
CN114219745A (en)*2021-12-032022-03-22地平线(上海)人工智能技术有限公司 Image correction method and device, electronic device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101690162A (en)*2007-05-102010-03-31爱西斯创新有限公司 Image capture device and method
CN101755448A (en)*2007-07-202010-06-23伊斯曼柯达公司Correcting imaging device motion during an exposure
CN106454289A (en)*2016-11-292017-02-22广东欧珀移动通信有限公司Control method, control device and electronic device
CN109194876A (en)*2018-10-312019-01-11Oppo广东移动通信有限公司Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111479035A (en)*2020-04-132020-07-31Oppo广东移动通信有限公司Image processing method, electronic device, and computer-readable storage medium
CN114219745A (en)*2021-12-032022-03-22地平线(上海)人工智能技术有限公司 Image correction method and device, electronic device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116774302A (en)*2023-08-232023-09-19江苏尚飞光电科技股份有限公司Data conversion method and device, electronic equipment and imaging equipment
CN116774302B (en)*2023-08-232023-11-17江苏尚飞光电科技股份有限公司Data conversion method and device, electronic equipment and imaging equipment

Similar Documents

PublicationPublication DateTitle
CN108492287B (en)Video jitter detection method, terminal equipment and storage medium
US8068697B2 (en)Real time video stabilizer
CN102479379B (en) Image Correction Method and Related Image Correction System
CN113962892B (en) Method, device and photographic equipment for correcting wide-angle lens image distortion
JP2019215622A5 (en)
EP4057623B1 (en)Subject detection method and apparatus, electronic device, and computer-readable storage medium
JP7383642B2 (en) Method and apparatus for removing video jitter
JP6830712B1 (en) Random sampling Consistency-based effective area extraction method for fisheye images
JP2011133984A (en)Motion feature extraction device and motion feature extraction method
CN115086517A (en)Image acquisition method and device, electronic equipment and storage medium
WO2017154423A1 (en)Image processing device, image processing method, and program
CN111371987B (en) Image processing method and apparatus, electronic device, computer-readable storage medium
US20230014096A1 (en)Apparatus for estimating camera pose using multi-view image of 2d array structure and method using same
JP4020093B2 (en) Edge detection method and apparatus, program, storage medium, and frame detection method, apparatus, program, and storage medium
CN113971634A (en)3D scanning method based on image evaluation and super-resolution interpolation
CN113421282B (en)Motion detection method, apparatus, and medium
CN117934611A (en)6D gesture estimation method, system, equipment and medium based on object imaging
JP6341708B2 (en) Information processing apparatus, control method therefor, and program
JP7321213B2 (en) Information processing device, information processing method
CN103997640B (en)bandwidth optimization method and bandwidth optimization device
KR101767927B1 (en)Method and system for detecting motion in real-time
CN113822800A (en) A method and device for stitching and fusion of panoramic images
CN107422969B (en)Infrared touch screen, and zooming method and device of infrared touch screen
US10244179B2 (en)Image processing apparatus, image capturing apparatus, control method, and recording medium
JP6730214B2 (en) Parallax calculator

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20220920


[8]ページ先頭

©2009-2025 Movatter.jp