WO2024098896A1 - 拍照方法、监控装置、电子设备及存储介质 - Google Patents

拍照方法、监控装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2024098896A1
WO2024098896A1 PCT/CN2023/115577 CN2023115577W WO2024098896A1 WO 2024098896 A1 WO2024098896 A1 WO 2024098896A1 CN 2023115577 W CN2023115577 W CN 2023115577W WO 2024098896 A1 WO2024098896 A1 WO 2024098896A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
preview
preview data
image
cameras
Prior art date
Application number
PCT/CN2023/115577
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 WO2024098896A1 publication Critical patent/WO2024098896A1/zh

Links

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
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Definitions

  • the present application relates to the field of computer technology, and in particular to a photographing method, a monitoring device, an electronic device and a storage medium.
  • cameras are widely used in building monitoring systems, bus monitoring systems, online car-hailing monitoring systems, special vehicle monitoring systems, etc.
  • Cameras are mainly used for taking photos and recording videos.
  • the camera can perform real-time image preview while recording in real time.
  • the system framework needs to be called to control the camera to obtain the photo image.
  • the photo processing module sends the control instruction to the camera service module, and the camera service module obtains the photo data.
  • the camera service module obtains the photo data.
  • the embodiments of the present application disclose a photographing method, a monitoring device, an electronic device and a storage medium.
  • an embodiment of the present application provides a photographing method, the method being applied to a monitoring device, the monitoring device comprising a camera module and a preview module, the method comprising:
  • the camera module is bound to the preview module, the preview module is used to display the preview data of the camera module; when a photo taking instruction is received, the preview data is obtained from the preview module; and an image is generated based on the preview data.
  • an embodiment of the present application provides a monitoring device, the monitoring device comprising a camera module, a preview module and a processing module;
  • the processing module is used to bind the camera module to the preview module
  • the preview module is used to display the preview data of the camera module
  • the processing module is further configured to obtain the preview data from the preview module upon receiving a photographing instruction, and generate an image based on the preview data.
  • an embodiment of the present application provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other; wherein the memory stores program instructions; when the program instructions are executed by the processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored; when the computer program runs on one or more processors, the method described in the first aspect or any possible implementation of the first aspect is executed.
  • an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute a method as described in the first aspect of the embodiment of the present application or any possible implementation of the first aspect.
  • Figure 1 is an example of a system architecture
  • FIG2 is a schematic diagram of a system architecture provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a process flow of a photographing method provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of the structure of a monitoring device provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the system architecture may include an application layer, a framework (framework, FW) layer, a hardware abstraction layer (hardware abstraction layer, HAL) layer, and a Linux kernel layer.
  • the Linux kernel layer may include a display system driver (Linux frame buffer driver), a camera driver (Camera Driver) module, and a kernel driver for video devices in Linux (video for linux2, V4L2).
  • the HAL layer may include a hardware HAL (hardware composer), a Camera HAL module, and an open multimedia acceleration layer (Open Media Acceleration, OMX) encoding component (Encoder Component).
  • the FW layer may include a display system (SurfaceFlinger) module, a display control (TextureView) module, a camera service (CameraService) module, a camera (Camera) module, a media recorder (MediaRecorder) module, a multimedia system (StageFright) module, and a video file encapsulation (Mpeg4Writer) module.
  • the application layer may include a preview processing module, a Camera control module, a video processing module, and a photo processing module.
  • the Camera control module can send control instructions to the Camera Driver module (indicated by a dotted arrow in Figure 1), and the Camera Driver module obtains the original data stream collected by the camera, and transmits the original data stream to the camera service module (indicated by a solid arrow in Figure 1).
  • the camera service module can generate a preview data stream and a recording data stream based on the original data stream, and transmit the preview data stream to the surfaceFlinger module.
  • the surfaceFlinger module synthesizes graphic display data based on the preview data stream, and sends the graphic display data to the TextureView module for display.
  • the camera service module also transmits the recording data stream to the StageFright module, and the StageFright module records the video based on the recording data stream.
  • the StageFright module can call Mpeg4Writer
  • the module encapsulates the video data stream to obtain a video file.
  • the photo processing module When the user triggers a photo command in the user interface (UI), the photo processing module generates a control command after detecting the photo command, and sends the control command to the Camera Driver module through the Camera Control Module, Camera Module, Camera Service Module, and Camera HAL Module.
  • the Camera Driver module obtains the original data stream of the camera and transmits the original data stream to the Camera Service Module.
  • the Camera Service Module generates a photo data stream based on the original data stream, and transmits the photo data stream to the photo processing module through the Camera Module and the Camera Control Module.
  • the photo processing module generates an image based on the photo data stream (shown by a thick arrow in Figure 1), thereby completing a photo.
  • the CameraService module when the camera is recording, the CameraService module will return an error message after receiving the control command to take a photo, resulting in a photo failure. Therefore, in this mode, the camera cannot take photos and record videos at the same time.
  • the application layer needs to rely on the call of the system framework to implement preview, video recording and photo taking. Each operation consumes a certain amount of system resources. When multiple cameras are used at the same time, resource consumption will increase exponentially.
  • the embodiments of the present application provide a photographing method, a monitoring device, an electronic device and a storage medium, which can enable a camera to take photos while recording video and save system resources.
  • the photographing method can be applied to a monitoring device, and the monitoring device can be applied to a building monitoring system, a bus monitoring system, an online car-hailing monitoring system, a special vehicle monitoring system, etc.
  • the system architecture may include an application layer, a FW layer, a HAL layer, and a Linux kernel layer.
  • the Linux kernel layer may include a Linux architecture cache driver, a Camera Driver module, and a V4L2 driver.
  • the HAL layer may include a hardware composer module, a Camera HAL module, and an OMX component code.
  • the FW layer may include a surfaceFlinger module, a TextureView module, a CameraService module, a Camera module, a MediaRecorder module, a StageFright module, and an Mpeg4Writer module.
  • the application layer may include a preview processing module, a Camera control module, a video processing module, and a photo processing module.
  • the CameraService module obtains the original data stream collected by the camera, and generates a preview data stream and a video data stream based on the original data stream (shown by a solid arrow in Figure 2), and transmits the preview data stream to the TextureView module for display, and transmits the video data stream to the StageFright module for video recording.
  • the photo processing module When the user triggers a photo command in the UI interface, the photo processing module generates a control command after detecting the photo command, and sends the control command to the preview processing module, which sends the control command to the TextureView module.
  • the TextureView module sends the preview data to the photo processing module through the preview processing module (as shown by the thick arrow in Figure 2).
  • the photo processing module generates an image based on the preview data, thereby completing the photo.
  • the preview data can be directly obtained from the TextureView module, and the image can be generated based on the preview data, without the need for the control command to be sent to the camera service module, thereby realizing that the camera can take photos while recording.
  • the system framework which can save system resources.
  • Figure 3 is a flow chart of a photographing method provided in an embodiment of the present application.
  • the photographing method is applied to a monitoring device, which includes a camera module and a preview module.
  • a monitoring device which includes a camera module and a preview module.
  • the system framework of the monitoring device can be shown in Figure 2.
  • steps in the flowchart of FIG. 3 are sequentially displayed as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
  • the photographing method includes but is not limited to the following steps.
  • binding a camera module to a preview module where the preview module is used to display preview data of the camera module.
  • the camera module may include one or more cameras.
  • the preview data of the camera module is obtained from the raw data acquired by the one or more cameras. After the monitoring device binds the camera module to the preview module, the preview module may display the preview data of the one or more cameras.
  • the preview module includes a display control TextureView
  • the TextureView module is used to display an interface based on the graphic display data.
  • the display control TextureView can be included in the framework layer of the monitoring module.
  • the application layer of the monitoring device opens the camera through a standard camera application program interface (application program interface, API) interface (such as Camera API Camera.open) to obtain a Camera object.
  • the monitoring device can call the setPreviewTexture interface through the Camera object to bind the display control TextureView and the Camera object, so that the preview data of the camera obtained by the framework layer can be displayed on the display control TextureView.
  • the monitoring device can call the startPreview interface through the Camera object to start the preview display, so that the system can continuously report the camera's preview data to the display control for display, thereby realizing the preview display.
  • the preview module may further include a SurfaceFlinger module.
  • the SurfaceFlinger module is used to synthesize graphic display data based on the preview data stream.
  • the various modules included in the preview module are only examples, and the SurfaceFlinger module and the TextureView module should not be understood as limitations on the preview module.
  • the monitoring device further includes a camera processing module and a video recording module.
  • the monitoring device can obtain the original data stream through the camera module, and transmit the original data stream to the camera processing module, and the camera service module generates a preview data stream and a video data stream based on the original data stream, and transmits the preview data stream to the preview module for preview display, and transmits the video data stream to the video recording module for video recording, thereby realizing the camera to preview and record at the same time.
  • the video recording module may include a MediaRecorder module, a StageFright module, and an Mpeg4Writer module, etc.
  • the MediaRecorder module may be used to control the video recording
  • the StageFright module and the Mpeg4Writer module may perform video recording and packaging based on the video data stream, thereby generating a video recording.
  • modules included in the video recording module are only examples, and the MediaRecorder module, StageFright module and Mpeg4Writer module should not be understood as limitations on the video recording module.
  • the photo-taking instruction may be triggered by a user on a UI interface.
  • the monitoring device may obtain preview data from the preview module, encode the preview data and write it into a corresponding image file to generate the image, thereby completing the photo-taking.
  • the monitoring device obtains the preview data of the camera module from the display control TextureView.
  • the monitoring device may include a photographing processing module and a preview processing module, and the photographing processing module and the preview processing module are in the application layer of the monitoring device.
  • the camera processing module can be used to receive a photographing instruction, and the preview processing module can be used to control the display control TextureView to display the preview data.
  • the camera processing module generates a preview data stream based on the original data stream of the camera module, and transmits the preview data stream to the SurfaceFlinger module.
  • the SurfaceFlinger module synthesizes graphic display data based on the preview data stream, and transmits the graphic display data to the display control for display.
  • the photographing processing module When the photographing processing module receives the photographing instruction, it generates a control instruction and sends the control instruction to the preview processing module, and the preview processing module sends the control instruction to the display control TextureView. After the display control TextureView receives the control instruction, it sends the preview data to the photographing processing module through the preview processing module.
  • the photographing processing module encodes the preview data and writes it into the corresponding picture file to generate an image, thereby completing the photographing.
  • the monitoring device may also display the image through the preview module.
  • the monitoring device can bind the camera module to the preview module so that the preview module can display the preview data of the camera module.
  • the preview data of the camera module can be obtained by processing the raw data obtained by the camera module.
  • the preview data can be directly obtained from the preview module, thereby avoiding calling the system framework to obtain the photo image, being able to obtain data faster, and saving system resources.
  • the preview data is preview data of the camera module in a first time period, and the moment corresponding to the photo-taking instruction is in the first time period.
  • the moment corresponding to the photographing instruction may be the moment when the photographing instruction is received, or the moment indicated by the moment information carried by the photographing instruction.
  • the moment corresponding to the photographing instruction when the photographing instruction does not carry the moment information, the moment corresponding to the photographing instruction is the moment when the photographing instruction is received; when the photographing instruction carries the moment information, the moment corresponding to the photographing instruction may be the moment indicated by the moment information.
  • the first time period may be a period of time before and after the moment corresponding to the photographing instruction.
  • the first time period includes 3 seconds before and after the moment corresponding to the photographing instruction.
  • the monitoring device may obtain the preview data within the first time period from the preview module.
  • the monitoring device may generate the image based on the preview data at any time within the first time period.
  • the monitoring device may encode the preview data corresponding to any time within the first time period and write it into the corresponding picture file to generate the image, thereby completing the photographing.
  • the monitoring device may generate the image based on selecting the preview data that makes the image quality of the image better from the preview data of the first time period to ensure the image quality of the image.
  • the monitoring device can obtain preview data within the first time period from the preview module, so as to select preview data that makes the image effect better from the preview data in the first time period, thereby ensuring the quality of the image.
  • step 303 generating an image based on the preview data may include the following steps:
  • the image quality includes resolution and clarity.
  • the preset condition may be a threshold condition for image quality.
  • the resolution of the image is greater than a first threshold
  • the clarity of the image is greater than a second threshold.
  • the first threshold and the second threshold may be set according to business requirements and are not limited here.
  • preview data of a second moment in the first period is obtained, and a second pre-selected image is generated based on the preview data of the second moment.
  • the second moment may be any moment in the first period except the first moment.
  • the monitoring device may compare the first pre-selected image and the second pre-selected image to determine the above image.
  • the image may be the one with better quality between the first pre-selected image and the second pre-selected image.
  • the monitoring device can compare the image qualities of the pre-selected images generated by the preview data at different times within the first time period, and select one with better image quality as the photographed image, thereby ensuring the image quality of the generated image.
  • the camera module includes N cameras
  • the preview data includes preview data of M cameras in the first time period
  • the M cameras are included in the N cameras
  • N and M are positive integers.
  • the monitoring device may determine the M cameras corresponding to the photographing instruction, and The preview data of the M cameras in the first period are obtained from the preview module. The monitoring device then generates an image based on the preview data of the M cameras in the first period, thereby realizing simultaneous photography of multiple cameras.
  • the preview data of the multiple cameras can be acquired by using a multi-threading mechanism, so that the function of multiple cameras taking photos simultaneously can be realized.
  • the photographing instruction may also carry quantity information, and the quantity information is used to indicate the number of images acquired by the photographing instruction.
  • the quantity information is used to indicate that the number of images acquired by the photographing instruction is 1, and the image includes one image.
  • the monitoring device integrates and encodes the preview data of the M cameras in the first time period and writes them into a picture file to generate the image.
  • the image includes the preview data of the M cameras.
  • the quantity information is used to indicate that the number of images acquired by the photographing instruction is M, and the image includes M images.
  • the monitoring device encodes the preview data of each of the M cameras and writes them into the corresponding picture file to generate M images.
  • the preview module can preview and display the preview data of N cameras.
  • the M cameras corresponding to the photo-taking instruction are determined, and the preview data of the M cameras in the first time period are obtained from the preview module, so that multiple cameras can take photos at the same time.
  • only the preview data of the M cameras in the first time period needs to be obtained from the preview module, which can reduce the resources consumed by transmitting the preview data.
  • the camera module includes N cameras
  • the preview data includes preview data of the N cameras in the first time period
  • generating an image based on the preview data includes:
  • M M cameras corresponding to the photo-taking instruction among the N cameras, where M is a positive integer; determine preview data of the M cameras in the first time period from the preview data; and generate the image based on the preview data of the M cameras in the first time period.
  • preview data of N cameras in a first time period can be obtained from the preview module, and then the M cameras corresponding to the photo-taking instruction can be determined, and an image can be generated based on the preview data of the M cameras in the first time period, thereby enabling the multiple cameras to take photos simultaneously.
  • the method further includes:
  • the preview data is saved; and when an adjustment instruction for the image is received, the image is adjusted based on the preview data.
  • the monitoring device may save the preview data to facilitate subsequent adjustment of the image.
  • the adjustment instruction may be triggered by the user in the UI interface. For example, when an error occurs in the M cameras indicated by the photo instruction, the image may be adjusted based on the preview data, thereby obtaining a more accurate image and improving the fault tolerance of the photo instruction.
  • the preview data includes preview data of N cameras
  • the image includes preview data of M cameras
  • the adjustment instruction is used to instruct to replace the preview data of the first camera with the preview data of the second camera.
  • the first camera is any one of the M cameras
  • the second camera is any one of the N cameras except the M cameras.
  • the monitoring device obtains the preview data of the second camera from the preview data, and generates a replacement image based on the preview data of the second camera.
  • the replacement image is replaced with the image corresponding to the first camera in the image, thereby completing the adjustment of the image.
  • the monitoring device can save the preview data so that the image can be adjusted based on the preview data. For example, when an adjustment instruction for the image is received, the image is adjusted based on the preview data, so that a more accurate image can be obtained.
  • Fig. 4 is a schematic diagram of the structure of a monitoring device provided in an embodiment of the present application.
  • the monitoring device 40 includes a camera module 401, a preview module 402 and a processing module 403.
  • the camera module 401 is used to obtain preview data
  • the processing module 403 is used to bind the camera module 401 and the preview module 402;
  • the processing module 403 is further configured to obtain preview data from the preview module 402 upon receiving a photographing instruction, and generate an image based on the preview data.
  • the preview data is preview data of the camera module in a first time period, and the moment corresponding to the photo-taking instruction is in the first time period.
  • the camera module includes N cameras
  • the preview data includes preview data of M cameras in the first time period
  • the M cameras are included in the N cameras
  • N and M are positive integers.
  • the camera module includes N cameras
  • the preview data includes preview data of the N cameras in the first time period
  • the processing module 403 is specifically used to determine M cameras corresponding to the photo-taking instruction among the N cameras, where M is a positive integer; determine the preview data of the M cameras in the first time period from the preview data; and generate the image based on the preview data of the M cameras in the first time period.
  • the processing module 403 is further configured to save the preview data; and when an adjustment instruction for the image is received, adjust the image based on the preview data.
  • the processing module 403 is specifically used to obtain preview data corresponding to a first moment in a first time period in the preview data, where the first moment is the moment corresponding to the photo-taking instruction; generate a first pre-selected image based on the preview data corresponding to the first moment; if the image quality of the first pre-selected image does not meet a preset condition, generate a second pre-selected image based on the preview data corresponding to a second moment, where the second moment is included in the and is different from the first moment; and determine the image from the first pre-selected image and the second pre-selected image.
  • the image quality of the first pre-selected image includes resolution and clarity.
  • Each module in the above device can be implemented in whole or in part by software, hardware, or a combination thereof.
  • Each module can be embedded in or independent of a processor in a server in the form of hardware, or can be stored in a memory in a server in the form of software, so that the processor can call and execute operations corresponding to each module.
  • the division of the various units in the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated.
  • the above units can be separately established processing elements, or they can be integrated into a certain chip of the terminal for implementation.
  • they can also be stored in the storage element of the controller in the form of program code, and called and executed by a certain processing element of the processor.
  • the various units can be integrated together or implemented independently.
  • the processing element here can be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method or the above units can be completed by the hardware integrated logic circuit in the processor element or the instructions in the form of software.
  • the processing element can be a general-purpose processor, such as a central processing unit (CPU), or it can be one or more integrated circuits configured to implement the above method, such as one or more application-specific integrated circuits (ASICs), or one or more microprocessors (digital signal processors DSPs), or one or more field-programmable gate arrays (FPGAs), etc.
  • CPU central processing unit
  • ASICs application-specific integrated circuits
  • DSPs digital signal processors
  • FPGAs field-programmable gate arrays
  • FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
  • the electronic device 50 includes a processor 501 and a memory 502.
  • the processor 501 and the memory 502 can communicate with each other through a communication bus 503.
  • the communication bus 503 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus.
  • the communication bus 503 may be an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG5 , but it does not mean that there is only one bus or one type of bus.
  • the memory 502 is used to store a computer program, and the computer program includes program instructions.
  • the processor 501 is configured to call the program instructions.
  • the program includes some or all of the steps for executing the method shown in FIG3 .
  • Processor 501 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the memory 502 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
  • the memory may be independent and connected to the processor through a bus.
  • the memory may also be integrated with the processor.
  • An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored.
  • a computer program runs on one or more processors, the method shown in FIG. 3 can be implemented.
  • the embodiment of the present application also provides a computer program product, and when the above-mentioned computer program product runs on a processor, it can implement the method shown in Figure 3 above.
  • An embodiment of the present application further provides a system, which includes at least one monitoring device 40 or electronic device 50 or chip as described above.
  • the processes can be completed by a computer program or hardware related to the computer program, and the computer program can be stored in a computer-readable storage medium.
  • the computer program When the computer program is executed, it can include the processes of the above-mentioned method embodiments.
  • the aforementioned storage medium includes: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store computer program codes.

Landscapes

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

Abstract

本申请实施例提供一种拍照方法、监控装置、电子设备及存储介质,该方法应用于监控装置,监控装置包括相机模块和预览模块,该方法包括:将相机模块与预览模块绑定,预览模块用于显示相机模块的预览数据;在接收到拍照指令的情况下,从预览模块获取预览数据;基于预览数据生成图像。

Description

拍照方法、监控装置、电子设备及存储介质
本申请要求于2022年11月11日提交中国专利局、申请号为202211413049.0、申请名称为“拍照方法、监控装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种拍照方法、监控装置、电子设备及存储介质。
背景技术
目前,相机(Camera)广泛应用于楼宇监控系统、公交车监控系统、网约车监控系统、特殊车辆监控系统等。相机主要用于拍照和录像。在一些场景中,相机进行实时录像的同时,进行实时画面预览。
一般地,在进行拍照时,需要借助系统框架的调用才能控制相机获取到拍照图像。例如,拍照处理模块将控制指令下发到相机服务(CameraService)模块,由该CameraService模块获取拍照数据。然而,这种方式中,每次拍照需要消耗的系统资源过多。
发明内容
本申请实施例公开了一种拍照方法、监控装置、电子设备及存储介质。
第一方面,本申请实施例提供一种拍照方法,所述方法应用于监控装置,所述监控装置包括相机模块和预览模块,所述方法包括:
将所述相机模块与所述预览模块绑定,所述预览模块用于显示所述相机模块的预览数据;在接收到拍照指令的情况下,从所述预览模块获取所述预览数据;基于所述预览数据生成图像。
第二方面,本申请实施例提供一种监控装置,所述监控装置包括相机模块、预览模块以及处理模块;
所述处理模块,用于将相机模块与预览模块绑定;
所述预览模块,用于显示所述相机模块的预览数据;
所述处理模块,还用于在接收到拍照指令的情况下,从所述预览模块获取所述预览数据,以及基于所述预览数据生成图像。
第三方面,本申请实施例提供一种电子设备,包括:存储器、处理器,其中所述存储器和所述处理器被相互可通信地连接;其中所述存储器存储有程序指令;所述程序指令被所述处理器执行时,使所述处理器执行如第一方面或第一方面任意可能的实现方式所描述的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序;当所述计算机程序在一个或多个处理器上运行时,执行如第一方面或第一方面任意可能的实现方式所描述的方法。
第五方面,本申请实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使计算机执行如本申请实施例第一方面或第一方面任意可能的实现方式所描述的方法。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目 的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,显而易见地,下面所描述的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为系统架构的一种示例;
图2是本申请实施例提供的一种系统架构的结构示意图;
图3是本申请实施例提供的一种拍照方法的流程示意图;
图4是本申请实施例提供的一种监控装置的结构示意图;
图5是本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
本申请的说明书、权利要求书及附图中的术语“第一”和“第二”等仅用于区别不同对象,而不是用于限定多个对象的顺序、时序、优先级或者重要程度。本申请实施例中“多个”是指两个或两个以上。此外,术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备等,没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元等,或可选地还包括对于这些过程、方法、产品或设备等固有的其它步骤或单元。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。
在本文中提及的“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员可以显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
请参见图1,图1为系统架构的一种示例。如图1所示,该系统架构可以包括应用层、框架(framework,FW)层、硬件抽象层(hardware abstraction layer,HAL)层以及Linux内核层。Linux内核层可以包括显示系统驱动(Linux frame buffer driver)、相机驱动(Camera Driver)模块以及Linux中关于视频设备的内核驱动(video for linux2,V4L2)。HAL层可以包括硬件HAL(hardware composer)、Camera HAL模块以及开放多媒体加速层(Open Media Acceleration,OMX)编码组件(Encoder Component)。FW层可以包括显示系统(SurfaceFlinger)模块、显示控件(TextureView)模块、相机服务(CameraService)模块、相机(Camera)模块、媒体录像机(MediaRecorder)模块、多媒体系统(StageFright)模块、以及视频文件封装(Mpeg4Writer)模块。应用层可以包括预览处理模块、Camera控制模块、录像处理模块以及拍照处理模块。
在相机进行录像时,Camera控制模块可以将控制指令下发到Camera Driver模块(图1中用虚线箭头示出),由该Camera Driver模块获取相机采集的原始数据流,并将该原始数据流传输至相机服务模块(图1中用实线箭头示出)。该相机服务模块可以基于该原始数据流生成预览数据流和录像数据流,并将该预览数据流传输至surfaceFlinger模块,由该surfaceFlinger模块基于该预览数据流合成图形显示数据,并将该图形显示数据发送到TextureView模块进行显示。相机服务模块还将该录像数据流传输至StageFright模块,由该StageFright模块基于该录像数据流进行视频录制。例如,StageFright模块可以调用Mpeg4Writer 模块对录像数据流进行封装,得到视频文件。
当用户在用户界面(User Interface,UI)触发拍照指令时,拍照处理模块检测到该拍照指令后生成控制指令,并通过Camera控制模块、Camera模块、CameraService模块、Camera HAL模块将控制指令下发到Camera Driver模块,由Camera Driver模块获取相机的原始数据流,并将该原始数据流传输至相机服务模块。该相机服务模块基于该原始数据流生成拍照数据流,并将该拍照数据流通过Camera模块和相机控制模块传输至拍照处理模块,由该拍照处理模块基于该拍照数据流生成图像(图1中用粗线箭头示出),从而完成一次拍照。
然而当相机在录像时,CameraService模块在接收到指示拍照的控制指令之后,会返回错误信息,导致拍照失败。因此,在该种方式中,相机不能同时拍照和录像。从图1可以看出应用层要实现预览、录像和拍照都需要借助系统框架的调用才能完成,每个操作都需要消耗一定的系统资源,多个Camera同时使用的时候,资源消耗就会成倍增加。
鉴于此,本申请实施例提供一种拍照方法、监控装置、电子设备及存储介质,能够使得相机在录像同时进行拍照,以及节省系统资源。该拍照方法可以应用于监控装置,该监控装置可以应用于楼宇监控系统、公交车监控系统、网约车监控系统、特殊车辆监控系统等。
请参见图2,图2为本申请实施例提供的一种系统框架图。如图2所示,该系统架构可以包括应用层、FW层、HAL层以及Linux内核层。Linux内核层可以包括Linux架构缓存区驱动、Camera Driver模块以及V4L2驱动。HAL层可以包括hardware composer模块、Camera HAL模块以及OMX分量码。FW层可以包括surfaceFlinger模块、TextureView模块、CameraService模块、Camera模块、MediaRecorder模块、StageFright模块、以及Mpeg4Writer模块。应用层可以包括预览处理模块、Camera控制模块、录像处理模块以及拍照处理模块。
在相机进行录像时,CameraService模块获取相机采集的原始数据流,并基于该原始数据流生成预览数据流和录像数据流(图2中用实线箭头示出),并将该预览数据流传输至TextureView模块进行显示,以及将录像数据流传输至StageFright模块进行视频录制。当用户在UI界面触发拍照指令时,拍照处理模块检测到拍照指令之后,生成控制指令,并将该控制指令发送至预览处理模块,由该预览处理模块将控制指令发送至TextureView模块。该TextureView模块接收到控制指令之后,通过预览处理模块将预览数据发送至拍照处理模块(如图2中粗线箭头所示)。该拍照处理模块基于该预览数据生成图像,从而完成拍照。在图2所示的系统框架下,在相机进行录像时,可以直接从TextureView模块中获取预览数据,基于预览数据生成图像,而无需控制指令下发至相机服务模块,从而实现了相机进行录像的同时还能进行拍照。而且,在拍照过程中,无需调用系统框架,能够节省系统资源。
请参见图3,图3为本申请实施例提供的一种拍照方法的流程示意图。该拍照方法应用于监控装置,该监控装置包括相机模块和预览模块。示例性地,该监控装置的系统框架可以如图2所示。
应该理解的是,虽然图3的流程图中的各个步骤按照箭头的指示依次显示但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,图中的至少部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
如图3所示,该拍照方法包括但不限于如下步骤。
301,将相机模块与预览模块绑定,该预览模块用于显示该相机模块的预览数据。
示例性地,该相机模块可以包括一个或多个相机。该相机模块的预览数据是由该一个或多个相机获取到的原始数据得到。监控装置将该相机模块与该预览模块绑定之后,该预览模块可以显示该一个或多个相机的预览数据。
示例性地,该预览模块包括显示控件TextureView,该TextureView模块用于基于该图形显示数据进行界面显示。该显示控件TextureView可以包含于该监控模块的框架层中。监控装置的应用层通过标准的相机应用程序接口(application program interface,API)接口(如Camera API Camera.open)打开相机,从而得到Camera对象。监控装置可以通过该Camera对象调用setPreviewTexture接口将显示控件TextureView和Camera对象进行绑定,从而使得框架层获取到的相机的预览数据能够在显示控件TextureView上显示。监控装置可以通过Camera对象调用startPreview接口开启预览显示,使得系统可以持续地上报相机的预览数据到显示控件进行显示,实现预览显示。
示例性地,该预览模块还可以包括SurfaceFlinger模块。该SurfaceFlinger模块用于基于该预览数据流合成图形显示数据。
可理解,关于该预览模块所包含的各个模块仅为示例,不应将该SurfaceFlinger模块和TextureView模块理解为对该预览模块的限制。
在一种可能的实现方式中,上述监控装置还包括相机处理模块和录像模块。
示例性地。监控装置可以通过相机模块获取原始数据流,并将该原始数据流传输至相机处理模块,由该相机服务模块基于该原始数据流生成预览数据流和录像数据流,并将预览数据流传输至预览模块进行预览显示,以及将录像数据流传输至录像模块进行视频录制,从而实现相机同时进行预览和录像。
示例性地,该录像模块可以包括MediaRecorder模块、StageFright模块以及Mpeg4Writer模块等。该MediaRecorder模块可以用于控制视频的录制,StageFright模块和Mpeg4Writer模块可以基于该录像数据流进行视频录制以及封装,从而生成录像视频。
可理解,关于该录像模块所包含的各个模块仅为示例,不应将MediaRecorder模块、StageFright模块以及Mpeg4Writer模块理解为对该录像模块的限制。
302,在接收到拍照指令的情况下,从预览模块获取预览数据。
303,基于预览数据生成图像。
示例性地,该拍照指令可以是由用户在UI界面上触发的。监控装置在接收到该拍照指令之后,可以从预览模块中获取预览数据,并将该预览数据进行编码后写入对应的图片文件中,生成该图像,从而完成拍照。例如,该监控装置接收到拍照指令之后,从显示控件TextureView中获取相机模块的预览数据。
示例性地,该监控装置可以包括拍照处理模块和预览处理模块,该拍照处理模块与预览处理模块在该监控装置的应用层。该相机处理模块可以用于接收拍照指令,该预览处理模块可以用于控制显示控件TextureView对预览数据进行显示。相机处理模块基于相机模块的原始数据流生成预览数据流,并将预览数据流传输至SurfaceFlinger模块。SurfaceFlinger模块基于该预览数据流合成图形显示数据,并将图形显示数据传输至显示控件进行显示。该拍照处理模块在接收到拍照指令的情况下,生成控制指令,并将该控制指令发送至预览处理模块,由该预览处理模块将控制指令发送至显示控件TextureView。该显示控件TextureView接收到控制指令之后,通过预览处理模块将预览数据发送至拍照处理模块。该拍照处理模块对该预览数据进行编码后写入对应的图片文件,生成图像,从而完成拍照。
可选的,监控装置在基于预览数据流生成图像之后,还可以通过该预览模块显示该图像。
本申请实施例中,监控装置可以将相机模块与预览模块进行绑定,使得预览模块能够显示该相机模块的预览数据。该相机模块的预览数据可以由相机模块获取的原始数据处理得到。在接收到拍照指令的情况下,可以直接从预览模块中获取预览数据,从而避免调用系统框架获取拍照图像,能够更快地获取数据,以及节省系统资源。
在一种可能的实现方式中,上述预览数据为相机模块在第一时段内的预览数据,拍照指令对应的时刻位于第一时段。
示例性地,该拍照指令对应的时刻可以为接收到该拍照指令的时刻,或者该拍照指令携带的时刻信息所指示的时刻。可选的,在该拍照指令中不携带时刻信息的情况下,该拍照指令对应的时刻为接收到该拍照指令的时刻;在该拍照指令中携带该时刻信息的情况下,该拍照指令对应的时刻可以为该时刻信息所指示的时刻。
该第一时段可以为该拍照指令对应的时刻的前后一段时间内。例如,该第一时间包括该拍照指令对应的时刻的前3秒和该拍照指令对应的时刻的后3秒。
监控装置在接收到拍照指令之后,可以从预览模块中获取第一时段内的预览数据。示例性地,监控装置可以基于该第一时段内任意时刻的预览数据生成该图像。例如,监控装置可以对该第一时段内的任意时刻对应的预览数据进行编码后写入对应的图片文件中,生成该图像,从而完成拍照。或者,监控装置可以基于从该第一时段的预览数据中选择使得该图像的图像质量较好的预览数据生成图像,以保证该图像的图像质量。
本申请实施例中,监控装置可以从预览模块中获取第一时段内的预览数据,以便于能够从该第一时段的预览数据中选择使得该图像效果更好的预览数据,从而保证该图像的质量。
在一种可能的实现方式中,步骤303中,基于所述预览数据生成图像,可以包括如下步骤:
从所述预览数据中获取第一时刻对应的预览数据,所述第一时刻为所述拍照指令对应的时刻;基于所述第一时刻对应的预览数据生成第一预选图像;在所述第一预选图像的图像质量不满足预设条件的情况下,基于第二时刻对应的预览数据生成第二预选图像,所述第二时刻包含于所述第一时段内,所述第二时刻与所述第一时刻不同;从所述第一预选图像与所述第二预选图像中确定所述图像。
示例性地,该图像质量包括分辨率和清晰度。该预设条件可以为图像质量的阈值条件。例如,图像的分辨率大于第一阈值,以及图像的清晰度大于第二阈值。该第一阈值与该第二阈值可以根据业务需求设定,这里不做限制。在该第一预选图像的图像质量不满足该预设条件时,表明该第一预选图像的图像质量不佳,因此可以对比第一时段内其他时刻的预览数据所生产的预选图像的图像质量,以便于生成的图像有更好的图像质量。
示例性地,在该第一预选图像的质量不佳的情况下,获取该第一时段内的第二时刻的预览数据,并基于该第二时刻的预览数据生成第二预选图像。该第二时刻可以为该第一时段内除了该第一时刻外的任意时刻。监控装置可以比较该第一预选图像和该第二预选图像,从而确定上述图像。例如,该图像可以为该第一预选图像和该第二预选图像中质量较好的一个。
本申请实施例中,监控装置在第一预选图像质量不佳的情况下,可以通过对比第一时段内不同时刻的预览数据生成的预选图像的图像质量,从中选择图像质量较好的一个为拍照图像,从而保证生成的图像的图像质量。
在一种可能的实现方式中,所述相机模块包括N个相机,所述预览数据包括M个相机在所述第一时段的预览数据,所述M个相机包含于所述N个相机,所述N和所述M为正整数。
示例性地,监控装置在接收到拍照指令之后,可以确定该拍照指令对应的M个相机,并 从该预览模块中获取该M个相机在第一时段内的预览数据。监控装置再基于该M个相机在第一时段内的预览数据生成图像,从而实现多相机同时拍照。
示例性地,在该相机模块中包括多个相机同时工作的情况下,可以利用多线程机制获取该多个相机的预览数据,能够实现多个相机同时拍照的功能。
可选的,该拍照指令还可以携带数量信息,该数量信息用于指示该拍照指令所获取的图像的数量。在一些实现方式中,该数量信息用于指示该拍照指令所获取的图像的数量为1,该图像包括一张图像。该监控装置在获取该M个相机在第一时段内的预览数据之后,将该M个相机在第一时段内的预览数据进行整合、编码后写入一个图片文件中,生成该图像。该图像包括该M个相机的预览数据。在另一些实现方式中,该数量信息用于指示该拍照指令所获取的图像的数量为M,该图像包括M张图像。该监控装置在获取到M个相机在第一时段内的预览数据后,分别对该M个相机中每个相机的预览数据进行编码后写入对应的图片文件中,生成M张图像。
本申请实施例中,预览模块可以对N个相机的预览数据进行预览显示。在接收到拍照指令的情况下,确定该拍照指令对应的M个相机,并从该预览模块中获取该M个相机在第一时段内的预览数据,从而能够实现多个相机同时拍照。另外,只需要从预览模块中获取该M个相机在第一时段内的预览数据,能够减少传输该预览数据消耗的资源。
在另一种可能的实现方式中,所述相机模块包括N个相机,所述预览数据包括所述N个相机在所述第一时段的预览数据,所述基于所述预览数据生成图像,包括:
确定所述N个相机中所述拍照指令对应的M个相机,所述M为正整数;从所述预览数据中确定所述M个相机在所述第一时段的预览数据;基于所述M个相机在所述第一时段的预览数据生成所述图像。
本申请实施例中,在接收到拍照指令的情况下,可以从预览模块中获取N个相机在第一时段内的预览数据,再确定该拍照指令对应的M个相机,并基于该M个相机在第一时段内的预览数据生成图像,从而能够实现该多个相机同时拍照。
在一种可能的实现方式中,所述基于所述M个相机在所述第一时段的预览数据生成所述图像之后,所述方法还包括:
保存所述预览数据;在接收到针对所述图像的调整指令的情况下,基于所述预览数据对所述图像进行调整。
示例性地,监控装置在获取该预览数据之后,可以保存该预览数据,以便于后续对该图像进行调整。该调整指令可以是用户在UI界面触发的。例如,在该拍照指令指示的M个相机出现错误时,可以基于该预览数据对该图像进行调整,从而能够获得更准确的图像,提高该拍照指令的容错率。
例如,该预览数据包括N个相机的预览数据,该图像包括M个相机的预览数据,该调整指令用于指示将第一相机的预览数据替换为第二相机的预览数据。该第一相机为该M个相机中的任一个,该第二相机为该N个相机中除了该M个相机之外的任一个。监控装置从该预览数据中获取该第二相机的预览数据,并基于该第二相机的预览数据生成替换图像。在该图像中将该替换图像替换到该第一相机对应的图像,从而完成对该图像的调整。
本申请实施例中,监控装置可以将预览数据进行保存,以便于可以基于该预览数据对图像进行调整。例如,在接收到针对该图像的调整指令的情况下,基于该预览数据对该图像进行调整,从而能够获取到更准确的图像。
请参见图4,图4为本申请实施例提供的一种监控装置的结构示意图。如图4所示,该监控装置40包括相机模块401、预览模块402和处理模块403。
相机模块401,用于获取预览数据;
处理模块403,用于将相机模块401与预览模块402绑定;
预览模块402,用于显示相机模块401的预览数据;
处理模块403,还用于在接收到拍照指令的情况下,从预览模块402获取预览数据,以及基于所述预览数据生成图像。
在一种可能的实现方式中,所述预览数据为所述相机模块在第一时段内的预览数据,所述拍照指令对应的时刻位于所述第一时段。
在一种可能的实现方式中,所述相机模块包括N个相机,所述预览数据包括M个相机在所述第一时段的预览数据,所述M个相机包含于所述N个相机,所述N和所述M为正整数。
在一种可能的实现方式中,所述相机模块包括N个相机,所述预览数据包括所述N个相机在所述第一时段的预览数据,所述处理模块403,具体用于确定所述N个相机中所述拍照指令对应的M个相机,所述M为正整数;从所述预览数据中确定所述M个相机在所述第一时段的预览数据;基于所述M个相机在所述第一时段的预览数据生成所述图像。
在一种可能的实现方式中,处理模块403,还用于保存所述预览数据;在接收到针对所述图像的调整指令的情况下,基于所述预览数据对所述图像进行调整。
在一种可能的实现方式中,处理模块403,具体用于从所述预览数据中第一时段获取第一时刻对应的预览数据,所述第一时刻为所述拍照指令对应的时刻;基于所述第一时刻对应的预览数据生成第一预选图像;在所述第一预选图像的图像质量不满足预设条件的情况下,基于第二时刻对应的预览数据生成第二预选图像,所述第二时刻包含于所述内,所述第二时刻与所述第一时刻不同;从所述第一预选图像与所述第二预选图像中确定所述图像。
在一种可能的实现方式中,所述第一预选图像的图像质量包括分辨率和清晰度。
上述装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于服务器中的处理器中,也可以以软件形式存储于服务器中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
应理解以上装置中的各个单元的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。例如,以上各个单元可以为单独设立的处理元件,也可以集成在终端的某一个芯片中实现,此外,也可以以程序代码的形式存储于控制器的存储元件中,由处理器的某一个处理元件调用并执行以上各个单元的功能。此外各个单元可以集成在一起,也可以独立实现。这里的处理元件可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤或以上各个单元可以通过处理器元件中的硬件的集成逻辑电路或者软件形式的指令完成。该处理元件可以是通用处理器,例如中央处理器(英文:central processing unit,简称:CPU),还可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(英文:application-specific integrated circuit,简称:ASIC),或,一个或多个微处理器(英文:digital signal processor,简称:DSP),或,一个或者多个现场可编程门阵列(英文:field-programmable gate array,简称:FPGA)等。
关于上述实施例中的监控装置40,其中各个单元执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
请参阅图5,图5为本申请实施例提供的一种电子设备的结构示意图,如图5所示,该电子设备50包括处理器501和存储器502。处理器501、存储器502可以通过通信总线503 相互连接。通信总线503可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。通信总线503可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。存储器502用于存储计算机程序,计算机程序包括程序指令,处理器501被配置用于调用程序指令,上述程序包括用于执行图3所示的方法中的部分或全部步骤。
处理器501可以是通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制以上方案程序执行的集成电路。
存储器502可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
本申请实施例还提供一种计算机可读存储介质,上述计算机可读存储介质中存储有计算机程序,当上述计算机程序在一个或多个处理器上运行时,可以实现上述图3所示的方法。
本申请实施例还提供一种计算机程序产品,当上述计算机程序产品在处理器上运行时,可以实现上述图3所示的方法。
本申请实施例还提供了一种系统,该系统包括了至少一个如上述监控装置40或电子设备50或芯片。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来计算机程序相关的硬件完成,该计算机程序可存储于计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储计算机程序代码的介质。

Claims (10)

  1. 一种拍照方法,所述方法应用于监控装置,所述监控装置包括相机模块和预览模块,所述方法包括:
    将所述相机模块与所述预览模块绑定,所述预览模块用于显示所述相机模块的预览数据;
    在接收到拍照指令的情况下,从所述预览模块获取所述预览数据;
    基于所述预览数据生成图像。
  2. 根据权利要求1所述的方法,其特征在于,所述预览数据为所述相机模块在第一时段内的预览数据,所述拍照指令对应的时刻位于所述第一时段。
  3. 根据权利要求2所述的方法,其特征在于,所述相机模块包括N个相机,所述预览数据包括M个相机在所述第一时段的预览数据,所述M个相机包含于所述N个相机,所述N和所述M为正整数。
  4. 根据权利要求2所述的方法,其特征在于,所述相机模块包括N个相机,所述预览数据包括所述N个相机在所述第一时段的预览数据,所述基于所述预览数据生成图像,包括:
    确定所述N个相机中所述拍照指令对应的M个相机,所述M为正整数;
    从所述预览数据中确定所述M个相机在所述第一时段的预览数据;
    基于所述M个相机在所述第一时段的预览数据生成所述图像。
  5. 根据权利要求4所述的方法,其特征在于,所述基于所述M个相机在所述第一时段的预览数据生成所述图像之后,所述方法还包括:
    保存所述预览数据;
    在接收到针对所述图像的调整指令的情况下,基于所述预览数据对所述图像进行调整。
  6. 根据权利要求1所述的方法,其特征在于,所述基于所述预览数据生成图像,包括:
    从所述预览数据中获取第一时刻对应的预览数据,所述第一时刻为所述拍照指令对应的时刻;
    基于所述第一时刻对应的预览数据生成第一预选图像;
    在所述第一预选图像的图像质量不满足预设条件的情况下,基于第二时刻对应的预览数据生成第二预选图像,所述第二时刻包含于所述第一时段内,所述第二时刻与所述第一时刻不同;
    从所述第一预选图像与所述第二预选图像中确定所述图像。
  7. 根据权利要求6所述的方法,其特征在于,所述第一预选图像的图像质量包括分辨率和清晰度。
  8. 一种监控装置,所述监控装置包括相机模块、预览模块以及处理模块;
    所述处理模块,用于将相机模块与预览模块绑定;
    所述预览模块,用于显示所述相机模块的预览数据;
    所述处理模块,还用于在接收到拍照指令的情况下,从所述预览模块获取所述预览数据,以及基于所述预览数据生成图像。
  9. 一种电子设备,包括处理器以及存储器,所述存储器用于存储一个或多个程序,所述一个或多个程序被配置成由所述处理器执行,所述程序包括用于执行如权利要求1~7任一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1~7任一项所述的方法。
PCT/CN2023/115577 2022-11-11 2023-08-29 拍照方法、监控装置、电子设备及存储介质 WO2024098896A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211413049.0A CN115714907A (zh) 2022-11-11 2022-11-11 拍照方法、监控装置、电子设备及存储介质
CN202211413049.0 2022-11-11

Publications (1)

Publication Number Publication Date
WO2024098896A1 true WO2024098896A1 (zh) 2024-05-16

Family

ID=85232832

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/115577 WO2024098896A1 (zh) 2022-11-11 2023-08-29 拍照方法、监控装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN115714907A (zh)
WO (1) WO2024098896A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714907A (zh) * 2022-11-11 2023-02-24 深圳市广和通无线股份有限公司 拍照方法、监控装置、电子设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150138406A1 (en) * 2013-11-18 2015-05-21 Nokia Corporation Method, apparatus and computer program product for capturing images
CN107222677A (zh) * 2017-05-27 2017-09-29 成都通甲优博科技有限责任公司 多摄像头同时打开的方法及装置
CN107302666A (zh) * 2017-08-29 2017-10-27 广东欧珀移动通信有限公司 拍照方法、移动终端及计算机可读存储介质
CN111405178A (zh) * 2020-03-09 2020-07-10 Oppo广东移动通信有限公司 基于Camera2的拍照方法、装置、存储介质及移动设备
CN112399087A (zh) * 2020-12-07 2021-02-23 Oppo(重庆)智能科技有限公司 图像处理方法、装置、拍摄装置、电子设备和存储介质
CN113890998A (zh) * 2021-10-26 2022-01-04 Oppo广东移动通信有限公司 图像数据的处理方法、装置、电子设备和存储介质
CN115714907A (zh) * 2022-11-11 2023-02-24 深圳市广和通无线股份有限公司 拍照方法、监控装置、电子设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150138406A1 (en) * 2013-11-18 2015-05-21 Nokia Corporation Method, apparatus and computer program product for capturing images
CN107222677A (zh) * 2017-05-27 2017-09-29 成都通甲优博科技有限责任公司 多摄像头同时打开的方法及装置
CN107302666A (zh) * 2017-08-29 2017-10-27 广东欧珀移动通信有限公司 拍照方法、移动终端及计算机可读存储介质
CN111405178A (zh) * 2020-03-09 2020-07-10 Oppo广东移动通信有限公司 基于Camera2的拍照方法、装置、存储介质及移动设备
CN112399087A (zh) * 2020-12-07 2021-02-23 Oppo(重庆)智能科技有限公司 图像处理方法、装置、拍摄装置、电子设备和存储介质
CN113890998A (zh) * 2021-10-26 2022-01-04 Oppo广东移动通信有限公司 图像数据的处理方法、装置、电子设备和存储介质
CN115714907A (zh) * 2022-11-11 2023-02-24 深圳市广和通无线股份有限公司 拍照方法、监控装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN115714907A (zh) 2023-02-24

Similar Documents

Publication Publication Date Title
CN109194960B (zh) 一种图像帧渲染方法、装置及电子设备
CN111163345B (zh) 一种图像渲染方法及装置
WO2024098896A1 (zh) 拍照方法、监控装置、电子设备及存储介质
US20100231735A1 (en) Methods, Apparatuses, and Computer Program Products for Facilitating Concurrent Video Recording and Still Image Capture
CN113890998B (zh) 图像数据的处理方法、装置、电子设备和存储介质
WO2019201077A1 (zh) 一种仅在涉密区域生成水印的方法、系统、装置及介质
CN113329176A (zh) 应用于智能终端的相机的图像处理方法及相关装置
CN111447370B (zh) 摄像头访问方法、访问装置、终端设备及可读存储介质
WO2024040990A1 (zh) 拍照方法及电子设备
CN114124919B (zh) 网络状况的检测方法、装置、计算机设备和存储介质
WO2019071618A1 (zh) 一种图像处理方法及设备
CN115665342B (zh) 图像处理方法、图像处理电路、电子设备和可读存储介质
WO2024007748A1 (zh) 拍照时显示缩略图的方法和电子设备
CN107071284A (zh) 一种拍照方法及终端
CN113760578A (zh) 跨进程快速传输大数据的方法、装置、设备及计算机程序
CN114640798B (zh) 图像处理方法、电子设备及计算机存储介质
CN114020496A (zh) 一种数据核对方法、装置、电子设备和存储介质
CN113992854A (zh) 图像预览方法、装置、电子设备和计算机可读存储介质
WO2018076710A1 (zh) 智能拍照方法及装置、存储介质
CN111447439B (zh) 图像编码方法、图像编码装置及移动终端
CN111294500B (zh) 图像拍摄方法、终端设备及介质
CN111131727A (zh) 视频数据处理方法和装置
CN114968158A (zh) 一种应用投屏方法、装置、电子设备及存储介质
CN115410075A (zh) 动态可配置检测拍照被篡改的方法、系统及存储介质
CN116057937A (zh) 用于检测和去除媒体中的伪影/劣化的方法和电子装置

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

Country of ref document: EP

Kind code of ref document: A1