WO2014166248A1 - 一种处理预览图像的方法、装置及移动终端 - Google Patents

一种处理预览图像的方法、装置及移动终端 Download PDF

Info

Publication number
WO2014166248A1
WO2014166248A1 PCT/CN2013/086843 CN2013086843W WO2014166248A1 WO 2014166248 A1 WO2014166248 A1 WO 2014166248A1 CN 2013086843 W CN2013086843 W CN 2013086843W WO 2014166248 A1 WO2014166248 A1 WO 2014166248A1
Authority
WO
WIPO (PCT)
Prior art keywords
processing
buffer
preview image
image data
buffers
Prior art date
Application number
PCT/CN2013/086843
Other languages
English (en)
French (fr)
Inventor
马树贤
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2014166248A1 publication Critical patent/WO2014166248A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Definitions

  • the present invention relates to the field of communication and mobile terminals, and in particular, to a method, an apparatus, and a mobile terminal for processing a preview image.
  • Embodiments of the present invention provide a method, a device, and a mobile terminal for processing a preview image, which are used to solve the problem that a real-time special effect photo preview frame rate requirement is relatively high, and a frame rate is low, which may cause image jamming.
  • an embodiment of the present invention provides a method for processing a preview image, including: presetting a plurality of buffers, the plurality of buffers supporting parallel processing of preview image data; receiving from an image sensor Preview image data; transferring the preview image data to a buffer and processing, wherein the buffer is one of a preset plurality of buffers, the plurality of buffers The area is used to support parallel processing of the preview image data.
  • the number of the plurality of buffers is the same as the number of simultaneous parallel processing tasks of the CPU of the mobile terminal.
  • the method further includes: determining whether there is a free buffer in the plurality of buffers; if yes, transmitting the preview image data to an idle buffer The area is processed; if not, it waits until there is a free buffer, and then the preview image data is transferred to the free buffer for processing.
  • the transmitting the preview image data to the buffer for processing comprises: reading the preview image data to be processed from the buffer to perform a special effect processing on the current image, where The buffer is one-to-one bound to the kernel of the CPU currently processing the preview image data; and the preview image data processed by the effect is output.
  • the transferring the preview image data to the buffer for processing comprises: dividing each of the buffers into an input sub-buffer and an output sub-buffer; the input sub-buffer Reading the preview image data to be processed in the buffer to perform a special effect processing on the current image, wherein the buffer is bound one-to-one with the kernel of the CPU currently processing the preview image data; The preview image data after the effect processing is output to the output sub-buffer to wait for the preview image after the effect processing is displayed on the display screen.
  • the method further includes: displaying the preview image in chronological order of the preview image data after the buffer output effect processing.
  • an embodiment of the present invention further provides an apparatus for processing a preview image, including: a receiving module, configured to: receive preview image data from an image sensor; and a processing module, configured to: preset a plurality of buffers, The plurality of buffers support parallel processing of the preview image data, and the preview image data is transmitted to a buffer for processing, wherein the buffer is one of a plurality of preset buffers.
  • the device further includes: a determining module, configured to: determine whether there is a buffer in the plurality of buffers; and the processing module is further configured to: in the multiple buffers In the case where there is a free buffer, the preview image data is transmitted to an idle buffer.
  • the execution module is configured to: in the case that there is no free buffer in the plurality of buffers, wait until the free buffer is available, and then transfer the preview image data to the idle The buffer is processed.
  • the processing module includes: a first processing unit, configured to: read the preview image data to be processed from the buffer to perform a special effect processing on the current image, where The punching area is bound one-to-one with the kernel of the CPU that currently processes the preview image data; the first output unit is configured to: output the preview image data after the special effect processing.
  • the processing module includes: a dividing unit, configured to: divide each of the buffers into an input sub-buffer and an output sub-buffer; and the second processing unit is set as: a buffer Reading the preview image data to be processed in the input sub-buffer to perform a special effect processing on the current image, wherein the buffer is paired with a core of a CPU that currently processes the preview image data a binding; the second output unit is configured to: output the preview image data after the effect processing to the output sub-buffer, to wait for the preview image after the special effect processing is displayed on the display screen.
  • the embodiment of the invention further provides a mobile terminal, comprising: the apparatus for processing a preview image according to any one of the preceding claims.
  • the embodiment of the invention provides a plurality of buffers, which can support parallel processing of preview image data, and change the traditional serial processing mode into a parallel processing mode without changing the special effect processing algorithm, previewing
  • the effect speed is obviously improved, the user experience is improved, and the real-time special effect photo preview frame rate requirement is relatively high, and the image jam is caused when the frame rate is low.
  • FIG. 1 is a flow chart of a method of processing a preview image in an embodiment of the present invention
  • FIG. 2 is a structural block diagram of an apparatus for processing a preview image in an embodiment of the present invention
  • FIG. 3 is a block diagram showing a preferred structure of an apparatus for processing a preview image in an embodiment of the present invention
  • FIG. 4 is a structural block diagram of a processing module of an apparatus for processing a preview image in an embodiment of the present invention
  • FIG. 5 is another structural block diagram of a processing module of an apparatus for processing a preview image in an embodiment of the present invention
  • 6 is a flow chart of processing effect preview image data in a preferred embodiment of the present invention
  • FIG. 7 is a flow chart showing the workflow of special effect processing preview image data in a preferred embodiment of the present invention.
  • the embodiment of the present invention provides a method, a device, and a mobile terminal for processing a preview image.
  • the embodiments of the invention are described in detail. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. In the case of no conflict, the features in the embodiments and the examples in the application can be arbitrarily combined with each other.
  • the embodiment provides a method for processing a preview image.
  • the process of the method is as shown in FIG. 1, and includes steps S102 to S104.
  • Step S102 receiving preview image data from the image sensor.
  • the image sensor is responsible for collecting preview image data (i.e., unprocessed raw image data), and then processing the preview image data to obtain a preview image.
  • preview image data i.e., unprocessed raw image data
  • Step S104 The preview image data is transmitted to a buffer for processing, wherein the buffer is one of a plurality of preset buffers, and the plurality of buffers are used to support parallel processing of the preview image data.
  • a plurality of buffers are provided, and the plurality of buffers can support parallel processing of preview image data, and the traditional serial processing method is changed into a parallel processing manner without changing the special effect processing algorithm, thereby effectively solving
  • the real-time special effects camera preview frame rate is relatively high, and the frame rate is very low, which causes image sticking problems.
  • the number of buffers can be equal to the ability of the CPU to simultaneously process tasks in parallel. If the number of CPU parallel processing tasks is 4 (usually a 4-core phone), the number of buffers can be set to be less than or equal to 4, but Ideally, you can set the number of set buffers to four and bind each buffer to the kernel of a CPU-independent processing task. For example, a dual-core phone sets up two buffers. Today's mobile terminals have large memory, so more buffer settings do not pose a threat to the performance of mobile terminals. This design method allows each CPU to participate in processing, and the processing speed is significantly improved. After receiving the preview image data from the image sensor, if it is directly sent to a buffer, the buffer may be processing the task.
  • the process of transferring the preview image data to the buffer for processing may include: reading the preview image data to be processed from the buffer corresponding to the CPU, and performing the special effect processing on the current image; directly previewing the image after the special effect processing The data is output.
  • each buffer can also be divided into an input sub-buffer and an output sub-buffer, wherein the input sub-buffer is used for The preview image data to be processed is stored, and the output sub-buffer is used to store the processed preview image data.
  • the preview image data to be processed is read from the input sub-buffer to perform the special effect processing on the current image; the preview image data after the special effect processing is output to the output sub-buffer to wait on the display screen. Displays the preview image after the effect processing.
  • the processing speed can be increased.
  • the preview image is displayed in the chronological order of the preview image data after the buffer output effect processing.
  • the embodiment of the present invention further provides an apparatus for processing a preview image, which is configured as shown in FIG. 2, and includes: a receiving module 10 configured to receive preview image data from an image sensor; and a processing module 20 coupled to the receiving module 10, Set to preset a plurality of buffers, the plurality of buffers support parallel processing of preview image data, and transmit preview image data to a buffer for processing, wherein the buffer is a preset plurality of buffers one of the.
  • the embodiment further provides an optimized device, and the structure thereof is as shown in FIG. 3, and further includes:
  • the determining module 30 is coupled to the receiving module 10, and configured to determine whether there are free buffers in the plurality of buffers; the processing module 20 is further coupled to the determining module 30, and is further configured to be in multiple buffers. In the case where there is a free buffer in the area, the preview image data is transferred to the free buffer for processing; the execution module 40 is coupled with the determination module 30 and the processing module 20, and is set not to be in multiple buffers. In the case where there is a free buffer, it waits until there is a free buffer, and then transfers the preview image data to the free buffer for processing.
  • FIG. 4 is a block diagram showing a preferred structure of the processing module 20 in any of the above devices, including: a first processing unit 202 configured to read preview image data to be processed from a corresponding buffer to the current image Performing a special effect processing, wherein the buffer is bound one-to-one with the kernel of the central processing unit CPU that currently processes the preview image data; the first output unit 204 is coupled with the first processing unit 202, and is configured to process the special effects. Preview image data for output.
  • Figure 5 is a block diagram showing another preferred structure of the processing module 20 in any of the above devices, comprising: a dividing unit 206, configured to divide each buffer into an input sub-buffer and an output sub-buffer;
  • the second processing unit 208 is coupled to the dividing unit 206, and configured to read the preview image data to be processed from the input sub-buffer of the corresponding buffer to perform a special effect processing on the current image, where the buffer and the current
  • the kernel of the CPU of the CPU that processes the preview image data is bound one-to-one;
  • the second output unit 210 is coupled to the second processing unit 208, and configured to output the preview image data after the effect processing to the output sub-buffer, Wait for the preview image after the effect processing is displayed on the display.
  • the embodiment further provides a mobile terminal comprising the apparatus for processing a preview image of any of the above.
  • the preferred embodiment improves the photographic effect processing speed and improves the user experience of the photographic application by not modifying the special effect processing algorithm library and performing the special effect processing by multi-threading in parallel.
  • the preview image data transmitted from the Sensor is input as an input, and the preview image data of the Sensor is read for special effect processing. After the special effect processing is completed, the data is sent to the display portion (Display). display.
  • the mobile terminal of the preferred embodiment is a quad-core mobile phone, and the technical solution adopted is as follows:
  • the preview image data allocation buffer transmitted from the sensor is used for special effect processing, buffering.
  • the maximum number of zone allocations is four; find one free from the four buffers and move the sensor data into the buffer. If the four buffer states are not idle, wait until one buffer is idle.
  • Each buffer is bound to the CPU CORE (core), and the bound buffer includes bindings of four worker threads, input, and output sub-buffers.
  • the data is read from the bound input sub-buffer to the worker thread for special effects processing; after the effect processing is completed, the data is moved to the output sub-buffer; from the output sub-buffer Find the oldest data in the area and send the data to the Display for rendering.
  • the raw image data passed from the Sensor is used as input, and a free buffer is searched from the four buffers, and the timestamp is recorded and then moved to the buffer, and then the working thread bound to the buffer.
  • Start special effects processing in the process of special effects processing, if the Sensor has data to send, continue to select a free buffer, if there is no free buffer, then wait; after processing is completed, the processed data will be put Go to the output sub-buffer, and wait for the bound buffer to have new data; continuously extract the oldest data in the output sub-buffer and send it to Display for rendering.
  • serial processing if the time spent on each frame of data is 100ms, the number of seconds is only 10 frames, the user obviously feels that the image is very stuck; after using the solution provided by the invention, it can reach more than 20 frames per second on the quad-core intelligent machine.
  • the preview is very smooth. The above method solves the serial technology scheme currently used, so that the special effect processing speed during the photo preview is very slow, the image often gets stuck, the preview effect speed is obviously improved, the user's use feeling is greatly improved, and the user is more Be happy to take pictures and record a rich and wonderful life.
  • the embodiment of the invention changes the traditional serial processing mode into the parallel processing mode without changing the special effect processing algorithm, and the preview special effect speed is obviously improved, the user experience is improved, and the real-time special effect photo preview frame rate requirement is effectively solved.
  • the frame rate is low, the image may be stuck.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Input (AREA)
  • Television Signal Processing For Recording (AREA)
  • Studio Devices (AREA)
  • Facsimiles In General (AREA)
  • Image Processing (AREA)

Abstract

一种处理预览图像的方法、装置及移动终端,其中,该方法包括:接收来自图像传感器的预览图像数据;将预览图像数据传输至缓冲区进行处理,其中,缓冲区为预设的多个缓冲区中的一个,多个缓冲区用于支持并行处理预览图像数据。

Description

一种处理预览图像的方法、 装置及移动终端 技术领域
本发明涉及通讯及移动终端领域,特别是涉及一种处理预览图像的方法、 装置及移动终端。
背景技术
近两年智能机逐渐淘汰了原来的功能机, 被越来越多的人使用, 并且发 展速度超过了业界所遵循的摩尔定律。 现在的智能机屏幕越来越大, 中央处 理器( Central Processing Unit , 简称为 CPU )从原来的单核变成了更强大的四 核八核、 图像传感器(sensor ) 更是达到了之前专业相机的精度。 与此同时, 微博开始逐渐取代传统媒体、 成为了更流行的一种社交方式, 大家开始记录 平时生活的精彩瞬间、 发送到微博跟其粉丝分享。
作为终端厂商来说, 照相已经成为了提升用户体验、 提高品牌知名度的 一个关键应用。 照相应用从原来的只有拍照功能又增加了很多实时特效和后 期照片处理功能。 对于增加了实时特效照相预览来讲, 帧率要求比较高, 帧 率很低时就会造成图像卡顿; 由于特效处理一般都是通过 CPU进行图像处理 来实现的, 如果特效处理速度慢的话很容易造成预览图像卡住, 跟强大的硬 件配置很不匹配, 并且带来了不好的用户感受。 目前很多特效处理算法相对 成熟, 提升效率的空间有限, 因此, 很难在处理效率上有所提升。
发明内容
本发明实施例提供了一种处理预览图像的方法、 装置及移动终端, 用以 解决实时特效照相预览帧率要求比较高,帧率很低时会造成图像卡顿的问题。
为解决上述技术问题, 一方面, 本发明实施例提供一种处理预览图像的 方法, 包括: 预设多个緩冲区, 所述多个緩冲区支持并行处理预览图像数据; 接收来自图像传感器的预览图像数据; 将所述预览图像数据传输至緩冲区并 进行处理, 其中, 所述緩冲区为预设的多个緩冲区中的一个, 所述多个緩冲 区用于支持并行处理所述预览图像数据。
较佳地,所述多个緩冲区的个数与移动终端的 CPU同时并行处理任务的 个数相同。
较佳地, 接收来自图像传感器的预览图像数据之后, 还包括: 判断所述 多个緩冲区中是否存在空闲的緩冲区; 如果是, 则将所述预览图像数据传输 至空闲的緩冲区进行处理; 如果否, 则等待, 直至有空闲的緩冲区时, 再将 所述预览图像数据传输至空闲的緩冲区进行处理。
较佳地, 将所述预览图像数据传输至緩冲区进行处理包括: 从所述緩冲 区中读取待处理的所述预览图像数据, 以对当前图像进行预订特效处理, 其 中, 所述緩冲区与当前处理所述预览图像数据的 CPU的内核一对一绑定; 将 特效处理后的所述预览图像数据进行输出。
较佳地, 将所述预览图像数据传输至緩冲区进行处理包括: 将每一个所 述緩冲区划分为输入子緩冲区和输出子緩冲区; 从緩冲区的所述输入子緩冲 区中读取待处理的所述预览图像数据, 以对当前图像进行预订特效处理, 其 中, 所述緩冲区与当前处理所述预览图像数据的 CPU的内核一对一绑定; 将 特效处理后的所述预览图像数据输出至所述输出子緩冲区, 以等待在显示屏 上显示特效处理后的预览图像。
较佳地, 将所述预览图像数据传输至緩冲区进行处理之后, 还包括: 按 照所述緩冲区输出特效处理后的所述预览图像数据的时间顺序显示预览图 像。
另一方面, 本发明实施例还提供一种处理预览图像的装置, 包括: 接收 模块, 设置为: 接收来自图像传感器的预览图像数据; 处理模块, 设置为: 预设多个緩冲区, 所述多个緩冲区支持并行处理预览图像数据, 将所述预览 图像数据传输至緩冲区进行处理, 其中, 所述緩冲区为预设的多个緩冲区中 的一个。
较佳地, 所述装置还包括: 判断模块, 设置为: 判断所述多个緩冲区中 是否存在空闲的緩冲区; 所述处理模块, 还设置为: 在所述多个緩冲区中存 在空闲的緩冲区的情况下, 将所述预览图像数据传输至空闲的緩冲区进行处 理; 执行模块, 设置为: 在所述多个緩冲区中不存在空闲的緩冲区的情况下, 等待, 直至有空闲的緩冲区时, 再将所述预览图像数据传输至空闲的緩冲区 进行处理。
较佳地, 所述处理模块包括: 第一处理单元, 设置为: 从所述緩冲区中 读取待处理的所述预览图像数据, 以对当前图像进行预订特效处理, 其中, 所述緩冲区与当前处理所述预览图像数据的 CPU的内核一对一绑定; 第一输 出单元, 设置为: 将特效处理后的所述预览图像数据进行输出。
较佳地, 所述处理模块包括: 划分单元, 设置为: 将每一个所述緩冲区 划分为输入子緩冲区和输出子緩冲区; 第二处理单元, 设置为: 从緩冲区的 所述输入子緩冲区中读取待处理的所述预览图像数据, 以对当前图像进行预 订特效处理, 其中, 所述緩冲区与当前处理所述预览图像数据的 CPU的内核 一对一绑定; 第二输出单元, 设置为: 将特效处理后的所述预览图像数据输 出至所述输出子緩冲区, 以等待在显示屏上显示特效处理后的预览图像。
再一方面, 本发明实施例还提供一种移动终端, 包括: 上述任一项所述 的处理预览图像的装置。
本发明实施例设置了多个緩冲区, 该多个緩冲区可以支持并行处理预览 图像数据, 在不改变特效处理算法的基础之上把传统的串行处理方式变为了 并行处理方式, 预览特效速度明显提升, 提高了用户体验, 有效解决了实时 特效照相预览帧率要求比较高, 帧率很低时会造成图像卡顿的问题。 附图概述
图 1 是本发明实施例中处理预览图像的方法的流程图;
图 2 是本发明实施例中处理预览图像的装置的结构框图;
图 3 是本发明实施例中处理预览图像的装置的优选结构框图;
图 4 是本发明实施例中处理预览图像的装置的处理模块的一种结构框 图;
图 5 是本发明实施例中处理预览图像的装置的处理模块的另一种结构框 图; 图 6 是本发明优选实施例中特效处理预览图像数据的流程图; 图 7 是本发明优选实施例中特效处理预览图像数据的工作流向示意图。 本发明的较佳实施方式
为了解决实时特效照相预览帧率要求比较高, 帧率很低时会造成图像卡 顿的问题, 本发明实施例提供了一种处理预览图像的方法、 装置及移动终端, 以下结合附图, 对本发明实施例进行详细说明。 应当理解, 此处所描述的具 体实施例仅仅用以解释本发明, 并不限定本发明。 在不冲突的情况下, 本申 请中的实施例及实施例中的特征可以相互任意组合。
基于上述问题, 本实施例提供了一种处理预览图像的方法, 该方法的流 程如图 1所示, 包括步骤 S102至步骤 S104。
步骤 S102, 接收来自图像传感器的预览图像数据。
当釆用实时特效来拍照时, 需要在屏幕上呈现釆用了特效之后的预览图 像, 以使得用户方便拍照。 图像传感器负责釆集预览图像数据(即未经处理 的原始图像数据) , 随后将上述预览图像数据进行处理进而得到预览图像。
步骤 S104, 将预览图像数据传输至緩冲区进行处理, 其中, 緩冲区为预 设的多个緩冲区中的一个, 多个緩冲区用于支持并行处理预览图像数据。
本实施例设置了多个緩冲区, 该多个緩冲区可以支持并行处理预览图像 数据, 在不改变特效处理算法的基础之上把传统的串行处理方式变为了并行 处理方式, 有效解决了实时特效照相预览帧率要求比较高, 帧率很低时会造 成图像卡顿的问题。
緩冲区的个数可以根据 CPU 同时并行处理任务的能力相当, 如果 CPU 并行处理任务的个数为 4 (通常为 4核手机) , 可以设置緩冲区的数量少于 或等于 4个, 但较为理想的情况下, 可以将设置緩冲区的个数设置为 4个, 并将每个緩冲区都与一个 CPU独立处理任务的内核进行绑定。 例如, 双核手 机则设置两个緩冲区。 现在的移动终端都具有较大的内存, 因此緩冲区设置 较多也不会对移动终端的性能构成威胁。这种设计方式可以让每个 CPU都参 与处理, 处理速度明显提升。 接收来自图像传感器的预览图像数据之后, 如果直接送至某一緩冲区, 可能该緩冲区正在处理任务, 因此, 还可以判断多个緩冲区中是否存在空闲 的緩冲区; 如果当前存在空闲的緩冲区, 则将预览图像数据传输至空闲的緩 冲区进行处理; 如果当前没有空闲的緩冲区, 则将该预览图像数据排队等待, 直至有空闲的緩冲区时再对预览图像数据进行处理。
将预览图像数据传输至緩冲区进行处理的过程可以包括:从 CPU对应的 緩冲区中读取待处理的预览图像数据, 以对当前图像进行预订特效处理; 直 接将特效处理后的预览图像数据进行输出。
按照上述的方法对预览图像数据进行处理会存在一种情况, 即处理过程 较快, 上一个处理后的数据正在显示, 导致此时输出的数据可能无法显示。 基于上述考虑, 将预览图像数据分配至空闲的緩冲区进行处理时, 还可以将 每一个緩冲区划分为输入子緩冲区和输出子緩冲区, 其中, 输入子緩冲区用 于存储待处理的预览图像数据, 输出子緩冲区用于存储已处理的预览图像数 据。 此时, 从输入子緩冲区中读取待处理的预览图像数据, 以对当前图像进 行预订特效处理; 将特效处理后的预览图像数据输出至输出子緩冲区, 以等 待在显示屏上显示特效处理后的预览图像。
不论通过上述哪种方法对预览图像数据进行处理,都可以加快处理速度。 通过上述方法处理预览图像数据后, 按照緩冲区输出特效处理后的预览图像 数据的时间顺序显示预览图像。
本发明实施例还提供了一种处理预览图像的装置, 其结构如图 2所示, 包括: 接收模块 10, 设置为接收来自图像传感器的预览图像数据; 处理模块 20, 与接收模块 10耦合, 设置为预设多个緩冲区, 所述多个緩冲区支持并行 处理预览图像数据, 将预览图像数据传输至緩冲区进行处理, 其中, 緩冲区 为预设的多个緩冲区中的一个。
接收模块 10接收到预览图像数据后, 如果直接送至某一緩冲区, 可能该 緩冲区正在处理任务, 无法处理该任务。 因此, 本实施例还提供了一种优化 后的装置, 其结构如图 3所示, 还包括:
判断模块 30, 与接收模块 10耦合, 设置为判断多个緩冲区中是否存在 空闲的緩冲区; 处理模块 20, 还与判断模块 30耦合, 还设置为在多个緩冲 区中存在空闲的緩冲区的情况下, 将预览图像数据传输至空闲的緩冲区进行 处理; 执行模块 40, 与判断模块 30和处理模块 20耦合, 设置为在多个緩冲 区中不存在空闲的緩冲区的情况下, 等待, 直至有空闲的緩冲区时, 再将预 览图像数据传输至空闲的緩冲区进行处理。
图 4给出了上述任意一个装置中处理模块 20的一种优选结构框图,包括: 第一处理单元 202 , 设置为从对应的緩冲区中读取待处理的预览图像数据, 以对当前图像进行预订特效处理, 其中, 緩冲区与当前处理预览图像数据的 中央处理器 CPU的内核一对一绑定;第一输出单元 204,与第一处理单元 202 耦合, 设置为将特效处理后的预览图像数据进行输出。
图 5给出了上述任意一个装置中处理模块 20的另一种优选结构框图, 包 括: 划分单元 206 , 设置为将每一个緩冲区划分为输入子緩冲区和输出子緩 冲区; 第二处理单元 208, 与划分单元 206耦合, 设置为从对应緩冲区的输 入子緩冲区中读取待处理的预览图像数据,以对当前图像进行预订特效处理, 其中,緩冲区与当前处理预览图像数据的中央处理器 CPU的内核一对一绑定; 第二输出单元 210, 与第二处理单元 208耦合, 设置为将特效处理后的预览 图像数据输出至输出子緩冲区, 以等待在显示屏上显示特效处理后的预览图 像。
本实施例还提供了一种移动终端, 该移动终端包括上述任一项的处理预 览图像的装置。
优选实施例
本优选实施例在不改动特效处理算法库的基础上, 通过多线程并行进行 特效处理的方法, 有效改善了照相特效处理速度, 提升了照相应用的用户体 验。
图 6示出了本优选实施例的总流程图, 从 Sensor传递过来的预览图像数 据作为输入, 读取 Sensor的预览图像数据进行特效处理, 特效处理完成之后 把数据送给显示部分(Display )进行显示。
本优选实施例的移动终终端为四核手机, 釆用的技术方案如下: 实施过 程中, 为从 sensor传递过来的预览图像数据分配緩冲区进行特效处理, 緩冲 区分配的最大数目为四个; 从四个緩冲区中找到一个空闲的, 把 sensor数据 搬移到该緩冲区中。 如果四个緩冲区状态都不是空闲的, 则等待, 直到有一 个緩冲区为空闲状态。 其中, 各个緩冲区与和 CPU CORE (核心)都是绑定 的, 绑定的緩冲区包括四个工作线程、 输入、 输出子緩冲区的绑定。
当有空闲的緩冲区时, 从绑定的输入子緩冲区中读取数据到工作线程中 进行特效处理; 特效处理完成之后把数据搬移到输出子緩冲区中; 从输出子 緩冲区中找到最早的数据并且把数据送到 Display去渲染。
下面结合图 7对上述过程进行进一步说明。 从 Sensor传递过来的原始图 像数据作为输入, 从四个緩冲区寻找一个空闲的緩冲区, 并且记录好时间戳 再搬移到緩冲区中, 接着和与该緩冲区绑定的工作线程开始进行特效处理; 在特效处理的过程中,如果 Sensor有数据送来,继续选择一个空闲的緩冲区, 如果没有空闲的緩冲区, 则等待; 处理完成之后会把处理好的数据放入到输 出子緩冲区中, 并等待绑定的緩冲区是否有新数据过来; 不断提取输出子緩 冲区当中最早的数据然后发送给 Display去渲染。
使用串行处理方式进行处理, 如果每帧数据花费时间为 100ms, —秒只 有 10帧, 用户明显感觉图像很卡; 使用本发明提供的方案之后在四核智能机 上每秒可以达到 20多帧, 预览很流畅。 上述方法解决了现在所釆用的串行技 术方案使得照相预览时的特效处理速度很慢, 图像经常卡住不动的问题, 预 览特效速度明显提升, 大大提升了用户的使用感觉, 使用户更乐于拍照、 记 录丰富精彩的生活。
尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员 将意识到各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限 于上述实施例。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。
工业实用性
本发明实施例在不改变特效处理算法的基础之上把传统的串行处理方式 变为了并行处理方式, 预览特效速度明显提升, 提高了用户体验, 有效解决 了实时特效照相预览帧率要求比较高, 帧率很低时会造成图像卡顿的问题。

Claims

权 利 要 求 书
1、 一种处理预览图像的方法, 包括:
预设多个緩冲区, 所述多个緩冲区支持并行处理预览图像数据; 接收来自图像传感器的预览图像数据;
将所述预览图像数据传输至所述多个緩冲区中的一个緩冲区并进行处 理。
2、 如权利要求 1所述的方法, 其中, 所述多个緩冲区的个数与移动终端 的中央处理器 CPU同时并行处理任务的个数相同。
3、 如权利要求 1所述的方法, 其中, 接收来自图像传感器的预览图像数 据之后, 还包括:
判断所述多个緩冲区中是否存在空闲的緩冲区;
如果是, 则将所述预览图像数据传输至空闲的緩冲区进行处理; 如果否, 则等待, 直至有空闲的緩冲区时, 再将所述预览图像数据传输 至空闲的緩冲区进行处理。
4、 如权利要求 1至 3中任一项所述的方法, 其中, 将所述预览图像数据 传输至緩冲区进行处理包括:
从所述緩冲区中读取待处理的所述预览图像数据, 以对当前图像进行预 订特效处理, 其中, 所述緩冲区与当前处理所述预览图像数据的中央处理器 CPU的内核一对一绑定;
将特效处理后的所述预览图像数据进行输出。
5、 如权利要求 1至 3中任一项所述的方法, 其中, 将所述预览图像数据 传输至緩冲区进行处理包括:
将每一个所述緩冲区划分为输入子緩冲区和输出子緩冲区;
从所述緩冲区的所述输入子緩冲区中读取待处理的所述预览图像数据, 以对当前图像进行预订特效处理, 其中, 所述緩冲区与当前处理所述预览图 像数据的中央处理器 CPU的内核一对一绑定;
将特效处理后的所述预览图像数据输出至所述输出子緩冲区 , 以等待在 显示屏上显示特效处理后的预览图像。
6、 如权利要求 1所述的方法, 其中, 将所述预览图像数据传输至緩冲区 进行处理之后, 还包括:
按照所述緩冲区输出特效处理后的所述预览图像数据的时间顺序显示预 览图像。
7、 一种处理预览图像的装置, 包括:
接收模块, 其设置为: 接收来自图像传感器的预览图像数据; 以及 处理模块, 其设置为: 预设多个緩冲区, 所述多个緩冲区支持并行处理 预览图像数据 , 将所述预览图像数据传输至所述多个緩冲区中的一个緩冲区 并进行处理。
8、 如权利要求 7所述的装置, 还包括判断模块和执行模块, 其中: 所述判断模块设置为: 判断所述多个緩冲区中是否存在空闲的緩冲区; 所述处理模块, 还设置为: 在所述多个緩冲区中存在空闲的緩冲区的情 况下, 将所述预览图像数据传输至空闲的緩冲区进行处理;
所述执行模块设置为: 在所述多个緩冲区中不存在空闲的緩冲区的情况 下, 等待, 直至有空闲的緩冲区时, 再将所述预览图像数据传输至空闲的緩 冲区进行处理。
9、 如权利要求 7或 8所述的装置, 其中, 所述处理模块包括:
第一处理单元, 其设置为: 从所述緩冲区中读取待处理的所述预览图像 数据, 以对当前图像进行预订特效处理, 其中, 所述緩冲区与当前处理所述 预览图像数据的中央处理器 CPU的内核一对一绑定;
第一输出单元, 其设置为: 将特效处理后的所述预览图像数据进行输出。
10、 如权利要求 7或 8所述的装置, 其中, 所述处理模块包括: 划分单元, 其设置为: 将每一个所述緩冲区划分为输入子緩冲区和输出 子緩冲区;
第二处理单元, 其设置为: 从所述緩冲区的所述输入子緩冲区中读取待 处理的所述预览图像数据, 以对当前图像进行预订特效处理, 其中, 所述緩 冲区与当前处理所述预览图像数据的中央处理器 CPU的内核一对一绑定; 第二输出单元, 其设置为: 将特效处理后的所述预览图像数据输出至所 述输出子緩冲区, 以等待在显示屏上显示特效处理后的预览图像。
11、 一种移动终端, 包括: 权利要求 7至 10中任一项所述的处理预览图 像的装置。
PCT/CN2013/086843 2013-07-11 2013-11-11 一种处理预览图像的方法、装置及移动终端 WO2014166248A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310290387.4A CN104284076A (zh) 2013-07-11 2013-07-11 一种处理预览图像的方法、装置及移动终端
CN201310290387.4 2013-07-11

Publications (1)

Publication Number Publication Date
WO2014166248A1 true WO2014166248A1 (zh) 2014-10-16

Family

ID=51688915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/086843 WO2014166248A1 (zh) 2013-07-11 2013-11-11 一种处理预览图像的方法、装置及移动终端

Country Status (2)

Country Link
CN (1) CN104284076A (zh)
WO (1) WO2014166248A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104902093A (zh) * 2015-05-28 2015-09-09 广东欧珀移动通信有限公司 一种防止移动终端卡顿死机的方法及装置
CN109076146A (zh) * 2016-04-15 2018-12-21 索尼公司 摄像元件、摄像装置和用于摄像元件的控制方法
CN114125277A (zh) * 2021-11-12 2022-03-01 北京达佳互联信息技术有限公司 控制应用的视频拍摄特效的方法及设备

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105472259A (zh) * 2016-01-21 2016-04-06 腾讯科技(深圳)有限公司 一种图像处理方法、设备及终端
CN106791408A (zh) * 2016-12-27 2017-05-31 努比亚技术有限公司 一种拍摄预览装置、终端及方法
CN108540710A (zh) * 2017-03-02 2018-09-14 上海传英信息技术有限公司 基于智能终端的图像处理方法、图像处理系统及智能终端
CN109618207B (zh) * 2018-12-21 2021-01-26 网易(杭州)网络有限公司 视频帧的处理方法、装置、存储介质及电子装置
CN110278373A (zh) * 2019-06-26 2019-09-24 Oppo广东移动通信有限公司 图像处理器、图像处理方法、拍摄装置和电子设备
CN114845036B (zh) * 2021-02-01 2023-09-12 Oppo广东移动通信有限公司 电子设备、图像处理器、应用处理器及图像处理方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650820A (zh) * 2009-09-24 2010-02-17 浙江大学 基于多核架构的大图像实时浏览方法
CN102016912A (zh) * 2008-05-02 2011-04-13 诺基亚公司 提供改进的图像捕获的方法、计算机程序产品和装置
CN102368779A (zh) * 2011-01-25 2012-03-07 麦克奥迪实业集团有限公司 一种用于移动互联网设备的超大图像加载显示方法
CN102393950A (zh) * 2010-06-29 2012-03-28 索尼公司 信息处理装置和信息处理方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102016912A (zh) * 2008-05-02 2011-04-13 诺基亚公司 提供改进的图像捕获的方法、计算机程序产品和装置
CN101650820A (zh) * 2009-09-24 2010-02-17 浙江大学 基于多核架构的大图像实时浏览方法
CN102393950A (zh) * 2010-06-29 2012-03-28 索尼公司 信息处理装置和信息处理方法
CN102368779A (zh) * 2011-01-25 2012-03-07 麦克奥迪实业集团有限公司 一种用于移动互联网设备的超大图像加载显示方法

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104902093A (zh) * 2015-05-28 2015-09-09 广东欧珀移动通信有限公司 一种防止移动终端卡顿死机的方法及装置
CN104902093B (zh) * 2015-05-28 2017-09-01 广东欧珀移动通信有限公司 一种防止移动终端卡顿死机的方法及装置
CN109076146A (zh) * 2016-04-15 2018-12-21 索尼公司 摄像元件、摄像装置和用于摄像元件的控制方法
EP3445031A4 (en) * 2016-04-15 2019-04-03 Sony Corporation IMAGE CAPTURE ELEMENT, IMAGE CAPTURE APPARATUS, AND METHOD FOR CONTROLLING IMAGE CAPTURE ELEMENT
US10645279B2 (en) 2016-04-15 2020-05-05 Sony Corporation Imaging element, imaging apparatus, and control method for imaging element
US11265465B2 (en) 2016-04-15 2022-03-01 Sony Corporation Imaging element, imaging apparatus, and control method for imaging element
CN114125277A (zh) * 2021-11-12 2022-03-01 北京达佳互联信息技术有限公司 控制应用的视频拍摄特效的方法及设备
CN114125277B (zh) * 2021-11-12 2024-02-09 北京达佳互联信息技术有限公司 控制应用的视频拍摄特效的方法及设备

Also Published As

Publication number Publication date
CN104284076A (zh) 2015-01-14

Similar Documents

Publication Publication Date Title
WO2014166248A1 (zh) 一种处理预览图像的方法、装置及移动终端
US9275604B2 (en) Constant speed display method of mobile device
WO2017092335A1 (zh) 一种显示立体图像的处理方法和装置
TWI242139B (en) Apparatus, method and system for rendering multiple images
US10241799B2 (en) Out-of-order command execution with sliding windows to maintain completion statuses
WO2021031850A1 (zh) 图像处理的方法、装置、电子设备及存储介质
CN104410785A (zh) 一种信息处理方法及电子设备
JP2017532645A (ja) 通話中のリアルタイム共有
EP3335107A1 (en) Data reordering using buffers and memory
TWI566597B (zh) 用於擷取影像之記事板
CN109151966A (zh) 终端控制方法、装置、终端设备及存储介质
US9508109B2 (en) Graphics processing
WO2018085982A1 (zh) 视频录制方法、装置及拍摄设备
WO2007122762A1 (ja) 画像表示装置、画像表示方法、情報処理装置、情報処理方法、及び情報記憶媒体
WO2021073206A1 (zh) 视频预览的方法、装置、存储介质及电子设备
WO2017063133A1 (zh) 一种拍摄方法和移动设备
US20110242115A1 (en) Method for performing image signal processing with aid of a graphics processing unit, and associated apparatus
US9554173B1 (en) News production system with dynamic media server allocation
JP6231702B2 (ja) ビデオ増進された写真ブラウジングのための装置、方法、及びコンピュータ・プログラム製品
WO2018049939A1 (zh) 数据迁移方法及相关产品
US20180288319A1 (en) Sharing panoramic video images over a wireless display session
WO2019184317A1 (zh) 设置背景图片的方法、装置、设备及存储介质
JP2014146248A (ja) 表示制御装置、表示制御方法およびプログラム
WO2018201993A1 (zh) 图像绘制方法、终端及存储介质
US20140193083A1 (en) Method and apparatus for determining the relationship of an image to a set of images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13881611

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13881611

Country of ref document: EP

Kind code of ref document: A1