Image pickup control method and apparatus, electronic device, and computer-readable storage medium
Patent Information
- Application Number
- CN202210573278.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-05-24
AI Technical Summary
[0003]但是,由于每种操作对摄像头的参数需求、功能模块需求不同,因此,摄像头的启动过程涉及的参数有待优化
[0037] This embodiment of the application collects real-time data streams from the camera when a target application calls the camera, obtains the target application's identification information and the corresponding configuration information of the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of the camera call based on the application's identification information and the data stream configuration information, the purpose of the camera call is determined, and the camera's startup parameters are controlled according to the purpose of the call, thereby achieving camera image control. Adjusting the camera parameters based on the target camera call allows for adjustment of the camera's startup parameters according to the call requirements, improving the camera's processing performance.
Smart Images

Figure CN117177047B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a camera control method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] Currently, the camera functions of mobile terminals are constantly being enriched. For example, the camera can be used to perform various functions such as previewing videos, scanning QR codes, taking photos, or recording videos.
[0003] However, since each operation has different requirements for camera parameters and functional modules, the parameters involved in the camera startup process need to be optimized. Summary of the Invention
[0004] This application provides a camera control method, apparatus, electronic device, and computer-readable storage medium that can enable rapid updates of current radio frequency parameters.
[0005] In a first aspect, embodiments of this application provide a camera control method, including:
[0006] Collect real-time data streams when the target application calls the camera;
[0007] Obtain the identification information of the target application and the configuration information corresponding to the real-time data stream;
[0008] The target operation of the invocation is determined based on the identification information and the configuration information;
[0009] Adjust the camera's startup parameters according to the target operation.
[0010] Secondly, embodiments of this application also provide a camera control device, including:
[0011] The acquisition module is used to acquire real-time data streams when the target application accesses the camera;
[0012] The acquisition module is used to acquire the identification information of the target application and the configuration information corresponding to the real-time data stream;
[0013] The determination module is used to determine the target operation of the invocation based on the identification information and the configuration information;
[0014] The control module is used to adjust the camera's startup parameters according to the target operation.
[0015] In some embodiments of this application, the determining module includes:
[0016] The acquisition unit is used to acquire the historical call results of the target application to the camera;
[0017] The determining unit is used to determine the target operation corresponding to the identification information and the configuration information based on the historical call results.
[0018] In some embodiments of this application, the determining unit includes:
[0019] The first acquisition subunit is used to obtain the historical actual call results of the target application calling the camera based on each historical data stream, according to the historical call results;
[0020] The statistics subunit is used to count the frequency of occurrence of each type of historical actual call result corresponding to each historical data stream;
[0021] A subunit is defined to determine the historical master operation result corresponding to the historical data stream based on the frequency of occurrence.
[0022] The second acquisition subunit is used to obtain the target operation of the target application calling the camera based on the real-time data stream, according to the historical main operation result corresponding to each historical data stream.
[0023] In some embodiments of this application, the determined subunit is specifically used for:
[0024] The historical actual call results with the highest occurrence frequency and the occurrence frequency reaching a preset threshold are used as the historical main operation results of the target application calling the camera based on the historical data stream.
[0025] In some embodiments of this application, the second acquisition subunit is specifically used for:
[0026] From the plurality of historical data streams, determine the target historical data stream that is the same as the real-time data stream;
[0027] Determine the historical master operation results corresponding to the target historical data stream;
[0028] The operation corresponding to the historical master operation result is used as the target operation for the target application to call the camera.
[0029] In some embodiments of this application, the device further includes a startup module, which includes:
[0030] A startup unit is used to start the camera according to the startup parameters;
[0031] The generation unit is used to obtain the invoked operation result of the camera based on the image information of the camera.
[0032] In some embodiments of this application, the generation unit includes:
[0033] The filtering subunit is used to filter the content of the last frame corresponding to the image information.
[0034] The identification subunit is used to identify the content of the image and obtain the result of the camera being invoked.
[0035] Thirdly, embodiments of this application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described camera control method.
[0036] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the above-described camera control method.
[0037] This embodiment of the application collects real-time data streams from the camera when a target application calls the camera, obtains the target application's identification information and the corresponding configuration information of the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of the camera call based on the application's identification information and the data stream configuration information, the purpose of the camera call is determined, and the camera's startup parameters are controlled according to the purpose of the call, thereby achieving camera image control. Adjusting the camera parameters based on the target camera call allows for adjustment of the camera's startup parameters according to the call requirements, improving the camera's processing performance. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a schematic diagram of a scene for the camera control method provided in the embodiments of this application;
[0040] Figure 2 This is a schematic flowchart of the camera control method provided in the embodiments of this application;
[0041] Figure 3 This is a schematic diagram illustrating the process of an application calling a camera to take pictures, as provided in an embodiment of this application.
[0042] Figure 4 This is a schematic diagram illustrating the process of an application calling the camera to scan a code, as provided in an embodiment of this application.
[0043] Figure 5 This is a schematic diagram illustrating the result of an application accessing a camera in historical time, as provided in an embodiment of this application.
[0044] Figure 6 This is a schematic diagram of the camera control device provided in the embodiments of this application;
[0045] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0046] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] This application provides a camera control method, apparatus, electronic device, and computer-readable storage medium. Specifically, this application provides a camera control apparatus suitable for electronic devices, wherein the electronic device includes a terminal device, which may be a mobile phone, tablet, or other device.
[0048] Please see Figure 1 Taking the camera control method executed by the terminal device as an example, the specific execution process of the camera control method is as follows:
[0049] When terminal device 10 detects that an application on its own device is calling the camera, it collects the data stream used by the application to call the camera, obtains the application's identification information and the configuration information corresponding to the data stream, determines the purpose of calling the camera based on the application's identification information and the configuration information of the data stream, and adjusts the camera's startup parameters according to the purpose of the operation.
[0050] In this embodiment of the application, the purpose of calling the camera may include previewing, scanning QR codes, taking photos, or recording videos.
[0051] In this embodiment of the application, the camera's startup parameters are different when the camera is invoked based on different operational purposes. Therefore, the camera's startup parameters can be adjusted according to different operational purposes.
[0052] This embodiment of the application collects real-time data streams from the camera when a target application calls the camera, obtains the target application's identification information and the corresponding configuration information of the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of the camera call based on the application's identification information and the data stream configuration information, the purpose of the camera call is determined, and the camera's startup parameters are controlled according to the purpose of the call, thereby achieving camera image control. Adjusting the camera parameters based on the target camera call allows for adjustment of the camera's startup parameters according to the call requirements, improving the camera's processing performance.
[0053] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0054] Please see Figure 2 , Figure 2 This is a schematic flowchart of a camera control method provided in an embodiment of this application. The specific flow of the camera control method can be as follows:
[0055] 101. Collect real-time data streams when the target application calls the camera.
[0056] In this embodiment of the application, "application" refers to an application program on a mobile terminal, which is used to perform specific corresponding functions during runtime. The application may include social applications, news applications, game applications, online shopping applications, or utility applications, etc., and different types of applications correspond to different types of functions.
[0057] In this embodiment, the data stream is an ordered sequence of bytes with a start and an end point. The data stream may include an input stream and an output stream. Different data streams are used to invoke the camera, thereby driving the camera to perform different camera operations.
[0058] In this embodiment of the application, the camera includes a camera located on a mobile terminal, which is activated by an application in the mobile terminal.
[0059] Specifically, when an application is detected accessing the camera, the data stream of the application accessing the camera is collected to facilitate the analysis and judgment of the purpose of the application accessing the camera.
[0060] 102. Obtain the identification information of the target application and the configuration information corresponding to the real-time data stream.
[0061] The application's identification information refers to the information used to distinguish an application from other applications. This identification information allows for the identification of the corresponding application, preventing confusion, misuse, or errors during application identification. In this embodiment, the application's identification information uniquely identifies the application, allowing for the identification of a unique application. In this embodiment, the application's data packet name can be used as the application's identification information.
[0062] Among them, the configuration information of the data stream refers to the configuration information of the parameters in the data stream. By configuring the data stream, the startup parameters of the camera device are controlled, realizing the function of controlling the camera startup and use according to the data stream call, as well as controlling various parameter information of the camera during use and adjusting the performance parameters of the camera during use.
[0063] By obtaining the identification information of the application calling the camera and the configuration information of the data stream, it is easy to determine the purpose of the application calling the camera based on the identification information and configuration information.
[0064] 103. Determine the target operation of the call based on the identification information and the configuration information.
[0065] In this embodiment of the application, the operation of calling the camera may include scanning a code, taking a picture, recording a video, or previewing, etc.
[0066] Specifically, the application that calls the camera is identified by the identification information. By analyzing the configuration information of the data stream and the identification information of the application that calls the camera, the purpose of the application calling the camera based on the data stream of the configuration information can be determined, and thus the target operation of the call can be obtained.
[0067] Since different applications can perform different camera operations (scanning QR codes, recording videos, or taking photos) through the same configured data stream, or perform the same camera operation through different configured data streams, it is not possible to directly determine whether the purpose of an application calling the camera is to scan QR codes or take photos based on the configuration information of the data stream. Therefore, it is necessary to combine the specific application and make a comprehensive judgment based on the configuration information of the application and the data stream when calling the camera to determine the purpose of the application calling the camera.
[0068] For example, regarding application A, if application A frequently calls the camera to perform QR code scanning operations using the data stream of configuration information a, then when application A calls the camera using the data stream of configuration information a, it can be analyzed that the purpose of the application calling the camera is to perform QR code scanning operations. If application A frequently calls the camera to perform photo taking operations using the data stream of configuration information b, then when application A calls the camera using the data stream of configuration information b, it can be analyzed that the purpose of the application calling the camera is to perform photo taking operations, and so on.
[0069] Therefore, in this embodiment of the application, the purpose of the application calling the camera based on the current data stream can be analyzed and determined based on the application's call results in historical time. That is, optionally, in some embodiments of this application, the step "determine the target operation of the call based on the identification information and the configuration information" includes:
[0070] Obtain the historical call results of the target application to the camera;
[0071] Based on the historical call results, determine the target operation corresponding to the identification information and the configuration information.
[0072] In this embodiment, the call result includes the operation result of calling the camera's historical time, which may include scanning a code, taking a photo, or recording a video. Correspondingly, in this embodiment, the call result also includes configuration information of the data stream when the application calls the camera; that is, the call result includes the operation result of the application calling the camera based on each data stream.
[0073] By recording the results of applications calling the camera in historical time periods, the purpose of the application's current camera call can be analyzed based on the application's historical call results.
[0074] Since an application can perform multiple camera operations based on the same data stream of configuration information, the results of an application calling the camera based on the same data stream can include multiple operations. For example, application A can perform a QR code scanning operation based on the data stream of configuration information a, and it can also perform a photo taking operation based on the data stream of configuration information a. Alternatively, application A can also perform a QR code scanning operation or a photo taking operation based on the data stream of configuration information b.
[0075] Therefore, it is difficult to directly determine the exact purpose of calling the camera based on the application's identification information and data stream. Based on this, in this embodiment, the frequency of occurrence of each operation result when the application calls the camera based on each data stream can be statistically analyzed. The main operation purpose of the application calling the camera can then be selected based on the frequency of occurrence. That is, optionally, in some embodiments of this application, the step "determining the target operation corresponding to the identification information and the configuration information based on the call result" includes:
[0076] Based on the historical call results, the actual historical call results of the target application calling the camera based on each historical data stream are obtained;
[0077] For each historical data stream, the frequency of occurrence of each type of historical actual call result corresponding to the historical data stream is counted;
[0078] Based on the frequency of occurrence, determine the historical master operation results corresponding to the historical data stream;
[0079] Based on the historical master operation results corresponding to each historical data stream, the target operation of the target application calling the camera based on the real-time data stream is obtained.
[0080] In this embodiment, the frequency of occurrence is the ratio of the number of times each historical actual call result occurs to the total number of historical actual call results corresponding to that historical data stream. For example, the frequency of occurrence of a QR code scanning operation can be obtained by the ratio of the number of QR code scanning operations to the total number of camera shots in that data stream.
[0081] The main operation result is the main operation result of the application under the data stream configured. For example, if the number of QR code scanning operations of the application under the data stream is large, then the main operation result of the application under the data stream is considered to be the QR code scanning operation.
[0082] Therefore, after determining the main operation result corresponding to each historical data stream, the operation purpose of the application when calling the camera in the current data stream can be obtained based on each historical data stream corresponding to the application and the historical main operation result corresponding to each historical data stream.
[0083] In this embodiment of the application, when determining the main operation result corresponding to each data stream, it can be determined based on the frequency of occurrence of each operation result in the operation results corresponding to the data stream and a predetermined threshold. That is, optionally, in some embodiments of the application, the step "determining the historical main operation result corresponding to the historical data stream based on the frequency of occurrence" includes:
[0084] The historical actual call results with the highest occurrence frequency and the occurrence frequency reaching a preset threshold are used as the historical main operation results of the target application calling the camera based on the historical data stream.
[0085] In this method, by selecting the historical actual call results that occur most frequently and whose frequency reaches a preset threshold as the main operation result of the application calling the camera, the operation results corresponding to the frequent operations of the application calling the camera under this data stream are used as the main operation result, which improves the accuracy of analyzing the purpose of the application calling the camera under the current data stream based on the main operation result.
[0086] In this embodiment of the application, after obtaining the historical master operation result corresponding to each historical data stream, the corresponding master operation result can be filtered out by comparing the current data stream with the historical data stream, and the operation corresponding to the master operation result can be used as the target operation for the application to call the camera based on the current data. That is, optionally, in some embodiments of this application, the step "obtaining the target operation for the target application to call the camera based on the real-time data stream according to the historical master operation result corresponding to each historical data stream" includes:
[0087] From the plurality of historical data streams, determine the target historical data stream that is the same as the real-time data stream;
[0088] Determine the historical master operation results corresponding to the target historical data stream;
[0089] The operation corresponding to the historical master operation result is used as the target operation for the target application to call the camera.
[0090] By comparing the current real-time data stream with historical data streams, a target historical data stream that is the same as the current actual data stream can be selected from several historical data streams. Based on the correspondence between historical data streams and historical master operation results, the historical master operation result corresponding to the target historical data stream can be obtained. In turn, the target operation of the application calling the camera based on the current real-time data stream can be obtained.
[0091] It is also important to emphasize that different user terminals can perform different operations using the same application and the same configured data stream. For example, application B can be used to take photos or scan QR codes. Therefore, different users can use application B to take photos or scan QR codes. Thus, the purpose of the application in the terminal when starting the camera can be determined based on the configuration information of the user terminal (corresponding to the corresponding user), the application, and the data stream when calling the camera.
[0092] 104. Adjust the camera's startup parameters according to the target operation.
[0093] By analyzing application identification information and data stream configuration information, the target operation for the application to call the camera can be obtained. After adjusting the camera's startup parameters according to this target operation, camera startup control can be achieved. Based on this startup parameter control, the camera's startup function and parameters can be managed, improving the camera's image performance. For example, when a regular camera is opened by an application, we configure many functions (such as noise reduction and other algorithms) at the underlying level to ensure the application gets the best effect and a fast response when taking pictures. However, for QR code scanning, high image quality is not actually required; speed is more important. Therefore, we can reduce the loading of some modules, reduce memory usage, and adjust the image sharpening and other effects specifically for QR code scanning scenarios to improve the camera's processing efficiency during the scanning process.
[0094] In this embodiment, after adjusting the camera's startup parameters, the actual operation results of the camera can be obtained based on its actual operation. This allows the application to optimize historical camera call data and improve the accuracy of analyzing the target camera call based on data streams when subsequently calling the camera. Optionally, in some embodiments of this application, the step "adjusting the camera's startup parameters according to the target operation" includes:
[0095] The camera is activated according to the activation parameters;
[0096] Based on the image information from the camera, the result of the camera being invoked is obtained.
[0097] By analyzing the camera's video feed, the result of the current operation being invoked by the camera can be determined. For example, if a QR code appears in the video feed after the camera is started, it can be determined that the purpose of starting the camera this time is to recognize the QR code, that is, to perform a scanning operation.
[0098] In this embodiment of the application, to improve the recognition efficiency of the camera's invoked operation result, the camera's invoked operation result can also be determined based on the last frame of the camera image. Analysis of the last frame improves the analysis efficiency of the camera's invoked operation result. That is, optionally, in some embodiments of this application, the step "obtaining the camera's invoked operation result based on the camera's image information" includes:
[0099] Filter the content of the last frame corresponding to the aforementioned image information;
[0100] The content of the image is identified to obtain the result of the camera being invoked.
[0101] When the camera is used for scanning QR codes and recognizes the QR code in the image, the camera's operation ends. At this point, the camera should retain the QR code image information in the last frame of the recording process. Therefore, the operation result of the camera can be judged directly by analyzing the last frame of the recording.
[0102] In this embodiment, after analyzing the target of the camera being accessed, the camera's startup parameters can be adjusted according to the target to improve camera performance and reduce unnecessary resource waste. For example, when it is identified that the application is accessing the camera for scanning a QR code, the camera's startup parameters can be adjusted according to the requirements of the scanning operation to improve scanning efficiency and reduce resource waste during camera use.
[0103] This embodiment of the application collects real-time data streams from the camera when a target application calls the camera, obtains the target application's identification information and the corresponding configuration information of the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of the camera call based on the application's identification information and the data stream configuration information, the purpose of the camera call is determined, and the camera's startup parameters are controlled according to the purpose of the call, thereby achieving camera image control. Adjusting the camera parameters based on the target camera call allows for adjustment of the camera's startup parameters according to the call requirements, improving the camera's processing performance.
[0104] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the process of an application calling the camera to take pictures, provided in an embodiment of this application. The specific process of the application calling the camera to take pictures includes:
[0105] 111. Applications that connect to the camera provide corresponding services;
[0106] 112. Application configuration calls the camera's data stream;
[0107] 113. The application starts the camera's preview function based on the data stream request;
[0108] 114. The camera's image is returned from the bottom layer;
[0109] 115. The application parses the content information in the camera image to obtain the camera's call results.
[0110] In this process, the application calls the camera based on the data stream and requests the camera to perform corresponding operations. For example, the application requests to start the camera based on the configured data stream to start operations such as recording, previewing, taking pictures, or scanning QR codes.
[0111] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating the process of an application calling the camera to scan a QR code, provided in an embodiment of this application. The specific process of the application calling the camera to scan a QR code includes:
[0112] 121. Applications that connect to the camera provide corresponding services;
[0113] 122. Application configuration calls the camera's data stream;
[0114] 123. Obtain the application's identification information and data stream configuration information;
[0115] 124. Based on the application's identification information and data stream configuration information, determine whether the application calls the camera for scanning QR codes. If it is for scanning QR codes, proceed to step 115; otherwise, proceed to step 116.
[0116] 125. The camera's underlying system adjusts the camera's startup parameters and underlying calling process according to the requirements of the QR code scanning operation.
[0117] 126. The application launches the camera preview function based on a data stream request;
[0118] 127. The application obtains the camera footage returned from the underlying camera;
[0119] 128. Analyze the camera's video feed and update the camera's historical call result database.
[0120] Before the camera is started, the purpose of the application calling the camera is analyzed based on the configuration information of the data stream of the application calling the camera and the application's identification information. The camera startup parameters are adjusted according to the purpose of the call, which improves the shooting efficiency after the camera is started.
[0121] In this embodiment of the application, the purpose of the application calling the camera based on the current data stream can be analyzed based on the application's historical call results. For example, by statistically analyzing the historical call information of the camera and comparing it with the current data stream, the purpose of the application calling the camera based on the current data stream can be obtained.
[0122] Please refer to Figure 5 , Figure 5 This is a schematic diagram of the application calling the camera in historical time according to an embodiment of this application. The schematic diagram records the actual operation result of each application calling the camera based on each data stream, the number of each actual operation result and the total number of camera calls. The actual operation result is taken as scanning a code.
[0123] In this embodiment of the application, the camera retrieval results stored in the database can be referenced. Figure 5 The diagram below illustrates the call results. Each time the application uses the camera, the "Total Number of Camera Opens" in the database is incremented by 1.
[0124] In this embodiment of the application, the screen content is recorded every 10 frames during use. If there is a QR code in the middle area of the last recorded screen before the application disconnects the camera, the "scan count" in the database is incremented by 1.
[0125] In this embodiment of the application, if the ratio of the number of QR code scans to the total number of camera calls is greater than or equal to 70%, it can be determined that the application's intention in calling the camera based on the configured data stream is to scan a QR code.
[0126] Specifically, by analyzing the application before calling the camera, the purpose of the application calling the camera can be predicted, and the camera startup parameters can be controlled according to the purpose of the call to improve the camera's video recording performance. At the same time, stopping the loading of unnecessary functions during the camera recording process can improve the camera's video recording efficiency and processing efficiency.
[0127] To facilitate better implementation of the camera control method of this application, this application also provides a camera control device based on the above-described camera control method. The meaning of the third target term is the same as in the above-described camera control method; specific implementation details can be found in the description of the method embodiments.
[0128] Please see Figure 6 , Figure 6 This application provides a schematic diagram of the structure of a camera control device, wherein the camera control device may include:
[0129] The acquisition module 201 is used to acquire real-time data streams when the target application calls the camera;
[0130] The acquisition module 202 is used to acquire the identification information of the target application and the configuration information corresponding to the real-time data stream;
[0131] The determining module 203 is used to determine the target operation of the call based on the identification information and the configuration information;
[0132] The control module 204 is used to adjust the startup parameters of the camera according to the target operation.
[0133] In some embodiments of this application, the determining module 203 includes:
[0134] The acquisition unit is used to acquire the historical call results of the target application to the camera;
[0135] The determining unit is used to determine the target operation corresponding to the identification information and the configuration information based on the historical call results.
[0136] In some embodiments of this application, the determining unit includes:
[0137] The first acquisition subunit is used to obtain the historical actual call results of the target application calling the camera based on each historical data stream, according to the historical call results;
[0138] The statistics subunit is used to count the frequency of occurrence of each type of historical actual call result corresponding to each historical data stream;
[0139] A subunit is defined to determine the historical master operation result corresponding to the historical data stream based on the frequency of occurrence.
[0140] The second acquisition subunit is used to obtain the target operation of the target application calling the camera based on the real-time data stream, according to the historical main operation result corresponding to each historical data stream.
[0141] In some embodiments of this application, the determined subunit is specifically used for:
[0142] The historical actual call results with the highest occurrence frequency and the occurrence frequency reaching a preset threshold are used as the historical main operation results of the target application calling the camera based on the historical data stream.
[0143] In some embodiments of this application, the second acquisition subunit is specifically used for:
[0144] From the plurality of historical data streams, determine the target historical data stream that is the same as the real-time data stream;
[0145] Determine the historical master operation results corresponding to the target historical data stream;
[0146] The operation corresponding to the historical master operation result is used as the target operation for the target application to call the camera.
[0147] In some embodiments of this application, the device further includes a startup module, which includes:
[0148] A startup unit is used to start the camera according to the startup parameters;
[0149] The generation unit is used to obtain the invoked operation result of the camera based on the image information of the camera.
[0150] In some embodiments of this application, the generation unit includes:
[0151] The filtering subunit is used to filter the content of the last frame corresponding to the image information.
[0152] The identification subunit is used to identify the content of the image and obtain the result of the camera being invoked.
[0153] In this embodiment, the acquisition module 201 acquires the real-time data stream when the target application calls the camera. Then, the acquisition module 202 acquires the identification information of the target application and the configuration information corresponding to the real-time data stream. Subsequently, the determination module 203 determines the target operation of the call based on the identification information and the configuration information. Then, the control module 204 adjusts the camera's startup parameters based on the target operation.
[0154] In this embodiment, when a target application calls the camera, it collects the real-time data stream of the called camera, obtains the target application's identification information and the configuration information corresponding to the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of calling the camera based on the application's identification information and the data stream configuration information, and then controlling the camera's startup parameters according to the purpose of the call, it achieves camera image control. Adjusting the camera parameters according to the target of the camera call allows for adjustment of the camera's startup parameters based on the call requirements, thereby improving the camera's processing performance.
[0155] In addition, this application also provides an electronic device, such as Figure 7 As shown, it illustrates the structural diagram of the electronic device involved in this application, specifically:
[0156] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0157] The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402, to perform various functions and process data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.
[0158] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0159] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0160] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0161] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application programs stored in the memory 402, thereby implementing the steps in any of the camera control methods provided in this application.
[0162] This embodiment of the application collects real-time data streams from the camera when a target application calls the camera, obtains the target application's identification information and the corresponding configuration information of the real-time data stream, determines the target operation for calling the camera based on the target application's identification information and the real-time data stream configuration information, and adjusts the camera's startup parameters according to the target operation. Specifically, by analyzing and determining the purpose of the camera call based on the application's identification information and the data stream configuration information, the purpose of the camera call is determined, and the camera's startup parameters are controlled according to the purpose of the call, thereby achieving camera image control. Adjusting the camera parameters based on the target camera call allows for adjustment of the camera's startup parameters according to the call requirements, improving the camera's processing performance.
[0163] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0164] Therefore, this application provides a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the camera control methods provided in this application.
[0165] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0166] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the camera control methods provided in this application, the beneficial effects that any of the camera control methods provided in this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0167] The foregoing has provided a detailed description of a camera control method, apparatus, electronic device, and computer-readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A camera control method, characterized in that, include: Collect real-time data streams when the target application calls the camera; Obtain the identification information of the target application and the configuration information corresponding to the real-time data stream; The target operation to be invoked is determined based on the identification information and the configuration information; Adjust the camera's startup parameters according to the target operation; Determining the target operation of the call based on the identification information and the configuration information includes: Obtain the historical call results of the target application to the camera; Based on the historical call results, the actual historical call results of the target application calling the camera based on each historical data stream are obtained; For each historical data stream, the frequency of occurrence of each type of historical actual call result corresponding to the historical data stream is counted; Based on the frequency of occurrence, determine the historical master operation results corresponding to the historical data stream; Based on the historical master operation results corresponding to each historical data stream, the target operation of the target application calling the camera based on the real-time data stream is obtained; Among them, the historical master operation result is the main operation result applied to the data stream of this configuration.
2. The method according to claim 1, characterized in that, The step of determining the historical master operation result corresponding to the historical data stream based on the occurrence frequency includes: The historical actual call results with the highest occurrence frequency and the occurrence frequency reaching a preset threshold are used as the historical main operation results of the target application calling the camera based on the historical data stream.
3. The method according to claim 1, characterized in that, The step of obtaining the target operation of the target application calling the camera based on the real-time data stream, according to the historical master operation result corresponding to each historical data stream, includes: Determine a target historical data stream that is identical to the real-time data stream from among the aforementioned historical data streams; Determine the historical master operation results corresponding to the target historical data stream; The operation corresponding to the historical master operation result is used as the target operation for the target application to call the camera.
4. The method according to claim 1, characterized in that, After adjusting the camera's startup parameters according to the target operation, the method further includes: The camera is activated according to the activation parameters; Based on the image information from the camera, the result of the camera being invoked is obtained.
5. The method according to claim 4, characterized in that, The step of obtaining the result of the camera's invocation operation based on the camera's image information includes: Filter the content of the last frame corresponding to the aforementioned image information; The content of the image is identified to obtain the result of the camera being invoked.
6. A camera control device, characterized in that, include: The acquisition module is used to acquire real-time data streams when the target application accesses the camera; The acquisition module is used to acquire the identification information of the target application and the configuration information corresponding to the real-time data stream; The determination module is used to determine the target operation to be invoked based on the identification information and the configuration information; A control module is used to adjust the camera's startup parameters according to the target operation; Determining the target operation of the call based on the identification information and the configuration information includes: Obtain the historical call results of the target application to the camera; Based on the historical call results, the actual historical call results of the target application calling the camera based on each historical data stream are obtained; For each historical data stream, the frequency of occurrence of each type of historical actual call result corresponding to the historical data stream is counted; Based on the frequency of occurrence, determine the historical master operation results corresponding to the historical data stream; Based on the historical master operation results corresponding to each historical data stream, the target operation of the target application calling the camera based on the real-time data stream is obtained; Among them, the historical master operation result is the main operation result applied to the data stream of this configuration.
7. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the camera control method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the camera control method as described in any one of claims 1-5.
Citation Information
Patent Citations
Shooting method, terminal equipment and computer readable storage medium
CN111491099A
Image processing method and system, electronic equipment and storage medium
CN113727035A