CN115134544A - Image processing method, image processing chip, application processing chip and electronic equipment - Google Patents

Image processing method, image processing chip, application processing chip and electronic equipment Download PDF

Info

Publication number
CN115134544A
CN115134544A CN202110328025.4A CN202110328025A CN115134544A CN 115134544 A CN115134544 A CN 115134544A CN 202110328025 A CN202110328025 A CN 202110328025A CN 115134544 A CN115134544 A CN 115134544A
Authority
CN
China
Prior art keywords
image
area
compressed data
sub
processing chip
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.)
Withdrawn
Application number
CN202110328025.4A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110328025.4A priority Critical patent/CN115134544A/en
Publication of CN115134544A publication Critical patent/CN115134544A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses an image processing method, an image processing chip, an application processing chip and electronic equipment. The method comprises the following steps: acquiring a shot current image and a shot historical image; dividing the current image into at least a first area image and a second area image, wherein the change range of the first area image relative to the corresponding area image in the historical image is larger than that of the second area image relative to the corresponding area image in the historical image; compressing the first area image according to a first compression algorithm to obtain first compressed data, and compressing the second area image according to a second compression algorithm to obtain second compressed data, wherein the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm; and transmitting the first compressed data and the second compressed data to an application processing chip for processing. The method and the device can improve the flexibility of image compression of the electronic equipment.

Description

图像处理方法、图像处理芯片、应用处理芯片及电子设备Image processing method, image processing chip, application processing chip and electronic device

技术领域technical field

本申请属于图像处理技术领域,尤其涉及一种图像处理方法、图像处理芯片、应用处理芯片及电子设备。The present application belongs to the technical field of image processing, and in particular, relates to an image processing method, an image processing chip, an application processing chip and an electronic device.

背景技术Background technique

随着技术的发展,用户经常会使用电子设备进行图像拍摄,如拍摄照片或录制视频等。然而,相关技术中,电子设对拍摄的图像仅采用单一的压缩方式进行压缩后传输至应用处理芯片进行图像处理,因此电子设备图像处理方法的灵活性较差。With the development of technology, users often use electronic devices to capture images, such as taking photos or recording videos. However, in the related art, the electronic device only uses a single compression method to compress the captured image and transmits it to the application processing chip for image processing, so the flexibility of the image processing method of the electronic device is poor.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种图像处理方法、图像处理芯片、应用处理芯片及电子设备,可以提升电子设备图像处理方法的灵活性。The embodiments of the present application provide an image processing method, an image processing chip, an application processing chip and an electronic device, which can improve the flexibility of the image processing method of the electronic device.

第一方面,本申请实施例提供一种图像处理方法,应用于图像处理芯片,所述图像处理芯片和应用处理芯片连接,所述方法包括:In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an image processing chip, wherein the image processing chip is connected to an application processing chip, and the method includes:

获取拍摄的当前图像和历史图像;Get current and historical images captured;

将所述当前图像至少划分为第一区域图像和第二区域图像,所述第一区域图像相对所述历史图像中对应区域图像的变化幅度大于所述第二区域图像相对所述历史图像中对应区域图像的变化幅度;The current image is divided into at least a first area image and a second area image, and the variation range of the first area image relative to the corresponding area image in the historical image is greater than that of the second area image relative to the corresponding area image in the historical image. The variation range of the regional image;

根据第一压缩算法将所述第一区域图像压缩得到第一压缩数据,根据第二压缩算法将所述第二区域图像压缩得到第二压缩数据,所述第一压缩算法的压缩比小于所述第二压缩算法的压缩比;The first region image is compressed according to a first compression algorithm to obtain first compressed data, and the second region image is compressed according to a second compression algorithm to obtain second compressed data, wherein the compression ratio of the first compression algorithm is smaller than the the compression ratio of the second compression algorithm;

将所述第一压缩数据和所述第二压缩数据传输到所述应用处理芯片进行处理。The first compressed data and the second compressed data are transmitted to the application processing chip for processing.

第二方面,本申请实施例提供一种图像处理方法,其应用于应用处理芯片,所述应用处理芯片和图像处理芯片连接,所述方法包括:In a second aspect, an embodiment of the present application provides an image processing method, which is applied to an application processing chip, where the application processing chip is connected to the image processing chip, and the method includes:

接收所述图像处理芯片发送的第一压缩数据和第二压缩数据,所述第一压缩数据采用第一压缩算法压缩,所述第二压缩数据采用第二压缩算法压缩,所述第一压缩算法的压缩比小于所述第二压缩算法的压缩比;Receive the first compressed data and the second compressed data sent by the image processing chip, the first compressed data is compressed by the first compression algorithm, the second compressed data is compressed by the second compression algorithm, the first compression algorithm The compression ratio is less than the compression ratio of the second compression algorithm;

对所述第一压缩数据进行解压缩得到第一子图像,以及对所述第二压缩数据进行解压缩得到第二子图像;Decompressing the first compressed data to obtain a first sub-image, and decompressing the second compressed data to obtain a second sub-image;

基于历史图像对所述第二子图像进行融合处理得到第三子图像;Fusion processing is performed on the second sub-image based on the historical image to obtain a third sub-image;

将所述第一子图像和所述第三子图像合成得到对应图像。A corresponding image is obtained by synthesizing the first sub-image and the third sub-image.

第三方面,本申请实施例提供一种的图像处理芯片,所述图像处理芯片和应用处理芯片连接,所述图像处理芯片包括神经网络处理器和第一中央处理器,所述神经网络处理器和所述第一中央处理器通过系统总线连接;In a third aspect, an embodiment of the present application provides an image processing chip, wherein the image processing chip is connected to an application processing chip, the image processing chip includes a neural network processor and a first central processing unit, and the neural network processor connected with the first central processing unit through a system bus;

所述神经网络处理器获取拍摄的当前图像和历史图像;The neural network processor obtains the current image and historical image captured;

所述神经网络处理器将所述当前图像至少划分为第一区域图像和第二区域图像,所述第一区域图像相对所述历史图像中对应区域图像的变化幅度大于所述第二区域图像相对所述历史图像中对应区域图像的变化幅度;The neural network processor divides the current image into at least a first area image and a second area image, and the variation range of the first area image relative to the corresponding area image in the historical image is greater than that of the second area image. the variation range of the corresponding area image in the historical image;

所述第一中央处理器根据第一压缩算法将所述第一区域图像压缩得到第一压缩数据,根据第二压缩算法将所述第二区域图像压缩得到第二压缩数据,所述第一压缩算法的压缩比小于所述第二压缩算法的压缩比;The first central processing unit compresses the first area image according to the first compression algorithm to obtain first compressed data, and compresses the second area image according to the second compression algorithm to obtain second compressed data, the first compression The compression ratio of the algorithm is less than the compression ratio of the second compression algorithm;

所述图像处理芯片将所述第一压缩数据和所述第二压缩数据传输到所述应用处理芯片进行处理。The image processing chip transmits the first compressed data and the second compressed data to the application processing chip for processing.

第四方面,本申请实施例提供一种应用处理芯片,所述应用处理芯片和图像处理芯片连接,所述应用处理芯片包括第二中央处理器;In a fourth aspect, an embodiment of the present application provides an application processing chip, the application processing chip is connected to an image processing chip, and the application processing chip includes a second central processing unit;

所述应用处理芯片接收所述图像处理芯片发送的第一压缩数据和第二压缩数据,所述第一压缩数据采用第一压缩算法压缩,所述第二压缩数据采用第二压缩算法压缩,所述第一压缩算法的压缩比小于所述第二压缩算法的压缩比;The application processing chip receives the first compressed data and the second compressed data sent by the image processing chip, the first compressed data is compressed by the first compression algorithm, and the second compressed data is compressed by the second compression algorithm, so The compression ratio of the first compression algorithm is less than the compression ratio of the second compression algorithm;

所述第二中央处理器对所述第一压缩数据进行解压缩得到第一子图像,以及对所述第二压缩数据进行解压缩得到第二子图像;The second central processing unit decompresses the first compressed data to obtain a first sub-image, and decompresses the second compressed data to obtain a second sub-image;

所述第二中央处理器基于历史图像对所述第二子图像进行融合处理得到第三子图像;The second central processing unit performs fusion processing on the second sub-image based on the historical image to obtain a third sub-image;

所述第二中央处理器将所述第一子图像和所述第三子图像合成得到对应图像。The second central processing unit synthesizes the first sub-image and the third sub-image to obtain a corresponding image.

第五方面,本申请实施例提供一种电子设备,其包括本申请任一实施例所述的图像处理芯片和本申请任一实施例所述的应用处理芯片,所述图像处理芯片和所述应用处理芯片连接。In a fifth aspect, an embodiment of the present application provides an electronic device, which includes the image processing chip described in any embodiment of the present application and the application processing chip described in any embodiment of the present application, the image processing chip and the The application handles the chip connection.

在本申请实施例中,图像处理芯片对比历史图像,将当前图像至少划分为变化幅度不同的第一区域图像和第二区域图像,并针对不同区域图像的变化幅度,采用不同的压缩算法进行压缩,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法,针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法。可以理解的,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法进行压缩,可以减少第一区域图像的压缩损失,针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法进行压缩,可以减少图像数据的传输量,使得应用处理芯片可以及时处理图像,从而提升电子设备进行图像压缩的灵活性。In the embodiment of the present application, the image processing chip compares historical images, divides the current image into at least a first area image and a second area image with different amplitudes of change, and uses different compression algorithms to compress the amplitudes of changes in the images in different areas , a first compression algorithm with relatively small compression is used for the first area image with a large variation range, and a second compression algorithm with relatively large compression is used for the second area image with a small variation range. It can be understood that, for the first area image with a large variation range, the first compression algorithm with relatively small compression is used for compression, which can reduce the compression loss of the first area image. Compressing with the second compression algorithm can reduce the amount of image data transmission, so that the application processing chip can process the image in time, thereby improving the flexibility of the electronic device for image compression.

附图说明Description of drawings

下面结合附图,通过对本申请的具体实施方式详细描述,将使本申请的技术方案及其有益效果显而易见。The technical solutions of the present application and the beneficial effects thereof will be apparent through the detailed description of the specific embodiments of the present application in conjunction with the accompanying drawings.

图1是本申请实施例提供的图像处理方法的第一种流程示意图。FIG. 1 is a first schematic flowchart of an image processing method provided by an embodiment of the present application.

图2是本申请实施例提供的图像处理方法的第二种流程示意图。FIG. 2 is a schematic flowchart of a second type of image processing method provided by an embodiment of the present application.

图3是本申请实施例提供的图像处理方法的第三种流程示意图。FIG. 3 is a third schematic flowchart of the image processing method provided by the embodiment of the present application.

图4是本申请实施例提供的图像处理方法的第四种流程示意图。FIG. 4 is a fourth schematic flowchart of the image processing method provided by the embodiment of the present application.

图5是本申请实施例提供的图像处理方法的第五种流程示意图。FIG. 5 is a fifth schematic flowchart of the image processing method provided by the embodiment of the present application.

图6是本申请实施例提供的图像处理方法的场景示意图。FIG. 6 is a schematic diagram of a scene of an image processing method provided by an embodiment of the present application.

图7是本申请实施例提供的图像处理方法的另一场景示意图。FIG. 7 is a schematic diagram of another scenario of the image processing method provided by the embodiment of the present application.

图8是本申请实施例提供的图像处理芯片和应用处理芯片的结构示意图。FIG. 8 is a schematic structural diagram of an image processing chip and an application processing chip provided by an embodiment of the present application.

图9是本申请实施例提供的电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

请参照图示,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Please refer to the drawings, wherein the same component symbols represent the same components, and the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application and should not be construed as limiting other specific embodiments of the present application not detailed herein.

可以理解的是,本申请实施例的执行主体可以是诸如智能手机或平板电脑等的电子设备。It can be understood that, the executive body of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.

请参阅图1,图1是本申请实施例提供的图像处理方法的第一种流程示意图。该图像处理方法可以应用于图像处理芯片,图像处理芯片和应用处理芯片连接,该图像处理方法的流程可以包括:Please refer to FIG. 1 . FIG. 1 is a first schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method can be applied to an image processing chip, and the image processing chip and the application processing chip are connected, and the flow of the image processing method can include:

在101中,获取拍摄的当前图像和历史图像。In 101, the captured current image and historical image are acquired.

随着技术的发展,用户经常会使用电子设备进行图像拍摄,如拍摄照片或录制视频等。然而,相关技术中,图像处理芯片获取摄像头采集到图像数据之后,图像处理芯片将整帧的图像数据通过MIPI接口传输给应用处理芯片进行相关的图像处理,传输的图像数据可以是RAW格式、YUV格式或是其它的格式。当前应用的传输技术的特点是直接将整帧图像数据全部进行传输,容易造成传输压力过大的问题,即使对图像数据进行压缩处理也是根据同一标准使用相同的压缩算法进行压缩,容易造成图像损失无法弥补的问题。也即,电子设备对拍摄的图像仅采用单一的压缩方式进行压缩后传输至应用处理芯片进行图像处理,因此电子设备图像处理方法的灵活性较差。With the development of technology, users often use electronic devices to capture images, such as taking photos or recording videos. However, in the related art, after the image processing chip acquires the image data collected by the camera, the image processing chip transmits the whole frame of image data to the application processing chip through the MIPI interface for related image processing, and the transmitted image data can be RAW format, YUV format or other formats. The characteristic of the currently applied transmission technology is that the entire frame of image data is directly transmitted, which is easy to cause the problem of excessive transmission pressure. Even if the image data is compressed, the same compression algorithm is used to compress the image data according to the same standard, which is easy to cause image loss. irreparable problems. That is, the electronic device only uses a single compression method to compress the captured image, and then transmits it to the application processing chip for image processing, so the flexibility of the electronic device image processing method is poor.

本申请实施例中,摄像头获取到图像后,可以通过接口将图像传输至图像处理芯片,因此图像处理芯片可以获取拍摄的当前图像和历史图像,其中当前图像可以是当前帧的图像,历史图像可以是上一帧的图像或者是相邻的前几帧的图像,比如前3帧、前5帧的图像等。需要说明的是,历史图像可以是一帧图像,也可以是多帧图像。In the embodiment of the present application, after the camera obtains the image, the image can be transmitted to the image processing chip through the interface, so the image processing chip can obtain the current image and historical image captured, wherein the current image can be the image of the current frame, and the historical image can be It is the image of the previous frame or the image of the adjacent previous frames, such as the images of the first 3 frames, the first 5 frames, etc. It should be noted that the historical image may be one frame of image or multiple frames of images.

可以理解的,针对上一帧的图像或者是相邻的前几帧的图像,当前图像可能只有部分发生较大的变化,其它部分发生了较小的变化或没有变化。It can be understood that, with respect to the image of the previous frame or the images of the adjacent previous frames, only a part of the current image may have undergone major changes, and other parts have undergone minor changes or no changes.

在102中,将当前图像至少划分为第一区域图像和第二区域图像,第一区域图像相对历史图像对应区域图像的变化幅度大于第二区域图像相对历史图像对应区域图像的变化幅度。In 102, the current image is divided into at least a first area image and a second area image, and the change range of the first area image relative to the area image corresponding to the historical image is greater than the change range of the second area image relative to the area image corresponding to the historical image.

本申请实施例中,图像处理芯片将当前图像与历史图像进行比较,将当前图像至少划分为第一区域图像和第二区域图像。其中,第一区域图像相对历史图像对应区域图像的变化幅度大于第二区域图像相对历史图像对应区域图像的变化幅度。In this embodiment of the present application, the image processing chip compares the current image with the historical image, and divides the current image into at least a first area image and a second area image. Wherein, the change range of the first area image relative to the area image corresponding to the historical image is greater than the change range of the second area image relative to the area image corresponding to the historical image.

在一种实施方式中,图像处理芯片将当前图像和历史图像进行比较,将变化幅度大于预设幅度阈值的区域图像设置为第一区域图像,将变化幅度小于预设幅度阈值的区域图像设置为第二区域图像。具体的预设幅度阈值可以根据需要进行设置,比如可以根据当前图像的大小,传输模块的传输压力等情况设置预设幅度阈值,本申请在此不做限制。In one embodiment, the image processing chip compares the current image with the historical image, sets the image of the area with a change amplitude greater than a preset amplitude threshold as the first area image, and sets the image of the area with a change amplitude smaller than the preset amplitude threshold as the image of the first area Second area image. The specific preset amplitude threshold can be set as required, for example, the preset amplitude threshold can be set according to the size of the current image, the transmission pressure of the transmission module, etc., which is not limited in this application.

需要说明的是,本申请可以将当前图像中不同区域相对历史图像的变化幅度,划分为更多区域,比如第三区域图像、第四区域图像等。It should be noted that, the present application may divide the variation range of different regions in the current image relative to the historical image into more regions, such as the third region image, the fourth region image, and so on.

在一种实施方式中,图像处理芯片可以将当前图像预先划分为n列m行的多个子区域图像,对每一个子区域图像与历史图像中相同区域的图像进行比较,将变化幅度大于预设幅度阈值的至少一个子区域图像设置为第一区域图像,将变化幅度小于预设幅度阈值的至少一个子区域图像设置为第二区域图像。In one embodiment, the image processing chip may pre-divide the current image into a plurality of sub-area images of n columns and m rows, compare each sub-area image with the images of the same area in the historical image, and compare the variation range greater than the preset The at least one sub-area image of the amplitude threshold is set as the first area image, and the at least one sub-area image whose variation amplitude is smaller than the preset amplitude threshold is set as the second area image.

需要说明的是,图像处理芯片对当前图像预先划分的子区域越多,每个子区域的面积越小,那么通过对每个子区域的变化幅度进行判断划分第一区域图像和第二区域图像,其划分的结果也会更精准。因此本申请实施例可以根据需要划分不同数量的多个子区域,即n、m的值可以根据需要进行设置,可以将当前图像预先划分为均匀大小的多个子区域,也可以划分为不同大小的多个子区域。比如,可以对当前图像识别出主体区域和背景区域,针对变化率较高的主体区域可以设置较多的子区域,也可以理解为针对主体区域设置的每个子区域面积较小,针对变化率较低的背景区域可以设置较少的子区域,也可以理解为针对背景区域设置的每个子区域面积较大。It should be noted that, the more sub-regions the image processing chip pre-divides the current image, and the smaller the area of each sub-region, the first region image and the second region image are divided by judging the change range of each sub-region. The results of the division will be more accurate. Therefore, in this embodiment of the present application, a different number of sub-regions can be divided as needed, that is, the values of n and m can be set as needed, and the current image can be pre-divided into multiple sub-regions of uniform size, and can also be divided into multiple sub-regions. For example, the main area and the background area can be identified for the current image, and more sub-areas can be set for the main area with a higher rate of change. A low background area can be set with fewer sub-areas, and it can also be understood that each sub-area set for the background area has a larger area.

在一种实施方式中,图像处理芯片可以将当前图像划分为多个子区域图像;获取当前图像的图像特征点;基于图像特征点在当前图像和历史图像的位置信息,获取多个子区域图像的变化幅度;将变化幅度大于预设幅度阈值的至少一个子区域图像设置为第一区域图像,将变化幅度小于预设幅度阈值的至少一个子区域图像设置为第二区域图像。In one embodiment, the image processing chip can divide the current image into multiple sub-region images; obtain image feature points of the current image; and obtain the changes of the multiple sub-region images based on the location information of the image feature points in the current image and historical images Amplitude; set at least one sub-area image whose variation range is greater than the preset amplitude threshold as the first area image, and set at least one sub-area image whose variation range is smaller than the preset amplitude threshold as the second area image.

在一种实施方式中,摄像头获取到当前图像后,将当前图像传输至图像处理芯片,图像处理芯片可以识别当前图像的图像特征点,也可以理解为当前图像中的图像关键点。In one embodiment, after the camera acquires the current image, it transmits the current image to the image processing chip, and the image processing chip can identify the image feature points of the current image, which can also be understood as image key points in the current image.

在一种实施方式中,可以通过神经网络的自主学习得到,比如,CNN特征提取的方式识别到图像特征点,而识别图像的关键点,比如识别图像中人物的头部、肩部、手臂、手掌、腿部、脚掌等位置,更具体的,比如头部中脸部的眼睛、鼻子、嘴巴、耳朵、眉毛等关键点位置。再比如,可以识别图像中物体的轮廓,根据轮廓选取图像特征点的分布,比如上端点、下端点、左端点、右端点、中间端点等位置设为图像特征点。In one embodiment, it can be obtained through autonomous learning of a neural network, for example, CNN feature extraction is used to identify image feature points, and key points of the image are identified, such as the head, shoulder, arm, etc. of the person in the image. Positions of palms, legs, soles of feet, etc., more specifically, such as key points such as the eyes, nose, mouth, ears, eyebrows, etc. of the face in the head. For another example, the outline of an object in an image can be identified, and the distribution of image feature points can be selected according to the outline, such as the upper endpoint, lower endpoint, left endpoint, right endpoint, and middle endpoint as image feature points.

获取图像特征点的坐标位置,比如图像特征点的坐标为(A、B),再获取该图像特征点在历史图像中对应的坐标位置,比如为(A'、B'),判断当前图像与历史图像中每个子区域中包含的图像特征点的坐标值变化幅度是否大于预设幅度阈值,若是,则将该子区域设置为第一区域图像,若不是,则将该子区域设置为第二区域图像。Obtain the coordinate position of the image feature point, for example, the coordinates of the image feature point are (A, B), and then obtain the corresponding coordinate position of the image feature point in the historical image, such as (A', B'), determine the current image and Whether the variation range of the coordinate values of the image feature points contained in each sub-region in the historical image is greater than the preset range threshold, if so, set the sub-region as the first region image, if not, set the sub-region as the second region image area image.

在一种实施方式中,图像处理芯片还可以预先设置每个子区域的参考点,比如每个子区域的中间位置为参考点,获取每个参考点的坐标位置,比如参考点的坐标为(C、D),再获取该参考点在历史图像中对应的坐标位置,比如为(C'、D'),判断当前图像与历史图像中每个子区域的参考点的坐标值变化幅度是否大于预设幅度阈值,若是,则设置为第一区域图像,若不是,则设置为第二区域图像。In one embodiment, the image processing chip may also preset the reference point of each sub-region, for example, the middle position of each sub-region is the reference point, and obtain the coordinate position of each reference point, for example, the coordinates of the reference point are (C, D), and then obtain the corresponding coordinate position of the reference point in the historical image, such as (C', D'), to determine whether the coordinate value change range of the reference point of each sub-region in the current image and the historical image is greater than the preset range Threshold, if yes, set it as the first area image, if not, set it as the second area image.

在103中,根据第一压缩算法将第一区域图像压缩得到第一压缩数据,根据第二压缩算法将第二区域图像压缩得到第二压缩数据,第一压缩算法的压缩比小于第二压缩算法的压缩比。In step 103, the first area image is compressed according to the first compression algorithm to obtain the first compressed data, the second area image is compressed according to the second compression algorithm to obtain the second compressed data, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm compression ratio.

本申请实施例中,当前图像中第一区域图像相对历史图像的变化幅度较大,因此,针对第一区域图像,图像处理芯片采用压缩比较小的第一压缩算法,得到的第一压缩数据的图像损失较小,从而可以更好的保存第一区域图像;其中,第一压缩算法可以是无损压缩的方法,若采用无损压缩的方式,经过解压缩后第一压缩数据可完全恢复原始的第一区域图像而不引起任何失真,无损压缩方式比如:Shannon-Fano编码,Huffman编码,游程(Run-length)编码,LZW(Lempel-Ziv-Welch)编码和算术编码等。In the embodiment of the present application, the image of the first area in the current image has a relatively large change range relative to the historical image. Therefore, for the image of the first area, the image processing chip adopts a first compression algorithm with a smaller compression ratio, and the obtained first compressed data is The image loss is small, so that the image of the first area can be better preserved; wherein, the first compression algorithm can be a lossless compression method, if the lossless compression method is adopted, after decompression, the first compressed data can be completely restored to the original first. A region image does not cause any distortion, lossless compression methods such as: Shannon-Fano coding, Huffman coding, Run-length coding, LZW (Lempel-Ziv-Welch) coding and arithmetic coding.

当前图像中第二区域图像相对历史图像的变化幅度较小或没有变化,比如当前图像中的部分背景区域,因此,图像处理芯片针对第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,得到第二压缩数据根据具体的压缩比允许压缩过程中损失一定的图像信息,经过解压缩后不能完全恢复原始的第二区域图像,但是可以减少图像所占用的容量,从而可以减少图像数据的传输量,减少了图像传输的压力。The second area image in the current image has a small or no change relative to the historical image, such as part of the background area in the current image. Therefore, the image processing chip uses a second compression algorithm with relatively large compression for the second area image. It is understood as lossy compression. Obtaining the second compressed data allows certain image information to be lost during the compression process according to the specific compression ratio. After decompression, the original second region image cannot be completely restored, but the capacity occupied by the image can be reduced, thereby It can reduce the transmission amount of image data and reduce the pressure of image transmission.

在104中,将第一压缩数据和第二压缩数据传输到应用处理芯片进行处理。In 104, the first compressed data and the second compressed data are transmitted to the application processing chip for processing.

图像处理芯片将第一压缩数据和第二压缩数据传输到应用处理芯片进行处理。The image processing chip transmits the first compressed data and the second compressed data to the application processing chip for processing.

在本申请实施例中,对比历史图像,图像处理芯片将当前图像至少划分为变化幅度不同的第一区域图像和第二区域图像,并针对不同区域图像的变化幅度,采用不同的压缩算法进行压缩,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法,针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法。可以理解的,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法进行压缩,可以减少第一区域图像的压缩损失,针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法进行压缩,可以减少图像数据的传输量,使得应用处理芯片可以及时处理图像,从而提升电子设备进行图像压缩的灵活性。In the embodiment of the present application, comparing historical images, the image processing chip divides the current image into at least a first area image and a second area image with different amplitudes of change, and uses different compression algorithms for compression according to the amplitudes of changes in the images in different areas , a first compression algorithm with relatively small compression is used for the first area image with a large variation range, and a second compression algorithm with relatively large compression is used for the second area image with a small variation range. It can be understood that, for the first area image with a large variation range, the first compression algorithm with relatively small compression is used for compression, which can reduce the compression loss of the first area image. Compressing with the second compression algorithm can reduce the amount of image data transmission, so that the application processing chip can process the image in time, thereby improving the flexibility of the electronic device for image compression.

请参阅图2,图2为本申请实施例提供的图像处理方法的第二种流程示意图,流程可以包括:Please refer to FIG. 2. FIG. 2 is a second schematic flowchart of an image processing method provided by an embodiment of the present application. The process may include:

在201中,获取拍摄的当前图像和历史图像。In 201, the captured current image and historical image are acquired.

本申请实施例中,摄像头获取到图像后,可以将图像传输至图像处理芯片,因此,图像处理芯片可以获取拍摄的当前图像和历史图像,其中当前图像可以是当前帧的图像,历史图像可以是上一帧的图像或者是相邻的前几帧的图像,比如前3帧、前5帧的图像等。需要说明的是,历史图像可以是一帧图像,也可以是多帧图像。In the embodiment of the present application, after the camera acquires the image, it can transmit the image to the image processing chip. Therefore, the image processing chip can acquire the current image and historical image captured, wherein the current image can be the image of the current frame, and the historical image can be The image of the previous frame or the images of the adjacent previous frames, such as the images of the first 3 frames, the first 5 frames, and so on. It should be noted that the historical image may be one frame of image or multiple frames of images.

可以理解的,针对上一帧的图像或者是相邻的前几帧的图像,当前图像可能只有部分发生较大的变化,其它部分只发生较小的变化或没有变化。It can be understood that, for the image of the previous frame or the image of the adjacent previous frames, only a part of the current image may have a large change, and other parts only have a small change or no change.

在202中,将当前图像划分为第一区域图像、第二区域图像和第三区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度,第二区域图像相对历史图像中对应区域图像的变化幅度大于第三区域图像相对历史图像对应区域图像的变化幅度。In 202, the current image is divided into a first area image, a second area image and a third area image, and the variation range of the first area image relative to the corresponding area image in the historical image is greater than that of the second area image relative to the corresponding area image in the historical image The change range of the second area image relative to the corresponding area image in the historical image is greater than the change range of the third area image relative to the corresponding area image in the historical image.

本申请实施例中,图像处理芯片将当前图像与历史图像进行比较,将当前图像划分为第一区域图像、第二区域图像和第三区域图像。其中,第一区域图像相对历史图像对应区域图像的变化幅度大于第二区域图像相对历史图像对应区域图像的变化幅度,第二区域图像相对历史图像中对应区域图像的变化幅度大于第三区域图像相对历史图像对应区域图像的变化幅度。In this embodiment of the present application, the image processing chip compares the current image with the historical image, and divides the current image into a first area image, a second area image, and a third area image. Wherein, the variation range of the image of the first area relative to the image of the corresponding area of the historical image is greater than that of the image of the second area relative to the image of the corresponding area of the historical image, and the variation range of the image of the second area relative to the image of the corresponding area in the historical image is greater than that of the image of the third area. The variation range of the area image corresponding to the historical image.

在一种实施方式中,将当前图像和历史图像进行比较,将变化幅度大于第一预设幅度阈值的区域图像设置为第一区域图像,将变化幅度不大于第一预设幅度阈值但是大于第二预设幅度阈值的区域图像设置为第二区域图像,将变化幅度不大于第二预设幅度阈值的区域图像设置为第三区域图像。也即对比第一区域图像和第二区域图像,第三区域图像相对历史图像的变化幅度很小或者基本没有变化。In one embodiment, the current image is compared with the historical image, the image of the area with the change amplitude greater than the first preset amplitude threshold is set as the first area image, and the change amplitude is not greater than the first preset amplitude threshold but greater than the first area image. The area image with the two preset amplitude thresholds is set as the second area image, and the area image whose variation amplitude is not greater than the second preset amplitude threshold is set as the third area image. That is, comparing the image of the first area with the image of the second area, the change of the image of the third area relative to the historical image is small or basically unchanged.

需要说明的是,具体的第一预设幅度阈值和第二预设幅度阈值可以根据需要进行设置,比如可以根据当前图像的大小,传输模块的传输压力等情况设置第一预设幅度阈值和第二预设幅度阈值,本申请在此不做限制。It should be noted that the specific first preset amplitude threshold and the second preset amplitude threshold can be set as required, for example, the first preset amplitude threshold and the first preset amplitude threshold can be set according to the size of the current image, the transmission pressure of the transmission module, etc. Two preset amplitude thresholds, which are not limited in this application.

在一种实施方式中,可以将当前图像划分为多个子区域图像;获取当前图像的图像特征点;基于图像特征点在当前图像和历史图像的位置信息,获取多个子区域图像的变化幅度;将变化幅度大于第一预设幅度阈值的至少一个子区域图像设置为第一区域图像,将变化幅度不大于第一预设幅度阈值但是大于第二预设幅度阈值的至少一个子区域图像设置为第二区域图像,将变化幅度不大于第二预设幅度阈值的至少一个子区域设置为第三区域图像。In one embodiment, the current image can be divided into a plurality of sub-region images; the image feature points of the current image are obtained; based on the position information of the image feature points in the current image and the historical image, the variation range of the multiple sub-region images is obtained; At least one sub-area image whose variation amplitude is greater than the first preset amplitude threshold is set as the first area image, and at least one sub-area image whose variation amplitude is not greater than the first preset amplitude threshold but greater than the second preset amplitude threshold is set as the first area image. For the second-region image, at least one sub-region whose variation amplitude is not greater than the second preset amplitude threshold is set as the third-region image.

需要说明的是,图像处理芯片可以根据需要划分不同数量的多个子区域,可以将当前图像预先划分为均匀大小的多个子区域,也可以划分为不同大小的多个子区域。It should be noted that, the image processing chip can divide multiple sub-regions of different numbers as required, and can divide the current image into multiple sub-regions of uniform size in advance, or can be divided into multiple sub-regions of different sizes.

需要说明的是,图像处理芯片对当前图像预先划分的子区域越多,每个子区域的面积越小,那么通过对每个子区域的变化幅度进行判断划分第一区域图像、第二区域图像和第三区域图像,其划分的结果也会更精准。因此本申请实施例可以根据需要划分不同数量的多个子区域,可以将当前图像预先划分为均匀大小的多个子区域,也可以划分为不同大小的多个子区域。比如,可以对当前图像识别出主体区域和背景区域,针对变化率较高的主体区域可以设置较多的子区域,也可以理解为针对主体区域设置的每个子区域面积较小,针对变化率较低的背景区域可以设置较少的子区域,也可以理解为针对背景区域设置的每个子区域面积较大。It should be noted that the more sub-regions the image processing chip pre-divides the current image, and the smaller the area of each sub-region, then the first region image, the second region image and the first region image are divided by judging the change range of each sub-region. The three-region image, the result of its division will be more accurate. Therefore, in this embodiment of the present application, a different number of sub-regions can be divided according to requirements, and the current image can be pre-divided into a plurality of sub-regions of uniform size, and can also be divided into a plurality of sub-regions of different sizes. For example, the main area and the background area can be identified for the current image, and more sub-areas can be set for the main area with a higher rate of change. A low background area can be set with fewer sub-areas, and it can also be understood that each sub-area set for the background area has a larger area.

在一种实施方式中,摄像头获取到当前图像后,将当前图像传输至图像处理芯片,图像处理芯片可以识别当前图像的图像特征点,也可以理解为当前图像中物体的图像关键点。在一种实施方式中,可以通过神经网络的自主学习得到,比如,CNN特征提取的方式识别到图像特征点,而识别图像的关键点,比如识别图像中人物的头部、肩部、手臂、手掌、腿部、脚掌等位置,更具体的,比如头部中脸部的眼睛、鼻子、嘴巴、耳朵、眉毛等关键点位置。再比如,可以识别图像中物体的轮廓,根据轮廓选取图像特征点的分布,比如上端点、下端点、左端点、右端点、中间端点等位置设为图像特征点。In one embodiment, after the camera acquires the current image, it transmits the current image to the image processing chip, and the image processing chip can identify the image feature points of the current image, which can also be understood as image key points of objects in the current image. In one embodiment, it can be obtained through autonomous learning of a neural network, for example, CNN feature extraction is used to identify image feature points, and key points of the image are identified, such as the head, shoulder, arm, etc. of the person in the image. Positions of palms, legs, soles of feet, etc., more specifically, such as key points such as the eyes, nose, mouth, ears, eyebrows, etc. of the face in the head. For another example, the outline of an object in an image can be identified, and the distribution of image feature points can be selected according to the outline, such as the upper endpoint, lower endpoint, left endpoint, right endpoint, and middle endpoint as image feature points.

获取图像特征点的坐标位置,比如图像特征点的坐标为(A、B),再获取该图像特征点在历史图像中对应的坐标位置,比如为(A'、B'),判断当前图像与历史图像中每个子区域中包含的图像特征点的坐标值变化幅度,若变化幅度大于第一预设幅度阈值,则将该子区域设置为第一区域图像,若变化幅度不大于第一预设幅度阈值但是大于第二预设幅度阈值,则将该子区域设置为第二区域图像,若变化幅度不大于第二预设幅度阈值,则将该子区域设置为第三区域图像。Obtain the coordinate position of the image feature point, for example, the coordinates of the image feature point are (A, B), and then obtain the corresponding coordinate position of the image feature point in the historical image, such as (A', B'), determine the current image and The change range of the coordinate value of the image feature points contained in each sub-region in the historical image, if the change range is greater than the first preset range threshold, the sub-region is set as the first region image, if the change range is not greater than the first preset range If the amplitude threshold is greater than the second preset amplitude threshold, the sub-area is set as the second area image, and if the change amplitude is not greater than the second preset amplitude threshold, the sub-area is set as the third area image.

在一种实施方式中,还可以预先设置每个子区域的参考点,比如每个子区域的中间位置为参考点,获取每个参考点的坐标位置,比如参考点的坐标为(C、D),再获取该参考点在历史图像中对应的坐标位置,比如为(C'、D'),判断当前图像与历史图像中每个子区域的参考点的坐标值变化幅度,若变化幅度大于第一预设幅度阈值,则将该子区域设置为第一区域图像,若变化幅度不大于第一预设幅度阈值但是大于第二预设幅度阈值,则将该子区域设置为第二区域图像,若变化幅度不大于第二预设幅度阈值,则将该子区域设置为第三区域图像。In one embodiment, the reference point of each sub-area can also be preset, for example, the middle position of each sub-area is the reference point, and the coordinate position of each reference point is obtained, for example, the coordinates of the reference point are (C, D), Then obtain the corresponding coordinate position of the reference point in the historical image, such as (C', D'), and judge the change range of the coordinate value of the reference point of each sub-region in the current image and the historical image. If the amplitude threshold is set, the sub-area is set as the first area image. If the change amplitude is not greater than the first preset amplitude threshold but greater than the second preset amplitude threshold, the sub-area is set as the second area image. If the amplitude is not greater than the second preset amplitude threshold, the sub-area is set as the third area image.

在203中,根据第一压缩算法将第一区域图像压缩得到第一压缩数据,根据第二压缩算法将第二区域图像压缩得到第二压缩数据,第一压缩算法的压缩比小于第二压缩算法的压缩比。In 203, the first area image is compressed according to the first compression algorithm to obtain the first compressed data, the second area image is compressed according to the second compression algorithm to obtain the second compressed data, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm compression ratio.

本申请实施例中,当前图像中第一区域图像相对历史图像的变化幅度较大,因此,图像处理芯片针对第一区域图像采用压缩比较小的第一压缩算法,得到的第一压缩数据的图像损失较小,从而可以更好的保存第一区域图像;其中,第一压缩算法可以是无损压缩的方法,若采用无损压缩的方式,经过解压缩后第一压缩数据可完全恢复原始的第一区域图像而不引起任何失真,无损压缩方式比如:Shannon-Fano编码,Huffman编码,游程(Run-length)编码,LZW(Lempel-Ziv-Welch)编码和算术编码等。In the embodiment of the present application, the image of the first area in the current image has a relatively large change range relative to the historical image. Therefore, the image processing chip adopts the first compression algorithm with relatively low compression for the image of the first area, and obtains an image of the first compressed data. The loss is small, so that the first area image can be better preserved; wherein, the first compression algorithm can be a lossless compression method, if the lossless compression method is adopted, after decompression, the first compressed data can be completely restored to the original Regional images without causing any distortion, lossless compression methods such as: Shannon-Fano coding, Huffman coding, Run-length coding, LZW (Lempel-Ziv-Welch) coding and arithmetic coding.

当前图像中第二区域图像相对历史图像的变化幅度虽然小于第一区域,但是还是具有一定的变化幅度,因此,图像处理芯片针对第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,得到第二压缩数据根据具体的压缩比允许压缩过程中损失一定的图像信息,经过解压缩后不能完全恢复原始的第二区域图像,但是可以减少图像所占用的容量,从而可以减少图像数据的传输量。Although the change range of the second area image in the current image relative to the historical image is smaller than that of the first area, it still has a certain change range. Therefore, it is understandable that the image processing chip adopts the second compression algorithm with relatively large compression for the second area image. For lossy compression, obtaining the second compressed data allows certain image information to be lost during the compression process according to the specific compression ratio. After decompression, the original second region image cannot be completely restored, but the capacity occupied by the image can be reduced, so that Reduce the transfer amount of image data.

在204中,获取第三区域图像的位置信息。In 204, position information of the third region image is obtained.

由于第三区域图像相对历史图像的对应区域图像,其变化幅度是很小甚至没有变化,因此图像处理芯片可以直接获取第三区域图像的位置信息,应用处理芯片可以根据该位置信息获取历史图像的对应区域图像,而不需要对第三区域图像进行压缩传输。Since the image of the third area has little or no change relative to the image of the corresponding area of the historical image, the image processing chip can directly obtain the location information of the image of the third area, and the application processing chip can obtain the location information of the historical image according to the location information. The corresponding area image does not need to be compressed and transmitted on the third area image.

在205中,将第一压缩数据、第二压缩数据和位置信息传输到应用处理芯片进行处理。In 205, the first compressed data, the second compressed data and the location information are transmitted to the application processing chip for processing.

图像处理芯片将第一压缩数据和第二压缩数据传输到应用处理芯片进行处理,需要说明的是,应用处理芯片中可以已经缓存有历史图像,应用处理芯片可以根据接收的第一压缩数据、第二压缩数据以及历史数据对图像进行进一步的处理。The image processing chip transmits the first compressed data and the second compressed data to the application processing chip for processing. It should be noted that the application processing chip may have cached historical images. Second, the compressed data and historical data are used for further processing of the image.

请参阅图3,图3为本申请实施例提供的图像处理方法的第三种流程示意图,该图像处理方法应用于应用处理芯片,应用处理芯片和图像处理芯片连接,流程可以包括:Please refer to FIG. 3. FIG. 3 is a third schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method is applied to an application processing chip, and the application processing chip and the image processing chip are connected. The flow may include:

在301中,接收图像处理芯片发送的第一压缩数据和第二压缩数据,第一压缩数据采用第一压缩算法压缩,第二压缩数据采用第二压缩算法压缩,第一压缩算法的压缩比小于所述第二压缩算法的压缩比。In 301, first compressed data and second compressed data sent by the image processing chip are received, the first compressed data is compressed by a first compression algorithm, the second compressed data is compressed by a second compression algorithm, and the compression ratio of the first compression algorithm is less than The compression ratio of the second compression algorithm.

应用处理芯片接收图像处理芯片发送的第一压缩数据和第二压缩数据。第一压缩数据采用第一压缩算法压缩,第二压缩数据采用第二压缩算法压缩,第一压缩算法的压缩比小于所述第二压缩算法的压缩比,第一压缩数据对应摄像头拍摄的当前图像的第一区域图像,第二压缩数据对应该当前图像的第二区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度,历史图像为当前图像的前一帧或前几帧图像。The application processing chip receives the first compressed data and the second compressed data sent by the image processing chip. The first compressed data is compressed by a first compression algorithm, the second compressed data is compressed by a second compression algorithm, the compression ratio of the first compression algorithm is smaller than the compression ratio of the second compression algorithm, and the first compressed data corresponds to the current image captured by the camera The first area image of the first area image, the second compressed data corresponds to the second area image of the current image, and the change range of the first area image relative to the corresponding area image in the historical image is greater than the change range of the second area image relative to the corresponding area image in the historical image, The historical image is the previous frame or previous frames of the current image.

可以理解的是,图像处理芯片可以为上述任意一个实施例中的图像处理芯片,第一压缩数据和第二压缩数据可以为上述任意一个实施例中的第一压缩数据和第二压缩数据,在此不再赘述。It can be understood that the image processing chip may be the image processing chip in any one of the above embodiments, and the first compressed data and the second compressed data may be the first compressed data and the second compressed data in any one of the above embodiments. This will not be repeated here.

在302中,对所述第一压缩数据进行解压缩得到第一子图像,以及对所述第二压缩数据进行解压缩得到第二子图像。In 302, decompress the first compressed data to obtain a first sub-image, and decompress the second compressed data to obtain a second sub-image.

应用处理芯片对第一压缩数据进行解压缩得到第一子图像,以及对第二压缩数据进行解压缩得到第二子图像。第一子图像为对应第一区域图像的子图像,第二子图像为对应第二区域图像的子图像。The application processing chip decompresses the first compressed data to obtain a first sub-image, and decompresses the second compressed data to obtain a second sub-image. The first sub-image is a sub-image corresponding to the first area image, and the second sub-image is a sub-image corresponding to the second area image.

可以理解的是,第一子图像和第二子图像可以为上述实施例中的第一子图像和第二子图像,在此不再赘述。It can be understood that, the first sub-image and the second sub-image may be the first sub-image and the second sub-image in the foregoing embodiment, and details are not described herein again.

在303中,基于历史图像对第二子图像进行融合处理得到第三子图像。In 303, a third sub-image is obtained by performing fusion processing on the second sub-image based on the historical image.

应用处理芯片基于历史图像对第二子图像进行融合处理得到第三子图像,历史图像为应用处理芯片存储的图像处理芯片之前发送的图像。历史图像和第二子图像具有关联,比如,历史图像可以为第二子图像前一帧或前几帧的图像。The application processing chip performs fusion processing on the second sub-image based on the historical image to obtain a third sub-image, and the historical image is an image previously sent by the image processing chip stored in the application processing chip. The historical image and the second sub-image are associated, for example, the historical image may be an image of one frame or several frames before the second sub-image.

在304中,将第一子图像和第三子图像合成得到对应图像。In 304, the first sub-image and the third sub-image are synthesized to obtain a corresponding image.

应用处理芯片将第一子图像和第三子图像合成得到对应图像,对应图像可以为摄像头拍摄的当前图像处理后的图像。比如,第一子图像为当前图像的第一区域图像无压缩传输的子图像,第二子图像为当前图像的第二区域图像有损压缩后的子图像,第三子图像为第二子图像和历史图像融合处理后的子图像,得到的第三子图像其图像损失较小,更接近于第二区域的图像,图像质量更高,同时提高了图像处理芯片和应用处理芯片的传输效率。The application processing chip synthesizes the first sub-image and the third sub-image to obtain a corresponding image, and the corresponding image may be a processed image of the current image captured by the camera. For example, the first sub-image is an uncompressed sub-image of the first area image of the current image, the second sub-image is a sub-image of the second area of the current image after lossy compression, and the third sub-image is the second sub-image After the sub-image is fused with the historical image, the obtained third sub-image has less image loss, is closer to the image in the second area, and has higher image quality, while improving the transmission efficiency of the image processing chip and the application processing chip.

请参阅图4,图4为本申请实施例提供的图像处理方法的第四种流程示意图,该图像处理方法应用于应用处理芯片,应用处理芯片和图像处理芯片连接,流程可以包括:Please refer to FIG. 4. FIG. 4 is a fourth schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method is applied to an application processing chip, and the application processing chip and the image processing chip are connected. The flow may include:

在401中,接收图像处理芯片发送的第一压缩数据、第二压缩数据和位置信息。In 401, the first compressed data, the second compressed data and the location information sent by the image processing chip are received.

应用处理芯片接收图像处理芯片发送的第一压缩数据、第二压缩数据和位置信息。第一压缩数据采用第一压缩算法压缩,第二压缩数据采用第二压缩算法压缩,第一压缩算法的压缩比小于所述第二压缩算法的压缩比,第一压缩数据对应摄像头拍摄的当前图像的第一区域图像,第二压缩数据对应该当前图像的第二区域图像,位置信息为对应该当前图像的第三区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度,第二区域图像相对历史图像中对应区域图像的变化幅度大于第三区域图像相对历史图像对应区域图像的变化幅度,历史图像为当前图像的前一帧或前几帧图像。The application processing chip receives the first compressed data, the second compressed data and the location information sent by the image processing chip. The first compressed data is compressed by a first compression algorithm, the second compressed data is compressed by a second compression algorithm, the compression ratio of the first compression algorithm is smaller than the compression ratio of the second compression algorithm, and the first compressed data corresponds to the current image captured by the camera The first area image of the current image, the second compressed data corresponds to the second area image of the current image, the location information is the third area image corresponding to the current image, and the change range of the first area image relative to the corresponding area image in the historical image is greater than that of the second area image. The change range of the area image relative to the corresponding area image in the historical image, the change range of the second area image relative to the corresponding area image in the historical image is greater than the change range of the third area image relative to the corresponding area image in the historical image, and the historical image is the previous image of the current image. frame or previous frames of images.

可以理解的是,图像处理芯片可以为上述任意一个实施例中的图像处理芯片,第一压缩数据、第二压缩数据和位置信息可以为上述任意一个实施例中的第一压缩数据和第二压缩数据,在此不再赘述。It can be understood that the image processing chip may be the image processing chip in any of the foregoing embodiments, and the first compressed data, the second compressed data, and the location information may be the first compressed data and the second compressed data in any of the foregoing embodiments. data, which will not be repeated here.

在402中,对第一压缩数据进行解压缩得到对应第一区域图像的第一子图像,以及对第二压缩数据进行解压缩得到对应第二区域图像的第二子图像。In 402, decompress the first compressed data to obtain a first sub-image corresponding to the first area image, and decompress the second compressed data to obtain a second sub-image corresponding to the second area image.

应用处理芯片接收到第一压缩数据和第二压缩数据后,应用处理芯片对第一压缩数据进行解压缩得到对应第一区域图像的第一子图像,对第二压缩数据进行解压缩得到对应第二区域图像的第二子图像。After the application processing chip receives the first compressed data and the second compressed data, the application processing chip decompresses the first compressed data to obtain a first sub-image corresponding to the first area image, and decompresses the second compressed data to obtain a corresponding first sub-image. The second sub-image of the two-region image.

由于第一区域图像采用压缩比较小的第一压缩算法,因此解压缩后的第一子图像的图像损失较小,本申请实施例中,针对第一区域图像还可以采用无损压缩的方法,使得解压缩后的第一子图像可完全恢复原始的第一区域图像而不引起任何失真,即应用处理芯片对第一压缩数据进行解压缩得到的第一子图像可以就是为第一区域图像。Since the first region image adopts the first compression algorithm with relatively low compression, the image loss of the decompressed first sub-image is small. In this embodiment of the present application, a lossless compression method may also be used for the first region image, so that The decompressed first sub-image can completely restore the original first-area image without causing any distortion, that is, the first sub-image obtained by applying the processing chip to decompress the first compressed data may be the first-area image.

由于第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,因此第二压缩数据经过解压缩后不能完全恢复原始的第二区域图像,会有部分图像信息损失,也即第二子图像相对第二区域图像根据具体的压缩比是具有一定的图像损失的。Since the second area image adopts the second compression algorithm with relatively large compression, it can also be understood as lossy compression. Therefore, the second area image cannot be completely restored to the original second area image after decompression, and some image information will be lost. That is, the second sub-image has a certain image loss relative to the second region image according to a specific compression ratio.

在403中,基于历史图像对第二子图像进行融合处理得到第三子图像。In 403, a third sub-image is obtained by performing fusion processing on the second sub-image based on the historical image.

可以理解的,应用处理芯片中可以已经缓存有历史图像,历史图像比如上一帧的图像或者是相邻的前几帧的图像。第二区域的图像相对历史图像中对应区域图像的变化幅度小于第一区域的图像,但还是具有一定的变化幅度。应用处理芯片接收到第二压缩数据之后,对第二压缩数据进行解压缩得到的第二子图像相对当前图像中的第二区域图像是具有图像损失的。It can be understood that the application processing chip may have cached historical images, such as images of the previous frame or images of adjacent previous frames. The variation range of the image of the second area relative to the image of the corresponding area in the historical image is smaller than that of the image of the first area, but still has a certain variation range. After the application processing chip receives the second compressed data, the second sub-image obtained by decompressing the second compressed data has image loss relative to the second region image in the current image.

本申请实施例中,应用处理芯片可以获取历史图像中与当前图像中第二区域图像对应区域的图像,并将对应区域的图像与第二子图像进行融合处理得到第三子图像。In the embodiment of the present application, the application processing chip may acquire the image of the area corresponding to the second area image in the current image in the historical image, and fuse the image of the corresponding area with the second sub-image to obtain the third sub-image.

在一种实施方式中,可以先根据历史图像比如相邻几帧图像的变化过程,对历史图像对应的区域图像根据变化过程进行相应的调整,以使调整后的历史图像中对应区域图像与第二区域的图像变化更小,更加接近;再通过调整后的历史图像对应的区域图像对解压缩后第二子图像损失的图像细节进行修正和增强得到第三子图像。In one embodiment, according to the change process of the historical image, such as several adjacent frames of images, the corresponding area image corresponding to the historical image may be adjusted according to the change process, so that the corresponding area image in the adjusted historical image is the same as the first image. The image changes in the second area are smaller and closer; and the image details lost in the second sub-image after decompression are corrected and enhanced by using the area image corresponding to the adjusted historical image to obtain a third sub-image.

因此,即使解压缩得到的第二子图像相对当前图像中的第二区域图像是具有一定的图像损失,但是第二子图像通过与历史图像进行增强融合处理后,得到的第三子图像更接近于当前图像中第二区域的图像,图像损失也更少,提升了第三子图像的图像质量,甚至相对第二区域图像具有更高的图像质量,比如更清晰。Therefore, even if the second sub-image obtained by decompression has a certain image loss relative to the second region image in the current image, the third sub-image obtained after the second sub-image is enhanced and fused with the historical image is closer to the current image. For the image of the second area in the current image, the image loss is also less, which improves the image quality of the third sub-image, and even has higher image quality than the second area image, for example, it is clearer.

在404中,基于历史图像和位置信息得到对应第四子图像。In 404, a corresponding fourth sub-image is obtained based on the historical image and the location information.

由于第三区域图像相对历史图像,其变化幅度是很小甚至没有变化,因此应用处理芯片可以根据第三区域图像的位置信息确定历史图像中与第三区域图像对应的区域图像,并将该区域图像作为对应第三区域图像的第四子图像。Since the third area image has little or no change relative to the historical image, the application processing chip can determine the area image corresponding to the third area image in the historical image according to the position information of the third area image, and assign this area to the image. The image is used as the fourth sub-image corresponding to the third area image.

在405中,将第一子图像、第三子图像和第四子图像合成得到对应图像。In 405, the first sub-image, the third sub-image and the fourth sub-image are synthesized to obtain a corresponding image.

由于第一区域图像采用压缩比较小的第一压缩算法,因此应用处理芯片解压缩后得到的第一子图像相对第一区域图像损失较小,若第一区域图像若采用无损压缩的方法,解压缩后的第一子图像可完全恢复原始的第一区域图像而不引起任何失真,即应用处理芯片解压缩得到的第一子图像可以就是为第一区域图像。Since the first area image adopts the first compression algorithm with less compression, the first sub-image obtained after decompression by the processing chip has less loss than the first area image. If the first area image adopts the lossless compression method, the solution The compressed first sub-image can completely restore the original first-area image without causing any distortion, that is, the first sub-image decompressed by the processing chip can be the first-area image.

第二区域图像采用压缩比较大的第一压缩算法,应用处理芯片解压缩后得到的第二子图像相对第二区域图像是具有图像损失的,但是本申请实施例,通过将第二子图像与历史图像进行增强融合处理后,提升了第三子图像的图像质量,得到的第三子图像更接近于第二区域的图像,图像损失也较小。The second region image adopts the first compression algorithm with relatively large compression, and the second sub-image obtained after decompression by the processing chip has image loss relative to the second region image. However, in this embodiment of the present application, by combining the second sub-image with After the historical image is enhanced and fused, the image quality of the third sub-image is improved, and the obtained third sub-image is closer to the image of the second area, and the image loss is also smaller.

第三区域图像相对历史图像,其变化幅度是很小甚至没有变化,因此本申请实施例,将历史图像中与第三区域图像相同位置信息的区域图像作为第三区域图像对应的第四子图像,可以理解的,第四子图像相对第三区域图像的图像损失也是很小或者没有损失。Compared with the historical image, the variation range of the third area image is very small or even no change. Therefore, in this embodiment of the present application, the area image with the same location information as the third area image in the historical image is used as the fourth sub-image corresponding to the third area image. , it can be understood that the image loss of the fourth sub-image relative to the third region image is also small or no loss.

本申请实施例中,由于第一子图像相对当前图像的第一区域图像的图像损失较小或没有损失,第三子图像相对当前图像的第二区域图像的图像损失也较小,第四子图像相对第三区域图像的图像损失也是很小或者没有损失,因此应用处理芯片将第一子图像、第三子图像和第四子图像进行合成,得到对应当前图像的图像,其图像损失也较小,应用处理芯片可以基于该图像进行进一步的图像处理。In this embodiment of the present application, since the image loss of the first sub-image relative to the image of the first area of the current image is small or no loss, the image loss of the third sub-image relative to the image of the second area of the current image is also small, and the image loss of the fourth sub-image is also small. The image loss of the image relative to the image in the third area is also small or no loss, so the application processing chip combines the first sub-image, the third sub-image and the fourth sub-image to obtain an image corresponding to the current image, and the image loss is also relatively low. Small, the application processing chip can perform further image processing based on the image.

可以理解的,当前图像与历史图像若只有部分发生较大的变化,部分发生较小的变化,且另外一部分发生微小的变化或没有变化,则只需要将部分的第一区域图像采用压缩比小的压缩方式进行压缩,以减少第一区域图像的图像损失,而可以将第二区域图像采用压缩比较大的压缩方式进行压缩,从而减少图像数据的传输量,针对第三区域图像不需要压缩传输,只需要将第三区域图像的位置信息发送给应用处理芯片,进一步减少图像数据的传输量,较大的减少了传输压力,从而应用处理芯片可以实时接收到图像数据进行处理,又可以保证应用处理芯片处理的图像相对当前图像具有较小的图像损失。It is understandable that if only some of the current image and the historical image have undergone major changes, some have minor changes, and the other part has undergone slight changes or no changes, it is only necessary to use a smaller compression ratio for some of the first region images. To reduce the image loss of the image in the first area, you can compress the image in the second area using a compression method with relatively large compression, thereby reducing the amount of image data transmission. For the image in the third area, no compression transmission is required. , it only needs to send the position information of the image of the third area to the application processing chip, which further reduces the amount of image data transmission and greatly reduces the transmission pressure, so that the application processing chip can receive the image data in real time for processing, and can The image processed by the processing chip has less image loss relative to the current image.

请参阅图5,图5为本申请实施例提供的图像处理方法的第五种流程示意图,该图像处理方法可以应用于图像处理芯片和应用处理芯片,图像处理芯片和应用处理芯片连接。流程可以包括:Please refer to FIG. 5. FIG. 5 is a fifth schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method can be applied to an image processing chip and an application processing chip, and the image processing chip and the application processing chip are connected. Processes can include:

在501中,获取拍摄的当前图像和历史图像。In 501, the captured current image and historical image are acquired.

本申请实施例中,摄像头获取到图像后,可以将当图像传输至图像处理芯片,因此图像处理芯片可以获取拍摄的当前图像和历史图像,其中当前图像可以是当前帧的图像,历史图像可以是上一帧的图像或者是相邻的前几帧的图像,比如前3帧、前5帧的图像等。可以理解的,针对上一帧的图像或者是相邻的前几帧的图像,当前图像可能只有部分发生较大的变化,其它部分只发生较小的变化或没有变化。In the embodiment of the present application, after the camera obtains the image, it can transmit the current image to the image processing chip, so the image processing chip can obtain the current image and historical image captured, wherein the current image can be the image of the current frame, and the historical image can be The image of the previous frame or the images of the adjacent previous frames, such as the images of the first 3 frames, the first 5 frames, and so on. It can be understood that, for the image of the previous frame or the image of the adjacent previous frames, only a part of the current image may have a large change, and other parts only have a small change or no change.

在502中,将当前图像至少划分为第一区域图像和第二区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度。In 502, the current image is divided into at least a first area image and a second area image, and the change range of the first area image relative to the corresponding area image in the historical image is greater than the change range of the second area image relative to the corresponding area image in the historical image.

本申请实施例中,图像处理芯片将当前图像与历史图像进行比较,将当前图像至少划分为第一区域图像和第二区域图像。其中,第一区域图像相对历史图像对应区域图像的变化幅度大于第二区域图像相对历史图像对应区域图像的变化幅度。In this embodiment of the present application, the image processing chip compares the current image with the historical image, and divides the current image into at least a first area image and a second area image. Wherein, the change range of the first area image relative to the area image corresponding to the historical image is greater than the change range of the second area image relative to the area image corresponding to the historical image.

在一种实施方式中,图像处理芯片将当前图像和历史图像进行比较,将变化幅度大于预设幅度阈值的区域图像设置为第一区域图像,将变化幅度不大于预设幅度阈值的区域图像设置为第二区域图像。具体的预设幅度阈值可以根据需要进行设置,比如可以根据当前图像的大小,传输模块的传输压力等情况设置预设幅度阈值,本申请在此不做限制。In one embodiment, the image processing chip compares the current image with the historical image, sets the image of the area with a change amplitude greater than a preset amplitude threshold as the first area image, and sets the image of the area with a change amplitude not greater than the preset amplitude threshold as the first area image for the second region image. The specific preset amplitude threshold can be set as required, for example, the preset amplitude threshold can be set according to the size of the current image, the transmission pressure of the transmission module, etc., which is not limited in this application.

在503中,根据第一压缩算法将第一区域图像压缩得到第一压缩数据,根据第二压缩算法将第二区域图像压缩得到第二压缩数据,第一压缩算法的压缩比小于第二压缩算法的压缩比。In step 503, the first area image is compressed according to the first compression algorithm to obtain the first compressed data, the second area image is compressed according to the second compression algorithm to obtain the second compressed data, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm compression ratio.

本申请实施例中,当前图像中第一区域图像相对历史图像的变化幅度较大,因此,图像处理芯片针对第一区域图像采用压缩比较小的第一压缩算法,得到的第一压缩数据的图像损失较小,从而可以更好的保存第一区域图像;其中,第一压缩算法可以是无损压缩的方法,若采用无损压缩的方式,经过解压缩后第一压缩数据可完全恢复原始的第一区域图像而不引起任何失真。In the embodiment of the present application, the image of the first area in the current image has a relatively large change range relative to the historical image. Therefore, the image processing chip adopts the first compression algorithm with relatively low compression for the image of the first area, and obtains an image of the first compressed data. The loss is small, so that the first area image can be better preserved; wherein, the first compression algorithm can be a lossless compression method, if the lossless compression method is adopted, after decompression, the first compressed data can be completely restored to the original area image without causing any distortion.

当前图像中第二区域图像相对历史图像的变化幅度较小或没有变化,因此,图像处理芯片针对第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,得到第二压缩数据根据具体的压缩比允许压缩过程中损失一定的图像信息,经过解压缩后不能完全恢复原始的第二区域图像,但是可以减少图像数据的传输量,减少了图像传输的压力。The variation of the second area image in the current image relative to the historical image is small or unchanged. Therefore, the image processing chip adopts the second compression algorithm with relatively large compression for the second area image, which can also be understood as lossy compression, and obtains the second compression algorithm. The compressed data allows a certain amount of image information to be lost during the compression process according to the specific compression ratio. After decompression, the original second region image cannot be completely restored, but it can reduce the amount of image data transmission and reduce the pressure of image transmission.

在504中,将第一压缩数据和第二压缩数据传输到应用处理芯片进行处理。In 504, the first compressed data and the second compressed data are transmitted to the application processing chip for processing.

图像处理芯片将第一压缩数据和第二压缩数据传输到应用处理芯片进行处理,需要说明的是,应用处理芯片中可以已经缓存有历史图像,应用处理芯片可以根据接收的第一压缩数据、第二压缩数据以及历史数据对图像进行进一步的处理。The image processing chip transmits the first compressed data and the second compressed data to the application processing chip for processing. It should be noted that the application processing chip may have cached historical images. Second, the compressed data and historical data are used for further processing of the image.

在505中,对第一压缩数据进行解压缩得到对应第一区域图像的第一子图像,以及对第二压缩数据进行解压缩得到对应第二区域图像的第二子图像。In 505, decompress the first compressed data to obtain a first sub-image corresponding to the first area image, and decompress the second compressed data to obtain a second sub-image corresponding to the second area image.

应用处理芯片接收到图像处理芯片发送的第一压缩数据和第二压缩数据后,应用处理芯片对第一压缩数据进行解压缩得到对应第一区域图像的第一子图像,对第二压缩数据进行解压缩得到对应第二区域图像的第二子图像。After the application processing chip receives the first compressed data and the second compressed data sent by the image processing chip, the application processing chip decompresses the first compressed data to obtain a first sub-image corresponding to the image of the first area, and performs the second compression on the second compressed data. Decompression obtains a second sub-image corresponding to the second region image.

由于第一区域图像采用压缩比较小的第一压缩算法,因此解压缩后的第一子图像的图像损失较小,本申请实施例中,针对第一区域图像还可以采用无损压缩的方法,使得解压缩后的第一子图像可完全恢复原始的第一区域图像而不引起任何失真,即应用处理芯片对第一压缩数据进行解压缩得到的第一子图像可以就是为第一区域图像。Since the first region image adopts the first compression algorithm with relatively low compression, the image loss of the decompressed first sub-image is small. In this embodiment of the present application, a lossless compression method may also be used for the first region image, so that The decompressed first sub-image can completely restore the original first-area image without causing any distortion, that is, the first sub-image obtained by applying the processing chip to decompress the first compressed data may be the first-area image.

由于第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,因此第二压缩数据经过解压缩后不能完全恢复原始的第二区域图像,会有部分图像信息损失,也即第二子图像相对第二区域图像根据具体的压缩比是具有一定的图像损失的。Since the second area image adopts the second compression algorithm with relatively large compression, it can also be understood as lossy compression. Therefore, the second area image cannot be completely restored to the original second area image after decompression, and some image information will be lost. That is, the second sub-image has a certain image loss relative to the second region image according to a specific compression ratio.

在506中,基于历史图像对第二子图像进行融合处理得到第三子图像。In 506, a third sub-image is obtained by fusing the second sub-image based on the historical image.

应用处理芯片接收到第二压缩数据之后,对第二压缩数据进行解压缩得到的第二子图像相对当前图像中的第二区域图像是具有图像损失的。After the application processing chip receives the second compressed data, the second sub-image obtained by decompressing the second compressed data has image loss relative to the second region image in the current image.

本申请实施例中,应用处理芯片可以获取历史图像中与当前图像中第二区域图像对应区域的图像,并将对应区域的图像与第二子图像进行融合处理得到第三子图像。历史图像可以为上一帧的图像或者是相邻的前几帧的图像。In the embodiment of the present application, the application processing chip may acquire the image of the area corresponding to the second area image in the current image in the historical image, and fuse the image of the corresponding area with the second sub-image to obtain the third sub-image. The historical image can be the image of the previous frame or the image of the adjacent previous frames.

第二区域的图像相对历史图像中对应区域图像的变化幅度较小或者没有变化。可以理解的,应用处理芯片中可以已经缓存有历史图像,当应用处理芯片对第二子图像进行融合增强处理时可以直接进行使用缓存历史图像,而不需要前置图像处理芯片将所需要的历史图像再次传输。The variation of the image of the second area relative to the image of the corresponding area in the historical image is small or does not change. It can be understood that the application processing chip may already have cached historical images. When the application processing chip performs fusion and enhancement processing on the second sub-image, the cached historical images can be directly used without the need for the pre-image processing chip to store the required historical images. The image is transferred again.

需要说明的是,由于第二区域的图像相对历史图像中对应区域图像的变化幅度较小或者没有变化,比如当前图像中的背景区域,因此历史图像可以是相隔的前几帧的图像,不需要实时进行更新,可以每隔一定的帧数进行更新就可以满足应用处理芯片的需求。比如,每隔3帧或5帧缓存一次历史数据。It should be noted that, since the image of the second area has a small or no change relative to the image of the corresponding area in the historical image, such as the background area in the current image, the historical image can be the image of the previous few frames, and does not need to be It is updated in real time, and it can be updated every certain number of frames to meet the needs of the application processing chip. For example, historical data is cached every 3 or 5 frames.

在一种实施方式中,可以先识别解压缩后的第二子图像相对第二区域图像损失的图像细节,再通过历史图像对应的区域图像对损失的图像细节进行修正和增强,弥补有损压缩导致的图像损失,得到第三子图像,比如,第二子图像损失的图像细节可以使用历史图像中对应区域图像进行弥补。In one embodiment, the image details lost in the decompressed second sub-image relative to the second region image can be identified first, and then the lost image details can be corrected and enhanced through the region image corresponding to the historical image to make up for the lossy compression. A third sub-image is obtained due to the resulting image loss. For example, the image details lost in the second sub-image can be compensated by using the corresponding area image in the historical image.

在一种实施方式中,可以先根据历史图像比如相邻几帧图像的变化过程,对历史图像对应的区域图像根据变化过程进行相应的调整,以使调整后的历史图像中对应区域图像与第二区域的图像变化更小,更加接近;再通过调整后的历史图像对应的区域图像对解压缩后第二子图像损失的图像细节进行修正和增强得到第三子图像。In one embodiment, according to the change process of the historical image, such as several adjacent frames of images, the corresponding area image corresponding to the historical image may be adjusted according to the change process, so that the corresponding area image in the adjusted historical image is the same as the first image. The image changes in the second area are smaller and closer; and the image details lost in the second sub-image after decompression are corrected and enhanced by using the area image corresponding to the adjusted historical image to obtain a third sub-image.

因此,即使解压缩得到的第二子图像相对当前图像中的第二区域图像是具有一定的图像损失,但是第二子图像通过与历史图像进行增强融合处理后,得到的第三子图像更接近于当前图像中第二区域的图像,图像损失也更少,提升了第三子图像的图像质量,甚至相对第二区域图像具有更高的图像质量,比如图像更清晰。Therefore, even if the second sub-image obtained by decompression has a certain image loss relative to the second region image in the current image, the third sub-image obtained after the second sub-image is enhanced and fused with the historical image is closer to the current image. For the image of the second area in the current image, the image loss is also less, and the image quality of the third sub-image is improved, and even has higher image quality than the image of the second area, for example, the image is clearer.

在一种实施方式中,历史图像可以为多帧,可以通过多帧历史图像与第二子图像进行融合处理,并可以根据需要控制历史图像的帧数,使得到的第三子图像可以获得更好的图像质量。In one embodiment, the historical image may be multiple frames, the multiple frames of the historical image may be fused with the second sub-image, and the number of frames of the historical image may be controlled as required, so that the obtained third sub-image can obtain more good image quality.

在一种实施方式中,也可以基于历史图像对第二区域的图像进行部分融合处理得到第三子图像,比如可以识别当前图像的背景区域和主体区域,只对第二区域的图像中涉及主体区域的部分进行融合增强处理,而对第二区域的图像中设计背景区域的部分不进行融合增强处理,以减少应用处理芯片融合处理的图像范围,提升应用处理芯片图像处理的效率。In one embodiment, the third sub-image can also be obtained by partially merging the images in the second area based on the historical images. For example, the background area and the main area of the current image can be identified, and only the images of the second area involve the main body. Fusion enhancement processing is performed on the part of the area, while fusion enhancement processing is not performed on the part of the image in the second area where the background area is designed, so as to reduce the image range of the application processing chip fusion processing and improve the image processing efficiency of the application processing chip.

在一种实施方式中,即使针对变化幅度较大的第一区域图像,也可以进一步对第一区域图像进行图像分割进行分别处理,比如,判断出图像中人物的头部区域是高变动区域,可以进一步判断头部区域中的脸部的眼睛部分图像、鼻子部分图像是变化幅度较少的,因此当解压缩第一区域图像得到第一子图像后,也可以将第一子图像中的变化较小图像部分使用历史图像进行融合增强处理,进一步提升第一子图像的质量。In one embodiment, even for the first area image with a large variation range, the first area image may be further segmented and processed separately, for example, it is determined that the head area of the person in the image is a high change area, It can be further determined that the eye part image and the nose part image of the face in the head area have less changes. Therefore, after decompressing the first area image to obtain the first sub-image, the changes in the first sub-image can also be calculated. The smaller image part is fused and enhanced using historical images to further improve the quality of the first sub-image.

在507中,将第一子图像和第三子图像合成得到对应当前图像的图像。In 507, the first sub-image and the third sub-image are synthesized to obtain an image corresponding to the current image.

由于第一区域图像采用压缩比较小的第一压缩算法,因此应用处理芯片解压缩后得到的第一子图像相对第一区域图像损失较小,若第一区域图像若采用无损压缩的方法,解压缩后的第一子图像可完全恢复原始的第一区域图像而不引起任何失真,即应用处理芯片解压缩得到的第一子图像可以就是为第一区域图像。Since the first area image adopts the first compression algorithm with less compression, the first sub-image obtained after decompression by the processing chip has less loss than the first area image. If the first area image adopts the lossless compression method, the solution The compressed first sub-image can completely restore the original first-area image without causing any distortion, that is, the first sub-image decompressed by the processing chip can be the first-area image.

第二区域图像采用压缩比较大的第一压缩算法,应用处理芯片解压缩后得到的第二子图像相对第二区域图像是具有图像损失的,但是由于第二区域图像与历史图像对应的区域变化幅度较小或没有变化,因此本申请实施,通过将第二子图像与历史图像进行增强融合处理后,得到的第三子图像其图像损失较小,更接近于第二区域的图像,图像质量更高。The second area image adopts the first compression algorithm with relatively large compression. The second sub-image obtained after decompression by the processing chip has image loss relative to the second area image, but because the area corresponding to the second area image and the historical image changes The amplitude is small or there is no change. Therefore, in the implementation of this application, after the second sub-image and the historical image are enhanced and fused, the third sub-image obtained has less image loss and is closer to the image of the second area. higher.

本申请实施例中,由于第一子图像相对当前图像的第一区域图像的图像损失较小或没有损失,第三子图像相对当前图像的第二区域图像的图像损失也较小,因此应用处理芯片将第一子图像和第三子图像进行融合,得到对应当前图像的图像,其图像损失也较小,可以基于该图像进行进一步的图像处理。In this embodiment of the present application, since the image loss of the first sub-image relative to the image of the first area of the current image is small or no loss, and the image loss of the third sub-image relative to the image of the second area of the current image is also small, the application processing The chip fuses the first sub-image and the third sub-image to obtain an image corresponding to the current image, and its image loss is also small, and further image processing can be performed based on the image.

可以理解的,当前图像与历史图像如果只是小部分发生较大的变化,而大部分没有发送变化,则只需要将小部分的第一区域图像采用压缩比小的压缩方式进行压缩,以减少第一区域图像的图像损失,而可以将大部分的第二区域图像采用压缩比较大的压缩方式进行压缩,因此可以较大的减少图像数据的传输量,使得应用处理芯片可以及时接收到图像数据。It is understandable that if only a small part of the current image and the historical image have undergone major changes, but most of the changes have not been sent, it is only necessary to compress a small part of the first area image with a compression method with a small compression ratio to reduce the number of The image loss of one area image, but most of the second area image can be compressed by a compression method with relatively large compression, so the transmission amount of image data can be greatly reduced, so that the application processing chip can receive the image data in time.

在本申请实施例中,图像处理芯片对比历史图像将当前图像至少划分为变化幅度不同的第一区域图像和第二区域图像,并针对不同区域图像的变化幅度,采用不同的压缩算法进行压缩,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法,针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法,提升了电子设备进行图像压缩的灵活性。In the embodiment of the present application, the image processing chip compares the historical images and divides the current image into at least a first area image and a second area image with different change ranges, and uses different compression algorithms to compress the change ranges of the different area images. The first compression algorithm with relatively small compression is used for the first area image with a large change range, and the second compression algorithm with relatively large compression is used for the second area image with a small change range, which improves the flexibility of the electronic device for image compression.

本申请实施例中,针对变化幅度大的第一区域图像采用压缩比较小的第一压缩算法比如无损压缩方法进行压缩,应用处理芯片解压缩得到的第一子图像相对第一区域图像具有较少的图像损失或没有图像损失;针对变化幅度小的第二区域图像采用压缩比较大的第二压缩算法,可以减少图像数据的传输量,但应用处理芯片解压缩得到的第二子图像相对第二区域图像是具有一定的图像损失,因此本申请实施例应用处理芯片还基于历史图像对第二子图像进行融合增强处理得到第三子图像,第三子图像更接近于第二区域的图像,再将第一子图像和第三子图像融合得到对应当前图像的图像。图像处理芯片通过差异化的压缩方式从而既减少了图像数据的传输量,使得应用处理芯片可以及时接收到图像数据,又可以通过对第二子图像进行融合增强处理保证得到的图像相对当前图像具有较小的图像损失,图像质量较高,甚至图像质量有所增强。In the embodiment of the present application, the first area image with a large variation range is compressed by a first compression algorithm with a small compression ratio, such as a lossless compression method, and the first sub-image obtained by applying the processing chip decompression has less compression than the first area image. There is no image loss or no image loss; for the second area image with a small change range, the second compression algorithm with relatively large compression can be used to reduce the transmission amount of image data, but the second sub-image obtained by applying the processing chip decompression is lower than the second sub-image. The region image has a certain image loss, so the application processing chip in this embodiment of the present application also performs fusion and enhancement processing on the second sub-image based on the historical image to obtain a third sub-image, and the third sub-image is closer to the image of the second region. The image corresponding to the current image is obtained by fusing the first sub-image and the third sub-image. The image processing chip not only reduces the amount of image data transmission through the differentiated compression method, so that the application processing chip can receive the image data in time, and can ensure that the obtained image has the same quality as the current image by performing fusion and enhancement processing on the second sub-image. Smaller image loss, higher image quality, or even improved image quality.

需要说明的是,在对图像的差异化算法处理之中,也可以参考本申请实施例中技术方案,比如对图像的噪点分区域处理,对图像中噪点多的区域采用一种相对复杂的算法进行降噪处理,对图像中噪点少的区域可以采用另外一种相对简单的算法进行降噪处理。It should be noted that, in the differential algorithm processing of the image, the technical solutions in the embodiments of the present application may also be referred to, for example, the noise of the image is processed in sub-regions, and a relatively complex algorithm is used for the areas with many noises in the image. For noise reduction processing, another relatively simple algorithm can be used to perform noise reduction processing on areas with less noise in the image.

请参阅图6至图7,图6是本申请实施例提供的图像处理方法的场景示意图,图7是本申请实施例提供的图像处理方法的另一场景示意图。Please refer to FIG. 6 to FIG. 7 , FIG. 6 is a schematic diagram of a scene of an image processing method provided by an embodiment of the present application, and FIG. 7 is a schematic diagram of another scene of an image processing method provided by an embodiment of the present application.

电子设备的相机应用启动,处于拍摄状态,摄像头开始采集图像,图像的格式可以是RAW格式或是其它格式。The camera application of the electronic device is started and is in a shooting state, and the camera starts to capture images, and the format of the images may be RAW format or other formats.

比如,摄像头获取到当前图像后,将当前图像传输至图像处理芯片,图像处理芯片的神经网络处理器可以识别当前图像的图像特征点,也可以理解为当前图像中物体的图像关键点。在一种实施方式中,可以通过神经网络的自主学习得到,比如,CNN特征提取的方式识别到图像特征点,而识别图像的关键点,比如识别图像中人物的头部、肩部、手臂、手掌、腿部、脚掌等位置,更具体的,比如头部中脸部的眼睛、鼻子、嘴巴、耳朵、眉毛等关键点位置。再比如,可以识别图像中物体的轮廓,根据轮廓选取图像特征点的分布,比如上端点、下端点、左端点、右端点、中间端点等位置设为图像特征点。For example, after the camera obtains the current image, it transmits the current image to the image processing chip. The neural network processor of the image processing chip can identify the image feature points of the current image, and can also be understood as the image key points of the objects in the current image. In one embodiment, it can be obtained through autonomous learning of a neural network, for example, CNN feature extraction is used to identify image feature points, and key points of the image are identified, such as the head, shoulder, arm, etc. of the person in the image. Positions of palms, legs, soles of feet, etc., more specifically, such as key points such as the eyes, nose, mouth, ears, eyebrows, etc. of the face in the head. For another example, the outline of an object in an image can be identified, and the distribution of image feature points can be selected according to the outline, such as the upper endpoint, lower endpoint, left endpoint, right endpoint, and middle endpoint as image feature points.

摄像头获取到当前图像后,可以将当前图像传输至图像处理芯片,图像处理芯片的神经网络处理器将当前图像与历史图像进行比较,将当前图像至少划分为第一区域图像和第二区域图像。其中,第一区域图像相对历史图像对应区域图像的变化幅度大于第二区域图像相对历史图像对应区域图像的变化幅度。其中,历史图像可以是上一帧的图像或者是相邻的前几帧的图像,比如前3帧、前5帧的图像等。历史图像可以是一帧图像,也可以是多帧图像。After the camera obtains the current image, it can transmit the current image to the image processing chip, and the neural network processor of the image processing chip compares the current image with the historical image, and divides the current image into at least the first area image and the second area image. Wherein, the change range of the first area image relative to the area image corresponding to the historical image is greater than the change range of the second area image relative to the area image corresponding to the historical image. Wherein, the historical image may be an image of the previous frame or an image of the adjacent previous frames, such as images of the previous 3 frames, the previous 5 frames, and the like. Historical images can be one frame of images or multiple frames of images.

比如,图像处理芯片的神经网络处理器可以将当前图像划分为多个子区域图像;基于图像特征点在当前图像和历史图像的位置信息,获取多个子区域图像的变化幅度;将变化幅度大于预设幅度阈值的至少一个子区域图像设置为第一区域图像,将变化幅度小于预设幅度阈值的至少一个子区域图像设置为第二区域图像。For example, the neural network processor of the image processing chip can divide the current image into multiple sub-region images; based on the position information of image feature points in the current image and historical images, obtain the variation range of the multiple sub-region images; The at least one sub-area image of the amplitude threshold is set as the first area image, and the at least one sub-area image whose variation amplitude is smaller than the preset amplitude threshold is set as the second area image.

图像处理芯片的神经网络处理器获取图像特征点的坐标位置,比如图像特征点的坐标为(A、B),再获取该图像特征点在历史图像中对应的坐标位置,比如为(A'、B'),判断当前图像与历史图像中每个子区域中包含的图像特征点的坐标值变化幅度是否大于预设幅度阈值内,若是,则将该子区域设置为第一区域图像,若不是,则将该子区域设置为第二区域图像。The neural network processor of the image processing chip obtains the coordinate positions of the image feature points, for example, the coordinates of the image feature points are (A, B), and then obtains the corresponding coordinate positions of the image feature points in the historical image, such as (A', B'), judging whether the variation range of the coordinate value of the image feature points contained in each sub-region in the current image and the historical image is greater than the preset range threshold, if so, then the sub-region is set as the first region image, if not, Then the sub-area is set as the second area image.

比如,请参考图5,图像处理芯片的神经网络处理器可以将当前图像划分为16个子区域,判断子区域图像的变化幅度是否处于预设幅度阈值内,将变化幅度大于预设幅度阈值的子区域3、6、7、8、11、14设置为第一区域图像,将变化幅度不大于预设幅度阈值的子区域1、2、4、5、9、10、12、13、15、16设置为第二区域图像。For example, please refer to Fig. 5, the neural network processor of the image processing chip can divide the current image into 16 sub-regions, determine whether the change range of the sub-region image is within the preset range threshold Areas 3, 6, 7, 8, 11, and 14 are set as the first area image, and the sub-areas 1, 2, 4, 5, 9, 10, 12, 13, 15, and 16 whose change amplitude is not greater than the preset amplitude threshold Set as the second area image.

图像处理芯片的第一中央处理器采用无损压缩的方法将第一区域图像压缩得到第一压缩数据,经过解压缩后第一压缩数据可完全恢复原始的第一区域图像而不引起任何失真。The first central processing unit of the image processing chip uses a lossless compression method to compress the first area image to obtain first compressed data. After decompression, the first compressed data can completely restore the original first area image without causing any distortion.

当前图像中第二区域图像相对历史图像的变化幅度较小或没有变化,因此,图像处理芯片的第一中央处理器针对第二区域图像采用压缩比较大的第二压缩算法,也可以理解为有损压缩,得到第二压缩数据根据具体的压缩比允许压缩过程中损失一定的图像信息,经过解压缩后不能完全恢复原始的第二区域图像,但是可以减少图像数据的传输量,减少了图像传输的压力。The variation of the second area image in the current image relative to the historical image is small or unchanged. Therefore, the first central processing unit of the image processing chip adopts the second compression algorithm with relatively large compression for the second area image, which can also be understood as having Loss compression to obtain the second compressed data. According to the specific compression ratio, a certain amount of image information is allowed to be lost during the compression process. After decompression, the original second region image cannot be completely restored, but it can reduce the amount of image data transmission and reduce image transmission. pressure.

图像处理芯片将第一压缩数据和第二压缩数据传输到应用处理芯片,应用处理芯片接收到第一压缩数据和第二压缩数据后,应用处理芯片的第二中央处理器可以对第一压缩数据进行解压缩得到对应第一区域图像的第一子图像,对第二压缩数据进行解压缩得到对应第二区域图像的第二子图像。The image processing chip transmits the first compressed data and the second compressed data to the application processing chip. After the application processing chip receives the first compressed data and the second compressed data, the second central processing unit of the application processing chip can process the first compressed data. The first sub-image corresponding to the first area image is obtained by decompressing, and the second sub-image corresponding to the second area image is obtained by decompressing the second compressed data.

由于第一区域图像采用压缩比较小的第一压缩算法,因此解压缩后的第一子图像的图像损失较小,若针对第一区域图像采用无损压缩的方法,应用处理芯片的第二中央处理器可以对第一压缩数据进行解压缩得到的第一子图像可以就是为第一区域图像。Since the first region image adopts the first compression algorithm with relatively low compression, the image loss of the decompressed first sub-image is small. If the lossless compression method is adopted for the first region image, the second central processing of the processing chip is applied. The first sub-image obtained by the device decompressing the first compressed data may be the first region image.

应用处理芯片接收到第二压缩数据之后,应用处理芯片的第二中央处理器可以对第二压缩数据进行解压缩得到的第二子图像相对当前图像中的第二区域图像是具有图像损失的。After the application processing chip receives the second compressed data, the second sub-image obtained by decompressing the second compressed data by the second central processing unit of the application processing chip has image loss relative to the second area image in the current image.

本申请实施例中,应用处理芯片的第二中央处理器可以获取历史图像中与当前图像中第二区域图像对应区域的图像,并将对应区域的图像与第二子图像进行融合处理得到第三子图像。比如,可以先识别解压缩后的第二子图像相对第二区域图像损失的图像细节,再通过历史图像对应的区域图像对损失的图像细节进行修正和增强,弥补有损压缩导致的图像损失,得到第三子图像。第二子图像损失的图像细节可以使用历史图像中对应区域图像进行弥补,使得提升了第三子图像的图像质量,第三子图像的图像损失较小,更接近于第二区域图像。In the embodiment of the present application, the second central processing unit of the application processing chip may acquire the image of the area corresponding to the image of the second area in the current image in the historical image, and fuse the image of the corresponding area with the second sub-image to obtain the third sub-image. subimage. For example, you can first identify the image details lost in the decompressed second sub-image relative to the second area image, and then correct and enhance the lost image details through the area image corresponding to the historical image to make up for the image loss caused by lossy compression. Get the third subimage. The image details lost in the second sub-image can be compensated by using the corresponding area image in the historical image, so that the image quality of the third sub-image is improved, and the image loss of the third sub-image is smaller and closer to the second area image.

应用处理芯片的第二中央处理器可以将第一子图像和第三子图像融合得到对应当前图像的图像,并对该图像进行进一步的处理,比如白平衡、对比度、亮度等调整。The second central processing unit of the application processing chip can fuse the first sub-image and the third sub-image to obtain an image corresponding to the current image, and perform further processing on the image, such as adjustment of white balance, contrast, and brightness.

本申请通过差异化的压缩方式既减少了图像数据的传输量,使得应用处理芯片可以及时接收到图像数据,应用处理芯片的第二中央处理器又可以根据历史图像对第二子图像进行融合增强处理保证应用处理芯片处理的图像相对当前图像具有较小的图像损失,图像质量较高,甚至图像质量有所增强。In the present application, the transmission amount of image data is reduced by the differentiated compression method, so that the application processing chip can receive the image data in time, and the second central processing unit of the application processing chip can fuse and enhance the second sub-image according to the historical image. The processing ensures that the image processed by the application processing chip has less image loss than the current image, the image quality is higher, and even the image quality is enhanced.

请参阅图8,图8是本申请实施例提供的图像处理芯片和应用处理芯片的结构示意图。如图8所示,本申请实施例提供的图像处理芯片400可以包括神经网络处理器410和第一中央处理器430,神经网络处理器410和第一中央处理器430通过系统总线450进行连接。图像处理芯片400还可以包括内部存储器470,内部存储器470也是通过系统总线450进行连接,图像处理芯片400中的神经网络处理器410、第一中央处理器430等用于处理摄像头500采集的图像,并将处理后的图像通过系统总线450存储进内部存储器470。Please refer to FIG. 8 . FIG. 8 is a schematic structural diagram of an image processing chip and an application processing chip provided by an embodiment of the present application. As shown in FIG. 8 , the image processing chip 400 provided in this embodiment of the present application may include a neural network processor 410 and a first central processing unit 430 , and the neural network processor 410 and the first central processing unit 430 are connected through a system bus 450 . The image processing chip 400 may further include an internal memory 470, and the internal memory 470 is also connected through the system bus 450. The neural network processor 410, the first central processing unit 430 and the like in the image processing chip 400 are used to process the images collected by the camera 500, The processed images are stored in the internal memory 470 through the system bus 450 .

请继续参阅图8,图像处理芯片400可以通过接口连接摄像头500以及通过其他接口连接应用处理芯片600,比如摄像头500通过第三接口420连接系统总线450从而连接图像处理芯片400,应用处理芯片600通过第二接口620与图像处理芯片400的第一接口440连接,第一接口440与系统总线450连接。Please continue to refer to FIG. 8 , the image processing chip 400 can be connected to the camera 500 through an interface and to the application processing chip 600 through other interfaces. For example, the camera 500 is connected to the system bus 450 through the third interface 420 to connect to the image processing chip 400, and the application processing chip 600 is connected to the image processing chip 400 through the third interface 420. The second interface 620 is connected to the first interface 440 of the image processing chip 400 , and the first interface 440 is connected to the system bus 450 .

其中,图像处理芯片400可以获取拍摄的当前图像和历史图像,比如,图像处理芯片400通过第三接口420和系统总线450将摄像头500拍摄的当前图像和历史图像存储至内部存储器470,神经网络处理器410可以通过系统总线450从内部存储器470中获取当前图像和历史图像。Wherein, the image processing chip 400 can obtain the current image and historical image captured, for example, the image processing chip 400 stores the current image and historical image captured by the camera 500 to the internal memory 470 through the third interface 420 and the system bus 450, and the neural network processes The controller 410 may obtain current images and historical images from the internal memory 470 through the system bus 450 .

神经网络处理器410可以将当前图像至少划分为第一区域图像和第二区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度。神经网络处理器410可以通过系统总线450将第一区域图像和第二区域图像存储至内部存储器470或传输至第一中央处理器430。The neural network processor 410 can divide the current image into at least a first area image and a second area image, and the change range of the first area image relative to the corresponding area image in the historical image is greater than the change of the second area image relative to the corresponding area image in the historical image. magnitude. The neural network processor 410 may store the first area image and the second area image to the internal memory 470 or transmit to the first central processing unit 430 through the system bus 450 .

第一中央处理器430通过系统总线450获取第一区域图像和第二区域图像后,可以根据第一压缩算法将第一区域图像压缩得到第一压缩数据,以及根据第二压缩算法将第二区域图像压缩得到第二压缩数据,第一压缩算法的压缩比小于第二压缩算法的压缩比。After the first central processing unit 430 obtains the first area image and the second area image through the system bus 450, it can compress the first area image according to the first compression algorithm to obtain the first compressed data, and according to the second compression algorithm, compress the second area image. The image is compressed to obtain second compressed data, and the compression ratio of the first compression algorithm is smaller than the compression ratio of the second compression algorithm.

图像处理芯片400将第一压缩数据和第二压缩数据传输到应用处理芯片600进行处理。比如,第一430可以通过系统总线450将第一压缩数据和第二压缩数据存储至内部存储器470,然后通过第一接口440传输至应用处理芯片600,或者第一中央处理器430将第一压缩数据和第二压缩数据通过第一接口440将第一压缩数据和第二压缩数据传输到应用处理芯片600,应用处理芯片600根据第一压缩数据和第二压缩数据可以进行后续的处理。The image processing chip 400 transmits the first compressed data and the second compressed data to the application processing chip 600 for processing. For example, the first 430 may store the first compressed data and the second compressed data in the internal memory 470 through the system bus 450, and then transmit them to the application processing chip 600 through the first interface 440, or the first central processing unit 430 may store the first compressed data The data and the second compressed data are transmitted to the application processing chip 600 through the first interface 440, and the application processing chip 600 can perform subsequent processing according to the first compressed data and the second compressed data.

在其他一些实施例中,神经网络处理器410将当前图像至少划分为第一区域图像和第二区域图像可以包括:神经网络处理器104将当前图像划分为第一区域图像、第二区域图像和第三区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度,第二区域图像相对历史图像中对应区域图像的变化幅度大于第三区域图像相对历史图像对应区域图像的变化幅度;In some other embodiments, the neural network processor 410 dividing the current image into at least the first area image and the second area image may include: the neural network processor 104 dividing the current image into the first area image, the second area image and the second area image. For the third area image, the change range of the first area image relative to the corresponding area image in the historical image is greater than the change range of the second area image relative to the corresponding area image in the historical image, and the change range of the second area image relative to the corresponding area image in the historical image is greater than The variation range of the third area image relative to the area image corresponding to the historical image;

将第一压缩数据和第二压缩数据传输到应用处理芯片600之前,神经网络处理器410还可以获取所述第三区域图像的位置信息;Before transmitting the first compressed data and the second compressed data to the application processing chip 600, the neural network processor 410 may also acquire the position information of the third region image;

将所述第一压缩数据和第二压缩数据传输到应用处理芯片600进行处理可以包括:将第一压缩数据、第二压缩数据和位置信息传输到应用处理芯片600进行处理。The transmitting the first compressed data and the second compressed data to the application processing chip 600 for processing may include: transmitting the first compressed data, the second compressed data and the location information to the application processing chip 600 for processing.

图像处理芯片400还可以具有更多的功能,具体可参阅上述实施例中的图像处理芯片,在此不再赘述。The image processing chip 400 may also have more functions. For details, please refer to the image processing chip in the above-mentioned embodiment, which will not be repeated here.

本申请还提供一种应用处理芯片,请继续参阅图8,应用处理芯片600和图像处理芯片400连接,应用处理芯片600包括第二中央处理器640和第二接口620。应用处理芯片600可以接收图像处理芯片400发送的第一压缩数据和第二压缩数据。比如,第二中央处理器640通过第二接口620获取图像处理芯片400发送的第一压缩数据和第二压缩数据。第一压缩数据采用第一压缩算法压缩,第二压缩数据采用第二压缩算法压缩,第一压缩算法的压缩比小于第二压缩算法的压缩比,第一压缩数据和第二压缩数据可以为上述实施例中的第一压缩数据和第二压缩数据,在此不再赘述。The present application further provides an application processing chip, please continue to refer to FIG. 8 , the application processing chip 600 is connected to the image processing chip 400 , and the application processing chip 600 includes a second central processing unit 640 and a second interface 620 . The application processing chip 600 may receive the first compressed data and the second compressed data sent by the image processing chip 400 . For example, the second central processing unit 640 obtains the first compressed data and the second compressed data sent by the image processing chip 400 through the second interface 620 . The first compressed data is compressed by the first compression algorithm, the second compressed data is compressed by the second compression algorithm, the compression ratio of the first compression algorithm is smaller than the compression ratio of the second compression algorithm, and the first compressed data and the second compressed data can be the above The first compressed data and the second compressed data in the embodiment will not be repeated here.

第二中央处理器640对第一压缩数据进行解压缩得到第一子图像,以及对第二压缩数据进行解压缩得到第二子图像,第二中央处理器640还可以基于历史图像对第二子图像进行融合处理得到第三子图像,以及将第一子图像和第三子图像合成得到对应图像。The second central processing unit 640 decompresses the first compressed data to obtain the first sub-image, and decompresses the second compressed data to obtain the second sub-image. The second central processing unit 640 may further decompress the second sub-image based on the historical image. The images are fused to obtain a third sub-image, and the first sub-image and the third sub-image are synthesized to obtain a corresponding image.

在其他一些实施例中,应用处理芯片还可以接收图像处理芯片发送的位置信息;应用处理芯片的第二中央处理器将第一子图像和第三子图像合成得到对应图像之前,第二中央处理器基于历史图像和位置信息得到第四子图像;第二中央处理器还可以将第一子图像、第三子图像和第四子图像合成得到对应图像。In some other embodiments, the application processing chip may also receive the position information sent by the image processing chip; before the second central processing unit of the application processing chip combines the first sub-image and the third sub-image to obtain a corresponding image, the second central processing The processor obtains the fourth sub-image based on the historical image and the position information; the second central processing unit can also synthesize the first sub-image, the third sub-image and the fourth sub-image to obtain a corresponding image.

应用处理芯片600的结构和功能可以参阅上述实施例中应用处理芯片的结构和功能,在此不再赘述。For the structure and function of the application processing chip 600, reference may be made to the structure and function of the application processing chip in the above-mentioned embodiments, and details are not described herein again.

本申请实施例还提供一种电子设备,包括存储器、图像处理芯片和应用处理芯片,图像处理芯片和应用处理芯片通过调用存储器中存储的计算机程序,用于执行本申请实施例提供的各个图像处理方法中的流程。其中,上述电子设备可以是诸如平板电脑或者智能手机等移动终端,图像处理芯片和应用处理芯片连接,图像处理芯片可以为上述任意一个实施例中的图像处理芯片,应用处理芯片可以为上述任意一个实施例中的应用处理芯片,在此不再赘述。Embodiments of the present application further provide an electronic device, including a memory, an image processing chip, and an application processing chip. The image processing chip and the application processing chip are used to execute each image processing provided by the embodiments of the present application by calling a computer program stored in the memory. process in the method. The electronic device may be a mobile terminal such as a tablet computer or a smart phone, the image processing chip is connected to the application processing chip, the image processing chip may be the image processing chip in any of the above embodiments, and the application processing chip may be any of the above The application processing chip in the embodiment will not be repeated here.

请参阅图9,图9本申请实施例提供的电子设备的结构示意图。该电子设备800可以包括存储器801、图像处理芯片802和应用处理芯片803等部件。本领域技术人员可以理解,图中示出的电子设备结构并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Please refer to FIG. 9 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 800 may include components such as a memory 801 , an image processing chip 802 , and an application processing chip 803 . Those skilled in the art can understand that the structure of the electronic device shown in the figures does not constitute a limitation on the electronic device, and may include more or less components than those shown in the figures, or combine some components, or arrange different components.

存储器801可用于存储计算机程序和数据。存储器801存储的计算机程序中包含有可在处理器中执行的指令。计算机程序可以组成各种功能模块。Memory 801 may be used to store computer programs and data. The computer program stored in the memory 801 contains instructions executable in the processor. A computer program can be composed of various functional modules.

图像处理芯片802通过调用存储在存储器801的计算机程序,从而执行各种图像处理功能以及数据处理。The image processing chip 802 executes various image processing functions and data processing by calling the computer program stored in the memory 801 .

应用处理芯片803是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,从而对电子设备进行整体监控。The application processing chip 803 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device, so as to monitor the electronic device as a whole.

在本实施例中,电子设备800中的图像处理芯片802会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器801中,并由图像处理芯片802来运行存储在存储器801中的计算机程序,从而实现各种功能:In this embodiment, the image processing chip 802 in the electronic device 800 loads the instructions corresponding to the processes of one or more computer programs into the memory 801 according to the following steps, and the image processing chip 802 executes the instructions stored in the memory 801. A computer program in the memory 801, thereby realizing various functions:

获取拍摄的当前图像和历史图像;Get current and historical images captured;

将当前图像至少划分为第一区域图像和第二区域图像,第一区域图像相对历史图像中对应区域图像的变化幅度大于第二区域图像相对历史图像中对应区域图像的变化幅度;Divide the current image into at least a first area image and a second area image, and the change range of the first area image relative to the corresponding area image in the historical image is greater than the change range of the second area image relative to the corresponding area image in the historical image;

根据第一压缩算法将第一区域图像压缩得到第一压缩数据,根据第二压缩算法将第二区域图像压缩得到第二压缩数据,第一压缩算法的压缩比小于第二压缩算法的压缩比;Compressing the first area image according to the first compression algorithm to obtain the first compressed data, and compressing the second area image according to the second compression algorithm to obtain the second compressed data, the compression ratio of the first compression algorithm is smaller than the compression ratio of the second compression algorithm;

将第一压缩数据和第二压缩数据传输到应用处理芯片803进行处理。The first compressed data and the second compressed data are transmitted to the application processing chip 803 for processing.

在本实施例中,电子设备800中的应用处理芯片803会按照如下的步骤,将一个或一个以上的计算机程序的进程对应的指令加载到存储器801中,并由应用处理芯片803来运行存储在存储器801中的计算机程序,从而实现各种功能:In this embodiment, the application processing chip 803 in the electronic device 800 loads the instructions corresponding to the processes of one or more computer programs into the memory 801 according to the following steps, and is executed by the application processing chip 803 and stored in the memory 801 . A computer program in the memory 801, thereby realizing various functions:

接收图像处理芯片发送的第一压缩数据和第二压缩数据,第一压缩数据采用第一压缩算法压缩,第二压缩数据采用第二压缩算法压缩,第一压缩算法的压缩比小于第二压缩算法的压缩比;Receive the first compressed data and the second compressed data sent by the image processing chip, the first compressed data is compressed by the first compression algorithm, the second compressed data is compressed by the second compression algorithm, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm compression ratio;

对第一压缩数据进行解压缩得到第一子图像,以及对第二压缩数据进行解压缩得到第二子图像;Decompressing the first compressed data to obtain a first sub-image, and decompressing the second compressed data to obtain a second sub-image;

基于历史图像对第二子图像进行融合处理得到第三子图像;Fusion processing is performed on the second sub-image based on the historical image to obtain a third sub-image;

将第一子图像和第三子图像合成得到对应图像。A corresponding image is obtained by synthesizing the first sub-image and the third sub-image.

请继续参阅图9,电子设备800还可以包括摄像头804、显示屏805、控制电路806、输入单元807、音频电路808、传感器809以及电源810等部件。Please continue to refer to FIG. 9 , the electronic device 800 may further include components such as a camera 804 , a display screen 805 , a control circuit 806 , an input unit 807 , an audio circuit 808 , a sensor 809 , and a power supply 810 .

摄像头804可用于视频摄像和图像采集,它是借由镜头采集图像后,由摄像头内的感光组件电路及控制组件对图像进行处理,然后借由软件再进行图像还原,通过显示屏可以看到图像。The camera 804 can be used for video recording and image acquisition. After the image is captured by the lens, the image is processed by the photosensitive component circuit and control component in the camera, and then the image is restored by software, and the image can be seen through the display screen. .

显示屏805可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种图形用户接口,这些图形用户接口可以由图像、文本、图标、视频和其任意组合来构成。The display screen 805 may be used to display information input by or provided to the user and various graphical user interfaces of the electronic device, which may be composed of images, text, icons, video, and any combination thereof.

控制电路806与显示屏805电性连接,用于控制显示屏805显示信息。The control circuit 806 is electrically connected to the display screen 805 for controlling the display screen 805 to display information.

输入单元807可用于接收输入的数字、字符信息或用户特征信息(例如指纹),以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。其中,输入单元807可以包括指纹识别模组。The input unit 807 can be used to receive input numbers, character information or user characteristic information (eg fingerprint), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. The input unit 807 may include a fingerprint identification module.

音频电路808可通过扬声器、传声器提供用户与电子设备之间的音频接口。其中,音频电路808包括麦克风。麦克风与应用处理芯片803电性连接。麦克风用于接收用户输入的语音信息。The audio circuit 808 may provide an audio interface between the user and the electronic device through speakers and microphones. Among them, the audio circuit 808 includes a microphone. The microphone is electrically connected to the application processing chip 803 . The microphone is used to receive voice information input by the user.

传感器809用于采集外部环境信息。传感器809可以包括环境亮度传感器、加速度传感器、陀螺仪等传感器中的一种或多种。The sensor 809 is used to collect external environment information. The sensor 809 may include one or more of an ambient brightness sensor, an acceleration sensor, a gyroscope, and the like.

电源810用于给电子设备800的各个部件供电。在一些实施例中,电源810可以通过电源管理系统与应用处理芯片803逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power supply 810 is used to power various components of the electronic device 800 . In some embodiments, the power supply 810 may be logically connected to the application processing chip 803 through a power management system, so as to implement functions such as managing charging, discharging, and power consumption through the power management system.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对图像处理方法的详细描述,此处不再赘述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the detailed description of the image processing method above, and details are not repeated here.

本申请实施例提供的电子设备与上文实施例中的图像处理方法属于同一构思,在电子设备上可以运行图像处理方法实施例中提供的任一方法,其具体实现过程详见图像处理方法实施例,此处不再赘述。The electronic device provided in the embodiment of the present application and the image processing method in the above embodiment belong to the same concept, and any method provided in the image processing method embodiment can be executed on the electronic device. For the specific implementation process, please refer to the implementation of the image processing method. For example, it will not be repeated here.

需要说明的是,对本申请实施例图像处理方法而言,本领域普通技术人员可以理解实现本申请实施例图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在存储器中,并被至少一个图像处理芯片和应用处理芯片执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)等。It should be noted that, for the image processing method of the embodiment of the present application, those of ordinary skill in the art can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program. The program may be stored in a computer-readable storage medium, such as a memory, and executed by at least one image processing chip and an application processing chip, and the execution process may include the flow of an embodiment of the image processing method. The storage medium may be a magnetic disk, an optical disk, a read only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), and the like.

以上对本申请实施例所提供的图像处理方法、装置、存储介质以及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。The image processing method, device, storage medium, and electronic device provided by the embodiments of the present application have been described in detail above, and the principles and implementations of the present application are described with specific examples. The descriptions of the above embodiments are only used for Help to understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In conclusion, the content of this description should not be understood to limit this application.

Claims (10)

1. An image processing method is applied to an image processing chip, and the image processing chip is connected with an application processing chip, and the method is characterized by comprising the following steps:
acquiring a shot current image and a shot historical image;
dividing the current image into at least a first area image and a second area image, wherein the change amplitude of the first area image relative to the corresponding area image in the historical image is larger than the change amplitude of the second area image relative to the corresponding area image in the historical image;
compressing the first area image according to a first compression algorithm to obtain first compressed data, and compressing the second area image according to a second compression algorithm to obtain second compressed data, wherein the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm;
and transmitting the first compressed data and the second compressed data to the application processing chip for processing.
2. The image processing method of claim 1, wherein the dividing the current image into at least a first region image and a second region image comprises:
dividing the current image into a plurality of subarea images;
acquiring image characteristic points of the current image;
acquiring the variation amplitude of a plurality of subarea images based on the position information of the image feature points in the current image and the historical image;
setting at least one sub-area image with the variation amplitude larger than a preset amplitude threshold value as the first area image, and setting at least one sub-area image with the variation amplitude not larger than the preset amplitude threshold value as the second area image.
3. The image processing method of claim 1, wherein the dividing the current image into at least a first region image and a second region image comprises:
dividing the current image into a first area image, a second area image and a third area image, wherein the change amplitude of the first area image relative to the corresponding area image in the historical image is larger than that of the second area image relative to the corresponding area image in the historical image, and the change amplitude of the second area image relative to the corresponding area image in the historical image is larger than that of the third area image relative to the corresponding area image in the historical image;
before the transmitting the first compressed data and the second compressed data to the application processing chip, the method further includes: acquiring position information of the third area image;
transmitting the first compressed data and the second compressed data to the application processing chip for processing, including: and transmitting the first compressed data, the second compressed data and the position information of the third area image to the application processing chip for processing.
4. An image processing method is applied to an application processing chip, and the application processing chip is connected with the image processing chip, and is characterized by comprising the following steps:
receiving first compressed data and second compressed data sent by the image processing chip, wherein the first compressed data are compressed by adopting a first compression algorithm, the second compressed data are compressed by adopting a second compression algorithm, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm;
decompressing the first compressed data to obtain a first sub-image, and decompressing the second compressed data to obtain a second sub-image;
performing fusion processing on the second subimage based on the historical image to obtain a third subimage;
and synthesizing the first sub-image and the third sub-image to obtain a corresponding image.
5. The image processing method of claim 4, wherein the receiving the first compressed data and the second compressed data sent by the image processing chip comprises: receiving the first compressed data, the second compressed data and the position information sent by the image processing chip;
decompressing the first compressed data to obtain a first sub-image, and decompressing the second compressed data to obtain a second sub-image;
performing fusion processing on the second sub-image based on the historical image to obtain a third sub-image;
obtaining a fourth sub-image based on the historical image and the position information;
and synthesizing the first sub-image, the third sub-image and the fourth sub-image to obtain a corresponding image.
6. An image processing chip is connected with an application processing chip, and is characterized in that the image processing chip comprises a neural network processor and a first central processing unit, wherein the neural network processor is connected with the first central processing unit through a system bus;
the neural network processor acquires a shot current image and a shot historical image;
the neural network processor divides the current image into at least a first area image and a second area image, and the change amplitude of the first area image relative to the corresponding area image in the historical image is larger than the change amplitude of the second area image relative to the corresponding area image in the historical image;
the first central processing unit compresses the first area image according to a first compression algorithm to obtain first compressed data, and compresses the second area image according to a second compression algorithm to obtain second compressed data, wherein the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm;
and the image processing chip transmits the first compressed data and the second compressed data to the application processing chip for processing.
7. The image processing chip of claim 6, wherein the neural network processor dividing the current image into at least a first region image and a second region image comprises: the neural network processor divides the current image into a first area image, a second area image and a third area image, wherein the change amplitude of the first area image relative to the corresponding area image in the historical image is larger than that of the second area image relative to the corresponding area image in the historical image, and the change amplitude of the second area image relative to the corresponding area image in the historical image is larger than that of the third area image relative to the corresponding area image in the historical image;
before the first compressed data and the second compressed data are transmitted to the application processing chip, the neural network processor acquires position information of the third area image;
the transmitting the first compressed data and the second compressed data to the application processing chip for processing includes: and transmitting the first compressed data, the second compressed data and the position information of the third area image to the application processing chip for processing.
8. An application processing chip is connected with an image processing chip and is characterized by comprising a second central processing unit;
the application processing chip receives first compressed data and second compressed data sent by the image processing chip, the first compressed data are compressed by adopting a first compression algorithm, the second compressed data are compressed by adopting a second compression algorithm, and the compression ratio of the first compression algorithm is smaller than that of the second compression algorithm;
the second central processing unit decompresses the first compressed data to obtain a first sub-image, and decompresses the second compressed data to obtain a second sub-image;
the second central processing unit performs fusion processing on the second sub-image based on the historical image to obtain a third sub-image;
and the second central processing unit synthesizes the first sub-image and the third sub-image to obtain a corresponding image.
9. The application processing chip of claim 8, wherein the application processing chip receiving the first compressed data and the second compressed data sent by the image processing chip comprises: the application processing chip receives the first compressed data, the second compressed data and the position information sent by the image processing chip;
before the second central processor synthesizes the first sub-image and the third sub-image to obtain a corresponding image, the second central processor obtains a fourth sub-image based on the historical image and the position information;
the second central processing unit synthesizes the first sub-image and the third sub-image to obtain a corresponding image, and the method comprises the following steps: and the second central processing unit synthesizes the first sub-image, the third sub-image and the fourth sub-image to obtain a corresponding image.
10. An electronic device comprising the image processing chip of claim 6 or 7 and the application processing chip of claim 8 or 9, the image processing chip and the application processing chip being connected.
CN202110328025.4A 2021-03-26 2021-03-26 Image processing method, image processing chip, application processing chip and electronic equipment Withdrawn CN115134544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110328025.4A CN115134544A (en) 2021-03-26 2021-03-26 Image processing method, image processing chip, application processing chip and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110328025.4A CN115134544A (en) 2021-03-26 2021-03-26 Image processing method, image processing chip, application processing chip and electronic equipment

Publications (1)

Publication Number Publication Date
CN115134544A true CN115134544A (en) 2022-09-30

Family

ID=83374188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110328025.4A Withdrawn CN115134544A (en) 2021-03-26 2021-03-26 Image processing method, image processing chip, application processing chip and electronic equipment

Country Status (1)

Country Link
CN (1) CN115134544A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101755460A (en) * 2007-07-20 2010-06-23 富士胶片株式会社 Image processing apparatus, image processing method, image processing system and program
CN103391442A (en) * 2013-07-24 2013-11-13 佳都新太科技股份有限公司 Rapid video image transmission compression algorithm based on regional division and difference comparison
WO2014079036A1 (en) * 2012-11-23 2014-05-30 华为技术有限公司 Image compression method and image processing apparatus
CN109982085A (en) * 2017-12-28 2019-07-05 新岸线(北京)科技集团有限公司 A kind of method of high precision image mixing compression

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101755460A (en) * 2007-07-20 2010-06-23 富士胶片株式会社 Image processing apparatus, image processing method, image processing system and program
WO2014079036A1 (en) * 2012-11-23 2014-05-30 华为技术有限公司 Image compression method and image processing apparatus
CN103391442A (en) * 2013-07-24 2013-11-13 佳都新太科技股份有限公司 Rapid video image transmission compression algorithm based on regional division and difference comparison
CN109982085A (en) * 2017-12-28 2019-07-05 新岸线(北京)科技集团有限公司 A kind of method of high precision image mixing compression

Similar Documents

Publication Publication Date Title
WO2020140986A1 (en) Image denoising method and apparatus, storage medium and terminal
CN109741280B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108038836B (en) Image processing method and device and mobile terminal
CN109413152B (en) Image processing method, image processing device, storage medium and electronic equipment
US11985358B2 (en) Artifact removal method and apparatus based on machine learning, and method and apparatus for training artifact removal model based on machine learning
KR102386385B1 (en) Electronic device and method for compressing image thereof
CN112669197A (en) Image processing method, image processing device, mobile terminal and storage medium
CN113658065B (en) Image noise reduction method and device, computer readable medium and electronic equipment
CN113099233A (en) Video encoding method, video encoding device, video encoding apparatus, and storage medium
CN113455013B (en) Electronic device for processing image and image processing method thereof
KR20190096748A (en) electronic device and method for correcting image using external electronic device
WO2018213176A1 (en) Systems and methods for reducing memory bandwidth via multiview compression/decompression
KR102609734B1 (en) electronic device and method for revising image based on transfer status of image
CN110473156A (en) Processing method, device, storage medium and the electronic equipment of image information
US20240397210A1 (en) Method for generating image and electronic device therefor
CN111797754B (en) Image detection method, device, electronic equipment and medium
CN110650309B (en) Video conference video image transmission method, terminal and readable storage medium
WO2024251063A1 (en) Gain map encoding method and apparatus, gain map decoding method and apparatus, device, and medium
CN115134544A (en) Image processing method, image processing chip, application processing chip and electronic equipment
KR102460123B1 (en) Electronic device for compressing image using compression attributes generated in image acquisition process using image sensor and method for operating thefeof
CN111432154A (en) Video playing method, video processing method and electronic equipment
KR20210056733A (en) Electronic device for providing streaming data and method for operating thereof
CN106201712A (en) Method, device and mobile terminal for adjusting target recognition frequency in augmented reality
CN112950516B (en) Method and device for enhancing local contrast of image, storage medium and electronic equipment
CN113453017B (en) Video processing method, device, equipment and computer program product

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20220930

WW01 Invention patent application withdrawn after publication