CN111314606A - Photographing method and device, electronic equipment and storage medium - Google Patents
Photographing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111314606A CN111314606A CN202010106623.2A CN202010106623A CN111314606A CN 111314606 A CN111314606 A CN 111314606A CN 202010106623 A CN202010106623 A CN 202010106623A CN 111314606 A CN111314606 A CN 111314606A
- Authority
- CN
- China
- Prior art keywords
- image data
- preset type
- target image
- image
- size
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/64—Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
- H04N23/631—Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/667—Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Human Computer Interaction (AREA)
- Studio Devices (AREA)
Abstract
The application provides a photographing method, a photographing device, electronic equipment and a storage medium, and belongs to the technical field of imaging. Wherein, the method comprises the following steps: judging whether a target image to be acquired currently meets a preset condition or not; if yes, sending a photographing request for indicating a hardware abstraction layer to return preset type image data to the camera equipment; acquiring metadata returned by a hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters; and performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image. Therefore, by the photographing method, the size of the captured image is not limited by the performance of the image sensor, the size of the captured image can be flexibly adjusted according to the requirements of a user, and the user experience is improved.
Description
Technical Field
The present application relates to the field of imaging technologies, and in particular, to a photographing method and apparatus, an electronic device, and a storage medium.
Background
With the development of science and technology, electronic devices such as smart phones and tablet computers with built-in cameras are increasingly popularized. With the enhancement of the processing capability of the electronic equipment and the development of the camera technology, the performance of the built-in camera is stronger and stronger, and the quality of the shot image is higher and higher. People in daily life use electronic devices such as smart phones and tablet computers to take pictures becomes a normal state.
In the related art, the size of an image captured by an electronic device is limited by the performance of an image sensor in the electronic device, so that a user cannot flexibly set the size of the captured image according to actual shooting requirements, and user experience is affected.
Disclosure of Invention
The photographing method, the photographing device, the electronic equipment and the storage medium are used for solving the problem that in the related technology, the size of an image captured by the electronic equipment is limited by the performance of an image sensor in the electronic equipment, so that a user cannot flexibly set the size of the captured image according to actual photographing requirements, and user experience is influenced.
An embodiment of an aspect of the present application provides a photographing method, including: judging whether a target image to be acquired currently meets a preset condition or not; if yes, sending a photographing request for indicating the hardware abstraction layer to return preset type image data to the hardware abstraction layer; acquiring metadata returned by the hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters; and performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
The device of shooing that this application another aspect embodiment provided includes: the judging module is used for judging whether the target image to be acquired currently meets a preset condition or not; the sending module is used for sending a photographing request for indicating the hardware abstraction layer to return the preset type image data to the hardware abstraction layer if the preset type image data is met; the acquisition module is used for acquiring metadata returned by the hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters; and the generating module is used for carrying out interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
An embodiment of another aspect of the present application provides an electronic device, which includes: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the photographing method as described above when executing the program.
In another aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the photographing method as described above.
In another aspect of the present application, a computer program is provided, which is executed by a processor to implement the photographing method according to the embodiment of the present application.
According to the photographing method, the photographing device, the electronic device, the computer-readable storage medium and the computer program provided by the embodiment of the application, when a target image to be acquired currently meets a preset condition, a photographing request for indicating the hardware abstraction layer to return preset type image data is sent to the hardware abstraction layer, metadata returned by the hardware abstraction layer is acquired, wherein the metadata comprises the preset type image data, the format of the preset type image data and filling parameters, and then interpolation processing is performed on the preset type image data according to the format of the preset type image data and the filling parameters to generate the target image. Therefore, when the target image to be acquired meets the preset condition, interpolation processing is carried out on the captured image data according to the data returned by the hardware abstraction layer after the shooting is finished so as to generate the target image, and therefore the size of the captured image is not limited by the performance of the image sensor by carrying out image post-processing after the image is captured, the size of the captured image can be flexibly adjusted according to the user requirement, and the user experience is improved.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a photographing method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a photographing process provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of another photographing method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another photographing method provided in the embodiment of the present application;
fig. 5 is a schematic flowchart of another photographing method provided in the embodiment of the present application;
fig. 6 is a schematic structural diagram of a photographing device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the like or similar elements throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The embodiment of the application provides a photographing method aiming at the problem that in the related art, the size of an image captured by electronic equipment is limited by the performance of an image sensor in the electronic equipment, so that a user cannot flexibly set the size of the captured image according to actual photographing requirements, and user experience is influenced.
According to the photographing method provided by the embodiment of the application, when the current target image to be acquired meets the preset condition, a photographing request for indicating the hardware abstraction layer to return the preset type image data is sent to the hardware abstraction layer, and the metadata returned by the hardware abstraction layer is acquired, wherein the metadata comprises the preset type image data, the format of the preset type image data and the filling parameters, and then the preset type image data is subjected to interpolation processing according to the format of the preset type image data and the filling parameters to generate the target image. Therefore, when the target image to be acquired meets the preset condition, interpolation processing is carried out on the captured image data according to the data returned by the hardware abstraction layer after the shooting is finished so as to generate the target image, and therefore the size of the captured image is not limited by the performance of the image sensor by carrying out image post-processing after the image is captured, the size of the captured image can be flexibly adjusted according to the user requirement, and the user experience is improved.
The photographing method, apparatus, electronic device, storage medium, and computer program provided by the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a photographing method according to an embodiment of the present application.
As shown in fig. 1, the photographing method includes the following steps:
It should be noted that the photographing method in the embodiment of the present application can be executed by the photographing apparatus in the embodiment of the present application. The photographing device of the embodiment of the application can be configured in any electronic equipment with a camera or an image processing function. The electronic device in the embodiment of the present application may include a mobile phone, a tablet computer, a personal digital assistant, a wearable device, and the like, but is not limited thereto.
The target image to be currently acquired refers to an image which is determined according to a shooting mode currently selected by a user in a camera application, a set shooting parameter and the like and needs to be acquired through a camera in the electronic device.
In the embodiment of the present application, whether the target image to be currently acquired meets the preset condition is determined, which may be whether each parameter of the target image to be currently acquired meets the preset condition. For example, it is determined whether the size of the target image, the photographing mode, the photographing parameter, and the like satisfy preset conditions. Wherein, each parameter of the target image can be determined according to the shooting parameter set by the user in the camera application.
It should be noted that an execution subject of the photographing method according to the embodiment of the present application may be a camera application in a camera architecture, as shown in fig. 2, which is a schematic diagram of a photographing process provided in the embodiment of the present application. The camera device control logic (oneCamera) in the camera application is used for controlling the camera device, such as processing requests of opening a camera, opening a preview, taking a picture, closing the preview, closing the camera, and the like; a camera manager (camera manager) in the camera application is used for configuring and collecting photographing setting items and is also used for controlling a User Interface (UI); the UI part comprises some controls in the camera interface, such as a photographing button, a front camera and a rear camera switching icon and the like. A surface texture (surface texture) for receiving the camera preview data and rendering on a display screen of the electronic device; and the image reader (Imagereader) is used for receiving the image data after shooting.
As a possible implementation manner, a camera manager in the camera application may acquire shooting parameters (such as auto-focus, auto-exposure, auto-white balance, flash speed, light sensitivity, and image size parameters) set by a user in the camera application, determine various parameters of the target image according to the acquired shooting parameters, and further determine whether the various parameters of the target image satisfy preset conditions.
Specifically, the step 101 may include:
and judging whether the size, the shooting mode or the display mode of the current target image to be acquired meet preset conditions.
Optionally, the photographing method according to the embodiment of the present application may be applied to a scene in which the size of the photographed image is customized by the user, so that the size of the captured image is not limited by the performance of the image sensor. That is, in a possible implementation form of the embodiment of the present application, the determining whether the size, the shooting mode, or the display mode of the target image to be currently acquired satisfy a preset condition may include:
and judging whether the size of the target image to be acquired currently is larger than the maximum image size supported by an image sensor in the camera.
As a possible implementation manner, since the size of an image that can be captured by a camera is limited by the performance of an image sensor, after the camera application obtains shooting parameters required for shooting, according to the performance of the image sensor, the size of an image reader (ImageReader) with a fixed size, that is, the size of the ImageReader, is the maximum image size supported by the image sensor in the camera, and the width and height attributes of the image are defined in the created ImageReader. Therefore, if the size of the target image to be acquired currently is larger than the size of the ImageReader, the camera cannot support the acquisition of the target image, so that when the size of the target image is larger than the maximum image size supported by an image sensor in the camera, the target image is determined to meet the preset condition, and the image post-processing is performed after the camera captures the image to generate the target image.
For example, an image size selection control may be provided in the user interface to enable a user to select a desired image size through the image size selection control. If the maximum image size supported by the image sensor in the camera is 46M, and the image size selected by the camera application and acquired by the user is 100M, it may be determined that the target image size is larger than the maximum image size supported by the image sensor, so that it may be determined that the target image to be currently acquired satisfies the preset condition.
It should be noted that, if the target image to be currently acquired does not satisfy the preset condition, the target image may be captured according to a general photographing process, and subsequent steps of the embodiment of the present application do not need to be executed.
And 102, if so, sending a photographing request for indicating the hardware abstraction layer to return preset type image data to the hardware abstraction layer.
The preset type image data may be luminance-chrominance space (YUV) image data or RAW image data (RAW) collected by an image sensor.
It should be noted that, when the hardware abstraction layer calls the camera application to take a picture, the default returns to the image in the Joint Photographic Experts Group (JPEG for short) format, and the post-processing of the image in the JPEG format results in poor quality of the processed image, so in the embodiment of the present application, the hardware abstraction layer can return YUV image data or RAW image data to ensure the quality of the image after-processing.
In this embodiment of the application, after the camera manager in the camera application acquires the shooting parameters, a shooting request including preset type image data may be generated and sent to the hardware abstraction layer through onecamara, so that the hardware abstraction layer may invoke the camera device to capture the preset type image data according to the acquired shooting request.
It should be noted that the photographing request sent to the hardware abstraction layer may further include parameters such as a target image size and the like capable of indicating the current photographing requirement, so that the hardware abstraction layer may return the parameters required to be used in the image post-processing according to the photographing request.
And 103, acquiring metadata returned by the hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters.
The format of the preset type image data is related to the preset type image data. For example, if the preset type image data is YUV image data, the format of the preset type image data may be NV21 or NV12, and the like, which is not limited in this embodiment of the application.
The filling parameters refer to parameters used by the camera application in image post-processing of image data returned by the hardware abstraction layer.
In this embodiment of the application, when a current target image to be acquired meets a preset condition, the size of an image captured by a camera device is not the same as the size of the target image, so that a camera application can acquire metadata (i.e., a photographing result) generated by a hardware abstraction layer after calling the camera device to capture the image according to a photographing request and the image captured by the camera device, specifically, the camera application can acquire a format and a filling parameter of preset type image data returned by the hardware abstraction layer through onecamara, and can acquire the preset type image data returned by the hardware abstraction layer through a flow pipeline, i.e., YUV image data or RAW image data captured by the camera device, through a camera manager.
As a possible implementation, the fill parameter may be that the hardware abstraction layer is determined according to the size of the preset type of image data captured by the camera device and the target image size. For example, if the size of the target image is 10 × 10 pixels and the size of the preset type of image data captured by the camera device is 2 × 10 pixels, the padding parameter may be 5 × 1.
And 104, performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
In the embodiment of the application, an image post-processing module may be added in the camera application, and the acquired preset type image data, the format of the preset type image data, and the filling parameter are sent to the image post-processing module, so that the image post-processing module performs interpolation processing on the preset type image data according to the format of the preset type image data and the filling parameter, so as to generate a target image with a target image size, and sends the generated target image to a memory or a database of the electronic device for storage.
It should be noted that, in actual use, a suitable image interpolation algorithm may be selected according to actual needs to perform interpolation processing on preset type image data, which is not limited in the embodiment of the present application. For example, the image interpolation algorithm used may be a central interpolation algorithm, a squared interpolation algorithm, or the like.
Further, after the target image is generated and stored, the acquisition process of the target image is completed, so that the user interface can be updated to enable the user to take the next photo. That is, in a possible implementation form of the embodiment of the present application, after the step 104, the method may further include:
and updating the available state of each control in the photographing setting interface.
In the embodiment of the application, in order to ensure that the photographing process and the image post-processing process of the camera are smoothly performed, the available state of each control in the photographing setting interface can be set as unavailable after the user presses the photographing key until the target image processing is completed, so that the user is prevented from sending out the photographing request again in the target image acquisition and processing process. Therefore, after the target image is generated, an update instruction can be sent to a camera manager in the camera application through the memory or the database, so that the camera application updates the available state of each control in the photographing setting interface to be available, and normal use of the camera device by a user is ensured.
According to the photographing method provided by the embodiment of the application, when the current target image to be acquired meets the preset condition, a photographing request for indicating the hardware abstraction layer to return the preset type image data is sent to the hardware abstraction layer, and the metadata returned by the hardware abstraction layer is acquired, wherein the metadata comprises the preset type image data, the format of the preset type image data and the filling parameters, and then the preset type image data is subjected to interpolation processing according to the format of the preset type image data and the filling parameters to generate the target image. Therefore, when the target image to be acquired meets the preset condition, interpolation processing is carried out on the captured image data according to the data returned by the hardware abstraction layer after the shooting is finished so as to generate the target image, and therefore the size of the captured image is not limited by the performance of the image sensor by carrying out image post-processing after the image is captured, the size of the captured image can be flexibly adjusted according to the user requirement, and the user experience is improved.
In a possible implementation form of the present application, the photographing method of the embodiment of the present application may also be applied in a video photographing mode to reduce complexity of a video processing process.
The photographing method provided in the embodiment of the present application is further described below with reference to fig. 3.
Fig. 3 is a schematic flowchart of another photographing method according to an embodiment of the present application.
As shown in fig. 3, the photographing method includes the following steps:
In the embodiment of the application, in the video shooting mode, the camera device needs to be called to continuously collect multi-frame images and send the multi-frame images to the camera application when video shooting is performed, so that the collected multi-frame images are processed to generate video data. If the size of the image acquired during video shooting is too large, the amount of data to be processed is large when the hardware abstraction layer returns image data to the camera application, so that the complexity of video data processing is large, and the efficiency of video data processing is reduced. Therefore, the hardware abstraction layer can directly call the camera equipment to capture small-sized images, so that the data transmission quantity between the hardware abstraction layer and the camera application is reduced, and the video data processing efficiency is improved.
It should be noted that, for a video shooting mode including a special effect, for example, in a beauty shooting mode, since special effect processing needs to be performed on a preview image and a shot image, if a captured image is too large in size, direct special effect algorithm processing is performed on a large-size image, which may cause performance problems such as too long processing time, and therefore, before performing special effect processing on the image, the captured image generally needs to be reduced, and then the reduced image needs to be subjected to special effect processing. The following is a detailed description of the beauty photography mode.
In the embodiment of the application, the hardware abstraction layer can directly call the camera device to capture a small-sized image through the photographing method of the embodiment of the application, so that the camera application can directly perform special effect processing on image data returned by the hardware abstraction layer without performing reduction operation, and the image after the special effect processing is amplified through the image post-processing module to generate a target image, thereby simplifying the image processing process in the beauty photographing mode. Therefore, the camera manager in the camera application can judge whether the shooting mode corresponding to the target image to be currently acquired is the beauty shooting mode or not according to the acquired shooting parameters. If yes, the target image can be generated by adopting the photographing method of the embodiment of the application.
And 204, performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
For the detailed implementation process and principle of the steps 202-204, reference may be made to the detailed description of the foregoing embodiments, which are not repeated herein.
According to the photographing method provided by the embodiment of the application, when the photographing mode corresponding to the current target image to be acquired is the video photographing mode, a photographing request for indicating the hardware abstraction layer to return the preset type image data is sent to the hardware abstraction layer, the metadata returned by the hardware abstraction layer is acquired, the metadata comprises the preset type image data, the format of the preset type image data and the filling parameters, and then the preset type image data is subjected to interpolation processing according to the format of the preset type image data and the filling parameters to generate the target image. Therefore, small-size image data are directly acquired in the video shooting mode so as to be convenient for transmission, special effect processing and the like of the image data, and the image after the special effect processing is subjected to interpolation processing through the image post-processing module so as to generate a target image, so that the size of the captured image is not limited by the performance of the image sensor, the size of the captured image can be flexibly adjusted according to the requirements of a user, the image processing process in the video shooting mode is simplified, and the user experience is further improved.
In a possible implementation form of the present application, the photographing method according to the embodiment of the present application may also be applied to an image preview process, so as to reduce data transmission during image preview.
The photographing method provided in the embodiment of the present application is further described below with reference to fig. 4.
Fig. 4 is a schematic flowchart of another photographing method provided in the embodiment of the present application.
As shown in fig. 4, the photographing method includes the following steps:
It should be noted that, since the image displayed in the preview interface of the camera is transferred in real time after the camera is turned on, if the size of the image data returned by the hardware abstraction layer is too large, a click phenomenon of the preview interface is easily caused.
In the embodiment of the application, the shooting method of the embodiment of the application enables the hardware abstraction layer to directly call the camera device to capture small-size images layer by layer, and the camera application can amplify the images through the image post-processing module after acquiring the small-size image data returned by the hardware abstraction layer, so that the data transmission quantity between the hardware abstraction layer and the camera application is reduced, and the fluency of the preview interface is further improved.
As a possible implementation manner, a camera manager in the camera application may determine whether a target image to be currently acquired is an image in the preview interface according to whether a shooting control in the shooting setting interface is triggered. Specifically, if the shooting control in the shooting setting interface is not triggered, it may be determined that the target image to be currently acquired is an image in the preview interface, that is, the target image may be generated by using the shooting method according to the embodiment of the present application.
And 302, if yes, sending a photographing request for indicating the hardware abstraction layer to return preset type image data to the hardware abstraction layer.
And 304, performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
The detailed implementation process and principle of the steps 302-304 can refer to the detailed description of the above embodiments, and are not described herein again.
According to the photographing method provided by the embodiment of the application, when the current target image to be acquired is an image in the preview interface, a photographing request for indicating the hardware abstraction layer to return the preset type image data is sent to the hardware abstraction layer, the metadata returned by the hardware abstraction layer is acquired, the metadata comprises the preset type image data, the format of the preset type image data and the filling parameters, and then the preset type image data is subjected to interpolation processing according to the format of the preset type image data and the filling parameters to generate the target image. Therefore, the camera equipment is directly called through the hardware abstraction layer to obtain small-size image data in the image previewing process, and the small-size image is amplified through the image post-processing module to generate the target image, so that the size of the captured image is not limited by the performance of the image sensor, the size of the captured image can be flexibly adjusted according to the user requirement, the data transfer amount between the hardware abstraction layer and the camera application is reduced, the fluency of the previewing interface is improved, and the user experience is further improved.
In a possible implementation form of the application, when the image acquired by the electronic device needs to be displayed in the external display device, the acquired image can be processed according to the resolution of the external display device, so that the adaptation range of the electronic device and the external display device is widened.
The photographing method provided in the embodiment of the present application is further described below with reference to fig. 5.
Fig. 5 is a flowchart illustrating a further photographing method according to an embodiment of the present application.
As shown in fig. 5, the photographing method includes the following steps:
And step 402, if yes, sending a photographing request for indicating the hardware abstraction layer to return preset type image data to the hardware abstraction layer.
The detailed implementation process and principle of the steps 401-403 may refer to the detailed description of the above embodiments, and are not described herein again.
In the embodiment of the application, the electronic device may further be connected to an external display device to display the target image. The resolution of the external display device may not match the resolution of the image sensor in the electronic device, so that to ensure the optimal display effect of the target image, the size of the target image may be determined according to the resolution of the external display device, and the preset type image data returned by the hardware abstraction layer is interpolated according to the size of the target image to generate the target image.
As a possible implementation manner, when the electronic device is connected to the external display device, if the size of the target image actively input by the user is not obtained, or the size of the target image actively input by the user does not match the resolution of the external display device, the size of the target image may be determined according to the resolution of the external display device. Specifically, if the size of the target image is not actively input by the obtained user and the resolution of the external display device is larger than the maximum image size supported by the image sensor in the electronic device, the size of the target image can be determined according to the resolution of the external display device; or, if the resolution of the external display device is larger than the maximum image size supported by the image sensor in the electronic device and larger than the size of the target image actively input by the user, the size of the target image may also be determined according to the resolution of the external display device, for example, the image size corresponding to the resolution of the external display device may be determined as the size of the target image.
Optionally, step 404 may be further performed before the photographing request is sent to the hardware abstraction layer, so as to determine the size of the target image directly according to the resolution of the external display device, and send the size of the target image to the hardware abstraction layer, so that the hardware abstraction layer determines the filling parameter according to the size of the target image and the image acquired by the camera device.
And 405, performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
In the embodiment of the application, after the size of the target image is determined according to the resolution of the external display device, interpolation processing can be performed on preset type image data according to the size of the target image, the format of the preset type image data and the filling parameters, so as to generate the target image.
Optionally, if the photographing request sent by the camera application to the hardware abstraction layer does not include the size of the target image, the padding parameter returned by the hardware abstraction layer to the camera application may be the size of the preset type image data acquired by the camera device, so that the camera application may perform interpolation processing on the preset type image data according to the size of the target image and the padding parameter, so as to generate the target image.
Optionally, when the electronic device is connected to the external display device, the size of the target image is determined according to the resolution of the external display device, and the hardware abstraction layer may determine the filling parameter according to the size of the target image and the size of the preset type image data acquired by the camera device, so that the camera application may directly perform interpolation processing on the preset type image data according to the filling parameter, thereby reducing the computational complexity of the camera application for performing image post-processing.
According to the photographing method provided by the embodiment of the application, when a target image to be acquired currently meets a preset condition, a photographing request for indicating the hardware abstraction layer to return preset type image data is sent to the hardware abstraction layer, metadata returned by the hardware abstraction layer is acquired, wherein the metadata comprises the preset type image data, the format of the preset type image data and filling parameters, then when the target image is used for being displayed on an external display device connected with electronic equipment, the size of the target image is determined according to the resolution of the external display device, then interpolation processing is carried out on the preset type image data according to the format of the preset type image data and the filling parameters, and the target image is generated. Therefore, when the target image is displayed through the external display device, if the resolution of the external display device is not matched with the performance of the image sensor, interpolation processing can be carried out on the captured image data through image post-processing, so that the size of the generated target image is matched with the resolution of the external display device, and the size of the captured image is not limited by the performance of the image sensor through image post-processing after the image is captured.
In order to implement the above embodiment, the present application further provides a photographing device.
Fig. 6 is a schematic structural diagram of a photographing device according to an embodiment of the present application.
As shown in fig. 6, the photographing apparatus 50 includes:
the judging module 51 is configured to judge whether a target image to be currently acquired meets a preset condition;
a sending module 52, configured to send, if yes, a photographing request for instructing the hardware abstraction layer to return preset type image data to the hardware abstraction layer;
an obtaining module 53, configured to obtain metadata returned by the hardware abstraction layer, where the metadata includes preset type image data, a format of the preset type image data, and a filling parameter;
and the generating module 54 is configured to perform interpolation processing on the preset type image data according to the format and the filling parameter of the preset type image data, so as to generate a target image.
In practical use, the photographing apparatus provided in the embodiment of the present application may be configured in any electronic device to execute the photographing method.
According to the photographing device provided by the embodiment of the application, when a target image to be acquired currently meets a preset condition, a photographing request for indicating the hardware abstraction layer to return preset type image data is sent to the hardware abstraction layer, metadata returned by the hardware abstraction layer is acquired, wherein the metadata comprises the preset type image data, the format of the preset type image data and filling parameters, and then interpolation processing is performed on the preset type image data according to the format of the preset type image data and the filling parameters, so that the target image is generated. Therefore, when the target image to be acquired meets the preset condition, interpolation processing is carried out on the captured image data according to the data returned by the hardware abstraction layer after the shooting is finished so as to generate the target image, and therefore the size of the captured image is not limited by the performance of the image sensor by carrying out image post-processing after the image is captured, the size of the captured image can be flexibly adjusted according to the user requirement, and the user experience is improved.
In a possible implementation form of the present application, the determining module 51 includes:
and the judging unit is used for judging whether the size, the shooting mode or the display mode of the current target image to be acquired meet preset conditions. Further, in another possible implementation form of the present application, the determining unit is specifically configured to:
and judging whether the size of the target image to be acquired currently is larger than the maximum image size supported by an image sensor in the camera.
Further, in another possible implementation form of the present application, the determining unit is further configured to:
and judging whether the shooting mode corresponding to the target image to be acquired currently is a video shooting mode.
Further, in another possible implementation form of the present application, the determining unit is further configured to:
and judging whether the target image to be acquired currently is an image in a preview interface.
Further, in another possible implementation form of the present application, the photographing apparatus 50 further includes:
and the determining module is used for determining the size of the target image according to the resolution of the external display device.
Further, in another possible implementation form of the present application, the preset type of image data is luminance-chrominance space image data or raw image data collected by an image sensor.
Further, in another possible implementation form of the present application, the photographing apparatus 50 further includes:
and the updating module is used for updating the available state of each control in the photographing setting interface.
It should be noted that the foregoing explanation of the embodiment of the photographing method shown in fig. 1, fig. 3, fig. 4, and fig. 5 is also applicable to the photographing apparatus 50 of this embodiment, and is not repeated herein.
The photographing device provided by the embodiment of the application, the photographing method provided by the embodiment of the application, when a photographing mode corresponding to a current target image to be acquired is a video photographing mode, sends a photographing request for instructing a hardware abstraction layer to return preset type image data to the hardware abstraction layer, and acquires metadata returned by the hardware abstraction layer, wherein the metadata includes the preset type image data, a format of the preset type image data and a filling parameter, and then performs interpolation processing on the preset type image data according to the format of the preset type image data and the filling parameter to generate the target image. Therefore, small-size image data are directly acquired in the video shooting mode so as to be convenient for transmission, special effect processing and the like of the image data, and the image after the special effect processing is amplified and interpolated through the image post-processing module so as to generate a target image, so that the size of the captured image is not limited by the performance of the image sensor, the size of the captured image can be flexibly adjusted according to the requirements of a user, the image processing process in the video shooting mode is simplified, and the user experience is further improved.
In order to implement the above embodiments, the present application further provides an electronic device.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
As shown in fig. 7, the electronic device 200 includes:
a memory 210 and a processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), wherein the memory 210 stores a computer program, and when the processor 220 executes the program, the photographing method according to the embodiment of the present application is implemented.
A program/utility 280 having a set (at least one) of program modules 270, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment, may be stored in, for example, the memory 210. The program modules 270 generally perform the functions and/or methodologies of the embodiments described herein.
The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210.
It should be noted that, for the implementation process and the technical principle of the electronic device of the embodiment, reference is made to the foregoing explanation of the photographing method of the embodiment of the present application, and details are not described here again.
The electronic device provided by the embodiment of the application can execute the photographing method as described above, and when a target image to be currently acquired meets a preset condition, a photographing request for instructing the hardware abstraction layer to return preset type image data is sent to the hardware abstraction layer, and metadata returned by the hardware abstraction layer is acquired, where the metadata includes the preset type image data, a format of the preset type image data, and a filling parameter, and further, according to the format of the preset type image data and the filling parameter, interpolation processing is performed on the preset type image data, so as to generate the target image. Therefore, when the target image to be acquired meets the preset condition, interpolation processing is carried out on the captured image data according to the data returned by the hardware abstraction layer after the shooting is finished so as to generate the target image, and therefore the size of the captured image is not limited by the performance of the image sensor by carrying out image post-processing after the image is captured, the size of the captured image can be flexibly adjusted according to the user requirement, and the user experience is improved.
In order to implement the above embodiments, the present application also proposes a computer-readable storage medium.
The computer readable storage medium stores thereon a computer program, and the computer program is executed by a processor to implement the photographing method according to the embodiment of the present application.
In order to implement the foregoing embodiments, a further embodiment of the present application provides a computer program, which when executed by a processor, implements the photographing method according to the embodiments of the present application.
In an alternative implementation, the embodiments may be implemented in any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device and partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., through the internet using an internet service provider).
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (11)
1. A method of taking a picture, comprising:
judging whether a target image to be acquired currently meets a preset condition or not;
if yes, sending a photographing request for indicating the hardware abstraction layer to return preset type image data to the hardware abstraction layer;
acquiring metadata returned by the hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters;
and performing interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
2. The method as claimed in claim 1, wherein the determining whether the target image to be currently acquired satisfies a preset condition includes:
and judging whether the size, the shooting mode or the display mode of the current target image to be acquired meet preset conditions.
3. The method of claim 2, wherein the determining whether the size, the shooting mode, or the display mode of the target image to be currently acquired satisfies a preset condition comprises:
and judging whether the size of the target image to be acquired currently is larger than the maximum image size supported by an image sensor in the camera.
4. The method of claim 2, wherein the determining whether the size, the shooting mode, or the display mode of the target image to be currently acquired satisfies a preset condition comprises:
and judging whether the shooting mode corresponding to the target image to be acquired currently is a video shooting mode.
5. The method of claim 2, wherein the determining whether the size, the shooting mode, or the display mode of the target image to be currently acquired satisfies a preset condition comprises:
and judging whether the target image to be acquired currently is an image in a preview interface.
6. The method according to any one of claims 1 to 5, wherein if the target image is for display on an external display device connected to an electronic device, before the interpolating the preset type image data, further comprising:
and determining the size of the target image according to the resolution of the external display device.
7. The method according to any one of claims 1 to 5, wherein the predetermined type of image data is luminance-chrominance spatial image data or raw image data acquired by an image sensor.
8. The method according to any one of claims 1 to 5, wherein after the interpolation processing is performed on the preset type of image data according to the format and the filling parameter of the preset type of image data, the method further comprises:
and updating the available state of each control in the photographing setting interface.
9. A photographing apparatus, comprising:
the judging module is used for judging whether the target image to be acquired currently meets a preset condition or not;
the sending module is used for sending a photographing request for indicating the hardware abstraction layer to return the preset type image data to the hardware abstraction layer if the preset type image data is met;
the acquisition module is used for acquiring metadata returned by the hardware abstraction layer, wherein the metadata comprises preset type image data, a format of the preset type image data and filling parameters;
and the generating module is used for carrying out interpolation processing on the preset type image data according to the format and the filling parameters of the preset type image data to generate a target image.
10. An electronic device, comprising: memory, processor and program stored on the memory and executable on the processor, characterized in that the processor implements the photographing method according to any one of claims 1 to 8 when executing the program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the photographing method according to any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010106623.2A CN111314606B (en) | 2020-02-21 | 2020-02-21 | Photographing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010106623.2A CN111314606B (en) | 2020-02-21 | 2020-02-21 | Photographing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111314606A true CN111314606A (en) | 2020-06-19 |
CN111314606B CN111314606B (en) | 2021-06-18 |
Family
ID=71153134
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010106623.2A Active CN111314606B (en) | 2020-02-21 | 2020-02-21 | Photographing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111314606B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113840091A (en) * | 2021-10-29 | 2021-12-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, electronic equipment and computer readable storage medium |
CN114125284A (en) * | 2021-11-18 | 2022-03-01 | Oppo广东移动通信有限公司 | Image processing method, electronic device, and storage medium |
CN114745495A (en) * | 2021-01-07 | 2022-07-12 | 北京小米移动软件有限公司 | Image generation method, image generation device and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104092931A (en) * | 2013-04-01 | 2014-10-08 | 德信无线通讯科技(北京)有限公司 | Method used for improving resolution |
CN106954099A (en) * | 2017-03-31 | 2017-07-14 | 青岛海信移动通信技术股份有限公司 | First terminal shows the method and system of the screen interface of second terminal |
CN109891905A (en) * | 2016-09-08 | 2019-06-14 | 皇家Kpn公司 | Partial video coding/decoding method, equipment and system |
CN109963083A (en) * | 2019-04-10 | 2019-07-02 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110062161A (en) * | 2019-04-10 | 2019-07-26 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110086967A (en) * | 2019-04-10 | 2019-08-02 | Oppo广东移动通信有限公司 | Image processing method, image processor, filming apparatus and electronic equipment |
CN110121022A (en) * | 2019-06-28 | 2019-08-13 | Oppo广东移动通信有限公司 | Control method, filming apparatus and the electronic equipment of filming apparatus |
CN110177214A (en) * | 2019-06-28 | 2019-08-27 | Oppo广东移动通信有限公司 | Image processor, image processing method, camera arrangement and electronic equipment |
CN110266951A (en) * | 2019-06-28 | 2019-09-20 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110290288A (en) * | 2019-06-03 | 2019-09-27 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110300240A (en) * | 2019-06-28 | 2019-10-01 | Oppo广东移动通信有限公司 | Image processor, image processing method, camera arrangement and electronic equipment |
US10510153B1 (en) * | 2017-06-26 | 2019-12-17 | Amazon Technologies, Inc. | Camera-level image processing |
CN110636353A (en) * | 2019-06-10 | 2019-12-31 | 青岛海信电器股份有限公司 | Display device |
-
2020
- 2020-02-21 CN CN202010106623.2A patent/CN111314606B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104092931A (en) * | 2013-04-01 | 2014-10-08 | 德信无线通讯科技(北京)有限公司 | Method used for improving resolution |
CN109891905A (en) * | 2016-09-08 | 2019-06-14 | 皇家Kpn公司 | Partial video coding/decoding method, equipment and system |
CN106954099A (en) * | 2017-03-31 | 2017-07-14 | 青岛海信移动通信技术股份有限公司 | First terminal shows the method and system of the screen interface of second terminal |
US10510153B1 (en) * | 2017-06-26 | 2019-12-17 | Amazon Technologies, Inc. | Camera-level image processing |
CN109963083A (en) * | 2019-04-10 | 2019-07-02 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110062161A (en) * | 2019-04-10 | 2019-07-26 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110086967A (en) * | 2019-04-10 | 2019-08-02 | Oppo广东移动通信有限公司 | Image processing method, image processor, filming apparatus and electronic equipment |
CN110290288A (en) * | 2019-06-03 | 2019-09-27 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110636353A (en) * | 2019-06-10 | 2019-12-31 | 青岛海信电器股份有限公司 | Display device |
CN110266951A (en) * | 2019-06-28 | 2019-09-20 | Oppo广东移动通信有限公司 | Image processor, image processing method, filming apparatus and electronic equipment |
CN110177214A (en) * | 2019-06-28 | 2019-08-27 | Oppo广东移动通信有限公司 | Image processor, image processing method, camera arrangement and electronic equipment |
CN110300240A (en) * | 2019-06-28 | 2019-10-01 | Oppo广东移动通信有限公司 | Image processor, image processing method, camera arrangement and electronic equipment |
CN110121022A (en) * | 2019-06-28 | 2019-08-13 | Oppo广东移动通信有限公司 | Control method, filming apparatus and the electronic equipment of filming apparatus |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114745495A (en) * | 2021-01-07 | 2022-07-12 | 北京小米移动软件有限公司 | Image generation method, image generation device and storage medium |
CN113840091A (en) * | 2021-10-29 | 2021-12-24 | Oppo广东移动通信有限公司 | Image processing method, image processing device, electronic equipment and computer readable storage medium |
CN113840091B (en) * | 2021-10-29 | 2023-07-18 | Oppo广东移动通信有限公司 | Image processing method, apparatus, electronic device, and computer-readable storage medium |
CN114125284A (en) * | 2021-11-18 | 2022-03-01 | Oppo广东移动通信有限公司 | Image processing method, electronic device, and storage medium |
CN114125284B (en) * | 2021-11-18 | 2023-10-31 | Oppo广东移动通信有限公司 | Image processing method, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111314606B (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114205522B (en) | Method for long-focus shooting and electronic equipment | |
CN110493538B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN111491102B (en) | Detection method and system for photographing scene, mobile terminal and storage medium | |
CN111314606B (en) | Photographing method and device, electronic equipment and storage medium | |
CN109040523B (en) | Artifact eliminating method and device, storage medium and terminal | |
CN112770059B (en) | Photographing method and device and electronic equipment | |
EP3525446A1 (en) | Photographing method and terminal | |
CN115689963B (en) | Image processing method and electronic equipment | |
CN109923850A (en) | A kind of image capture device and method | |
CN117479000B (en) | Video recording method and related device | |
JP2010016826A (en) | System and method for efficiently performing image processing operations | |
CN111259441B (en) | Device control method, device, storage medium and electronic device | |
CN115359105B (en) | Depth-of-field extended image generation method, device and storage medium | |
CN113810604A (en) | Document shooting method and device | |
KR20230086770A (en) | Shooting method, shooting device, electronic device and readable storage medium | |
EP4262226A1 (en) | Photographing method and related device | |
CN117692759A (en) | Method, terminal, storage medium and chip for generating preview image | |
CN115460343A (en) | Image processing method, apparatus and storage medium | |
CN113746998A (en) | Image processing method, device, equipment and storage medium | |
CN117560574B (en) | Shooting method, electronic equipment and readable storage medium | |
CN117278864B (en) | Image capturing method, electronic device, and storage medium | |
US20240292096A1 (en) | Multi-camera strategy scheduling method and related device thereof | |
CN118828188A (en) | Shooting method, shooting device, electronic equipment and medium | |
CN114125197A (en) | Mobile terminal and photographing method thereof | |
CN118828231A (en) | Image processing method and device, electronic equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |