Mobile terminal, configuration method of camera on mobile terminal and storage medium
By setting up the Always on camera on the mobile terminal, preview data is collected in real time and cameras are configured according to the target scene, the problem of needing to re-adjust the shooting parameters after re-opening the camera, and the camera is quickly configured and the best lens is captured in a timely manner.
Patent Information
- Application Number
- CN202311024411.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, the shooting parameters need to be re-adjusted after re-opening the camera, resulting in the inability to take the best lens effectively in time.
By setting the first camera and the second camera on the mobile terminal, using the first camera to collect preview data in a standby state, determine the current status and target scene of the mobile terminal, and initialize the second camera based on the photography data of the target scene Configuration.
It realizes the rapid configuration of the camera in the target state of the mobile terminal, avoiding the problem of re-adjusting the shooting parameters after re-opening the camera, so that the best lens can be captured in a timely and effective manner.
Smart Images

Figure CN119496965A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent terminals, and in particular to a mobile terminal and a configuration method and storage medium for a camera on the mobile terminal. Background Art
[0002] With the continuous development of science and technology, the functions of mobile terminals such as smart phones and personal digital assistants (English: Personal Digital Assistant, PAD) are becoming more and more powerful, and more and more users like to take photos and videos through mobile terminals such as smart phones.
[0003] In the prior art, users usually turn off the camera after taking a few photos, and then turn on the camera when they encounter some scenes they want to shoot during the game. After turning on the camera again, the shooting parameters of the camera need to be readjusted, which may result in missing the best shot. Summary of the invention
[0004] The present application provides a mobile terminal and a configuration method and storage medium for a camera on the mobile terminal, which are used to at least solve the problem in the prior art that the camera shooting parameters need to be readjusted after being reopened, and the camera cannot be shot in a timely and effective manner.
[0005] 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 be operated when the mobile terminal is in a standby state, and the method includes:
[0006] Acquire current preview data collected by the first camera; determine the current state of the mobile terminal; when the current state is a target state, determine a target scene corresponding to the current preview data; when the target scene is a preset scene, initially configure a target camera based on the photographing data corresponding to the target scene, the target camera being one of the second cameras.
[0007] 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.
[0008] In a third aspect, an embodiment of the present application provides a configuration device for a camera on a mobile terminal, comprising: an acquisition module, configured to acquire current preview data collected by the first camera;
[0009] A first determination module is used to determine the current state of the mobile terminal; a second determination module is used to determine the target scene corresponding to the current preview data when the current state is the target state; a configuration module is used to initially configure the target camera based on the photographing data corresponding to the target scene when the target scene is a preset scene, and the target camera is one of the second cameras.
[0010] 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 via the communication bus; the memory is used to store a computer program;
[0011] The processor is used to execute the program stored in the memory to implement the configuration method of 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.
[0013] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, in which a first camera and a second camera are set in the mobile terminal, the first camera can be operated when the mobile terminal is in a standby state, and the current state of the mobile terminal is determined by obtaining the current preview data collected by the first camera; when the current state is the target state, the target scene corresponding to the current preview data is determined; when the target scene is a preset scene, the target camera is initially configured based on the photographic data corresponding to the target scene, and the target camera is one of the second cameras. In this way, the current preview data collected by the first camera can be used for analysis, and when the mobile terminal is in the target state and the target scene is a preset scene, the initial configuration of the target camera is realized through the photographic data corresponding to the target scene, so as to realize the rapid configuration of the target camera according to the target scene, for example, when the user wants to start the camera, he can directly use the configured target camera to shoot, thereby avoiding missing the best shot. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0016] Figure 1 A schematic diagram of an application scenario of a method for configuring a camera on a mobile terminal provided in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of a flow chart of a method for configuring a camera on a mobile terminal provided in one embodiment of the present application;
[0018] Figure 3 A schematic diagram of a convolution factor in a method for configuring a camera on a mobile terminal provided in an embodiment of the present application;
[0019] Figure 4 A schematic diagram of the structure of a mobile terminal provided in one embodiment of the present application;
[0020] Figure 5 A schematic diagram of the structure of a camera configuration device on a mobile terminal provided in one embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application.
[0022] Reference numerals:
[0023] Mobile terminal body-1, processor-2, first camera-3, second camera-4. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0025] According to an embodiment of the present application, a method for configuring a camera on a mobile terminal is provided. In an exemplary implementation, the method for configuring a camera on a mobile terminal can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 102 shown in FIG. Figure 1As shown, 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.) for the terminal or a client installed on the terminal. A database can be set up 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.
[0026] The method for configuring the camera on the mobile terminal of the embodiment of the present application may be executed by the server 102, or by the terminal 101, or by both the server 102 and the terminal 101. The terminal 101 executes the method for configuring the camera on the mobile terminal of the embodiment of the present application, or it may be executed by a client installed thereon.
[0027] Taking the method for configuring the camera on the mobile terminal of the embodiment of the present application as an example, Figure 2 is a flow chart of an optional method for configuring a camera on a mobile terminal according to an embodiment of the present application, such as Figure 2 As shown, the process of the method may include the following steps:
[0028] Step 201: Obtain current preview data collected by the first camera.
[0029] In some embodiments, the first camera is a camera that can operate when the mobile terminal is in a standby state. Lightweight Image Signal Processing Lite (Lite ISP) supports Always on cameras, which have relatively low resolutions. Lite ISP has low power consumption and can continue to work in a standby state. Therefore, the first camera can be set as the aforementioned Always on camera.
[0030] The mobile terminal is provided with a first camera, and the first camera can collect the pictures taken by the first camera in real time or at intervals of a preset time, that is, the current preview data. It can be understood that the preset time can be set based on actual conditions.
[0031] Step 202: Determine the current state of the mobile terminal.
[0032] In some embodiments, the current state of the mobile terminal is used to indicate the mobile state or use state of the mobile terminal. For example, the current state may include, but is not limited to, stationary, moving, in a certain height range, or in a certain angle range with the ground. Whether the mobile terminal is relatively stable can be detected by Gyro sensor data or image feature point detection algorithm to obtain the current state.
[0033] In an optional embodiment, determining the current state of the mobile terminal may include:
[0034] Acquire a spatial position set of the mobile terminal, wherein the spatial position set includes at least two spatial positions;
[0035] Calculating a first difference between two adjacent spatial positions, where the two adjacent spatial positions refer to spatial positions acquired at adjacent moments;
[0036] In the case that the first difference is less than the first preset difference by an amount greater than a first preset value, determining that the current state is a stable state;
[0037] 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.
[0038] The spatial position set may be obtained after the mobile terminal collects its own spatial position once at a preset time interval, and the preset time interval may be set according to actual conditions, for example, 10 milliseconds. Alternatively, the spatial position set may be obtained after the first camera collects a frame of image and obtains the spatial position once.
[0039] The spatial position can be obtained by, but is not limited to, a Gyro sensor. The spatial position can use {X, Y, Z} to represent the coordinate values of the mobile terminal in three directions, wherein the origin of the spatial position coordinate system can be selected based on actual conditions, for example, selecting a spatial position commonly used by the mobile terminal or selecting a spatial position where the mobile terminal is located for a preset time before the current moment. The preset time can be set based on actual conditions, for example, it can be within 1 to 5 minutes.
[0040] In an exemplary embodiment, the mobile terminal turns on the Gyro sensor, reads the coordinate values of the mobile terminal in three directions {X, Y, Z} in real time; calculates the coordinate difference between two adjacent frames of the Gyro sensor, and records 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 first difference values less than the first preset difference value, and if A>A0 (first preset value), determines that the current state is a stable state; if A≤A0, determines that the current state is an unstable state. Wherein, the first preset difference value can be any value less than or equal to N.
[0041] In an alternative embodiment, when the first preset difference is N, the process of determining the current state includes: If ΔX0 < Xthr, ΔY0 < Ythr, ΔZ0 < Zthr,..., ΔXn-1 < Xthr, ΔYn-1 < Ythr, ΔZn-1 < Zthr are all satisfied simultaneously, then it is considered that the terminal is relatively stable, and its current state is determined to be stable; otherwise, its current state is determined to be unstable.
[0042] In an alternative embodiment, determining the current state of the mobile terminal may include:
[0043] Dividing each frame image of the current preview data into multiple blocks;
[0044] Extracting the feature points of each block and calculating the coordinate values of each feature point;
[0045] Calculating the second difference of the coordinate values of the same feature points in the current frame and its two adjacent frames;
[0046] If the number of second differences less than the second preset difference is greater than the second preset value, determining the current state to be a stable state; or
[0047] If the number of second differences less than the second preset difference is not greater than the second preset value, determining the current state to be an unstable state.
[0048] In some embodiments, the current preview data may be the preview frame data within a recent period of time, such as the preview frame data within two seconds, and the preview frame data includes multiple frames of images.
[0049] In an exemplary embodiment, the preview frame data is divided into m blocks; feature point detection is performed for each block; assuming that at least one feature point is extracted from each block, which are P0, P1,..., Pm-1 respectively, and the coordinate values of each feature point are calculated; the coordinate values of the feature points in the 0th frame are denoted as {X 0,0 , Y 0,0}, {X 0,1 , Y 0,1},..., {X 0,m-1 , Y 0,m-1},..., and the coordinate values of the feature points in the (n - 1)th frame are denoted as {X n-1,0 , Y 0,0}, {X n-1,1 , Y 0,1},..., {X n-1,m-1 , Y n-1,m-1};
[0050] Assume that the conditions for judging whether the mobile terminal is stable are as follows: if the difference of 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.
[0051] Step 203: When the current state is a target state, determine a target scene corresponding to the current preview data.
[0052] In some embodiments, the target state may include but is not limited to at least one of a stable state, the mobile terminal being within a preset height range for a preset time, and the angle between the mobile terminal and the ground being within a preset angle range for a preset time.
[0053] After the mobile terminal is in a relatively stable state, 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.
[0054] In an optional embodiment, determining the target scene corresponding to the current preview data includes:
[0055] 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;
[0056] The target scene is determined based on the data feature.
[0057] In some embodiments, the shape feature may be a contour feature. The pixel feature may be features such as the color, brightness, and position of a pixel in the current preview data. The color feature may be obtained by a color picker. The spatial relationship feature may be the distance relationship between the photographed object in the current preview data and the mobile terminal.
[0058] 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.
[0059] In an optional embodiment, the data feature is a shape feature, and extracting the data feature in the current preview data includes:
[0060] Performing grayscale processing on the target image in the current preview data to obtain a grayscale image;
[0061] Extracting a scene outline in the grayscale image, and determining the scene outline as the shape feature;
[0062] The determining the target scene based on the data feature includes:
[0063] 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;
[0064] The scene object corresponding to the target preset outline is determined as the target scene object.
[0065] The target image may be any image in the current preview data, preferably a frame of image acquired most recently.
[0066] In an optional embodiment, the target image may be gray-scaled in the following three ways:
[0067] The first one is the maximum value method.
[0068] For each pixel, directly take the component value with the largest value among the R, G, and B components. The formula is R=G=B=max(R,G,B).
[0069] The second method: average value method.
[0070] Take the average of the three component values of R, G, and B. The formula is R=G=B=(R+G+B) / 3.
[0071] The third method: weighted average method.
[0072] 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, wb are the weights of R, G, and B respectively.
[0073] Exemplarily, it is obtained in the following manner:
[0074] Gray(i,j)=0.299*R(i,j)+0.578*G(i,j)+0.114*B(i,j)
[0075] 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.
[0076] In an optional embodiment, extracting the scene contour in the grayscale image may include:
[0077] Using Gaussian filtering to denoise the grayscale image to obtain a smooth image;
[0078] Calculating the gradient direction and gradient magnitude of the smoothed image;
[0079] 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;
[0080] The scene contour is determined based on the grayscale gradient of the intermediate image.
[0081] 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:
[0082]
[0083] 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.
[0084] In an optional embodiment, the gradient direction and gradient magnitude of the smoothed image may be calculated in the following manner:
[0085] The smoothed image uses the Sobel operator to calculate the first-order derivatives in the horizontal and vertical directions (Gx and Gy). See Sobel convolution factor for details. Figure 3 .
[0086] The Sobel convolution calculation formula is:
[0087]
[0088] The approximate horizontal and vertical gradients of each pixel of the smoothed image can be combined with the following formula to calculate the magnitude of the gradient;
[0089]
[0090]
[0091] 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 4 categories: vertical, horizontal, and two diagonal directions.
[0092] Among them, A is the smoothed image and G is the gradient image.
[0093] In an optional embodiment, 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, which can be determined in the following manner:
[0094] After obtaining the direction and magnitude of the gradient, the entire image is scanned to remove those non-boundary points. Each pixel is checked to determine whether the gradient value of the pixel point is the maximum value among the surrounding points with the same gradient direction. If it is, the point is retained, otherwise the point is suppressed. After scanning the entire image, a binary image with "thin edges" is obtained.
[0095] In an optional embodiment, determining the scene contour based on the grayscale gradient of the intermediate image may include:
[0096] Set two thresholds: minVal and maxVal. When the grayscale gradient of any pixel in the intermediate image is higher than maxVal, it is considered to be the true boundary, and the pixel below minVal is discarded; if the gradient value of a pixel is between the two, determine whether the pixel is connected to a point determined to be a true boundary point. If so, the point is considered to be a boundary point and retained, otherwise, the point is discarded, thereby determining the true boundary in the image and obtaining the scene contour.
[0097] In an optional embodiment, a plurality of preset contours are stored in a 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 contours are matched in sequence. If the match is successful, the scene object corresponding to the preset contour is used as the target scene object.
[0098] Among them, scene objects can be people, animals, buildings, natural scenery (such as beaches, plants), etc.
[0099] Step 204: When the target scene is a preset scene, initially configure a target camera based on photographing data corresponding to the target scene, where the target camera is one of the second cameras.
[0100] In some embodiments, the preset scene may be a preset character scene, landscape scene, animal scene, environment scene, payment scene, code scanning scene, etc. The photographing data may be obtained from the current preview data.
[0101] In an optional embodiment, the initial configuration of the target camera based on the photographic data corresponding to the target scene includes:
[0102] Determine a target camera to be configured from the second camera;
[0103] Extracting shooting parameters corresponding to the current preview data, and determining the shooting parameters as the photographing data;
[0104] The target camera is initially configured based on the photographing data.
[0105] 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 pre-setting the index of the landscape scene to 0, the index of the portrait scene to 1, the index of the architectural scene to 2, etc.).
[0106] After obtaining the above-mentioned photographing data, the shooting parameters of the target camera are set to the photographing data to complete the initial configuration.
[0107] In an optional embodiment, determining the target camera to be configured from the second camera includes:
[0108] Determining whether the mobile terminal sets the priority of the second camera;
[0109] 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;
[0110] 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;
[0111] In a case where the target scene is not suitable for the second camera with the highest priority, determining any second camera except the second camera with the highest priority as the target camera;
[0112] When the priority of the second camera is not set, any second camera is determined as the target camera.
[0113] In some embodiments, when the number of the second cameras is one, the second camera is determined to be the target camera, and when the number of the second cameras is more than two, a target camera can be determined from the plurality of second cameras based on the current scene.
[0114] 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.
[0115] 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 it is determined whether to give priority to the ultra-wide-angle camera in scenes such as landscapes and group photos.
[0116] In an exemplary embodiment, the ultra-wide-angle camera can be started by querying the user whether it is set to be started first; 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.
[0117] 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:
[0118] When it is detected that the target camera meets the start condition, the configured target camera is started or pre-started.
[0119] 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.
[0120] There may be multiple starting conditions for the target camera, for example, the starting conditions may be:
[0121] monitoring a preset operation of the mobile terminal on a preset application, where the preset application is an application capable of using the target camera; or,
[0122] The usage data / status data of the mobile terminal monitored are preset usage data / preset status data.
[0123] The preset application may be, but is not limited to, an application that can realize the image acquisition function (such as a camera, a social media application, a short video platform application, a payment application, a scanning application, etc.). The preset operation may be, but is not limited to, a start operation. In the case where the preset application is a payment application, the start of the payment application can directly jump to the payment interface (such as a code scanning interface or a payment code interface).
[0124] The usage data may be the user's operation on the mobile terminal, such as single or double click of a button, triggering of a certain position of the screen, and audio data. The status data may be the height information of the mobile terminal and the open or folded status of the mobile terminal screen.
[0125] 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.
[0126] 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.
[0127] Exemplarily, 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.
[0128] 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, and if not, directly trigger photo taking 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 terminal's current altitude information is one of the preset altitude information, trigger photo taking or video recording.
[0129] In an optional embodiment, after the target camera is started and configured, the method further includes:
[0130] The target camera is triggered to take a photo or a video.
[0131] Among them, after the target camera is started, it can automatically trigger taking pictures (one or more pictures) or recording videos.
[0132] In an exemplary embodiment, the mobile terminal of the present application is in standby mode, and 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:
[0133] First, using a mobile terminal stability detection algorithm or using a gyroscope to detect whether the mobile terminal state is relatively stable;
[0134] Second, use the real-time scene detection algorithm to detect the current scene;
[0135] Third, when the current state detection and scene detection results of the mobile terminal meet the preset conditions: record the current environment brightness information, color temperature information, focus motor position or object distance and other information and scene detection results;
[0136] Fourth, when it is detected that the state of the mobile terminal is relatively stable and the detected scene is one of the preset scenes, the camera is triggered to start, and the current brightness information, color temperature information, focus motor position or object distance and other information as well as the scene detection result are transmitted to the camera as the initial configuration of the camera so that the camera can quickly be in the best shooting state.
[0137] Since the first camera has low power consumption, it can effectively improve the problem of requiring users to manually start the camera while solving the battery life anxiety problem, thereby achieving truly effective and fast photography to capture the best shot.
[0138] 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, the camera is triggered to take pictures quickly, which effectively improves the shooting experience of the mobile terminal and has good market value.
[0139] Based on the same concept, a mobile terminal is provided in the 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.
[0140] Figure 4 The processor is drawn with a dotted line, indicating that the processor is disposed inside the mobile terminal body.
[0141] The number of the first camera is at least one, which may be a front-mounted Always on camera or a rear-mounted Always on camera. When the number of the first camera is multiple, it may include a front-mounted Always on camera and a rear-mounted Always on camera.
[0142] The above-mentioned current preview data may be obtained by pre-processing preview data obtained by combining multiple Always on cameras.
[0143] Based on the same concept, an embodiment of the present application provides a configuration device for a camera on a mobile terminal. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 5 As shown, the device may include:
[0144] An acquisition module 501 is used to acquire current preview data collected by the first camera;
[0145] A first determining module 502, configured to determine a current state of the mobile terminal;
[0146] A second determination module 503, configured to determine a target scene corresponding to the current preview data when the current state is a target state;
[0147] The starting module 504 is used to perform initial configuration on a target camera based on photographing data corresponding to the target scene when the target scene is a preset scene, and the target camera is one of the second cameras.
[0148] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 6As shown, 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 through the communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
[0149] Obtaining current preview data collected by the first camera;
[0150] Determining a current state of the mobile terminal;
[0151] In a case where the current state is a target state, determining a target scene corresponding to the current preview data;
[0152] 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.
[0153] The communication bus 603 mentioned in the above 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 representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0154] The memory 602 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor 601.
[0155] 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 gates or transistor logic devices, discrete hardware components.
[0156] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes the method for configuring the camera on the mobile terminal described in the above embodiment.
[0157] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0158] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0159] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be 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 invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for configuring a camera on a mobile terminal, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: 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, characterized in that: include: 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 claims 1-10.
12. A computer-readable storage medium storing a computer program, characterized in that: 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
Method of saving power for video camera
US5710597A