Mobile terminal, configuration method for camera on mobile terminal, and storage medium
By setting up an Always on camera on a mobile terminal, combining gyroscope and image feature point detection, and automatically configuring camera parameters, the problem of manually turning on the camera in the existing technology is solved, and the immediacy and quality of shooting are improved.
Patent Information
- Application Number
- PCT/CN2024/101690
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-14
- Filing Date
- 2024-06-26
- Publication Date
- 2025-02-20
AI Technical Summary
The existing mobile terminal needs to manually turn on the camera after taking a photo, which causes the shooting parameters to be re-adjusted and may miss the best lens.
By setting up the Always on camera on the mobile terminal, obtaining preview data in real time, combining gyroscope and image feature point detection, determining the current status and scene of the mobile terminal, and automatically configuring the shooting parameters of the target camera.
It realizes that the scene is automatically detected and camera parameters are configured in the standby state of the mobile terminal, reducing the time for users to operate manually and improving the immediacy and quality of shooting.
Smart Images

Figure CN2024101690_20022025_PF_FP_ABST
Abstract
Description
Mobile terminal, camera configuration method and storage medium on mobile terminal
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 202311024411.X filed on August 14, 2023, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the technical field of smart terminals, and in particular to a mobile terminal and a configuration method and storage medium for a camera on the mobile terminal. Background Art
[0004] With the continuous development of science and technology, the functions of mobile terminals such as smart phones and personal digital assistants (PDAs) are becoming more and more powerful, and more and more users like to take photos and videos through mobile terminals such as smart phones.
[0005] In the existing technology, users usually turn off the camera after taking a few photos. When they encounter a scene they want to shoot during the game, they turn the camera back on. However, after turning the camera back on, they need to readjust the shooting parameters, which may result in missing the best shot.
[0006] Summary of the Invention
[0007] The present application provides a mobile terminal and a configuration method and storage medium for a camera on the mobile terminal.
[0008] In a first aspect, an embodiment of the present application provides a method for configuring a camera on a mobile terminal, wherein the mobile terminal includes a first camera and a second camera, and the first camera can operate when the mobile terminal is in a standby state. The method includes: obtaining current preview data collected by the first camera; determining the current state of the mobile terminal; when the current state is a target state, determining a target scene corresponding to the current preview data; when the target scene is a preset scene, initially configuring the target camera based on the photo data corresponding to the target scene, the target camera being one of the second cameras.
[0009] In a second aspect, an embodiment of the present application provides a mobile terminal, comprising: a mobile terminal body, one or more processors, one or more first cameras and a second camera, wherein the one or more processors are used to execute the camera configuration method on the mobile terminal as described in the first aspect.
[0010] In a third aspect, an embodiment of the present application provides a device for configuring a camera on a mobile terminal, comprising: an acquisition module for acquiring current preview data collected by the first camera; a first determination module for determining the current state of the mobile terminal; a second determination module for determining a target scene corresponding to the current preview data when the current state is a target state; and a configuration module for initially configuring a target camera based on photographic data corresponding to the target scene when the target scene is a preset scene, the target camera being one of the second cameras.
[0011] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to implement the method for configuring the camera on the mobile terminal described in the first aspect.
[0012] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for configuring a camera on a mobile terminal described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0014] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0015] FIG1 is a schematic diagram of an application scenario of a method for configuring a camera on a mobile terminal provided by an embodiment of the present application;
[0016] FIG2 is a flow chart of a method for configuring a camera on a mobile terminal according to an embodiment of the present application;
[0017] FIG3 is a schematic diagram of a convolution factor in a method for configuring a camera on a mobile terminal according to an embodiment of the present application;
[0018] FIG4 is a schematic structural diagram of a mobile terminal provided in an embodiment of the present application;
[0019] FIG5 is a schematic diagram of the structure of a camera configuration device on a mobile terminal provided in one embodiment of the present application;
[0020] FIG6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
[0021] Reference numerals:
[0022] Mobile terminal body-1, processor-2, first camera-3, second camera-4. DETAILED DESCRIPTION
[0023] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0024] According to an embodiment of the present application, a method for configuring a camera on a mobile terminal is provided. In an exemplary embodiment, the method for configuring a camera on a mobile terminal can be applied to a hardware environment consisting of a terminal 101 and a server 102 as shown in FIG1 . As shown in FIG1 , the server 102 is connected to the terminal 101 via a network and can be used to provide services (such as video services, application services, etc.) to the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 102. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 is not limited to a mobile phone, a tablet computer, etc.
[0025] The method for configuring the camera on the mobile terminal of the embodiment of the present application can be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The method for configuring the camera on the mobile terminal of the embodiment of the present application can be executed by the terminal 101 or by a client installed thereon.
[0026] Taking the terminal executing the configuration method of the camera on the mobile terminal according to the embodiment of the present application as an example, FIG2 is a flow chart of an optional configuration method of the camera on the mobile terminal according to the embodiment of the present application. As shown in FIG2, the flow of the method may include the following steps:
[0027] Step 201: Obtain current preview data collected by the first camera.
[0028] In some embodiments, the first camera is a camera that can operate while the mobile terminal is in standby mode. Lite Image Signal Processing Lite (Lite ISP) supports always-on cameras. Such cameras have relatively low resolutions, and Lite ISP consumes less power and can operate continuously in standby mode. Therefore, the first camera can be configured as the aforementioned always-on camera.
[0029] The mobile terminal is provided with a first camera, which can capture the pictures taken by the first camera in real time or at intervals of a preset time, that is, the current preview data. The preset time can be set based on actual conditions.
[0030] Step 202: Determine the current state of the mobile terminal.
[0031] In some embodiments, the current state of the mobile terminal is used to indicate the mobile state or usage state of the mobile terminal. For example, the current state may include, but is not limited to, stationary, moving, within a certain altitude range, or within a certain angle range relative to the ground. The current state can be determined by detecting whether the mobile terminal is relatively stable using gyro sensor data or image feature point detection algorithms.
[0032] In an optional embodiment, determining the current state of the mobile terminal may include: obtaining a spatial position set of the mobile terminal, the spatial position set including at least two spatial positions; calculating a first difference between each two adjacent spatial positions, the two adjacent spatial positions referring to spatial positions obtained at adjacent moments; when the first difference is less than a first preset difference by a number greater than a first preset value, determining that the current state is a stable state; when the first difference is less than the first preset difference by a number not greater than the first preset value, determining that the current state is an unstable state.
[0033] The spatial position set may be obtained by the mobile terminal collecting its own spatial position once at a preset interval. The preset interval can be set according to actual conditions, for example, 10 milliseconds. Alternatively, the spatial position set may be obtained by the first camera collecting a frame of image once.
[0034] The spatial position can be obtained by, but not limited to, a Gyro sensor. The spatial position can be represented by {X, Y, Z}, which are the coordinate values of the mobile terminal in three directions. The origin of the spatial position coordinate system can be selected based on the actual situation. For example, it can be the common spatial position of the mobile terminal or the spatial position where the mobile terminal was located within a preset duration before the current moment. The preset duration can be set based on the actual situation. For example, it can be within 1 to 5 minutes.
[0035] In an exemplary embodiment, the mobile terminal turns on the Gyro sensor and reads the coordinate values of the mobile terminal in the {X, Y, Z} three directions in real time; calculates the coordinate differences between adjacent two frames of the Gyro sensor. Denote the first difference between the 0th frame and the 1st frame as {ΔX0, ΔY0, Δz0}, the first difference between the 1st frame and the 2nd frame as {ΔX1, ΔY1, ΔZ1},...... the first difference between the N - 1th frame and the Nth frame as {ΔXn - 1, ΔYn - 1, ΔZn - 1}, where n is a positive integer greater than 1; sets the first preset difference for determining the stability of the terminal as {Xthr, Ythr, Zthr}; counts the number A of the above first differences that are less than the first preset difference. If A > A0 (the first preset value), determines that the current state is a stable state; if A ≤ A0, determines that the current state is an unstable state. The first preset difference can be any value less than or equal to N.
[0036] In an optional embodiment, when the first preset difference is N, the process of determining the current state includes: if ΔX0 < Xthr, ΔY0 < Ythr, ΔZ0 < Zthr are all satisfied simultaneously,......, ΔXn - 1 < Xthr, ΔYn - 1 < Ythr, ΔZn - 1 < Zthr, then the terminal is considered relatively stable and its current state is determined to be stable; otherwise, its current state is determined to be unstable.
[0037] In an optional embodiment, determining the current state of the mobile terminal may include: dividing each frame image of the current preview data into multiple blocks; extracting the feature points of each block and calculating the coordinate values of each feature point; calculating the second difference between the coordinate values of the same feature points in the current frame and its two adjacent frames; if the number of the second differences that are less than the second preset difference is greater than the second preset value, determining that the current state is a stable state; or, if the number of the second differences that are less than the second preset difference is not greater than the second preset value, determining that the current state is an unstable state.
[0038] In some embodiments, the current preview data can be the preview frame data within a recent period of time, such as the preview frame data within two seconds. The preview frame data includes multiple frames of images.
[0039] In an exemplary embodiment, the preview frame data is divided into m blocks; feature point detection is performed for each block; it is assumed that at least one feature point is extracted from each block, namely P0, P1, ... Pm-1, and the coordinate value of each feature point is calculated; the coordinates of the feature points of the 0th frame are respectively {X 0,0 ,Y 0,0},{X 0, 1,Y 0,1},......,{X 0,m -1,Y 0,m -1}, ..., the coordinates of the feature points in the n-1th frame are {X n-1,0 ,Y 0,0},{X n-1, 1,Y 0,1},......,{X n-1,m-1 ,Y n-1,m-1}; Assume that the conditions for judging whether the mobile terminal is stable are: if the difference between a preset number k block feature coordinate points between the previous and next frames of n frames of data is less than a second preset difference {Xthrp, Ythrp}, the mobile terminal is determined to be in a stable state; otherwise, the mobile terminal is determined to be in an unstable state; wherein n is a positive integer greater than 1, m is a positive integer greater than 1, and k is a positive integer greater than 1 and less than or equal to m.
[0040] Step 203: When the current state is the target state, determine the target scene corresponding to the current preview data.
[0041] In some embodiments, the target state may include, but is not limited to, at least one of a stable state, the mobile terminal being in a preset altitude range for a preset time, and the angle between the mobile terminal and the ground being in a preset angle range for a preset time.
[0042] After the mobile terminal is relatively stable, multiple frames of always-on camera real-time preview data are continuously collected to detect people, objects, or scenes. This can be achieved through traditional image processing technology, AI technology, and other methods.
[0043] In an optional embodiment, determining the target scene corresponding to the current preview data includes: extracting data features in the current preview data, the data features including at least one of shape features, pixel features, color features, and spatial relationship features; and determining the target scene based on the data features.
[0044] In some embodiments, the shape feature may be an outline feature. The pixel feature may be features such as the color, brightness, and position of pixels in the current preview data. The color feature may be obtained using a color picker. The spatial relationship feature may be the distance between the subject in the current preview data and the mobile terminal.
[0045] Among them, there may be multiple scenes corresponding to different data features. By summarizing the scenes, a preset scene set is obtained. In the preset scene set, each scene is configured with its own scene conditions. After the data feature meets the preset conditions of a scene, the scene is determined to be the target scene corresponding to the data feature.
[0046] In an optional embodiment, the data feature is a shape feature, and extracting the data feature in the current preview data includes: performing grayscale processing on the target image in the current preview data to obtain a grayscale image; extracting a scene contour in the grayscale image, and determining that the scene contour is the shape feature.
[0047] Determining the target scene based on the data features includes: matching the scene outline with a preset outline set, determining a target preset outline in the preset outline set that matches the scene outline, the preset outline set including preset outlines of multiple scene objects; and determining the scene object corresponding to the target preset outline as the target scene object.
[0048] The target image may be any image in the current preview data, and may be a most recently acquired frame of image.
[0049] In an optional embodiment, grayscale processing of the target image can be performed in the following three ways:
[0050] The first one is the maximum value method.
[0051] For each pixel, directly take the component value with the largest value among R, G, and B components. The formula is R=G=B=max(R,G,B).
[0052] The second method: average value method.
[0053] Take the average of the three component values of R, G, and B. The formula is R=G=B=(R+G+B) / 3.
[0054] The third method: weighted average method.
[0055] According to the sensitivity of the human eye to the three colors R, G, and B, weighted averaging is performed according to certain weights. The formula is R=G=B=(wr*R+wg*G+wb*B) / 3, where wr, wg, and wb are the weights of R, G, and B respectively.
[0056] For example, it is obtained in the following manner:
[0057] Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j)
[0058] Among them, i represents the row where the pixel point in the target image is located, and j represents the column where the pixel point in the target image is located.
[0059] In an optional embodiment, extracting the scene contour from the grayscale image may include: denoising the grayscale image using Gaussian filtering to obtain a smoothed image; calculating the gradient direction and gradient magnitude of the smoothed image; removing non-boundary points in the smoothed image based on the gradient magnitude and the gradient direction to obtain an intermediate image with an initial contour; and determining the scene contour based on the grayscale gradient of the intermediate image.
[0060] In an optional embodiment, Gaussian filtering can be used to remove noise from the grayscale image to obtain a smooth image. The Gaussian filtering calculation formula is:
[0061] Wherein, x represents the row where the pixel point in the grayscale image is located, y represents the column where the pixel point in the grayscale image is located, and σ is a preset value.
[0062] In an optional embodiment, the gradient direction and gradient magnitude of the smoothed image can be calculated as follows: the smoothed image is subjected to calculation of the first-order derivatives (Gx and Gy) in the horizontal and vertical directions using the Sobel operator. The Sobel convolution factor is shown in FIG3 .
[0063] The Sobel convolution calculation formula is:
[0064] The approximate horizontal and vertical gradients of each pixel of the smoothed image can be combined with the following formula to calculate the gradient size:
[0065] If the angle θ is equal to zero, it means that the image is a vertical edge. If a pixel is an edge, its gradient direction is always perpendicular to the edge. Gradient directions are classified into four categories: vertical, horizontal, and two diagonal directions.
[0066] Among them, A is the smooth image and G is the gradient image.
[0067] In an optional embodiment, non-boundary points in the smoothed image are removed based on the gradient magnitude and gradient direction to obtain an intermediate image having an initial contour. This can be determined as follows: after obtaining the gradient direction and magnitude, the entire image is scanned to remove non-boundary points. Each pixel is checked to determine whether its gradient value is the maximum among surrounding points with the same gradient direction. If so, the pixel is retained; otherwise, it is suppressed. After scanning the entire image, a binary image with a "thin edge" is obtained.
[0068] In an optional embodiment, determining the scene contour based on the grayscale gradient of the intermediate image may include setting two thresholds: minVal and maxVal. When the grayscale gradient of any pixel in the intermediate image exceeds maxVal, it is considered a true boundary, and pixels below minVal are discarded. If the gradient value of a pixel is between the two thresholds, it is determined whether the pixel is connected to a point determined to be a true boundary point. If so, the pixel is considered a boundary point and retained; otherwise, the pixel is discarded, thereby determining the true boundary in the image and obtaining the scene contour.
[0069] In an optional embodiment, a plurality of preset contours are stored in the preset contour set, and each preset contour is pre-configured with a scene object, so that after obtaining the scene contour, the scene contour and the preset contour are matched in sequence. If the match is successful, the scene object corresponding to the preset contour is used as the target scene object.
[0070] Among them, scene objects can be people, animals, buildings, natural scenery (such as beaches, plants), etc.
[0071] Step 204: When the target scene is a preset scene, initially configure the target camera based on the photographic data corresponding to the target scene, where the target camera is one of the second cameras.
[0072] In some embodiments, the preset scene may be a pre-set character scene, landscape scene, animal scene, environment scene, payment scene, code scanning scene, etc. The photographed data may be obtained from the current preview data.
[0073] In an optional embodiment, the initial configuration of the target camera based on the photographic data corresponding to the target scene includes: determining the target camera to be configured from the second camera; extracting the shooting parameters corresponding to the current preview data, and determining the shooting parameters as the photographic data; and initially configuring the target camera based on the photographic data.
[0074] In some embodiments, the shooting parameters may include AE (Auto Exposure) (such as Lux (brightness value), AWB (Automatic White Balance) information (such as CCT color temperature value), AF (Auto Focus) information (such as object distance, code index (motor position information), etc.) in the current environment, and the current scene detection index value (such as the index of the landscape scene is preset to 0, the index of the portrait scene is preset to 1, the index of the architectural scene is preset to 2, etc.).
[0075] After obtaining the above-mentioned photographic data, the shooting parameters of the target camera are set to the photographic data to complete the initial configuration.
[0076] In an optional embodiment, determining the target camera to be configured from the second camera includes: judging whether the mobile terminal sets the priority of the second camera; if the priority of the second camera has been set, judging whether the target scene is applicable to the second camera with the highest priority; if the target scene is applicable to the second camera with the highest priority, determining the second camera with the highest priority as the target camera; if the target scene is not applicable to the second camera with the highest priority, determining any second camera other than the second camera with the highest priority as the target camera; if the priority of the second camera is not set, determining any second camera as the target camera.
[0077] In some embodiments, when the number of second cameras is one, the second camera is determined to be the target camera. When the number of second cameras is two or more, one target camera can be determined from multiple second cameras based on the current scene.
[0078] In an exemplary embodiment, the second camera may include an ultra-wide-angle camera and a normal camera, and the ultra-wide-angle camera is usually set to have the highest priority.
[0079] If the mobile terminal does not have an ultra-wide-angle camera, the ordinary camera will be directly activated; on devices with an ultra-wide-angle camera, a switch is provided for the user to choose, and whether to give priority to the ultra-wide-angle camera in scenes such as landscapes and group photos will be determined.
[0080] In an exemplary embodiment, the ultra-wide-angle camera can be started first by querying the user; if so, it is determined whether the current scene is a preset scene that can be used for ultra-wide-angle shooting, such as scenery, group photos, buildings, etc.; if the above conditions are met at the same time, the ultra-wide-angle camera is started; otherwise, the ordinary camera is started.
[0081] In an optional embodiment, after the target camera is initially configured based on the photographic data corresponding to the target scene, the method further includes: starting or pre-starting the configured target camera when it is detected that the target camera meets the starting conditions.
[0082] In some embodiments, since the target camera is pre-configured, when it is detected that the target camera meets the start-up conditions, the configured target camera is directly started to shoot the target scene, thereby obtaining photos with better shooting effects.
[0083] Among them, the startup conditions of the above-mentioned target camera can be multiple, for example, it can be: monitoring the preset operation of the mobile terminal on the preset application, and the preset application is an application that can use the target camera; or monitoring the usage data / status data of the mobile terminal as preset usage data / preset status data.
[0084] The preset application may be, but is not limited to, an application that can implement image acquisition functions (such as a camera, social media application, short video platform application, payment application, scanning application, etc.). The preset operation may be, but is not limited to, a startup operation. In the case where the preset application is a payment application, launching the payment application can directly jump to the payment interface (such as a code scanning interface or a payment code interface).
[0085] Usage data can include user operations on the mobile terminal, such as single or double clicks on a button, triggering a certain position on the screen, and audio data. Status data can include the height of the mobile terminal and the open or folded state of the mobile terminal screen.
[0086] The preset usage data may be, but is not limited to, that the user double-clicks the volume of the mobile terminal and the audio data is consistent with the stored target audio.
[0087] The preset state data may include, but is not limited to, that the screen of the mobile terminal is adjusted from a folded state to an open state, and the mobile terminal is at a preset height.
[0088] For example, it may be detected that the mobile terminal is adjusted from a folded state to an open state, or that a shortcut key of the mobile terminal (such as double-clicking the volume) is triggered, or that the mobile terminal is voice-controlled to open a preset application.
[0089] Furthermore, it is also possible to determine whether the mobile terminal has a sensor that can obtain altitude information, such as an air pressure sensor, etc. If not, directly trigger the photo or video recording; if so, obtain the altitude information of the current position (the actual height of the terminal from the ground), and match the obtained altitude information with the preset altitude information; if the current altitude information of the terminal is one of the preset altitude information, trigger the photo or video recording.
[0090] In an optional embodiment, after starting the configured target camera, the method further includes: triggering the target camera to take a photo or a video.
[0091] Among them, after the target camera is started, it can automatically trigger taking pictures (one or more pictures) or recording videos.
[0092] In an exemplary embodiment, when the mobile terminal of the present application is in standby mode, the Always on camera remains turned on in the background. Taking the target application as a camera as an example, the configuration method of the camera on the mobile terminal may include: first, using a mobile terminal stability detection algorithm or a gyroscope to detect whether the state of the mobile terminal is relatively stable; second, using a real-time scene detection algorithm to detect the current scene; third, when the current state detection and scene detection results of the mobile terminal meet preset conditions: recording the current ambient brightness information, color temperature information, focus motor position or object distance and other information and scene detection results; fourth, when it is detected that the mobile terminal state is relatively stable and the detected scene is one of the preset scenes, triggering the camera to start, and passing the current brightness information, color temperature information, focus motor position or object distance and other information and scene detection results to the camera as the initial configuration of the camera so that the camera can quickly be in the best photo-taking state.
[0093] Since the first camera has low power consumption, it can effectively improve the problem of users needing to manually start the camera while solving the battery life anxiety problem, thereby achieving truly effective and fast photography to capture the best shot.
[0094] This application uses the Always on camera real-time preview to detect information. When it is detected that the mobile terminal is in the current state and the current scene meets one of the preset scenes, it triggers the camera to start taking quick photos, effectively improving the shooting experience of the mobile terminal and has good market value.
[0095] Based on the same concept, a mobile terminal is provided in an embodiment of the present application, see Figure 4, the mobile terminal includes: a mobile terminal body 1, one or more processors 2, one or more first cameras 3 and a second camera 4, and the one or more processors are used to execute the camera configuration method on the mobile terminal described in the above-mentioned related embodiments.
[0096] In FIG4 , the processor is drawn with dotted lines, indicating that the processor is disposed inside the mobile terminal body.
[0097] The number of the first camera is at least one, which can be a front-mounted always-on camera or a rear-mounted always-on camera. When the number is multiple, it can include a front-mounted always-on camera and a rear-mounted always-on camera.
[0098] The above-mentioned current preview data may be obtained by pre-processing preview data captured by a plurality of always-on cameras.
[0099] Based on the same concept, an embodiment of the present application provides a device for configuring a camera on a mobile terminal. For the specific implementation of the device, please refer to the description of the method embodiment part, and the repeated parts will be omitted. As shown in Figure 5, the device may include: an acquisition module 501, used to obtain the current preview data collected by the first camera; a first determination module 502, used to determine the current state of the mobile terminal; a second determination module 503, used to determine the target scene corresponding to the current preview data when the current state is the target state; a starting module 504, used to initially configure the target camera based on the photo data corresponding to the target scene when the target scene is a preset scene, and the target camera is one of the second cameras.
[0100] Based on the same concept, an electronic device is also provided in an embodiment of the present application, as shown in FIG6 , and the electronic device mainly includes: a processor 601, a memory 602, and a communication bus 603, wherein the processor 601 and the memory 602 communicate with each other via the communication bus 603. The memory 602 stores a program that can be executed by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps: obtaining the current preview data collected by the first camera; determining the current state of the mobile terminal; when the current state is the target state, determining the target scene corresponding to the current preview data; when the target scene is a preset scene, initially configuring the target camera based on the photographic data corresponding to the target scene, the target camera being one of the second cameras.
[0101] The communication bus 603 mentioned in the electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 603 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG6 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0102] The memory 602 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk storage. In one embodiment, the memory may also be at least one storage device located away from the processor 601.
[0103] The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0104] In another embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program runs on a computer, the computer executes the method for configuring the camera on the mobile terminal described in the above embodiment.
[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website, computer, server or data center to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (such as a floppy disk, hard disk, tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0106] In this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0107] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.
Claims
1. A method for configuring a camera on a mobile terminal, wherein: The mobile terminal includes a first camera and a second camera, the first camera can be operated when the mobile terminal is in a standby state, and the method includes: Obtaining current preview data collected by the first camera; Determining a current state of the mobile terminal; In a case where the current state is a target state, determining a target scene corresponding to the current preview data; In the case where the target scene is a preset scene, the target camera is initially configured based on the photographing data corresponding to the target scene, and the target camera is one of the second cameras.
2. The method for configuring a camera on a mobile terminal according to claim 1, wherein: The determining the current state of the mobile terminal includes: Acquire a spatial position set of the mobile terminal, wherein the spatial position set includes at least two spatial positions; Calculating a first difference between two adjacent spatial positions, where the two adjacent spatial positions refer to spatial positions acquired at adjacent moments; In a case where the first difference is smaller than a first preset difference by an amount greater than a first preset value, determining that the current state is a stable state; or When the amount by which the first difference is smaller than the first preset difference is not greater than the first preset value, it is determined that the current state is an unstable state.
3. The method for configuring a camera on a mobile terminal according to claim 1, wherein: The determining the current state of the mobile terminal includes: Divide each frame image of the current preview data into a plurality of blocks; Extracting feature points of each of the blocks and calculating coordinate values of each of the feature points; Calculate the second difference between the coordinate values of the same feature point in the current frame and two adjacent frames; In a case where the number of times that the second difference is less than a second preset difference is greater than a second preset value, determining that the current state is a stable state; or When the number of times that the second difference is less than the second preset difference is not greater than the second preset value, it is determined that the current state is an unstable state.
4. The method for configuring a camera on a mobile terminal according to claim 1, wherein: The determining a target scene corresponding to the current preview data includes: Extracting data features from the current preview data, wherein the data features include at least one of shape features, pixel features, color features, and spatial relationship features; The target scene is determined based on the data features.
5. The method for configuring a camera on a mobile terminal according to claim 4, wherein: The data feature is a shape feature, and the extracting the data feature in the current preview data includes: Performing grayscale processing on the target image in the current preview data to obtain a grayscale image; Extracting a scene outline in the grayscale image, and determining the scene outline as the shape feature; The determining the target scene based on the data feature includes: Matching the scene outline with a preset outline set, and determining a target preset outline in the preset outline set that matches the scene outline, wherein the preset outline set includes preset outlines of a plurality of scene objects; The scene corresponding to the preset target outline is determined as the target scene.
6. The method for configuring a camera on a mobile terminal according to claim 5, wherein: The extracting of the scene contour in the grayscale image comprises: Using Gaussian filtering to denoise the grayscale image to obtain a smooth image; Calculating the gradient direction and gradient magnitude of the smoothed image; Based on the gradient magnitude and the gradient direction, non-boundary points in the smoothed image are removed to obtain an intermediate image with an initial contour; The scene contour is determined based on the grayscale gradient of the intermediate image.
7. The method for configuring a camera on a mobile terminal according to claim 1, wherein: The initial configuration of the target camera based on the photographic data corresponding to the target scene includes: Determine a target camera to be configured from the second camera; Extracting shooting parameters corresponding to the current preview data, and determining the shooting parameters as the photographing data; The target camera is initially configured based on the photographing data.
8. The method for configuring a camera on a mobile terminal according to claim 7, wherein: The step of determining a target camera to be configured from the second camera includes: Determining whether the mobile terminal sets the priority of the second camera; In the case where the priority of the second camera has been set, determining whether the target scene is suitable for the second camera with the highest priority; In a case where the target scene is applicable to a second camera with the highest priority, determining the second camera with the highest priority as the target camera; In a case where the target scene is not suitable for the second camera with the highest priority, determining any second camera other than the second camera with the highest priority as the target camera; or When the priority of the second camera is not set, any second camera is determined as the target camera.
9. The method for configuring a camera on a mobile terminal according to claim 1, wherein: After the target camera is initially configured based on the photographic data corresponding to the target scene, the method further includes: When it is detected that the target camera meets the start condition, the configured target camera is started or pre-started.
10. The method for configuring a camera on a mobile terminal according to claim 9, wherein: The starting conditions include: An operation of a target function of a preset application by the mobile terminal is monitored, where the preset application is an application capable of using the target camera; or The usage data / status data of the mobile terminal monitored are preset usage data / preset status data.
11. A mobile terminal, comprising: A mobile terminal body, one or more processors, one or more first cameras and a second camera, wherein the one or more processors are used to execute the camera configuration method on the mobile terminal as described in any one of claims 1-10.
12. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by one or more processors, the method for configuring a camera on a mobile terminal according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Prompting method and system for mobile terminal photographing
CN104301612A
Photo taking method, mobile terminal and computer readable storage medium
CN108337433A
Image processing method, mobile terminal and computer readable memory medium
CN108810407A
Image shooting method, terminal and storage medium
CN115914817A
Air gesture recognition method, electronic equipment and storage medium
CN116301363A