WO2019061054A1 - 图像处理方法、处理系统及电子设备 - Google Patents

图像处理方法、处理系统及电子设备 Download PDF

Info

Publication number
WO2019061054A1
WO2019061054A1 PCT/CN2017/103601 CN2017103601W WO2019061054A1 WO 2019061054 A1 WO2019061054 A1 WO 2019061054A1 CN 2017103601 W CN2017103601 W CN 2017103601W WO 2019061054 A1 WO2019061054 A1 WO 2019061054A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
image
cameras
image processing
generate
Prior art date
Application number
PCT/CN2017/103601
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 深圳传音通讯有限公司
Priority to PCT/CN2017/103601 priority Critical patent/WO2019061054A1/zh
Priority to CN201780097104.0A priority patent/CN111373731B/zh
Publication of WO2019061054A1 publication Critical patent/WO2019061054A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the present invention relates to the field of mobile communications technologies, and in particular, to an image processing method, a processing system, and an electronic device.
  • FIG. 1 it is a schematic flowchart of image processing when only one camera is detected in the prior art; as shown in FIG. 1 , the existing image processing method includes:
  • Step S11 detecting a camera of the electronic device; that is, when starting the mobile phone or starting the camera function, first scanning the camera;
  • Step S12 when it is detected that the number of cameras is only one, the camera is determined as a rear camera;
  • step S13 the image captured by the camera is rotated by 90° to generate a preview image.
  • the post-shooting direction is 90°
  • the front-out direction is 270°. This leads to the installation only.
  • the pre-photograph should be processed according to 270°, and the result is recognized as a post-shoot by default. Passing the parameter to 0, it becomes 90° to process, so that the proactive preview photo is inverted.
  • An object of the present invention is to provide an image processing method, a processing system, and an electronic device, which can effectively identify the type of the camera, and thus correctly process the image captured by the camera to effectively improve the performance of the electronic device.
  • the present invention provides an image processing method, including: detecting a camera of an electronic device; identifying a type of the camera when the number of cameras is detected; and when identifying that the camera is a front camera, The image taken by the camera is rotated by 270° to generate a preview image.
  • the image processing method further includes: when the camera is recognized as a rear camera, the image captured by the camera is rotated by 90° to generate a preview image.
  • the image processing method further includes: when detecting that the number of cameras is two, respectively identifying the types of the two cameras; performing 270° rotation on the image captured by the front camera to generate a preview image, or The image taken by the rear camera is rotated by 90° to generate a preview image.
  • the step of respectively identifying the types of the two cameras includes: respectively acquiring the identification data of the two cameras on the architecture platform; determining the rear camera according to the acquired identification data. Or front camera.
  • the step of identifying the type of the camera includes: acquiring ID data of the camera; determining, according to the acquired ID data, the camera as a front camera or a rear camera.
  • the present invention also provides an image processing system, comprising: a detecting module, configured to detect a camera of the electronic device; and an identifying module, configured to identify a type of the camera when the number of the cameras is detected; the processing module is configured to be used as When it is recognized that the camera is a front camera, the image captured by the camera is rotated by 270° to generate a preview image.
  • the processing module is further configured to: when the camera is recognized as a rear camera, rotate the image captured by the camera by 90° to generate a preview image.
  • the identification module is further configured to separately identify the types of the two cameras when the number of the cameras is two; the processing module is configured to perform the image captured by the front camera
  • the identification module includes: an obtaining unit, configured to acquire ID data of the camera; and a determining unit, configured to determine, according to the acquired ID data, the camera as a front camera or a rear camera.
  • the invention also provides an electronic device comprising the image processing system of any of the preceding claims.
  • the image processing method, the processing system, and the electronic device of the present invention have the following advantages compared with the prior art:
  • the image processing method, the processing system and the electronic device of the invention can accurately identify the type of the camera, so that accurate image processing can be performed according to different types of cameras, thus effectively avoiding image rendering errors and improving device performance. .
  • FIG. 1 is a schematic flow chart of image processing when only one camera is detected in the prior art
  • FIG. 2 is a schematic structural diagram of an implementation manner of an image processing system according to the present invention.
  • FIG. 3 is a schematic flow chart of an implementation manner of an image processing method in the present invention.
  • FIG. 4 is a schematic flow chart of another implementation manner of an image processing method in the present invention.
  • the terms “including”, “comprising”, “having”, or any other variants are intended to encompass a non-exclusive inclusion, such that a process, method, article, or terminal device that includes a plurality of elements includes not only those elements but also Includes other elements not explicitly listed, or elements that are inherent to such a process, method, item, or terminal device.
  • An element defined by the phrase “including” or “comprising” does not exclude the presence of additional elements in the process, method, article or terminal device including the element.
  • “greater than”, “less than”, “exceeded”, etc. are understood as not including the number; “above”, “below”, “inside”, etc. are understood to include the number.
  • the image processing system, the image processing method, and the electronic device of the present embodiment are all described by taking an Android system as an example and Google's mobile phone architecture platform as an example.
  • the Android system is generally applied to a mobile intelligent terminal such as a mobile phone, or a tablet computer, or a smart wearable device (including a smart watch or a smart bracelet), and includes: a kernel driver layer (Kernel), which is a mobile intelligent terminal.
  • Kernel is a mobile intelligent terminal.
  • the hardware driver running layer is an abstraction layer between hardware and software processes; the framework layer is a link layer connecting the application layer and the kernel driver layer; the application layer (App) is in the mobile intelligent terminal. Each application process runs at this level.
  • FIG. 2 is a schematic structural diagram of an image processing system provided by the present invention.
  • the image processing system includes:
  • the detecting module 10 is configured to detect a camera of the electronic device
  • the detecting module 10 can be implemented by combining related hardware and software components.
  • the event monitor implements the detection function of the camera.
  • the event monitor receives event information from a peripheral device interface.
  • the event information includes information about sub-events (eg, user touches on a touch-sensitive display system that is part of a multi-touch gesture).
  • the peripheral device interface transmits information it receives from an I/O subsystem or sensor, such as a proximity sensor, an accelerometer, and/or a microphone (via an audio circuit).
  • the information that the peripheral interface receives from the I/O subsystem includes information from the touch-sensitive display system or touch-sensitive surface, and the like.
  • the event monitor sends a request to the peripheral device interface at predetermined intervals.
  • the peripheral interface transmits event information.
  • the peripheral device interface transmits event information only when there are significant events (eg, receiving an input that exceeds a predetermined noise threshold and/or is longer than a predetermined duration).
  • the identification module 20 is configured to identify the type of the camera when the number of cameras is one;
  • the identification module 20 includes: an obtaining unit and a determining unit (not shown).
  • the obtaining unit is configured to acquire ID data of the camera;
  • the determining unit is configured to determine, according to the acquired ID data, that the camera is a front camera or a rear camera.
  • the identification module 20 in this embodiment accurately determines the type of the detected camera by directly acquiring the ID data of the camera; thereby avoiding the default of the camera when there is only one camera in the prior art. The problem with the rear camera.
  • the processing module 30 is configured to: when the camera is recognized as the front camera, rotate the image captured by the camera by 270° to generate a preview image.
  • the detecting module, the identifying module and the processing module can all be completed by corresponding hardware and software components, and the software component can include an operating system, a communication module (or an instruction set), a contact/motion module (or an instruction set), and a graphic module ( Or instruction set), user interface status module (or instruction set), and one or more applications (or instruction sets).
  • Operating systems such as Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS, or embedded operating systems such as Vxworks
  • various software components and/or drivers that facilitate communication between various hardware and software components.
  • the identification module 20 provides an accurate basis for the processing of the processing module 30. Therefore, the processing module 30 performs corresponding processing on the image to ensure that the final generated preview image is accurate, which is effective. Improve the performance of the device, but also great Improve the user experience.
  • the processing module 30 is further configured to: when the camera is recognized as a rear camera, rotate the image captured by the camera by 90° to generate a preview image.
  • the processing module 30 rotates the image by 90° according to the recognition result to ensure that the finally generated preview image is forward, thereby improving the user experience.
  • the identification module 20 is further configured to identify the types of the two cameras when the number of the cameras is two; the processing module 30 is further configured to recognize that the camera is captured by the front camera. The image is rotated by 270° to generate a preview image, or the image captured as the rear camera is rotated by 90° to generate a preview image.
  • the specific identifying process is: acquiring the identification data of the two cameras on the architecture platform respectively. ; Determine the rear camera or front camera based on the acquired identification data. That is to say, when two cameras are detected, it is confirmed that the front camera and the rear camera are all running normally, so that in order to improve the recognition efficiency, the identification data of the camera can be obtained directly from the architecture platform (for example, on the Google architecture) : The identification data of the rear camera is 0, and the identification data of the front camera is 1); the type of the camera can be quickly and accurately confirmed by the identification data of the camera.
  • the processing module 30 After determining the type of the camera, the processing module 30 performs accurate processing on the captured data according to the type of the camera, thereby ensuring that the final preview image is positive. For example, an image recognized as a front camera is rotated by 270° to generate a preview image; and an image recognized as a rear camera is rotated by 90° to generate a preview image.
  • the processing module of this embodiment may be implemented by an image processor, a CPU, an MCU, or the like. More specifically, the processor may execute instructions stored in a memory and/or non-volatile storage device to perform operations in the computing device, such as generating image data and/or transmitting image data to an electronic display. As such, the processor may include one or more general purpose microprocessors, one or more application specific processors (ASICs), one or more field programmable logic arrays (FPGAs), or any combination thereof.
  • ASICs application specific processors
  • FPGAs field programmable logic arrays
  • Software components stored in memory include an operating system, a communication module (or set of instructions), a contact/motion module (or set of instructions), a graphics module (or set of instructions), a haptic feedback module (or set of instructions), a text input module ( Or instruction set), Global Positioning System (GPS) module (or instruction set), and application (or instruction set).
  • the memory or memory stores the device/global internal state.
  • the device/global internal state includes one or more of the following: active application state, indicating the currently active application (if any) Display status, indicating which applications, views, or other information occupy various areas of the touch-sensitive display system; sensor status, including information obtained from various sensors and other input or control devices of the device; and location of the device and/or Or position and/or positioning information related to the posture.
  • the memory can include high speed random access memory and can also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices.
  • the memory may also include memory remote from one or more processors, such as network attached memory accessed via RF circuitry or external ports and a communication network (not shown), where the communication network may be the Internet One or more internal networks, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), etc., or a suitable combination thereof.
  • the memory controller can control access to the memory by other components of the device, such as the CPU and peripheral interfaces.
  • FIG. 2 The working process of the image processing system shown in FIG. 2 will be further described in detail below in conjunction with specific implementations. It is assumed that the image processing system is applied to a smartphone, and the smartphone is configured with a front camera and a rear camera.
  • the camera is scanned by the detecting module 10; under normal circumstances, there should be two cameras scanned, that is, the front camera and the rear camera are described. At this time, it is indicated that the two cameras of the smart phone can operate normally. At this time, the types of the two cameras are respectively identified by the identification module 20, and the identification process at this time is: acquiring the two cameras on the architecture platform respectively. Identification data; determining a rear camera or a front camera based on the acquired identification data.
  • the identification data of the camera can be obtained directly from the architecture platform (for example, on the Google architecture) :
  • the identification data of the rear camera is 0, and the identification data of the front camera is 1); the type of the camera can be quickly and accurately confirmed by the identification data of the camera.
  • the processing module 30 After determining the type of the camera, the processing module 30 performs accurate processing on the captured data according to the type of the camera, thereby ensuring that the final preview image is positive. For example, an image recognized as a front camera is rotated by 270° to generate a preview image; and an image recognized as a rear camera is rotated by 90° to generate a preview image. Through such processing, images captured by either the front camera or the rear camera can be presented to the user in the forward direction, thereby improving the user experience.
  • the type of the camera scanned before is recognized; if the type of the camera is not accurately obtained by acquiring the identification data from the architecture platform, the ID data of the camera needs to be acquired by the identification module 20, and the ID data can be accurately obtained.
  • the camera is determined to be a rear camera or a front camera.
  • the processing module 30 rotates the captured image by 90° to generate a preview image; instead, if the captured camera is acquired When it is a front camera, it is necessary for the processing module 30 to rotate the captured image by 270° to generate a preview image.
  • the type of the camera can be accurately determined, thereby providing an accurate basis for subsequent image processing, thereby improving the performance of the device and improving the user experience.
  • the invention also provides an electronic device comprising the image processing system of any of the preceding claims.
  • the electronic device includes, but is not limited to, a handheld computer, a tablet computer, a mobile phone, a smart phone, a media player, a personal digital assistant (PDA), etc., and a combination of two or more of them.
  • the electronic device is an Android (Android) operating system based smart device, where the Android operating system includes: an Android native operating system and an improved operating system based on the Android kernel.
  • examples of operating systems based on the improved Android kernel are not limited to: EMUI developed by Huawei, MIUI developed by Huawei, and the like. Also included are combinations of two or more of them.
  • the electronic device typically includes a memory, a memory controller, one or more processing units (CPUs), peripheral interfaces, RF circuits, audio circuits, speakers, microphones, input/output (I/O) subsystems, touch screens, others Output or control device, as well as external ports. These components communicate over one or more communication buses or signal lines. It should be understood that the electronic device in this embodiment is only an example. In a specific application, the components of the electronic device may have more or fewer components in the embodiment, or have different component configurations; and various components. This can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the electronic device can also include a power system for powering various components.
  • the power system can include a power management system, one or more power sources (eg, battery, alternating current (AC)), charging system, power failure detection circuit, power converter or inverter, power status indicator (eg, light emitting diode (LED) )), as well as any other components associated with power generation, management, and distribution in portable devices.
  • FIG. 3 is a schematic flowchart diagram of an implementation manner of an image processing method provided by the present invention, The image processing method includes:
  • Step S10 detecting a camera of the electronic device
  • step S10 can be implemented by a combination of related hardware and software components, such as an event monitor to implement a camera detection function.
  • the event monitor receives event information from a peripheral device interface.
  • the event information includes information about sub-events (eg, user touches on a touch-sensitive display system that is part of a multi-touch gesture).
  • the peripheral device interface transmits information it receives from an I/O subsystem or sensor, such as a proximity sensor, an accelerometer, and/or a microphone (via an audio circuit).
  • the information that the peripheral interface receives from the I/O subsystem includes information from the touch-sensitive display system or touch-sensitive surface, and the like.
  • the event monitor sends a request to the peripheral device interface at predetermined intervals.
  • the peripheral interface transmits event information.
  • the peripheral device interface transmits event information only when there are significant events (eg, receiving an input that exceeds a predetermined noise threshold and/or is longer than a predetermined duration).
  • Step S20 determining whether the camera is one
  • step S30 is performed to identify the type of the camera; in other words, determine whether the camera is a front camera;
  • the step of identifying the type of the camera includes: acquiring ID data of the camera; and determining, according to the acquired ID data, the camera as a front camera or a rear camera.
  • the type of the detected camera is accurately determined by directly acquiring the ID data of the camera; thereby avoiding the prior art that when there is only one camera, the camera is defaulted to the rear camera. The problem.
  • step S40 is performed, and the image captured by the camera is rotated by 270° to generate a preview image.
  • the image is processed correspondingly to ensure that the final generated preview image is accurate, thus effectively improving the performance of the device. At the same time, it greatly improves the user experience.
  • the image processing method further includes: Step S50, when it is recognized that the camera is a rear camera, the image captured by the camera is rotated by 90° to generate a preview image.
  • the processing module 30 rotates the image by 90° according to the recognition result to ensure that the finally generated preview image is forward, thereby improving the user experience.
  • FIG. 4 is a schematic flowchart of another implementation manner of an image processing method according to the present invention.
  • the image processing method is similar to the image processing method shown in FIG. 3, and includes: Step S10: detecting a camera of an electronic device;
  • the detection module 10 can be implemented by a combination of related hardware and software components, such as an event monitor to implement a camera detection function.
  • the event monitor receives event information from a peripheral device interface.
  • the event information includes information about sub-events (eg, user touches on a touch-sensitive display system that is part of a multi-touch gesture).
  • the peripheral device interface transmits information it receives from an I/O subsystem or sensor, such as a proximity sensor, an accelerometer, and/or a microphone (via an audio circuit).
  • the information that the peripheral interface receives from the I/O subsystem includes information from the touch-sensitive display system or touch-sensitive surface, and the like.
  • the event monitor sends a request to the peripheral device interface at predetermined intervals.
  • the peripheral interface transmits event information.
  • the peripheral device interface transmits event information only when there are significant events (eg, receiving an input that exceeds a predetermined noise threshold and/or is longer than a predetermined duration).
  • Step S20 determining whether the camera is one
  • step S30 is performed to identify the type of the camera; in other words, determine whether the camera is a front camera;
  • the step of identifying the type of the camera includes: acquiring ID data of the camera; and determining, according to the acquired ID data, the camera as a front camera or a rear camera.
  • step S40 is performed, and the image captured by the camera is rotated by 270° to generate a preview image.
  • the image is processed correspondingly to ensure that the final generated preview image is accurate, thus effectively improving the performance of the device. At the same time, it greatly improves the user experience.
  • step S50 the image captured by the camera is rotated by 90° to generate a preview image.
  • the image processing method of the embodiment further includes: when detecting that the number of cameras is two, performing step S60 to identify the types of the two cameras respectively; It is recognized that the image taken by the front camera is rotated by 270° to generate a preview image, or the image recognized as the rear camera is rotated by 90° to generate a preview image.
  • the step of respectively identifying the types of the two cameras includes: respectively acquiring the identification data of the two cameras on the architecture platform; determining the rear camera according to the acquired identification data. Or front camera.
  • the specific identification process is: acquiring the identification data of the two cameras on the architecture platform respectively; according to the acquired The identification data determines the rear camera or front camera. That is to say, when two cameras are detected, it is confirmed that the front camera and the rear camera are all running normally, so that in order to improve the recognition efficiency, the identification data of the camera can be obtained directly from the architecture platform (for example, on the Google architecture) : The identification data of the rear camera is 0, and the identification data of the front camera is 1); the type of the camera can be quickly and accurately confirmed by the identification data of the camera.
  • the processing module 30 After determining the type of the camera, the processing module 30 performs accurate processing on the captured data according to the type of the camera, thereby ensuring that the final preview image is positive. For example, an image recognized as a front camera is rotated by 270° to generate a preview image; and an image recognized as a rear camera is rotated by 90° to generate a preview image.
  • the image processing method of this embodiment can be implemented by the aforementioned image processing system, and specifically, can be implemented by an image processor, a CPU, an MCU, or the like. More specifically, the processor may execute instructions stored in a memory and/or non-volatile storage device to perform operations in the computing device, such as generating image data and/or transmitting image data to an electronic display. As such, the processor may include one or more general purpose microprocessors, one or more application specific processors (ASICs), one or more field programmable logic arrays (FPGAs), or any combination thereof.
  • ASICs application specific processors
  • FPGAs field programmable logic arrays
  • Software components stored in memory include an operating system, a communication module (or set of instructions), a contact/motion module (or set of instructions), a graphics module (or set of instructions), a haptic feedback module (or set of instructions), a text input module ( Or instruction set), Global Positioning System (GPS) module (or instruction set), and application (or instruction set).
  • the memory or memory stores the device/global internal state.
  • the device/global internal state includes one or more of the following: an active application state indicating the currently active application (if any), and a display status indicating which applications, views, or other information occupy the touch-sensitive display system. Area; sensor status, including information obtained from various sensors and other input or control devices of the device; and location and/or positioning information related to the position and/or posture of the device.
  • the memory can include high speed random access memory and can also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices.
  • the memory may also include memory remote from one or more processors, such as network attached memory accessed via RF circuitry or external ports and a communication network (not shown), where the communication network may be the Internet One or more internal networks, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), etc., or a suitable combination thereof.
  • the memory controller can control access to the memory by other components of the device, such as the CPU and peripheral interfaces.
  • the camera when the smart booting is started (or when the camera function is turned on), the camera is scanned first; under normal circumstances, there should be two cameras scanned, that is, the front camera and the rear camera are described, At this time, it is indicated that the two cameras of the smart phone can operate normally. At this time, the types of the two cameras are separately identified.
  • the identification process at this time is: acquiring the identification data of the two cameras on the architecture platform respectively; The rear camera or the front camera is determined based on the acquired identification data.
  • the identification data of the camera can be obtained directly from the architecture platform (for example, on the Google architecture) :
  • the identification data of the rear camera is 0, and the identification data of the front camera is 1); the type of the camera can be quickly and accurately confirmed by the identification data of the camera.
  • the processing module 30 After determining the type of the camera, the processing module 30 performs accurate processing on the captured data according to the type of the camera, thereby ensuring that the final preview image is positive. For example, an image recognized as a front camera is rotated by 270° to generate a preview image; and an image recognized as a rear camera is rotated by 90° to generate a preview image. Through such processing, images captured by either the front camera or the rear camera can be presented to the user in the forward direction, thereby improving the user experience.
  • the camera is a rear camera or a front camera. If the acquired camera is a rear camera, the processing module 30 rotates the captured image by 90° to generate a preview image; on the contrary, if the acquired camera is the front When the camera is placed, the captured image is required to be rotated by 270° by the processing module 30 to generate a preview image.
  • the type of the camera can be accurately determined, thereby providing an accurate basis for subsequent image processing, thereby improving the performance of the device and improving the user experience.
  • the image processing method, the processing system, and the electronic device provided by the present invention can accurately obtain the type of the camera in different situations by detecting the number of cameras to distinguish the type of the camera.
  • the accurate processing of the final image is effectively ensured, and the user experience is greatly improved; in addition, the acquisition mode of different types of cameras can effectively improve the processing efficiency and further improve the performance of the device.
  • the image processing method, the processing system and the electronic device of the present invention have the following advantages: the accurate acquisition of the type of the camera provides a basis for the subsequent image processing mode, thereby greatly improving the image processing. Accuracy, while also improving the performance of the device and the user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

本发明涉及一种图像处理方法、图像处理系统及电子设备。所述图像处理方法,包括:检测电子设备的摄像头;当检测到摄像头的数量为一个时,识别该摄像头的类型;当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。所述图像处理系统包括:检测模块,用于检测电子设备的摄像头;识别模块,用于当检测到摄像头的数量为一个时,识别该摄像头的类型;处理模块,用于当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。本发明能够准确的识别摄像头的类型,从而可以根据摄像头的不同类型进行准确的图像处理,这样,有效的避免了图像的呈现错误,进而提高了设备的性能。

Description

图像处理方法、处理系统及电子设备 技术领域
本发明涉及移动通信技术领域,特别涉及一种图像处理方法、处理系统及电子设备。
背景技术
随着技术的发展与进步,智能终端越来越多的被人们广泛使用,,并且智能终端的功能越来越强大,以手机为例,目前大部分的手机均具有摄像头,以实现拍照或摄影的目的。随着人们对拍照或摄影的要求越来越高,许多手机均配置有前置摄像头或后置摄像头。
一般来讲,人们对于后置摄像头的使用更加频繁,且对图像的清晰度要求更高,因此后置摄像头的像素要高于前置摄像头的像素。目前终端用户在购买手机后,因为各种不确定因素造成后摄像头损坏或者后摄像头识别不到,只能使用前摄时,然而前摄预览拍照还是倒置的,结果一个后摄的损坏导致前后摄都不能使用,这样的体验非常差。
这是因为,在Google架构上的后摄像头是用0来表示,前摄像头是用1来表示,由于只有一颗摄像头的情况下,不论安装的是前摄模组还是后摄模组,代码架构无法来做区分,都是默认当做后摄来处理,所以只安装前摄的情况下,也是当做后摄0来处理。具体地,参考图1,为现有技术中仅检测到一个摄像头时图像处理的流程示意图;如图1所示,现有的图像处理方法包括:
步骤S11,检测电子设备的摄像头;也就是说,在启动手机时或者启动摄像功能时,首先扫描摄像头;
步骤S12,当检测到摄像头的数量仅为一个时,将该摄像头确定为后置摄像头;
步骤S13,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
而架构平台上为了保证前后摄的出图方向是正确的,已经做了统一处理,后摄出图方向做90°处理,前摄出图方向做270°处理,这样就导致了只安装前摄的时候,前摄本应该按照270°来处理出图,结果被默认识别成后摄, 传参数为0,就变成了90°来处理,从而使得前摄预览拍照倒置。
也就是说,现有技术中后置摄像头不被识别或者损坏后,通过前置摄像头拍摄成型的图像是倒置的,从而导致用户的体验差。
发明的公开
本发明的目的是提供一种图像处理方法、处理系统及电子设备,能够有效的识别摄像头的类型,进而正确的对摄像头拍摄的图像进行处理,以有效的提高电子设备的性能。
为实现上述目的,本发明提供一种图像处理方法,包括:检测电子设备的摄像头;当检测到摄像头的数量为一个时,识别该摄像头的类型;当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
所述图像处理方法还包括:当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
所述图像处理方法还包括:当检测到摄像头的数量为两个时,分别识别两个摄像头的类型;将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
所述当检测到摄像头的数量为两个时,分别识别两个摄像头的类型的步骤包括:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。
所述当检测到摄像头的数量为一个时,识别该摄像头的类型的步骤包括:获取该摄像头的ID数据;根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
本发明还提供一种图像处理系统,包括:检测模块,用于检测电子设备的摄像头;识别模块,用于当检测到摄像头的数量为一个时,识别该摄像头的类型;处理模块,用于当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
所述处理模块还用于当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
所述识别模块还用于当检测到摄像头的数量为两个时,分别识别两个摄像头的类型;所述处理模块用于将识别为前置摄像头所拍摄的图像进行
270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
所述识别模块包括:获取单元,用于获取该摄像头的ID数据;确定单元,用于根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
本发明还提供一种电子设备,包括如前述任一项所述的图像处理系统。
综上所述,本发明所述的图像处理方法、处理系统及电子设备,与现有技术相比,具有以下优点:
本发明的图像处理方法、处理系统及电子设备能够准确的识别摄像头的类型,从而可以根据摄像头的不同类型进行准确的图像处理,这样,有效的避免了图像的呈现错误,进而提高了设备的性能。
附图的简要说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图进行简单介绍,显而易见的,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术中的仅检测到一个摄像头时的图像处理的流程示意图;
图2为本发明中的图像处理系统的一实现方式的结构示意图;
图3为本发明中的图像处理方法的一实现方式的流程示意图;
图4为本发明中的图像处理方法的另一实现方式的流程示意图。
实现本发明的最佳方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,在本文中,诸如“第一”、“第二”、“第三”等关系术语(如果存在)仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。应该理解这样使用的术语在适当情况下可以互换,以便这里描述的本发明的实施例,例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”、“包含”、“具有”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括……”或“包含……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的要素。此外,在本文中,“大于”、“小于”、“超过”等理解为不包括本数;“以上”、“以下”、“以内”等理解为包括本数。
以下结合图2~图4,以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
需要说明的是,目前的手机系统有许多种,如:安卓、java、塞班、ISO等等,类似于电脑的windows2000系统、windowsVista系统等,安卓系统经常用在手机上,成为目前主流的手机系统之一,属于智能系统
本实施例的图像处理系统、图像处理方法及电子设备均以安卓(Android)系统为例和Google的手机架构平台为例进行说明。其中,所述的Android系统一般应用于手机、或平板电脑、或智能可穿戴设备(包括智能手表或智能手环)等的移动智能终端,包含:内核驱动层(Kernel),是移动智能终端的硬件驱动程序运行层,是硬件和软件进程之间的抽象层;框架层(Framework),是连接应用程序层与内核驱动层之间的链接层;应用程序层(App),移动智能终端中的各个应用进程均在该层运行。
如图2所示,为本发明所提供的图像处理系统的结构示意图;所述图像处理系统包括:
检测模块10,用于检测电子设备的摄像头;
本实施例中,所述检测模块10可以由相关的硬件和软件组件结合实现, 比如由事件监测器实现摄像头的检测功能。所述事件监测器从外围设备接口接收事件信息。事件信息包括关于子事件(例如,作为多触摸手势的一部分的触敏显示器系统上的用户触摸)的信息。外围设备接口传输其从I/O子系统或传感器(诸如接近传感器、加速度计和/或麦克风(通过音频电路))接收的信息。外围设备接口从I/O子系统接收的信息包括来自触敏显示器系统或触敏表面的信息等等。
在一些实施例中,事件监测器以预定间隔向外围设备接口发送请求。作为响应,外围设备接口传输事件信息。在其他实施例中,只在存在重要事件(例如,接收到超过预定噪声阈值和/或长于预定持续时间的输入)时,外围设备接口才传输事件信息。
识别模块20,用于当检测到摄像头的数量为一个时,识别该摄像头的类型;
本实施例中,所述识别模块20包括:获取单元和确定单元(图中未示出)。所述获取单元用于获取该摄像头的ID数据;所述确定单元用于根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
也就是说,本实施例中的识别模块20通过直接获取摄像头的ID数据的方式以准确的确定检测到的摄像头的类型;从而避免了现有技术中当只有一个摄像头时,将该摄像头默认为后置摄像头的问题。
处理模块30,用于当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
所述检测模块、识别模块及处理模块均可以由相应的硬件及软件组件配合完成,软件组件可以包括操作系统、通信模块(或指令集)、接触/运动模块(或指令集)、图形模块(或指令集)、用户界面状态模块(或指令集),以及一个或多个应用(或指令集)。操作系统(例如Darwin、RTXC、LINUX、UNIX、OS X、WINDOWS或是诸如Vxworks之类的嵌入式操作系统)包括用于控制和管理常规系统任务(例如内存管理、存储设备控制、电源管理等等)以及有助于各种软硬件组件之间通信的各种软件组件和/或驱动器。
通过识别模块20对摄像头的类型进行准确识别,为处理模块30的处理提供了准确依据,因此再通过处理模块30对图像进行对应的处理,以保证最终生成的预览图像为准确的,这样就有效的提高了设备的性能,同时也极大的 提高了用户的体验。
本实施例中,所述处理模块30还用于当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
若识别到摄像头为后置摄像头时,处理模块30根据识别结果对图像进行90°旋转以保证最终生成的预览图像为正向,从而提高用户的体验。
在本实施例中,所述识别模块20还用于当检测到摄像头的数量为两个时,分别识别两个摄像头的类型;所述处理模块30还用于将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
具体地,当检测模块检测到的摄像头的数量为两个时,通过识别模块20分别对两个摄像头的类型进行识别,具体识别过程为:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。也就是说,当检测到两个摄像头时,即确认前置摄像头和后置摄像头均正常运行,这样,为了提高识别效率,可以直接从架构平台上获取摄像头的标识数据(如,在Google架构上:后置摄像头的标识数据为0,前置摄像头的标识数据为1);通过摄像头的标识数据即可快速准确的确认摄像头的类型。当确定好摄像头的类型后,再由处理模块30根据摄像头的类型对其拍摄的数据做准确的处理,从而确保最终的预览图像为正向。如,将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像;并且,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
本实施例的处理模块可以由图像处理器、CPU、MCU等实现。更具体地,处理器可执行在存储器和/或非易失性存储设备中存储的指令以在计算设备中执行操作,诸如生成图像数据和/或将图像数据传输到电子显示器。如此,处理器可包括一个或多个通用微处理器、一个或多个专用处理器(ASIC)、一个或多个现场可编程逻辑阵列(FPGA)、或它们的任何组合。存储在存储器中的软件组件包括操作系统、通信模块(或指令集)、接触/运动模块(或指令集)、图形模块(或指令集)、触觉反馈模块(或指令集)、文本输入模块(或指令集)、全球定位系统(GPS)模块(或指令集)以及应用(或指令集)。此外,在一些实施例中,存储器或者存储器存储设备/全局内部状态。设备/全局内部状态包括以下各项中的一项或多项:活跃应用状态,指示当前活跃的应用(如果有的 话);显示器状态,指示哪些应用、视图或其他信息占用触敏显示器系统各种区域;传感器状态,包括从设备的各种传感器和其他输入或控制设备获得的信息;以及与设备的位置和/或姿势有关的位置和/或定位信息。
存储器可包括高速随机存取存储器,并且还可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。在某些实施例中,存储器还可以包括远离一个或多个处理器的存储器,例如经由RF电路或外部端口以及通信网络(未示出)访问的网络附加存储器,其中所述通信网络可以是因特网、一个或多个内部网、局域网(LAN)、广域网(WLAN)、存储局域网(SAN)等,或其适当组合。存储器控制器可控制设备的诸如CPU和外设接口之类的其他组件对存储器的访问。
下面再结合具体实施对图2所示的图像处理系统的工作过程做进一步详细说明。假设该图像处理系统被应用于智能手机上,且该智能手机配置有前置摄像头和后置摄像头。
首先,在智能开机启动时(或者开启摄像功能时),通过检测模块10对摄像头进行扫描;正常情况下,应该是扫描到有两个摄像头,即前置摄像头和后置摄像头均被描述到,这时表明智能手机的两个摄像头均能够正常运行,此时,通过识别模块20分别对两个摄像头的类型进行识别,此时的识别过程为:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。也就是说,当检测到两个摄像头时,即确认前置摄像头和后置摄像头均正常运行,这样,为了提高识别效率,可以直接从架构平台上获取摄像头的标识数据(如,在Google架构上:后置摄像头的标识数据为0,前置摄像头的标识数据为1);通过摄像头的标识数据即可快速准确的确认摄像头的类型。当确定好摄像头的类型后,再由处理模块30根据摄像头的类型对其拍摄的数据做准确的处理,从而确保最终的预览图像为正向。如,将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像;并且,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。通过这样的处理,无论是通过前置摄像头还是后置摄像头拍摄到的图像均可以被正向呈现给用户,从而提高用户的体验。
若通过检测模块10仅扫描到一个摄像头时,则表明智能手机的一个摄像头无法正常运行,为避免现有技术中的图像无法正向呈现的问题。需要对当 前扫描到的摄像头的类型进行识别;若是采用从架构平台上获取标识数据的方式无法准确的获取到摄像头的类型,因此,需要通过识别模块20获取该摄像头的ID数据,通过该ID数据可以准确的判断该摄像头为后置摄像头或者前置摄像头,若是获取到的摄像头为后置摄像头时,则由处理模块30将所拍摄的图像进行90°旋转以生成预览图像;相反,若是获取到的摄像头为前置摄像头时,则需要由处理模块30将所拍摄的图像进行270°旋转以生成预览图像。
通过获取摄像头的ID数据的方式可以精准的判断摄像头的类型,从而为后续的图像处理提供了精确的依据,进而提高了设备的性能,同时提高用户的体验。
本发明还提供一种电子设备,包括如前述任一项所述的图像处理系统。所述电子设备包括但不限于手持电脑、平板电脑、移动电话、智能手机、媒体播放器、个人数字助理(PDA)等等,还包括其中两项或多项的组合。在某些实施方式中,所述电子设备为基于安卓(Android)操作系统的智能设备,在此,所述安卓操作系统包括:Android原生操作系统及基于Android内核改进的操作系统。其中,基于Android内核改进的操作系统举例但不限于:华为开发的EMUI,小米开发的MIUI等。还包括其中两项或多项的组合。
所述电子设备通常包括存储器、存储器控制器、一个或多个处理单元(CPU)、外设接口、RF电路、音频电路、扬声器、麦克风、输入/输出(I/O)子系统、触摸屏、其他输出或控制设备,以及外部端口。这些组件通过一条或多条通信总线或信号线进行通信。应当理解,本实施例中的电子设备只是一个实例,具体应用中,电子设备的组件可以本实施例中的电子设备具有更多或更少的组件,或具有不同的组件配置;并且各种组件可以用硬件、软件或软硬件的组合来实现,包括一个或多个信号处理和/或专用集成电路。
所述电子设备还可以包括用于为各种组件供电的电源系统。该电源系统可以包括电源管理系统、一个或多个电源(例如电池、交流电(AC))、充电系统、电源故障检测电路、电源转换器或逆变器、电源状态指示器(例如发光二极管(LED)),以及与便携式设备中的电能生成、管理和分布相关联的其他任何组件。
如图3所示,为本发明提供的图像处理方法的一实现方式的流程示意图, 所述图像处理方法包括:
步骤S10,检测电子设备的摄像头;
本实施例中,步骤S10可以由相关的硬件和软件组件结合实现,比如由事件监测器实现摄像头的检测功能。所述事件监测器从外围设备接口接收事件信息。事件信息包括关于子事件(例如,作为多触摸手势的一部分的触敏显示器系统上的用户触摸)的信息。外围设备接口传输其从I/O子系统或传感器(诸如接近传感器、加速度计和/或麦克风(通过音频电路))接收的信息。外围设备接口从I/O子系统接收的信息包括来自触敏显示器系统或触敏表面的信息等等。
在一些实施例中,事件监测器以预定间隔向外围设备接口发送请求。作为响应,外围设备接口传输事件信息。在其他实施例中,只在存在重要事件(例如,接收到超过预定噪声阈值和/或长于预定持续时间的输入)时,外围设备接口才传输事件信息。
步骤S20,判断所述摄像头是否为一个;
当检测到摄像头的数量为一个时,执行步骤S30,识别该摄像头的类型;换句话说,判断摄像头是否为前置摄像头;
具体地,所述当检测到摄像头的数量为一个时,识别该摄像头的类型的步骤包括:获取该摄像头的ID数据;根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
也就是说,本实施例中,通过直接获取摄像头的ID数据的方式以准确的确定检测到的摄像头的类型;从而避免了现有技术中当只有一个摄像头时,将该摄像头默认为后置摄像头的问题。
当识别到所述摄像头为前置摄像头时,执行步骤S40,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
通过对摄像头的类型进行准确识别,为后续的图像处理提供了准确依据,因此再通过对图像进行对应的处理,以保证最终生成的预览图像为准确的,这样就有效的提高了设备的性能,同时也极大的提高了用户的体验。
另外,本实施例中,所述图像处理方法还包括:步骤S50,当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
若识别到摄像头为后置摄像头时,处理模块30根据识别结果对图像进行90°旋转以保证最终生成的预览图像为正向,从而提高用户的体验。
如图4所示,为本发明提供的图像处理方法的另一实现方式的流程示意图;所述图像处理方法与图3所示的图像处理方法相似,包括:步骤S10,检测电子设备的摄像头;本实施例中,所述检测模块10可以由相关的硬件和软件组件结合实现,比如由事件监测器实现摄像头的检测功能。所述事件监测器从外围设备接口接收事件信息。事件信息包括关于子事件(例如,作为多触摸手势的一部分的触敏显示器系统上的用户触摸)的信息。外围设备接口传输其从I/O子系统或传感器(诸如接近传感器、加速度计和/或麦克风(通过音频电路))接收的信息。外围设备接口从I/O子系统接收的信息包括来自触敏显示器系统或触敏表面的信息等等。
在一些实施例中,事件监测器以预定间隔向外围设备接口发送请求。作为响应,外围设备接口传输事件信息。在其他实施例中,只在存在重要事件(例如,接收到超过预定噪声阈值和/或长于预定持续时间的输入)时,外围设备接口才传输事件信息。
步骤S20,判断所述摄像头是否为一个;
当检测到摄像头的数量为一个时,执行步骤S30,识别该摄像头的类型;换句话说,判断摄像头是否为前置摄像头;
具体地,所述当检测到摄像头的数量为一个时,识别该摄像头的类型的步骤包括:获取该摄像头的ID数据;根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
当识别到所述摄像头为前置摄像头时,执行步骤S40,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
通过对摄像头的类型进行准确识别,为后续的图像处理提供了准确依据,因此再通过对图像进行对应的处理,以保证最终生成的预览图像为准确的,这样就有效的提高了设备的性能,同时也极大的提高了用户的体验。
另外,当识别到所述摄像头为后置摄像头时,步骤S50:将该摄像头拍摄的图像进行90°旋转以生成预览图像。
与图3所示的方法的区别在于:本实施例的图像处理方法还包括:当检测到摄像头的数量为两个时,执行步骤S60,分别识别两个摄像头的类型;将 识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
所述当检测到摄像头的数量为两个时,分别识别两个摄像头的类型的步骤包括:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。
具体地,当检测到的摄像头的数量为两个时,分别对两个摄像头的类型进行识别,具体识别过程为:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。也就是说,当检测到两个摄像头时,即确认前置摄像头和后置摄像头均正常运行,这样,为了提高识别效率,可以直接从架构平台上获取摄像头的标识数据(如,在Google架构上:后置摄像头的标识数据为0,前置摄像头的标识数据为1);通过摄像头的标识数据即可快速准确的确认摄像头的类型。当确定好摄像头的类型后,再由处理模块30根据摄像头的类型对其拍摄的数据做准确的处理,从而确保最终的预览图像为正向。如,将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像;并且,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
本实施例的图像处理方法可以由前述的图像处理系统实现,具体地,可以由图像处理器、CPU、MCU等实现。更具体地,处理器可执行在存储器和/或非易失性存储设备中存储的指令以在计算设备中执行操作,诸如生成图像数据和/或将图像数据传输到电子显示器。如此,处理器可包括一个或多个通用微处理器、一个或多个专用处理器(ASIC)、一个或多个现场可编程逻辑阵列(FPGA)、或它们的任何组合。存储在存储器中的软件组件包括操作系统、通信模块(或指令集)、接触/运动模块(或指令集)、图形模块(或指令集)、触觉反馈模块(或指令集)、文本输入模块(或指令集)、全球定位系统(GPS)模块(或指令集)以及应用(或指令集)。此外,在一些实施例中,存储器或者存储器存储设备/全局内部状态。设备/全局内部状态包括以下各项中的一项或多项:活跃应用状态,指示当前活跃的应用(如果有的话);显示器状态,指示哪些应用、视图或其他信息占用触敏显示器系统各种区域;传感器状态,包括从设备的各种传感器和其他输入或控制设备获得的信息;以及与设备的位置和/或姿势有关的位置和/或定位信息。
存储器可包括高速随机存取存储器,并且还可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。在某些实施例中,存储器还可以包括远离一个或多个处理器的存储器,例如经由RF电路或外部端口以及通信网络(未示出)访问的网络附加存储器,其中所述通信网络可以是因特网、一个或多个内部网、局域网(LAN)、广域网(WLAN)、存储局域网(SAN)等,或其适当组合。存储器控制器可控制设备的诸如CPU和外设接口之类的其他组件对存储器的访问。
本实施例中,在智能开机启动时(或者开启摄像功能时),首先对摄像头进行扫描;正常情况下,应该是扫描到有两个摄像头,即前置摄像头和后置摄像头均被描述到,这时表明智能手机的两个摄像头均能够正常运行,此时,再分别对两个摄像头的类型进行识别,此时的识别过程为:分别获取所述两个摄像头在架构平台上的标识数据;根据所获取到的标识数据确定后置摄像头或前置摄像头。也就是说,当检测到两个摄像头时,即确认前置摄像头和后置摄像头均正常运行,这样,为了提高识别效率,可以直接从架构平台上获取摄像头的标识数据(如,在Google架构上:后置摄像头的标识数据为0,前置摄像头的标识数据为1);通过摄像头的标识数据即可快速准确的确认摄像头的类型。当确定好摄像头的类型后,再由处理模块30根据摄像头的类型对其拍摄的数据做准确的处理,从而确保最终的预览图像为正向。如,将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像;并且,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。通过这样的处理,无论是通过前置摄像头还是后置摄像头拍摄到的图像均可以被正向呈现给用户,从而提高用户的体验。
若仅扫描到一个摄像头时,则表明智能手机的一个摄像头无法正常运行,为避免现有技术中的图像无法正向呈现的问题。需要对当前扫描到的摄像头的类型进行识别;若是采用从架构平台上获取标识数据的方式无法准确的获取到摄像头的类型,因此,需要获取该摄像头的ID数据,通过该ID数据可以准确的判断该摄像头为后置摄像头或者前置摄像头,若是获取到的摄像头为后置摄像头时,则由处理模块30将所拍摄的图像进行90°旋转以生成预览图像;相反,若是获取到的摄像头为前置摄像头时,则需要由处理模块30将所拍摄的图像进行270°旋转以生成预览图像。
通过获取摄像头的ID数据的方式可以精准的判断摄像头的类型,从而为后续的图像处理提供了精确的依据,进而提高了设备的性能,同时提高用户的体验。
综上所述,本发明所提供的图像处理方法、处理系统及电子设备,通过检测摄像头的数量以区分获取摄像头的类型的方式,从而在不同的情况下均可以准确的获取到摄像头的类型,进而有效的保证了最终图像的精确处理,大大提高了用户的体验;另外,采用不同的摄像头的类型的获取方式,还可以有效的提高其处理效率,进一步提高设备的性能。
本发明所述的图像处理方法、处理系统及电子设备,与现有技术相比,具有以下优点:通过准确的获取摄像头的类型以为后续的图像处理方式提供了依据,因此大大提高了图像处理的准确性,同时也提高了设备的性能和用户的体验。
本领域内的技术人员应明白,上述各实施例可提供为方法、装置、或计算机程序产品。这些实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。上述各实施例涉及的方法中的全部或部分步骤可以通过程序来指令相关的硬件完成,所述的程序可以存储于计算机设备可读取的存储介质中,用于执行上述各实施例方法所述的全部或部分步骤。
上述各实施例是参照根据实施例所述的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到计算机设备的处理器以产生一个机器,使得通过计算机设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
尽管本发明的内容已经通过上述优选实施例作了详细介绍,但应当认识到上述的描述不应被认为是对本发明的限制。在本领域技术人员阅读了上述内容后,对于本发明的多种修改和替代都将是显而易见的。因此,本发明的保护范围应由所附的权利要求来限定。

Claims (10)

  1. 一种图像处理方法,其特征在于,包括:
    检测电子设备的摄像头;
    当检测到摄像头的数量为一个时,识别该摄像头的类型;
    当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
  2. 如权利要求1所述的图像处理方法,其特征在于,还包括:当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
  3. 如权利要求1所述的图像处理方法,其特征在于,还包括:
    当检测到摄像头的数量为两个时,分别识别两个摄像头的类型;
    将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
  4. 如权利要求3所述的图像处理方法,其特征在于,所述当检测到摄像头的数量为两个时,分别识别两个摄像头的类型的步骤包括:
    分别获取所述两个摄像头在架构平台上的标识数据;
    根据所获取到的标识数据确定后置摄像头或前置摄像头。
  5. 如权利要求1所述的图像处理方法,其特征在于,所述当检测到摄像头的数量为一个时,识别该摄像头的类型的步骤包括:
    获取该摄像头的ID数据;
    根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
  6. 一种图像处理系统,其特征在于,包括:
    检测模块,用于检测电子设备的摄像头;
    识别模块,用于当检测到摄像头的数量为一个时,识别该摄像头的类型;
    处理模块,用于当识别到所述摄像头为前置摄像头时,将该摄像头拍摄的图像进行270°旋转以生成预览图像。
  7. 如权利要求6所述的图像处理系统,其特征在于,所述处理模块还用于当识别到所述摄像头为后置摄像头时,将该摄像头拍摄的图像进行90°旋转以生成预览图像。
  8. 如权利要求6所述的图像处理系统,其特征在于,所述识别模块还用于当检测到摄像头的数量为两个时,分别识别两个摄像头的类型;所述处理模块用于将识别为前置摄像头所拍摄的图像进行270°旋转以生成预览图像,或者,将识别为后置摄像头所拍摄的图像进行90°旋转以生成预览图像。
  9. 如权利要求6所述的图像处理系统,其特征在于,所述识别模块包括:
    获取单元,用于获取该摄像头的ID数据;
    确定单元,用于根据所获取到的ID数据确定该摄像头为前置摄像头或者后置摄像头。
  10. 一种电子设备,其特征在于,包括如权利要求6-9任一项所述的图像处理系统。
PCT/CN2017/103601 2017-09-27 2017-09-27 图像处理方法、处理系统及电子设备 WO2019061054A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/103601 WO2019061054A1 (zh) 2017-09-27 2017-09-27 图像处理方法、处理系统及电子设备
CN201780097104.0A CN111373731B (zh) 2017-09-27 2017-09-27 图像处理方法、处理系统及电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/103601 WO2019061054A1 (zh) 2017-09-27 2017-09-27 图像处理方法、处理系统及电子设备

Publications (1)

Publication Number Publication Date
WO2019061054A1 true WO2019061054A1 (zh) 2019-04-04

Family

ID=65900405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103601 WO2019061054A1 (zh) 2017-09-27 2017-09-27 图像处理方法、处理系统及电子设备

Country Status (2)

Country Link
CN (1) CN111373731B (zh)
WO (1) WO2019061054A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111950345A (zh) * 2020-06-28 2020-11-17 北京百度网讯科技有限公司 摄像头的识别方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070010689A (ko) * 2005-07-19 2007-01-24 주식회사 팬택앤큐리텔 무선통신단말기의 상 표시 방법 및 장치
CN103795922A (zh) * 2014-01-24 2014-05-14 厦门美图网科技有限公司 一种移动终端的摄像头智能校正方法
CN105227963A (zh) * 2015-08-31 2016-01-06 北京暴风科技股份有限公司 对终端进行流媒体采集自动识别方向并调整的方法及系统
CN105657260A (zh) * 2015-12-31 2016-06-08 宇龙计算机通信科技(深圳)有限公司 一种拍摄方法及终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070010689A (ko) * 2005-07-19 2007-01-24 주식회사 팬택앤큐리텔 무선통신단말기의 상 표시 방법 및 장치
CN103795922A (zh) * 2014-01-24 2014-05-14 厦门美图网科技有限公司 一种移动终端的摄像头智能校正方法
CN105227963A (zh) * 2015-08-31 2016-01-06 北京暴风科技股份有限公司 对终端进行流媒体采集自动识别方向并调整的方法及系统
CN105657260A (zh) * 2015-12-31 2016-06-08 宇龙计算机通信科技(深圳)有限公司 一种拍摄方法及终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CSDN, 13 December 2016 (2016-12-13), Retrieved from the Internet <URL:https://blog.csdn.net/nihaomawobuhaoa/article/detai-ls/53608584> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111950345A (zh) * 2020-06-28 2020-11-17 北京百度网讯科技有限公司 摄像头的识别方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN111373731B (zh) 2022-03-08
CN111373731A (zh) 2020-07-03

Similar Documents

Publication Publication Date Title
US10958850B2 (en) Electronic device and method for capturing image by using display
US10574895B2 (en) Image capturing method and camera equipped electronic device
CN107786794B (zh) 向应用提供由图像传感器获取的图像的电子装置和方法
US8456512B2 (en) Electronic device for capturing panoramic images
KR102327779B1 (ko) 이미지 처리 방법 및 장치
US20160037067A1 (en) Method for generating image and electronic device thereof
CN111090687B (zh) 数据处理方法及装置、系统、计算机可读存储介质
US10609276B2 (en) Electronic device and method for controlling operation of camera-related application based on memory status of the electronic device thereof
WO2018059328A1 (zh) 一种终端控制方法及终端、存储介质
CN108897659B (zh) 修改日志级别的方法、装置及存储介质
US20130332936A1 (en) Resource Management with Dynamic Resource Budgeting
US11507444B1 (en) Platform framework error handling
WO2019205735A1 (zh) 数据传输方法、装置、显示屏及显示装置
US10491884B2 (en) Image processing method and electronic device supporting the same
CN108632529B (zh) 为焦点提供图形指示符的电子设备及操作电子设备的方法
CN109845224B (zh) 电子装置和用于操作电子装置的方法
WO2019061054A1 (zh) 图像处理方法、处理系统及电子设备
US11070736B2 (en) Electronic device and image processing method thereof
WO2019205767A1 (zh) 拍摄控制方法、装置及便携式电子设备
EP3328066B1 (en) Electronic device and method for autofocusing
CN112181915A (zh) 执行业务的方法、装置、终端和存储介质
US20220279118A1 (en) Image capturing apparatus, method for controlling image capturing apparatus, information processing apparatus
CN113935427A (zh) 训练任务的执行方法、装置、电子设备及存储介质
CN114071007A (zh) 图像处理方法、多媒体处理芯片以及电子设备
US10594942B2 (en) Delineated monitoring for ubiquitous computing

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: 17927169

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: 17927169

Country of ref document: EP

Kind code of ref document: A1