图像处理方法、装置、图像处理芯片和电子设备Image processing method, device, image processing chip and electronic device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求享有于2021年01月27日提交的名称为“图像处理方法、装置、图像处理芯片和电子设备”的中国专利申请202110111128.5的优先权,该申请的全部内容通过引用并入本文中。This application claims the priority of Chinese Patent Application No. 202110111128.5 filed on January 27, 2021, entitled "Image Processing Method, Device, Image Processing Chip and Electronic Equipment", the entire content of which is incorporated herein by reference.
技术领域technical field
本申请涉及图像处理技术领域,具体而言,涉及一种图像处理方法、一种图像处理装置、一种图像处理芯片、一种电子设备和一种可读存储介质。The present application relates to the technical field of image processing, and in particular, to an image processing method, an image processing apparatus, an image processing chip, an electronic device, and a readable storage medium.
背景技术Background technique
随着手机、监控芯片中图像数据的处理需求已经越来越多,芯片中往往会集成多个图像处理IP(Intellectual Property,知识产权)。多个IP通过对同一图像数据进行流水处理,但是各个IP对于图像数据格式的需求并不完全兼容,利用传统的通用直接存储器访问DMA(Direct Memory Access)装置,仅能进行单一的图像数据转换,对于多维图像数据搬运并没有很好的支持,效率非常低。而且通过CPU(Central Processing Unit,中央处理单元)软件进行数据格式转换占用很多CPU资源,进一步降低图像处理效率。As the processing requirements of image data in mobile phones and monitoring chips have increased, multiple image processing IPs (Intellectual Property, intellectual property) are often integrated into the chips. Multiple IPs process the same image data by pipeline, but the requirements of each IP for the image data format are not fully compatible. Using the traditional general-purpose direct memory access DMA (Direct Memory Access) device, only a single image data conversion can be performed. There is no good support for multi-dimensional image data handling, and the efficiency is very low. Moreover, data format conversion through CPU (Central Processing Unit) software takes up a lot of CPU resources, further reducing the efficiency of image processing.
因此,亟需提出一种高效的用于图像数据格式转换的DMA装置。Therefore, there is an urgent need to provide an efficient DMA device for image data format conversion.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种图像处理方法、装置、图像处理芯片和电子设备,能够解决相关技术中通用DMA图像数据处理效率低的技术问题。The embodiments of the present application provide an image processing method, apparatus, image processing chip and electronic device, which can solve the technical problem of low efficiency of general DMA image data processing in the related art.
为了解决上述问题,本申请是这样实现的:In order to solve the above problems, this application is implemented as follows:
第一方面,本申请实施例提供了一种图像处理方法,包括:In a first aspect, an embodiment of the present application provides an image processing method, including:
获取目标图像和目标图像的格式转换任务;Get the target image and the format conversion task of the target image;
将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,以使目标格式转换模块对目标图像进行格式转换。The format conversion task of the target image is allocated to the target format conversion module corresponding to the format conversion task, so that the target format conversion module performs format conversion on the target image.
第二方面,本申请实施例提供了一种图像处理装置,包括:In a second aspect, an embodiment of the present application provides an image processing apparatus, including:
多个格式转换模块,用于对目标图像进行格式转换;Multiple format conversion modules for format conversion of target images;
管理模块,用于获取目标图像和目标图像的格式转换任务,并将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块。The management module is used for acquiring the target image and the format conversion task of the target image, and assigning the format conversion task of the target image to the target format conversion module corresponding to the format conversion task.
第三方面,本申请实施例提供了一种图像处理芯片,包括处理器、存储器及存储在该存储器上并在处理器上运行的程序或指令,该程序或指令被处理器执行时实现如第一方面提供的图像处理方法的步骤。In a third aspect, an embodiment of the present application provides an image processing chip, including a processor, a memory, and a program or instruction stored on the memory and running on the processor. When the program or instruction is executed by the processor, the An aspect provides steps of an image processing method.
第四方面,本申请实施例提供了一种电子设备,包括:In a fourth aspect, an embodiment of the present application provides an electronic device, including:
如第三方面提供的图像处理芯片。The image processing chip provided by the third aspect.
第五方面,本申请实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,该程序或指令被处理器执行时实现如第一方面提供的图像处理方法的步骤。In a fifth aspect, an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the image processing method provided in the first aspect are implemented.
第六方面,本申请实施例提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现如第一方面提供的图像处理方法的步骤。In a sixth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the steps of the image processing method provided in the first aspect.
第七方面,本申请实施例提供了一种电子设备,被配置为用于执行如第一方面所述的图像处理方法的步骤。In a seventh aspect, an embodiment of the present application provides an electronic device configured to execute the steps of the image processing method described in the first aspect.
第八方面,本申请实施例提供了一种计算机程序产品,所述计算机程序产品被处理器执行以实现如第一方面所述的图像处理方法的步骤。In an eighth aspect, an embodiment of the present application provides a computer program product, where the computer program product is executed by a processor to implement the steps of the image processing method according to the first aspect.
在本申请实施例中,获取目标图像和目标图像的格式转换任务;将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,以使目标格式转换模块对目标图像进行格式转换。从而能够利用多个不同功能的格式转换模块对待处理的目标图像执行不同的格式转换任务,即使是多维的目标图像也能进行高效的格式转换,满足用户对不同图像格式的需求,而且避免通过图像处理芯片的控制装置直接进行图像格式转换,减少 控制装置在进行格式转换时的资源占用,在提高转换效率的同时降低控制装置的运行压力。In the embodiment of the present application, the target image and the format conversion task of the target image are obtained; the format conversion task of the target image is allocated to the target format conversion module corresponding to the format conversion task, so that the target format conversion module performs format conversion on the target image. Therefore, multiple format conversion modules with different functions can be used to perform different format conversion tasks for the target image to be processed. Even multi-dimensional target images can be efficiently formatted to meet the needs of users for different image formats. The control device of the processing chip directly performs image format conversion, which reduces the resource occupation of the control device during format conversion, and reduces the operating pressure of the control device while improving the conversion efficiency.
附图说明Description of drawings
图1示出了根据本申请的一个实施例的图像处理方法的流程图之一;FIG. 1 shows one of the flowcharts of an image processing method according to an embodiment of the present application;
图2示出了根据本申请的一个实施例的图像处理方法的流程图之二;FIG. 2 shows the second flowchart of an image processing method according to an embodiment of the present application;
图3示出了根据本申请的一个实施例的图像处理方法的流程图之三;FIG. 3 shows the third flowchart of an image processing method according to an embodiment of the present application;
图4示出了根据本申请的一个实施例的图像处理方法的流程图之四;FIG. 4 shows a fourth flowchart of an image processing method according to an embodiment of the present application;
图5示出了根据本申请的一个实施例的图像处理方法的流程图之五;Fig. 5 shows the fifth flowchart of the image processing method according to an embodiment of the present application;
图6示出了根据本申请的一个实施例的图像处理方法的流程图之六;FIG. 6 shows a sixth flowchart of an image processing method according to an embodiment of the present application;
图7示出了根据本申请的一个实施例的图像处理装置的结构框图之一;FIG. 7 shows one of the structural block diagrams of an image processing apparatus according to an embodiment of the present application;
图8示出了根据本申请的一个实施例的图像处理装置的结构框图之二;FIG. 8 shows the second structural block diagram of an image processing apparatus according to an embodiment of the present application;
图9示出了根据本申请的一个实施例的图像处理装置的结构框图之三;FIG. 9 shows the third structural block diagram of an image processing apparatus according to an embodiment of the present application;
图10示出了根据本申请的一个实施例的图像处理芯片的结构框图之一;10 shows one of the structural block diagrams of an image processing chip according to an embodiment of the present application;
图11示出了根据本申请的一个实施例的图像处理芯片的结构框图之二;FIG. 11 shows the second structural block diagram of an image processing chip according to an embodiment of the present application;
图12示出了根据本申请的一个实施例的电子设备的硬件结构示意图。FIG. 12 shows a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施方式对本申请进行进一步的详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to more clearly understand the above objects, features and advantages of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments may be combined with each other in the case of no conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本申请,但是,本申请还可以采用其他不同于在此描述的其他方式来实施,因此,本申请 的保护范围并不受下面公开的具体实施例的限制。Many specific details are set forth in the following description to facilitate a full understanding of the present application. However, the present application can also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific details disclosed below. Example limitations.
下面参照图1至图12描述根据本申请一些实施例的图像处理方法、装置、图像处理芯片和电子设备。The following describes an image processing method, apparatus, image processing chip, and electronic device according to some embodiments of the present application with reference to FIGS. 1 to 12 .
在本申请的一个实施例中,图1示出了本申请的一个实施例的图像处理方法的流程图之一,包括:步骤102和步骤104。In an embodiment of the present application, FIG. 1 shows one of the flowcharts of an image processing method according to an embodiment of the present application, including step 102 and step 104 .
步骤102,获取目标图像和目标图像的格式转换任务。 Step 102, acquiring the target image and the format conversion task of the target image.
在本实施例中,格式转换任务包括以下至少之一:维度格式转换任务、位宽格式转换任务、表示格式转换任务。In this embodiment, the format conversion task includes at least one of the following: a dimension format conversion task, a bit-width format conversion task, and a representation format conversion task.
具体举例来说,维度格式转换任务包括:一维线性的数据搬运拷贝、二维图像数据的搬运拷贝,三维图像数据的拷贝搬运等不同维度的图像进行维度格式转换的任务,例如,将三维图像转换为二维图像。表示格式转换任务包括RGB格式、YUV格式和其它图像表示格式之间的互转,例如,RGB565,RGB888,YUV444,YUV422,YUV420等各种图像的表示格式。位宽格式转换任务包括多种位宽格式之间的转换,例如,8bit(比特),76bit,24bit,32bit等格式的互转。其中,8bit(比特)=1b(字节)。For example, the dimensional format conversion tasks include: one-dimensional linear data transfer and copy, two-dimensional image data transfer and copy, three-dimensional image data copy transfer and other tasks to perform dimensional format conversion on images of different dimensions. Convert to a 2D image. The representation format conversion task includes the mutual conversion between RGB format, YUV format and other image representation formats, for example, RGB565, RGB888, YUV444, YUV422, YUV420 and other image representation formats. The bit-width format conversion task includes conversion between multiple bit-width formats, for example, the mutual conversion of 8bit (bit), 76bit, 24bit, 32bit and other formats. Among them, 8bit (bit)=1b (byte).
可以理解的是,目标图像可以是至少一张图片,也可以视频,当然也可以从视频中截取的图片。It can be understood that the target image may be at least one picture, or may be a video, and of course, may also be a picture captured from a video.
步骤104,将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,以使目标格式转换模块对目标图像进行格式转换。Step 104: Allocate the format conversion task of the target image to the target format conversion module corresponding to the format conversion task, so that the target format conversion module performs format conversion on the target image.
在本实施例中,获取控制装置(CPU)配置的格式转换任务以及需要进行格式转换的目标图像。将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,利用多个不同功能的格式转换模块对待处理的目标图像执行不同的格式转换任务。一方面,能够实现格式转换任务的并行处理,大大缩短格式转换所需的时间,而且由于不同的格式转换模块能够执行了不同的格式转换任务,使得输出的目标图像能够兼顾图像处理时的不同需求,即使是多维的图像也能进行高效的格式转换,有利于多维图像搬运,提高格式转换效率。另一方面,避免通过图像处理芯片的控制装置直接进行图像格式转换,减少控制装置在进行图像格式转换时的资源占用,在提高转换效率的同时降低控制装置的运行压力。In this embodiment, a format conversion task configured by a control device (CPU) and a target image that needs to be formatted are acquired. The format conversion task of the target image is allocated to the target format conversion module corresponding to the format conversion task, and a plurality of format conversion modules with different functions are used to perform different format conversion tasks on the target image to be processed. On the one hand, the parallel processing of format conversion tasks can be realized, which greatly shortens the time required for format conversion, and because different format conversion modules can perform different format conversion tasks, the output target image can take into account the different needs of image processing. , even multi-dimensional images can perform efficient format conversion, which is conducive to multi-dimensional image handling and improves format conversion efficiency. On the other hand, it is avoided to directly perform image format conversion through the control device of the image processing chip, thereby reducing the resource occupation of the control device when performing the image format conversion, and reducing the operating pressure of the control device while improving the conversion efficiency.
需要说明的是,该图像处理方法适用于图像处理装置,该图像处理装置包括多个独立的格式转换模块,多个格式转换模块中的每一个格式转换模块可以执行相同或不同的格式转换任务。It should be noted that the image processing method is applicable to an image processing apparatus, and the image processing apparatus includes a plurality of independent format conversion modules, and each format conversion module of the plurality of format conversion modules can perform the same or different format conversion tasks.
在本申请的一个实施例中,如图2所示,步骤104,将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,包括:In an embodiment of the present application, as shown in FIG. 2, step 104, assigning the format conversion task of the target image to the target format conversion module corresponding to the format conversion task, including:
步骤202,将格式转换任务分配至处于空闲状态的目标格式转换模块。Step 202: Allocate the format conversion task to the target format conversion module in the idle state.
在本实施例中,在分配格式转换任务之前,先确定每一个格式转换模块的使用状态,若需要执行格式转换任务的目标格式转换模块处于空闲状态,说明该目标格式转换模块当前可执行格式转换任务,则将格式转换任务分配至处于空闲状态的目标格式转换模块。若目标格式转换模块处于非空闲状态,说明该目标格式转换模块当前正在执行格式转换任务,则等待目标格式转换模块空闲后再进行任务分配,或将格式转换分配至其它能够执行该任务的空闲的目标格式转换模块。从而有利于实现并行式的格式转换任务,而且能够避免格式转换模块重复执行格式转换任务,防止格式转换模块无谓工作,进而能够实现格式转换任务的动态分配,大幅度提升了格式转换模块利用效率。In this embodiment, before assigning a format conversion task, the usage status of each format conversion module is determined. If the target format conversion module that needs to perform the format conversion task is in an idle state, it means that the target format conversion module can currently perform format conversion. task, the format conversion task is allocated to the target format conversion module in the idle state. If the target format conversion module is in a non-idle state, it means that the target format conversion module is currently performing the format conversion task, then wait for the target format conversion module to be idle before assigning the task, or assign the format conversion to other idle machines that can execute the task. Target format conversion module. Therefore, the parallel format conversion task can be realized, and the format conversion module can be prevented from repeatedly performing the format conversion task, and unnecessary work of the format conversion module can be prevented, so that the dynamic allocation of the format conversion task can be realized, and the utilization efficiency of the format conversion module can be greatly improved.
在本申请的一些实施例中,如图3所示,步骤104,将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块,包括:步骤302和步骤304。In some embodiments of the present application, as shown in FIG. 3 , step 104 , assigning the format conversion task of the target image to the target format conversion module corresponding to the format conversion task includes: step 302 and step 304 .
步骤302,读取缓存模块的缓存空间。 Step 302, read the cache space of the cache module.
在本实施例中,缓存模块用于缓存格式转换任务所需的缓存数据,以供格式转换模块读取或再读取,加快格式转换模块的读取速度,节省执行格式转换任务的时间和资源,有利于降低格式转换模块的运行负担,而且图像处理装置出现故障时,通过缓存数据仍能够在一定时间内正常提供数据支持,以完成格式转换任务,提高图像处理装置的可用能。In this embodiment, the cache module is used to cache the cached data required by the format conversion task for reading or re-reading by the format conversion module, which speeds up the reading speed of the format conversion module and saves time and resources for performing the format conversion task. , which is beneficial to reduce the operating burden of the format conversion module, and when the image processing device fails, data support can still be provided normally within a certain period of time through the cached data, so as to complete the format conversion task and improve the available energy of the image processing device.
步骤304,在缓存空间大于或等于预设阈值的情况下,将目标图像的格式转换任务分配至目标格式转换模块。 Step 304 , when the buffer space is greater than or equal to the preset threshold, assign the format conversion task of the target image to the target format conversion module.
在本实施例中,在分配格式转换任务之前,先确定缓存模块的缓存空 间大小。若当前缓存空间能够满足格式转换任务所需的缓存数据的存储空间,则开始分配格式转换任务至目标格式转换模块,以执行图像格式转换。若当前缓存空间不足以支持格式转换任务所需的缓存数据,则暂停分配格式转换任务,直至缓存空间恢复满足格式转换任务所需的缓存数据的存储空间的大小,再开始分配格式转换任务。从而保证格式转换任务拥有足够的空间进行缓存,提高图像格式转换过冲中的数据读写速度,使得格式转换任务能够顺利被执行,进而能够实现任务的动态分配,提升格式转换效率,确保图像处理装置的可靠性。In this embodiment, before allocating the format conversion task, the size of the cache space of the cache module is determined first. If the current cache space can satisfy the storage space of the cached data required by the format conversion task, the format conversion task is allocated to the target format conversion module to perform image format conversion. If the current cache space is not enough to support the cache data required by the format conversion task, the allocation of the format conversion task is suspended until the cache space recovers to meet the size of the storage space of the cache data required by the format conversion task, and then the format conversion task is allocated. This ensures that the format conversion task has enough space for buffering, improves the data read and write speed in the image format conversion overshoot, enables the format conversion task to be executed smoothly, and then realizes the dynamic assignment of tasks, improves the format conversion efficiency, and ensures image processing. device reliability.
在本申请的一些实施例中,图4示出了本申请的一个实施例的格式转换的流程图之四,包括:步骤402和步骤404。In some embodiments of the present application, FIG. 4 shows the fourth flow chart of format conversion in an embodiment of the present application, including step 402 and step 404 .
步骤402,确定格式转换任务的进程信息。 Step 402, determining the process information of the format conversion task.
其中,进程信息可以理解为格式转换任务的执行进度,进程信息包括:任务完成信息、任务进行信息、任务中断信息。The process information can be understood as the execution progress of the format conversion task, and the process information includes: task completion information, task progress information, and task interruption information.
具体地,当格式转换任务的执行进度达到某个进度阈值的持续时间达到预设时间,则判定进程信息为任务中断信息;当格式转换任务的执行进度达到100%的持续时间达到预设时间,则判定进程信息为任务完成信息,当格式转换任务的执行进度未达到100%,且处于某个进度阈值的持续时间也未达到预设时间,则判定个数转换任务正在执行,此时进程信息为任务进行信息。Specifically, when the execution progress of the format conversion task reaches a certain progress threshold and the duration reaches the preset time, it is determined that the progress information is the task interruption information; when the execution progress of the format conversion task reaches 100%, the duration reaches the preset time, Then it is determined that the process information is the task completion information. When the execution progress of the format conversion task has not reached 100%, and the duration of a certain progress threshold has not reached the preset time, it is determined that the number conversion task is being executed. At this time, the process information Information for the task.
步骤404,在进程信息为任务完成信息或任务中断信息的情况下,中断格式转换任务,并释放缓存模块中格式转换任务对应的缓存数据。 Step 404 , when the process information is the task completion information or the task interruption information, interrupt the format conversion task, and release the cached data corresponding to the format conversion task in the cache module.
在本实施例中,在进行格式转换的过程中,确定格式转换任务当前的进程信息。若进程信息为任务完成信息或任务中断信息,也即当前格式转换任务已经完成或出错,则中断正在执行的格式转换任务,并释放该格式转换任务对应的缓存数据,以便于拥有足够的资源去执行下一个格式转换任务,提高资源利用率,确保图像格式转换效率。In this embodiment, during the process of format conversion, the current progress information of the format conversion task is determined. If the process information is task completion information or task interruption information, that is, the current format conversion task has been completed or an error occurs, the current format conversion task will be interrupted, and the cached data corresponding to the format conversion task will be released, so as to have enough resources to Execute the next format conversion task to improve resource utilization and ensure the efficiency of image format conversion.
在一些实施方式中,在获得进程信息之后,可将进程信息上报给控制装置(CPU),以供控制装置对格式转换任务的进度进行记录,便于用户对图像处理过程进行查询和追溯。In some embodiments, after the process information is obtained, the process information can be reported to the control device (CPU), so that the control device can record the progress of the format conversion task, so as to facilitate the user to query and trace the image processing process.
在本申请的一些实施例中,步骤104,将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块之前,还包括:根据目标图像的图像参数对目标图像进行压缩。In some embodiments of the present application, step 104, before allocating the format conversion task of the target image to the target format conversion module corresponding to the format conversion task, further includes: compressing the target image according to image parameters of the target image.
在本实施例中,对于分辨率、尺寸、位宽较大的图像,在进行图像格式转换时,占用个较多的资源,且处理速度较慢。为此在进行格式转换任务之前,通过图像压缩来降低图像所占空间,以缓解格式转换模块的运行压力。In this embodiment, for an image with larger resolution, size, and bit width, when the image format conversion is performed, more resources are occupied, and the processing speed is relatively slow. Therefore, before performing the format conversion task, the image occupied space is reduced by image compression, so as to relieve the operation pressure of the format conversion module.
在本申请的一些实施例中,步骤104,将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块之后,还包括:解压缩处于压缩状态的目标图像;输出解压缩后的目标图像。In some embodiments of the present application, step 104, after allocating the format conversion task of the target image to the target format conversion module corresponding to the format conversion task, further includes: decompressing the target image in a compressed state; outputting the decompressed target image image.
在本实施例中,在格式转换后在通过解压技术还原图像压缩前的图像参数。从而能够有效提高格式转换效率,满足大分辨率图像处理的实时性需求,增强图像处理装置的可用性。In this embodiment, the image parameters before image compression are restored by decompression technology after format conversion. Therefore, the format conversion efficiency can be effectively improved, the real-time requirement of large-resolution image processing can be met, and the usability of the image processing device can be enhanced.
具体举例来说,可采用行程长度压缩编解码(run-length codec)算法进行压缩,将图像中颜色值相近的两个相邻像素用两个字节来标识,其中,第一个字节是计数值,用于指定像素重复的次数;第二个字节是具体像素的值。从而能够在压缩的同时保证目标图像的质量。For example, the run-length codec algorithm can be used for compression, and two adjacent pixels with similar color values in the image are identified by two bytes, where the first byte is A count value that specifies the number of times the pixel is repeated; the second byte is the value of the specific pixel. Therefore, the quality of the target image can be guaranteed while compressing.
在本申请的一些实施例中,图5示出了本申请的一个实施例的图像处理方法的流程图之五,包括:In some embodiments of the present application, FIG. 5 shows the fifth flowchart of an image processing method according to an embodiment of the present application, including:
步骤502,获取目标图像的分割任务; Step 502, obtaining the segmentation task of the target image;
步骤504,根据目标图像的分割任务分割目标图像。 Step 504, segment the target image according to the segmentation task of the target image.
在本实施例中,若用户需要对目标图像进行拆分时,获取控制装置输出目标图像的分割任务,根据该分割任务对图像进行分割处理。不仅能够满足目标图像的输出数量要求,而且由于分割后的图像块尺寸、内存占用等均小于原始目标图像,在分别对多个图像块进行格式转换时,能够有效降低格式转换模块的处理压力,从而能够对于分辨率、尺寸、位宽较大的目标图像进行格式转换,而且能够提高目标图像格式转换的速度,满足大分辨率图像处理的实时性需求,增强图像处理装置的可用性。In this embodiment, if the user needs to split the target image, a segmentation task for the control device to output the target image is acquired, and the image is segmented according to the segmentation task. Not only can it meet the output quantity requirements of the target image, but also because the size and memory usage of the segmented image block are smaller than the original target image, it can effectively reduce the processing pressure of the format conversion module when performing format conversion on multiple image blocks respectively. Therefore, the format conversion can be performed for the target image with larger resolution, size and bit width, and the speed of the target image format conversion can be increased, the real-time requirement of large-resolution image processing can be met, and the usability of the image processing device can be enhanced.
具体地,控制装置可按照目标图像的图像参数配置分割任务,也可以 按照用户输入的分割指令配置分割任务。例如,在图像的九宫格模式,可根据图像尺寸将目标图像均分为9张图像。Specifically, the control device may configure the segmentation task according to the image parameters of the target image, or may configure the segmentation task according to the segmentation instruction input by the user. For example, in the nine-square pattern of the image, the target image can be divided into 9 images equally according to the image size.
在本申请的一些实施例中,图6示出了本申请的一个实施例的图像处理方法的流程图之六,包括:In some embodiments of the present application, FIG. 6 shows the sixth flowchart of an image processing method according to an embodiment of the present application, including:
步骤602,获取目标图像的合并任务; Step 602, acquiring the merging task of the target image;
步骤604,根据目标图像的合并任务合并目标图像。 Step 604, merge the target images according to the merging task of the target images.
在本实施例中,获取控制装置输出目标图像的合并任务,根据该合并任务对图像进行合并处理。其中,合并处理不仅能够执行分割后的图像块合成任务,还能够对将多个完整的目标图像的进行合并,满足用户不同的图像需求。In this embodiment, a merging task for the control device to output the target image is acquired, and the images are merged according to the merging task. Among them, the merging process can not only perform the task of synthesizing the segmented image blocks, but also combine multiple complete target images to meet different image requirements of users.
例如,在进行全景拍摄场景,需要将多个图像进行合并得到全景图像。For example, in a panoramic shooting scene, it is necessary to combine multiple images to obtain a panoramic image.
具体地,可采用α混合(Alpha Blending)技术合并目标图像,按照α混合向量混合源像素和目标像素,从而在保证清晰度和契合度的清境况下实现两幅目标图像的合成。Specifically, the alpha blending (Alpha Blending) technology can be used to merge the target images, and the source pixels and the target pixels can be mixed according to the alpha blending vector, so as to realize the synthesis of the two target images under the condition of ensuring the clarity and fit.
在本申请的一些实施例中,如图7所示,图像处理装置700包括:多个格式转换模块704,格式转换模块704用于对目标图像进行格式转换;管理模块702,管理模块702用于获取目标图像和目标图像的格式转换任务,并将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块。In some embodiments of the present application, as shown in FIG. 7 , the image processing apparatus 700 includes: a plurality of format conversion modules 704, the format conversion modules 704 are used to perform format conversion on the target image; the management module 702, the management module 702 is used for Acquire the target image and the format conversion task of the target image, and assign the format conversion task of the target image to the target format conversion module corresponding to the format conversion task.
在一些示例中,格式转换任务包括但不限于以下至少之一:维度格式转换任务、位宽格式转换任务、表示格式转换任务。In some examples, the format conversion task includes, but is not limited to, at least one of the following: a dimensional format conversion task, a bit-width format conversion task, and a representation format conversion task.
在本实施例中,图像处理装置700设置有多个格式转换模块704,多个格式转换模块704能够同时执行相同或不同的格式转换任务。当需要进行图像的格式转换时,向格式转换模块704输入待转换的目标图像,管理模块702接收控制装置(CPU)配置的格式转换任务。管理模块702将不同的格式转换任务分配给能够执行该任务对应的格式转换模块704。一方面,利用多个不同功能的独立的格式转换模块704执行不同的格式转换任务,能够实现格式转换任务的并行处理,大大缩短格式转换所需的时间, 而且由于不同的格式转换模块704能够执行了不同的格式转换任务,使得输出的目标图像能够兼顾图像处理时的不同需求,实现多维图像的格式转换,有利于多维图像搬运,提高图像处理装置700的格式转换效率,另一方面,避免通过图像处理芯片的控制装置进行图像格式转换,减少控制装置在进行图像格式转换时的资源占用,在提高转换效率的同时降低控制装置的运行压力。In this embodiment, the image processing apparatus 700 is provided with a plurality of format conversion modules 704, and the plurality of format conversion modules 704 can simultaneously perform the same or different format conversion tasks. When the format conversion of the image is required, the target image to be converted is input to the format conversion module 704, and the management module 702 receives the format conversion task configured by the control device (CPU). The management module 702 assigns different format conversion tasks to the format conversion modules 704 corresponding to the tasks that can be performed. On the one hand, by using a plurality of independent format conversion modules 704 with different functions to perform different format conversion tasks, parallel processing of the format conversion tasks can be realized, which greatly shortens the time required for format conversion, and since different format conversion modules 704 can execute Different format conversion tasks are performed, so that the output target image can take into account the different needs of image processing, realize the format conversion of multi-dimensional images, facilitate multi-dimensional image handling, and improve the format conversion efficiency of the image processing device 700. The control device of the image processing chip performs image format conversion, reduces the resource occupation of the control device when performing the image format conversion, and reduces the operating pressure of the control device while improving the conversion efficiency.
在一些实施方式中,格式转换模块704可通过不同的实例化配置合理设置,例如,可以设置为5个或8个等。In some implementations, the format conversion module 704 can be set reasonably through different instantiation configurations, for example, it can be set to 5 or 8 and so on.
在一些实施例中,如图8所示,多个格式转换模块704包括以下至少之一:表示格式模块7042,表示格式模块7042用于对目标图像进行表示格式转换;位宽格式模块7044,位宽格式模块7044用于对目标图像进行位宽格式转换;维度格式模块7046,维度格式模块7046用于对目标图像进行维度格式转换。In some embodiments, as shown in FIG. 8 , the plurality of format conversion modules 704 include at least one of the following: a representation format module 7042, which is used to perform representation format conversion on the target image; a bit-width format module 7044, a bit-width format module 7044, The wide format module 7044 is used for performing bit-width format conversion on the target image; the dimensional format module 7046 is used for performing dimensional format conversion on the target image.
在本实施例中,格式转换模块704可按照格式转换需求配置不同的格式模块,从而支持多种目标图像格式转换的操作,满足图像处理时的不同格式需求。In this embodiment, the format conversion module 704 can configure different format modules according to the format conversion requirements, so as to support the operation of converting multiple target image formats and meet different format requirements during image processing.
在一些实施例中,管理模块702还用于将格式转换任务分配至处于空闲状态的目标格式转换模块。In some embodiments, the management module 702 is further configured to assign the format conversion task to the target format conversion module in the idle state.
在一些实施例中,如图9所示,图像处理装置700还包括:缓存模块706,与多个格式转换模块704连接,缓存模块706用于缓存格式转换任务所需的缓存数据。In some embodiments, as shown in FIG. 9 , the image processing apparatus 700 further includes: a cache module 706 , which is connected to a plurality of format conversion modules 704 , and the cache module 706 is configured to cache the cache data required by the format conversion task.
在本实施例中,利用缓存模块706缓存格式转换任务所需的缓存数据,以供格式转换模块704读取或再读取,加快格式转换模块704的读取速度,节省执行格式转换任务的时间和资源,能够降低格式转换模块704的运行负担,而且图像处理装置700出现故障时,通过缓存数据仍能够在一定时间内正常提供数据支持,以完成格式转换任务,提高图像处理装置700的可用能。In this embodiment, the cached data required by the format conversion task is cached by the cache module 706 for reading or re-reading by the format conversion module 704, which speeds up the reading speed of the format conversion module 704 and saves the time for executing the format conversion task. and resources, the operating burden of the format conversion module 704 can be reduced, and when the image processing device 700 fails, data support can still be provided normally within a certain period of time by buffering data to complete the format conversion task and improve the available energy of the image processing device 700. .
需要说明的是,不同的格式转换任务执行的实时性需求不同,需要的数据缓存模块706大小也不同。It should be noted that different format conversion tasks have different real-time requirements for execution, and require different sizes of the data cache module 706 .
可以理解的是,由于图像格式转换过程中每个格式转换模块704都需要一定的数据缓存区(buffer),多个格式转换模块704能够共享缓存模块706内的缓存资源,避免缓存数据的重复创建、处理和传输,进一步节省执行格式转换任务的时间和资源,保证格式转换稳定性。It can be understood that, since each format conversion module 704 requires a certain data buffer area (buffer) in the image format conversion process, multiple format conversion modules 704 can share the cache resources in the cache module 706 to avoid duplicate creation of cached data. , processing and transmission, further saving the time and resources of performing format conversion tasks and ensuring the stability of format conversion.
在一些实施例中,管理模块702还用于根据缓存模块706的缓存空间分配格式转换任务至目标格式转换模块。In some embodiments, the management module 702 is further configured to allocate the format conversion task to the target format conversion module according to the cache space of the cache module 706 .
在本实施例中,在分配格式转换任务之前,先确定缓存模块706的缓存空间大小。若当前缓存空间能够满足格式转换任务所需的缓存数据的存储空间,则开始分配格式转换任务至目标格式转换模块,以完成图像格式转换。若当前缓存空间不足以支持格式转换任务所需的缓存数据,则暂停分配格式转换任务,直至缓存空间恢复满足格式转换任务所需的缓存数据的存储空间的大小,再开始分配格式转换任务。从而保证格式转换任务拥有足够的空间进行缓存,提高图像格式转换过冲中的数据读写速度,使得格式转换任务能够顺利被执行,进而能够实现任务的动态分配,提升了格式转换模块704利用效率,确保图像处理装置700的可靠性。In this embodiment, before allocating the format conversion task, the size of the cache space of the cache module 706 is determined first. If the current cache space can satisfy the storage space of the cached data required by the format conversion task, the format conversion task is allocated to the target format conversion module to complete the image format conversion. If the current cache space is not enough to support the cache data required by the format conversion task, the allocation of the format conversion task is suspended until the cache space recovers to meet the size of the storage space of the cache data required by the format conversion task, and then the format conversion task is allocated. Therefore, it is ensured that the format conversion task has enough space for buffering, and the data read and write speed in the image format conversion overshoot is improved, so that the format conversion task can be executed smoothly, thereby realizing the dynamic assignment of tasks, and improving the utilization efficiency of the format conversion module 704. , to ensure the reliability of the image processing device 700 .
在一些实施例中,管理模块702还用于根据格式转换任务的进程信息中断格式转换任务,并释放缓存模块706中格式转换任务对应的缓存数据。In some embodiments, the management module 702 is further configured to interrupt the format conversion task according to the process information of the format conversion task, and release the cached data corresponding to the format conversion task in the cache module 706 .
在一些实施例中,图像处理装置700还包括:分割模块(图中未示出),分割模块用于根据目标图像的分割任务分割目标图像。In some embodiments, the image processing apparatus 700 further includes: a segmentation module (not shown in the figure), the segmentation module is configured to segment the target image according to the segmentation task of the target image.
在一些实施例中,图像处理装置700还包括:合成模块(图中未示出),合成模块用于根据目标图像的合并任务合并目标图像。In some embodiments, the image processing apparatus 700 further includes: a synthesizing module (not shown in the figure), the synthesizing module is configured to merge the target images according to the merging task of the target images.
在一些实施例中,图像处理装置700还包括:压缩模块(图中未示出)压缩模块用于根据目标图像的图像参数对目标图像进行压缩,以及解压缩处于压缩状态的目标图像。In some embodiments, the image processing apparatus 700 further includes: a compression module (not shown in the figure), the compression module is configured to compress the target image according to the image parameters of the target image, and decompress the target image in a compressed state.
在一些实施例中,如图9所示,图像处理装置700还包括:传输模块708,传输模块708用于将图像传输至多个格式转换模块704,或传输格式转换后的目标图像至目标位置。In some embodiments, as shown in FIG. 9 , the image processing apparatus 700 further includes: a transmission module 708, which is configured to transmit the image to a plurality of format conversion modules 704, or transmit the format-converted target image to the target location.
在本实施例中,在管理模块702为格式转换模块704分配格式转换任 务之后,通过传输模块708将读回的目标图像分发给格式转换模块704,同时格式转换模块704也会将转换完的目标图像传送给传输模块708,以将目标图像输送至目标位置。In this embodiment, after the management module 702 assigns the format conversion task to the format conversion module 704, the read back target image is distributed to the format conversion module 704 through the transmission module 708, and the format conversion module 704 will also convert the converted target image to the format conversion module 704. The images are passed to the transfer module 708 to deliver the target image to the target location.
在一些实施方式中,目标位置可以是格式转换后的图像处理器,也可以是用于显示目标图像的显示装置,本申请并不限定。In some embodiments, the target location may be an image processor after format conversion, or may be a display device for displaying the target image, which is not limited in this application.
具体举例来说,如图9所示,目标图像的相关数据通过片上网络数据端口进行数据读写交互。传输模块708会将从总线读回的数据分发给各路格式转换模块704,同时各路图像数据格式转换模块也会将处理完的数据传送给传输模块708,然后通过片上网络总线接口写到相应的双倍速率同步(DDR)内存或者片上静态随机存取存储器(SRAM)地址。For example, as shown in FIG. 9 , the related data of the target image performs data read-write interaction through the on-chip network data port. The transmission module 708 will distribute the data read back from the bus to the format conversion modules 704, and at the same time, the image data format conversion modules of each channel will also transmit the processed data to the transmission module 708, and then write to the corresponding data through the on-chip network bus interface. double-rate synchronous (DDR) memory or on-chip static random access memory (SRAM) addresses.
控制装置(CPU)通过配置端口配置目标图像相应的格式转换任务,基于事件的格式转换任务下发至管理模块702,在由管理模块702将任务分配到某一路图像数据格式转换模块,该模块会进行该任务的执行,当任务完成或者出错的时候上报中断给CPU。其中,共享数据缓存buffer池(缓存模块706)可以给多路图像数据格式转换模块公用。The control device (CPU) configures the format conversion task corresponding to the target image through the configuration port, and sends the event-based format conversion task to the management module 702, and the management module 702 assigns the task to a certain channel of image data format conversion module, which will Carry out the execution of the task, and report an interrupt to the CPU when the task is completed or an error occurs. The shared data cache buffer pool (cache module 706 ) may be shared by the multi-channel image data format conversion module.
在本实施例中,图像处理装置700的各模块执行各自功能时实现如上述任一实施例中的图像处理方法的步骤,因此,图像处理装置700同时也包括如上述任一实施例中的图像处理方法的全部有益效果,在此不再赘述。In this embodiment, each module of the image processing apparatus 700 implements the steps of the image processing method in any of the above embodiments when performing their respective functions. Therefore, the image processing apparatus 700 also includes the image in any of the above embodiments. All the beneficial effects of the processing method will not be repeated here.
具体地,本申请实施例中的图像处理装置700可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。Specifically, the image processing apparatus 700 in this embodiment of the present application may be an apparatus, and may also be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc., non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
本申请实施例中的图像处理装置700可以为具有操作系统的装置。该 操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The image processing apparatus 700 in this embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android (Android) operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
在本申请的一些实施例中,如图10所示,一种图像处理芯片800,包括处理器804,存储器802及存储在存储器802上并可在处理器804上运行的程序或指令,程序或指令被处理器804执行时实现上述任一实施例的图像处理方法的步骤。因此,该图像处理芯片800包括如上述任一实施例中提供的图像处理方法的全部有益效果,在此不再赘述。In some embodiments of the present application, as shown in FIG. 10, an image processing chip 800 includes a processor 804, a memory 802, and programs or instructions stored in the memory 802 and executable on the processor 804. When the instructions are executed by the processor 804, the steps of the image processing method in any of the above embodiments are implemented. Therefore, the image processing chip 800 includes all the beneficial effects of the image processing method provided in any of the above embodiments, and details are not described herein again.
在本申请的一些实施例中,如图11所示,图像处理芯片800包括:控制装置806,与处理器804相连接,用于根据转换参数确定并生成格式转换任务;图像处理器808,图像处理器808与处理器804、控制装置806相连接,图像处理器808用于对目标图像进行图像处理;存储器802与图像处理器808、控制装置806相连接,存储器802还用于存储格式转换任务和图像处理所需的数据。In some embodiments of the present application, as shown in FIG. 11 , the image processing chip 800 includes: a control device 806, connected to the processor 804, for determining and generating a format conversion task according to conversion parameters; an image processor 808, an image The processor 808 is connected with the processor 804 and the control device 806, and the image processor 808 is used to perform image processing on the target image; the memory 802 is connected with the image processor 808 and the control device 806, and the memory 802 is also used for storing format conversion tasks. and data required for image processing.
具体地,当电子设备接收到用户对目标图像的第一输入时,控制装置806确定第一输入指示的转换参数,并根据转换参数生成格式转换任务,通过控制装置806负责整个格式转换任务的调度,以供通过图像格式转换专用的处理器804对输入目标图像进行格式转换。从而不再需要控制装置806(CPU)直接去进行图像数据处理,大幅提高电子设备的内存或片上存储装置之间搬运图像数据的效率。Specifically, when the electronic device receives the user's first input to the target image, the control device 806 determines the conversion parameters indicated by the first input, and generates a format conversion task according to the conversion parameters, and the control device 806 is responsible for scheduling the entire format conversion task. , so as to perform format conversion on the input target image by the processor 804 dedicated to image format conversion. Therefore, it is no longer necessary for the control device 806 (CPU) to directly process the image data, which greatly improves the efficiency of transferring image data between the internal memory of the electronic device or the on-chip storage devices.
在一些实施例中,转换参数包括但不限于以下至少之一:目标图像的图像参数、目标图像的源位置、目标图像的目标位置、目标图像的格式、目标图像的目标格式、目标图像的输出数量、目标图像的分辨率等。In some embodiments, the conversion parameters include, but are not limited to, at least one of the following: image parameters of the target image, source position of the target image, target position of the target image, format of the target image, target format of the target image, output of the target image number, resolution of the target image, etc.
在一些实施例中,存储器802包括静态随机存取存储器8022(Static Random-access Memory,SRAM)或双倍速率同步动态随机存储器(Double Data Rate Synchronous Dynamic Random-access Memory,DDR SRAM),以及内存控制器8024。通过静态/动态随机存取存储器保存控制装置806执行或调度不同图形相关任务时的数据,通过内存控制器8024读写图像处理芯片800外部的内存颗粒900。In some embodiments, the memory 802 includes a static random access memory 8022 (Static Random-access Memory, SRAM) or a double-rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random-access Memory, DDR SRAM), and a memory control 8024. The data when the control device 806 executes or schedules different graphics-related tasks are saved through the static/dynamic random access memory, and the memory particles 900 outside the image processing chip 800 are read and written through the memory controller 8024 .
具体举例来说,如图11所示,图像处理器808包括以下至少之一: 图像信号处理器8082(Imaging Signal Processor,ISP)、视频编解码器(Video Codec)、神经网络处理器8084(Neural-network Processing Unit,NPU)、图形处理器8086(Graphics Processing Unit,GPU)、数字信号处理器8088(Digital Signal Processing,DSP)。通过多种图像处理器808实现不同的图像处理功能。多个图像处理器808通过片上网络总线810(network on chip,NOC)进行互联,控制装置806、处理器804和存储器802同样挂载在片上网络总线810上。Specifically, as shown in FIG. 11 , the image processor 808 includes at least one of the following: an image signal processor 8082 (Imaging Signal Processor, ISP), a video codec (Video Codec), a neural network processor 8084 (Neural -Network Processing Unit, NPU), graphics processor 8086 (Graphics Processing Unit, GPU), digital signal processor 8088 (Digital Signal Processing, DSP). Different image processing functions are implemented by various image processors 808 . A plurality of image processors 808 are interconnected through an on-chip network bus 810 (network on chip, NOC). The control device 806 , the processor 804 and the memory 802 are also mounted on the on-chip network bus 810 .
在本申请的一些实施例中,提供了一种电子设备,包括:上述任一实施例的图像处理芯片,因此,该电子设备包括如上述任一实施例中提供的图像处理芯片的全部有益效果,在此不再赘述。In some embodiments of the present application, an electronic device is provided, including: the image processing chip of any of the above embodiments, therefore, the electronic device includes all the beneficial effects of the image processing chip provided in any of the above embodiments , and will not be repeated here.
图12为实现本申请实施例的一种电子设备的硬件结构示意图。该电子设备1200包括但不限于:射频单元1202、网络模块1204、音频输出单元1206、输入单元1208、传感器1210、显示单元1212、用户输入单元1214、接口单元1216、存储器1218、处理器1220等部件。FIG. 12 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application. The electronic device 1200 includes but is not limited to: a radio frequency unit 1202, a network module 1204, an audio output unit 1206, an input unit 1208, a sensor 1210, a display unit 1212, a user input unit 1214, an interface unit 1216, a memory 1218, a processor 1220 and other components .
本领域技术人员可以理解,电子设备1200还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1220逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图12中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本申请实施例中,电子设备包括但不限于移动终端、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、以及计步器等。Those skilled in the art can understand that the electronic device 1200 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 1220 through a power management system, so as to manage charging, discharging, and power management through the power management system. consumption management and other functions. The structure of the electronic device shown in FIG. 12 does not constitute a limitation to the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components. In the embodiments of the present application, electronic devices include, but are not limited to, mobile terminals, tablet computers, notebook computers, handheld computers, vehicle-mounted electronic devices, wearable devices, and pedometers.
其中,处理器1220获取目标图像和目标图像的格式转换任务;将目标图像的格式转换任务分配至格式转换任务对应的目标格式转换模块。The processor 1220 acquires the target image and the format conversion task of the target image, and assigns the format conversion task of the target image to the target format conversion module corresponding to the format conversion task.
在一些实施例中,处理器1220还用于将格式转换任务分配至处于空闲状态的目标格式转换模块。In some embodiments, the processor 1220 is further configured to assign the format conversion task to the target format conversion module in the idle state.
在一些实施例中,处理器1220还用于读取缓存模块的缓存空间;在缓存空间大于或等于预设阈值的情况下,将目标图像的格式转换任务分配至目标格式转换模块。In some embodiments, the processor 1220 is further configured to read the cache space of the cache module; when the cache space is greater than or equal to a preset threshold, assign the format conversion task of the target image to the target format conversion module.
在一些实施例中,处理器1220确定格式转换任务的进程信息;在进 程信息为任务完成信息或任务中断信息的情况下,中断格式转换任务,并释放缓存模块中格式转换任务对应的缓存数据。In some embodiments, the processor 1220 determines the process information of the format conversion task; when the process information is task completion information or task interruption information, interrupts the format conversion task, and releases the cached data corresponding to the format conversion task in the cache module.
在一些实施例中,处理器1220根据目标图像的图像参数对目标图像进行压缩;解压缩处于压缩状态的目标图像;输出解压缩后的目标图像。In some embodiments, the processor 1220 compresses the target image according to the image parameters of the target image; decompresses the target image in a compressed state; and outputs the decompressed target image.
在一些实施例中,处理器1220还用于获取目标图像的分割任务;根据目标图像的分割任务分割目标图像。In some embodiments, the processor 1220 is further configured to obtain a segmentation task of the target image; segment the target image according to the segmentation task of the target image.
在一些实施例中,处理器1220还用于获取目标图像的合并任务;根据目标图像的合并任务合并目标图像。In some embodiments, the processor 1220 is further configured to obtain a merging task of the target images; merging the target images according to the merging task of the target images.
应理解的是,本申请实施例中,射频单元1202可用于收发信息或收发通话过程中的信号,具体的,接收基站的下行数据或向基站发送上行数据。射频单元1202包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。It should be understood that, in this embodiment of the present application, the radio frequency unit 1202 may be used to send and receive information or send and receive signals during a call, and specifically, receive downlink data from the base station or send uplink data to the base station. The radio frequency unit 1202 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
网络模块1204为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The network module 1204 provides users with wireless broadband Internet access, such as helping users to send and receive emails, browse web pages, and access streaming media.
音频输出单元1206可以将射频单元1202或网络模块1204接收的或者在存储器1218中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元1206还可以提供与电子设备1200执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元1206包括扬声器、蜂鸣器以及受话器等。The audio output unit 1206 may convert audio data received by the radio frequency unit 1202 or the network module 1204 or stored in the memory 1218 into audio signals and output as sound. Also, the audio output unit 1206 may also provide audio output related to a specific function performed by the electronic device 1200 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 1206 includes a speaker, a buzzer, a receiver, and the like.
输入单元1208用于接收音频或视频信号。输入单元1208可以包括图形处理器(Graphics Processing Unit,GPU)5082和麦克风5084,图形处理器5082对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元1212上,或者存储在存储器1218(或其它存储介质)中,或者经由射频单元1202或网络模块1204发送。麦克风5084可以接收声音,并且能够将声音处理为音频数据,处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元1202发送到移动通信基站的格式输出。The input unit 1208 is used to receive audio or video signals. The input unit 1208 may include a graphics processor (Graphics Processing Unit, GPU) 5082 and a microphone 5084, and the graphics processor 5082 is used for still pictures or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 1212, or stored in the memory 1218 (or other storage medium), or transmitted via the radio frequency unit 1202 or the network module 1204. The microphone 5084 can receive sound, and can process the sound into audio data, and the processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 1202 for output in the case of a telephone call mode.
电子设备1200还包括至少一种传感器1210,比如指纹传感器、压力 传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器、光传感器、运动传感器以及其他传感器。The electronic device 1200 also includes at least one sensor 1210, such as a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, motion sensor, and other sensors.
显示单元1212用于显示由用户输入的信息或提供给用户的信息。显示单元1212可包括显示面板5122,可以采用液晶显示器、有机发光二极管等形式来配置显示面板5122。The display unit 1212 is used to display information input by the user or information provided to the user. The display unit 1212 may include a display panel 5122, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
用户输入单元1214可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元1214包括触控面板5142以及其他输入设备5144。触控面板5142也称为触摸屏,可收集用户在其上或附近的触摸操作。触控面板5142可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1220,接收处理器1220发来的命令并加以执行。其他输入设备5144可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 1214 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 1214 includes a touch panel 5142 and other input devices 5144 . The touch panel 5142, also referred to as a touch screen, collects the user's touch operations on or near it. The touch panel 5142 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 1220, the command sent by the processor 1220 is received and executed. Other input devices 5144 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which are not described herein again.
在一些实施例中,触控面板5142可覆盖在显示面板5122上,当触控面板5142检测到在其上或附近的触摸操作后,传送给处理器1220以确定触摸事件的类型,随后处理器1220根据触摸事件的类型在显示面板5122上提供相应的视觉输出。触控面板5142与显示面板5122可作为两个独立的部件,也可以集成为一个部件。In some embodiments, the touch panel 5142 can be overlaid on the display panel 5122. When the touch panel 5142 detects a touch operation on or near it, it transmits it to the processor 1220 to determine the type of the touch event, and then the processor 1220 provides corresponding visual output on display panel 5122 according to the type of touch event. The touch panel 5142 and the display panel 5122 can be used as two independent components, or can be integrated into one component.
接口单元1216为外部装置与电子设备1200连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元1216可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备1200内的一个或多个元件或者可以用于在电子设备1200和外部装置之间传输数据。The interface unit 1216 is an interface for connecting an external device to the electronic device 1200 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 1216 may be used to receive input (eg, data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 1200 or may be used between the electronic device 1200 and external Transfer data between devices.
存储器1218可用于存储应用程序程序以及各种数据。存储器1218可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、 至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据移动终端的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器1218可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。 Memory 1218 may be used to store application programs and various data. The memory 1218 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data (such as audio data, phone book, etc.) created by the use of the mobile terminal, etc. Additionally, memory 1218 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
处理器1220通过运行或执行存储在存储器1218内的应用程序程序和/或模块,以及调用存储在存储器1218内的数据,执行电子设备1200的各种功能和处理数据,从而对电子设备1200进行整体监控。处理器1220可包括一个或多个处理单元;处理器1220可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要无线通信。The processor 1220 executes various functions of the electronic device 1200 and processes data by running or executing the application programs and/or modules stored in the memory 1218, and calling the data stored in the memory 1218, so as to perform the overall operation of the electronic device 1200. monitor. The processor 1220 may include one or more processing units; the processor 1220 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes Wireless communication.
在本申请的一些实施例中,提供了一种可读存储介质,其上存储有程序或指令,该程序或指令被处理器执行时实现如上述任一实施例中提供的图像处理方法的步骤。In some embodiments of the present application, a readable storage medium is provided, on which programs or instructions are stored, and when the program or instructions are executed by a processor, implement the steps of the image processing method provided in any of the foregoing embodiments .
在本实施例中,可读存储介质能够实现本申请的实施例提供的图像处理方法的各个过程,并能达到相同的技术效果,为避免重复,这里不再赘述。In this embodiment, the readable storage medium can implement each process of the image processing method provided by the embodiments of the present application, and can achieve the same technical effect, which is not repeated here to avoid repetition.
在一些示例中,处理器为上述实施例中的电子设备中的处理器。可读存储介质的示例包括非暂态计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。In some examples, the processor is the processor in the electronic device in the above-described embodiments. Examples of readable storage media include non-transitory computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disks, or optical disks, and the like.
本申请实施例还提供了一种芯片,芯片包括处理器和通信接口,通信接口和处理器耦合,处理器用于运行程序或指令,实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used for running a program or an instruction to implement each process of the above image processing method embodiments, and can achieve the same The technical effect, in order to avoid repetition, will not be repeated here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、 物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved. To perform functions, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to some examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only preferred embodiments of the present application, and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.