Photographing method, terminal device, chip and storage medium

By identifying the proportion of the face area and the shooting distance, determining the scene as a portrait or card scene, and adjusting the camera parameters, the problem of unclear text display when the terminal device is photographed by portraits and text is solved, and the adaptive image shooting is achieved.

CN118474522BActive Publication Date: 2024-12-31HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311477576.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2024-12-31
Estimated Expiration
2043-11-07

AI Technical Summary

Technical Problem

When shooting at the terminal device, when portraits and text exist at the same time, taking pictures according to the camera parameters set in the portrait effect will cause the text to be unclear in the pictures after taking pictures, especially when shooting cards with portraits.

Method used

By identifying the video image frames in the camera preview stream, calculating the size ratio and shooting distance of the face area, determining the scene as a portrait or card scene, and taking pictures according to the corresponding image optimization algorithm and effect parameters, avoiding priority use of portrait effect settings parameters.

Benefits of technology

Make sure that the captured images are displayed clearly in the text, and adapt to the parameters of the card certificate scene to avoid the problem of unclear text display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118474522B_ABST
    Figure CN118474522B_ABST
Patent Text Reader

Abstract

The present application relates to a photographing method, a terminal device, a chip and a storage medium. If the terminal device recognizes a face and text from a video image frame, the ratio of the size of the face area of ​​the video image frame in the video image frame is calculated as the portrait ratio. If the portrait ratio is smaller than the real portrait ratio, the terminal device determines that the scene corresponding to the video image frame is a card scene, and determines the image optimization algorithm and picture effect parameters corresponding to the card scene, and takes a photo based on the image optimization algorithm and image effect parameters of the card scene. The present case can recognize the card scene of the video image frame, the image optimization algorithm and picture effect parameters of the card scene, and take a photo based on the image optimization algorithm and image effect parameters of the card scene, so as to avoid that when a portrait is included in the video image frame, the algorithm and camera parameters set for the portrait photography effect are given priority to take a photo, resulting in unclear text on the image obtained by taking a photo.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminals, and more specifically, to a photographing method, a terminal device, a chip and a storage medium. Background Art

[0002] When the terminal device is taking a photo, if a portrait is detected, the camera parameters will be set according to the effect that suits the portrait. For example, when a portrait is detected, the terminal device will set the brightness, noise, contrast, sharpness and other parameters to suit the portrait photography effect. However, since the portrait and text as the photographed objects have different requirements for parameters such as brightness, contrast, and sharpness, if the text is photographed according to the camera parameters set for the portrait photography effect, the text on the photographed image will not achieve the best display effect, and even the text display will not be clear. In particular, when photographing cards with portraits (such as identity cards and campus cards), photographing the card according to the camera parameters set for the portrait photography effect will cause the text on the card image to be unclear. Summary of the invention

[0003] In view of the above, it is necessary to provide a photographing method, a terminal device, a chip and a storage medium to solve the problem that the text on the photographed picture is not clearly displayed when taking a photo of a portrait and text at the same time.

[0004] In a first aspect, an embodiment of the present application provides a photographing method, which is applied to a terminal device, and the method includes: obtaining a video image frame of a camera preview stream through a camera preview interface; if a face and text are recognized from the video image frame, calculating the ratio of the size of the face area of ​​the video image frame in the video image frame as the portrait ratio; obtaining the shooting distance between the camera of the terminal device and the photographed object; determining the real portrait ratio corresponding to the shooting distance according to the shooting distance; if the portrait ratio is smaller than the real portrait ratio, determining that the scene corresponding to the video image frame is a card scene; determining the image optimization algorithm and picture effect parameters corresponding to the card scene, and taking a photo based on the image optimization algorithm and image effect parameters of the card scene. In the above technical scheme, when it is recognized that the video image frame in the camera preview stream includes a portrait and text, the proportion of the size of the face area in the video image frame in the video image frame is further determined as the portrait ratio, and the real portrait ratio corresponding to the camera distance is determined according to the camera distance, and when the portrait ratio is smaller than the real portrait ratio, the scene of the video image frame is determined to be a card scene, and the image optimization algorithm and picture effect parameters of the card scene are determined according to the card scene, and the photo is taken based on the image optimization algorithm and image effect parameters of the card scene. In this way, when it is recognized that the video image frame includes a portrait, the image optimization algorithm and camera parameters set for the portrait photography effect are given priority to take the photo, resulting in unclear text on the image obtained by the photo.

[0005] In one embodiment of the present application, taking photos based on the image optimization algorithm and image effect parameters of the card scene includes: displaying a prompt control of the card scene on the camera preview interface to indicate that the scene of the video image frame is the card scene; in response to the user clicking the prompt control of the card scene, taking photos based on the image optimization algorithm and image effect parameters of the card scene and obtaining the photographed image. The above technical solution can identify the card scene of the video image frame, and after receiving the user clicking the prompt control of the card scene, take photos according to the image optimization algorithm and image effect parameters of the card scene, so that it is convenient to take photos according to the image optimization algorithm and image effect parameters adapted to the card scene, and the photographed image can be adapted to the card scene.

[0006] In one embodiment of the present application, taking a photo based on an image optimization algorithm and image effect parameters of a card scene includes: in response to a user clicking on a photo control on a camera preview interface, obtaining a photographed image based on the image optimization algorithm and image effect parameters of the card scene. After receiving an operation in which a user clicks on a photo control, the above technical solution can take a photo according to the image optimization algorithm and image effect parameters of the card scene, so that the photographed image is adapted to the card scene.

[0007] In one embodiment of the present application, determining the real portrait ratio corresponding to the camera distance according to the camera distance includes: searching a face size relationship table according to the camera distance to determine the real portrait ratio corresponding to the camera distance, wherein the face size relationship table includes a correspondence between multiple camera distances and multiple real portrait ratios. In the above technical solution, searching the face size relationship table according to the camera distance can quickly determine the real portrait ratio corresponding to the camera distance.

[0008] In one embodiment of the present application, determining the image optimization algorithm and picture effect parameters corresponding to the card scene includes: searching the parameter relationship table to determine the image optimization algorithm and picture effect parameters corresponding to the card scene according to the card scene, wherein the parameter relationship table includes multiple scenes, multiple image optimization algorithms and multiple picture effect parameters, and each scene corresponds to at least one image optimization algorithm and at least one image optimization parameter. In the above technical solution, searching the parameter relationship table according to the card scene can quickly determine the image optimization algorithm and picture effect parameters of the card scene.

[0009] In one embodiment of the present application, the image optimization algorithm of the card scene includes at least one of a multi-frame noise reduction algorithm and a text algorithm, and the image effect parameters of the card scene include at least one of sharpness, contrast, and noise.

[0010] In one embodiment of the present application, the method further includes: if the portrait ratio is greater than or equal to the real portrait ratio, determining that the scene of the video image frame is a real portrait scene; according to the real portrait scene, searching the parameter relationship table to determine the image optimization algorithm and picture effect parameters corresponding to the real portrait scene, wherein the image optimization algorithm of the real portrait scene includes at least one of a portrait enhancement algorithm, a beauty algorithm, and a beauty makeup algorithm, and the image effect parameters of the real portrait scene include at least one of color and brightness; taking pictures based on the image optimization algorithm and image effect parameters of the real portrait scene. The above technical solution can determine that the scene of the video image frame is a real portrait scene when the portrait ratio is greater than or equal to the real portrait ratio, and take pictures based on the image optimization algorithm and image effect parameters of the real portrait scene, so that the image after taking pictures can be adapted to the real portrait scene.

[0011] In one embodiment of the present application, taking photos based on the image optimization algorithm and image effect parameters of a real portrait scene includes: displaying a prompt control of the real portrait scene on the camera preview interface to indicate that the scene of the video image frame is a real portrait scene; in response to the user clicking the prompt control of the real portrait scene, taking photos based on the image optimization algorithm and image effect parameters of the real portrait scene and obtaining the photographed image. The above technical solution can respond to the user's operation of the prompt control of the real portrait scene when the scene of the video image frame is a real portrait scene, and take photos according to the image optimization algorithm and image effect parameters of the real portrait scene, so that the image taken by the user is adapted to the real portrait scene.

[0012] In one embodiment of the present application, taking a photo based on an image optimization algorithm and image effect parameters of a real portrait scene includes: responding to a user's operation of clicking a photo control on a camera preview interface, and obtaining a photographed image based on the image optimization algorithm and image effect parameters of a real portrait scene. The above technical solution can respond to a user's operation of a photo control when the scene of a video image frame is a real portrait scene, and take a photo according to the image optimization algorithm and image effect parameters of a real portrait scene, so that the image taken by the user is adapted to the real portrait scene.

[0013] In one embodiment of the present application, obtaining the shooting distance between the camera of the terminal device and the shooting object includes: obtaining the motor focus code value of the voice coil motor of the camera, and determining the shooting distance corresponding to the motor focus code value by searching the object distance mapping table according to the motor focus code value, wherein the object distance mapping table includes the correspondence between multiple motor focus code values ​​and multiple shooting distances. The above technical solution can quickly determine the shooting distance corresponding to the motor focus code value by searching the object distance mapping table according to the motor focus code value.

[0014] In one embodiment of the present application, obtaining the shooting distance between the camera of the terminal device and the shooting object includes: measuring the reflection time of infrared light emitted by the TOF camera of the terminal device, and determining the distance between the TOF camera and the shooting object according to the reflection time to obtain the shooting distance. In the above technical solution, the distance between the TOF camera and the shooting object can be accurately calculated according to the reflection time of infrared light emitted by the TOF camera, thereby improving the accuracy of obtaining the shooting distance.

[0015] In one embodiment of the present application, obtaining the shooting distance between the camera of the terminal device and the shooting object includes: obtaining the shooting distance between the camera and the shooting object through a laser ranging device of the terminal device. The above technical solution obtains the shooting distance between the camera and the shooting object through the laser ranging device of the terminal device, thereby improving the acquisition accuracy of the shooting distance.

[0016] In one embodiment of the present application, calculating the proportion of the size of the face area of ​​the video image frame in the video image frame as the portrait proportion includes: using a rectangular frame to mark the face area identified in the video image frame; determining the size of the face area based on the rectangular frame; and determining the proportion of the size of the face area in the video image frame as the portrait proportion according to the size of the face area and the size of the video image frame. The above technical solution determines the size of the face area according to the rectangular frame that marks the face area, and obtains the portrait proportion according to the proportion of the size of the face area to the size of the video image frame.

[0017] In one embodiment of the present application, determining the size of the face area based on the rectangular frame includes: determining the width value of the rectangular frame as the width value of the face area, determining the height value of the rectangular frame as the height value of the face area; and using one of the width value, height value and area value of the face area as the size of the face area.

[0018] In a second aspect, an embodiment of the present application provides a terminal device, which includes a camera, a memory and a processor, wherein: the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the terminal device executes the above-mentioned photo-taking method.

[0019] In a third aspect, an embodiment of the present application provides a chip coupled to a memory in a terminal device, and the chip is used to control the terminal device to execute the above-mentioned photographing method.

[0020] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores program instructions. When the program instructions are executed on a terminal device, the terminal device executes the above-mentioned photographing method.

[0021] In addition, the technical effects brought about by the second to fourth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A software structure block diagram of a terminal device provided in one embodiment of the present application.

[0024] Figure 2 A flowchart of a photographing method provided in one embodiment of the present application.

[0025] Figure 3 A schematic diagram of a mobile phone executing a photo taking method provided in one embodiment of the present application.

[0026] Figure 4 A schematic diagram of a desktop of a mobile phone provided in accordance with an embodiment of the present application.

[0027] Figure 5 A schematic diagram of calling the camera function in a mobile phone's chat interface provided in an embodiment of the present application.

[0028] Figure 6 This is a diagram showing the effect of using a cascade classifier to recognize facial images according to an embodiment of the present application.

[0029] Figure 7 A schematic diagram of a parameter relationship table provided in an embodiment of the present application.

[0030] Figure 8 A schematic diagram of a prompt control for displaying a portrait scene on a camera preview interface provided in an embodiment of the present application.

[0031] Fig. 9 A schematic diagram of a prompt control for displaying a cat and dog scene on a camera preview interface provided in an embodiment of the present application.

[0032] Fig.10 A schematic diagram of a prompt control for displaying a sunset scene on a camera preview interface provided in an embodiment of the present application.

[0033] Fig.11 A schematic diagram of a flow chart for calculating the proportion of the size of a face area in a video image frame provided by an embodiment of the present application.

[0034] Fig.12A schematic diagram of a prompt control for displaying a card scene on a camera preview interface provided in an embodiment of the present application.

[0035] Fig.13 A schematic diagram of a prompt control for displaying a real scene on a camera preview interface provided in an embodiment of the present application.

[0036] Fig.14 A schematic diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0037] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, " / " means or. For example, A / B can represent A or B. "And / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.

[0039] When the terminal device is taking a photo, if a portrait is detected, the camera parameters will be set according to the effect that suits the portrait. For example, when a portrait is detected, the terminal device will set the brightness, noise, contrast, sharpness and other parameters to suit the portrait photography effect. However, since the portrait and text as the photographed objects have different requirements for parameters such as brightness, contrast, and sharpness, if the text is photographed according to the camera parameters set for the portrait photography effect, the text on the photographed image will not achieve the best display effect, and even the text display will not be clear. In particular, when photographing cards with portraits (such as identity cards and campus cards), photographing the card according to the camera parameters set for the portrait photography effect will cause the text on the card image to be unclear.

[0040] In order to solve the problem that the text on the photographed picture is not clearly displayed when the terminal device photographs a portrait and text, an embodiment of the present application provides a photographing method. The photographing method is applied in a terminal device. The terminal device includes an application processor, and the application processor is used to run an operating system. The operating system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the terminal device.

[0041] Figure 1 A software structure diagram of a terminal device provided in one embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four or five layers, which are, from top to bottom, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, the kernel layer, and the hardware layer. In one embodiment of the present application, the photographing method is applied in one or more layers of the Android system.

[0042] The application layer can include a series of application packages.

[0043] like Figure 1 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.

[0044] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 1As shown, the application framework layer may include a display engine, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The application framework layer may provide display function-related APIs for the display applications of the application layer, and provide display services for the display applications to implement the display dimming function.

[0045] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0046] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0047] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0048] The phone manager is used to provide communication functions for terminal devices, such as the management of call status (including answering, hanging up, etc.).

[0049] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0050] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0051] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0052] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0053] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0054] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0055] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.

[0056] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0057] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0058] A 2D graphics engine is a drawing engine for 2D drawings.

[0059] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0060] The kernel layer is the core of the operating system of an electronic device. It is the first layer of software expansion based on hardware. It provides the most basic functions of the operating system and is the basis for the operation of the operating system. It is responsible for managing the system's processes, memory, device drivers, files, and network systems, and determines the performance and stability of the system. For example, the kernel can determine the operating time of an application on a certain part of the hardware.

[0061] The kernel layer includes programs that are closely related to the hardware, such as interrupt handlers, device drivers, etc. It also includes basic, common, and high-frequency modules, such as clock management modules, process scheduling modules, etc. It also includes key data structures. The kernel layer can be set in the processor or solidified in the internal memory.

[0062] The hardware layer includes multiple hardware devices of electronic devices, such as cameras, display screens, laser ranging devices, etc.

[0063] refer to Figure 2 FIG. 1 is a flow chart of a photographing method provided in an embodiment of the present application. The method is applied to a terminal device. Figure 2 One or more steps are performed in the method of the example, but it does not constitute a limitation of the present application. In addition, the order of the steps of the method is only an example, and the order of the steps can be changed. Without departing from the content disclosed in the present application, additional steps can be added or steps can be reduced. The method specifically includes the following steps.

[0064] Step S201, obtaining a video image frame of a camera preview stream.

[0065] The following describes the photographing method of the present application embodiment using a mobile phone as an example of a terminal device. Figure 3 In one embodiment of the present application, the desktop of the mobile phone (such as Figure 4 The mobile phone displays the icon of the camera application (as shown). If the mobile phone detects that the user touches the camera application on the desktop, the camera application and the camera are started, and the video image frames of the camera preview stream of the shooting object are captured by the camera, and the video image frames are displayed on the display screen of the mobile phone, such as the camera preview interface. For example, in one embodiment of the present application, the image data captured by the camera preview interface can be 30 video image frames per second. The shooting object includes one or more of a portrait, a cat, a dog, a sunset, and text.

[0066] In another embodiment of the present application, a user calls a camera function through a user operation in the interface of a target application of a mobile phone. If the mobile phone detects the user operation of calling the camera function, the mobile phone starts the camera application and the camera, captures the video image frame of the camera preview stream of the object through the camera, and displays the video image frame on the camera preview interface of the mobile phone. In one embodiment of the present application, the target application is an application with a camera function. For example, the target application can be an instant messaging application, and the camera is called to capture images or videos. The following uses an instant messaging application as an example to illustrate the scene where a mobile phone enters a camera application. Reference Figure 5 The user calls the camera function by clicking the shooting button in the chat interface of the instant messaging application. If the mobile phone detects that the user clicks the shooting button, the camera application and the camera are started to shoot the subject.

[0067] Step S202, identifying the scene of the video image frame in the camera preview stream.

[0068] In one embodiment of the present application, the mobile phone identifies the scene corresponding to the video image frame in the camera preview stream according to the AI ​​scene detection algorithm. The scene of the video image frame in the camera preview stream may include, but is not limited to: a portrait scene, an animal (e.g., a cat or dog) scene, and a sunset scene. In one embodiment of the present application, the mobile phone identifies each video image frame in the camera preview stream according to the AI ​​scene detection algorithm. If it is identified that a preset number of consecutive video image frames contain a photographed object, the scene of the video image frame is determined to be a scene including the photographed object, wherein the preset number is 5. In other embodiments, the preset number can also be set to other values ​​according to demand. For example, the mobile phone identifies each video image frame in the camera preview stream according to the AI ​​scene detection algorithm. If it is identified that a preset number of consecutive video image frames include a face or a portrait, the scene of the video image frame is determined to be a portrait scene; if it is identified that a preset number of consecutive video image frames include an animal, such as a cat or a dog, the scene of the video image frame is determined to be an animal scene; if it is identified that a preset number of consecutive video image frames include a sunset, the scene of the video image frame is determined to be a sunset scene. The above scenes and corresponding recognition methods are only examples, and are not limited to this in actual applications.

[0069] In one embodiment of the present application, assuming that the animal scene is a cat and dog scene, in order to realize the recognition of the scene of the video image frame as a cat and dog scene according to the AI ​​scene detection algorithm, the AI ​​scene detection algorithm adopts a deep learning network, such as Convolutional Neural Networks (CNN), and collects a large number of cat and dog image data sets, and divides the cat and dog image data sets into a training set and a test set; then, the training set is input into the deep learning network for training, and by continuously adjusting the parameters inside the deep learning network, the deep learning network can accurately recognize the images of cats and dogs, thereby realizing the recognition of the scene of the video image frame as a cat and dog scene according to the AI ​​scene detection algorithm.

[0070] In one embodiment of the present application, in order to realize the recognition of the scene of the video image frame as a sunset scene according to the AI ​​scene detection algorithm, the AI ​​scene detection algorithm adopts a deep learning network, and collects a large number of sunset image data sets, and divides the sunset image data sets into a training set and a test set; then, the training set is input into the deep learning network for training, and by continuously adjusting the parameters within the deep learning network, the deep learning network can accurately recognize the image of the sunset, thereby realizing the recognition of the scene of the video image frame as a sunset scene according to the AI ​​scene detection algorithm.

[0071] In one embodiment of the present application, in order to realize the recognition of text in the camera preview stream according to the AI ​​scene detection algorithm, the AI ​​scene detection algorithm adopts a deep learning network, and collects a large number of text image data sets, and divides the text image data sets into a training set and a test set; then, the training set is input into the deep learning network for training, and by continuously adjusting the parameters inside the deep learning network, the deep learning network can accurately recognize the image of the text, thereby realizing the recognition of text in the camera preview stream according to the AI ​​scene detection algorithm.

[0072] In one embodiment of the present application, in order to realize the recognition of portraits in the camera preview stream according to the AI ​​scene detection algorithm, the AI ​​scene detection algorithm adopts a deep learning network, collects a large number of face image data sets, and divides the face image data sets into a training set and a test set; then, the training set is input into the deep learning network for training, and the parameters inside the deep learning network are continuously adjusted so that the deep learning network can accurately recognize the image of the face, thereby realizing the recognition of portraits in the camera preview stream according to the AI ​​scene detection algorithm.

[0073] Taking face recognition as an example, the specific content of identifying faces in the camera preview stream according to the AI ​​scene detection algorithm is described as follows. In another embodiment of the present application, the mobile phone identifies the portrait of the camera preview stream according to the AI ​​scene detection algorithm, including: using a cascade classifier to identify faces in the camera preview stream. The cascade classifier is formed by cascading multiple strong classifiers, and each strong classifier is formed by a certain number of weak classifiers through the ADABOOST algorithm (an algorithm that generates the final strong classifier by iterating weak classifiers). Among them, the weak classifier is used to extract the Harr-like rectangular features of the image, and the rectangular features can be rectangles with black areas and white areas, and can include original rectangular features and extended rectangular features. Specifically, any rectangle is selected and placed on the video image frame, and then the pixel sum of the white area is subtracted from the pixel sum of the black area, and the difference is used as the feature value of the rectangular feature. If the rectangular feature is placed in the face area and the non-face area of ​​the video image frame of the camera preview stream, the calculated feature values ​​are different, so it is judged based on the feature value of the rectangular feature whether the area with rectangular features in the video image frame is a face area, and then it is judged whether the camera preview stream contains a portrait.

[0074] If the face region can be identified in the video image frame of the camera preview stream through the cascade classifier, it is determined that the video image frame contains a face. If the face region cannot be identified in the video image frame through the cascade classifier, it is determined that the video image frame does not contain a face. If a preset number of consecutive video image frames contain a face, it is determined that the video image frame captured by the camera contains a face. Reference Figure 6 As shown, it is an effect diagram of recognizing a face image using a cascade classifier provided by an embodiment of the present application, and the rectangular frame part is the face area.

[0075] In other embodiments, face detection methods such as face detection based on template matching, face detection based on appearance shape, face detection based on neural network, face detection based on feature, and face detection based on skin color can be used to detect whether the video image frames of the camera preview stream contain faces. The above detection methods are all examples and are not limited to this in actual applications.

[0076] Step S203: if the scene includes a portrait, determine whether the scene is a portrait and text scene.

[0077] In one embodiment of the present application, if it is recognized that the scene includes a portrait or the scene is a portrait scene, it is further determined whether the video image frame includes text. If it includes text, the scene of the video image frame is determined to be a portrait and text scene, and step S204 is executed. If the scene is not a portrait and text scene, step S205 is executed.

[0078] Step S204, determining an image optimization algorithm and picture effect parameters according to the scene, and taking a photo based on the image optimization algorithm and the image effect parameters.

[0079] In one embodiment of the present application, the mobile phone searches the parameter relationship table according to the scene to determine the image optimization algorithm and picture effect parameters corresponding to the scene. The parameter relationship table includes multiple scenes, multiple image optimization algorithms and multiple picture effect parameters, and each scene corresponds to at least one image optimization algorithm and at least one image optimization parameter. Figure 7 As shown, it is a schematic diagram of a parameter relationship table provided in an embodiment of the present application. If the scene is a portrait scene, the mobile phone searches the parameter relationship table for the portrait scene to determine that the image optimization algorithm corresponding to the portrait scene is at least one of a portrait enhancement algorithm, a beauty algorithm, and a beauty makeup algorithm, and determines that the image effect parameters corresponding to the portrait scene include at least one of exposure time, color, brightness, contrast, and dynamic range. If the scene is a cat and dog scene, the mobile phone searches the parameter relationship table for the cat and dog scene to determine that the image optimization algorithm corresponding to the cat and dog scene is an image enhancement algorithm, and determines that the picture effect parameters corresponding to the portrait scene include at least one of color, brightness, and contrast. If the scene is a sunset scene, the mobile phone searches the parameter relationship table for the sunset scene to determine that the image optimization algorithm corresponding to the sunset scene is at least one of a dynamic filtering algorithm and an adaptive histogram equalization algorithm, and determines that the picture effect parameters corresponding to the sunset scene include at least one of dynamic range and brightness. In an embodiment of the present application, a portrait scene refers to a scene in which an image containing a face is taken as a shooting object. A real portrait scene refers to a scene in which a real face is taken as a shooting object. A sunset scene refers to a scene in which a sunset is taken as a shooting object. Animal scenes refer to scenes in which animals (such as cats and dogs) are photographed.

[0080] In one embodiment of the present application, the mobile phone displays a scene prompt control in the program interface of the camera application (such as the camera preview interface), and the prompt control is used to indicate the scene corresponding to the camera preview stream. Figure 8 If the scene is a portrait scene, the phone displays a portrait scene prompt control on the camera preview interface (for example Figure 8 The phone responds to the user clicking the camera preview interface's photo control (e.g. Figure 8 In another embodiment, after the mobile phone displays a prompt control of the portrait scene on the camera preview interface, in response to the user clicking the prompt control of the portrait scene, the mobile phone takes a photo based on the image optimization algorithm and image effect parameters of the portrait scene to obtain a photo image.

[0081] For example, refer to Fig. 9 If the scene is a cat and dog scene, the phone displays a prompt control of the cat and dog scene on the camera preview interface (for example Fig. 9 The cat and dog control in the interface of the mobile phone is used to indicate that the current scene corresponding to the camera preview stream of the mobile phone is a cat and dog scene, and the mobile phone responds to the user clicking the camera preview interface's photo control (for example Fig. 9 The user may click on a prompt control of a cat or dog scene, and take a photo based on the image optimization algorithm and image effect parameters of the cat or dog scene to obtain a photo image.

[0082] For example, refer to Fig.10 If the scene is a sunset scene, the phone displays a sunset scene prompt control on the camera preview interface (for example Fig.10 The sunset control in the interface of the mobile phone is used to indicate that the current scene of the mobile phone camera preview stream is a sunset scene, and the mobile phone responds to the user clicking the camera preview interface's photo control (for example Fig.10 The user may respond to a user clicking a prompt control of a sunset scene by taking a photo, and based on the image optimization algorithm and image effect parameters of the sunset scene, taking a photo to obtain a photo image.

[0083] Step S205 , calculating the ratio of the size of the face area in the video image frame to the size of the face area in the video image frame to obtain the portrait ratio.

[0084] In one embodiment of the present application, if a video image frame contains a human face, the ratio of the size of the facial area corresponding to the face in the video image frame is calculated to obtain the portrait ratio; if the video image frame contains multiple faces, the ratio of the size of the facial area corresponding to all faces in the video image frame is calculated, and the ratio corresponding to the maximum value of all ratios is used as the portrait ratio.

[0085] In one embodiment of the present application, reference Fig.11 As shown, it is a schematic diagram of a flow chart of calculating the proportion of the size of the face area in the video image frame provided by an embodiment of the present application, which specifically includes the following steps.

[0086] S2051: Use a rectangular frame to mark the face area recognized in the video image frame.

[0087] In one embodiment of the present application, after the mobile phone recognizes that the video image frame contains a face, it also uses a rectangular frame to mark the face area recognized in the video image frame. The rectangular frame can be the smallest rectangle that surrounds the face area.

[0088] Specifically, refer to Figure 6 In the process of face detection, the mobile phone simultaneously calculates the face coordinates, and determines the minimum rectangular frame that includes the face area based on the coordinates of the four endpoints of the face area, the horizontal edge of the minimum rectangular frame extends in the horizontal direction, and the longitudinal edge extends in the vertical direction. In one embodiment of the present application, the face coordinates can be determined based on the two-dimensional coordinate system of the image, where the horizontal direction of the two-dimensional coordinate system of the image is the same as the width direction of the image (i.e. Figure 6 The y-axis direction) is parallel to the vertical direction of the image (i.e. Figure 6 The x-axis direction is parallel to the height direction of the image, and the origin of the two-dimensional coordinate system of the image is the coordinate point of the upper left corner of the image.

[0089] S2052: Determine the size of the face area based on the rectangular frame.

[0090] In one embodiment of the present application, the size of the face region may include a width value w, a height value h, and an area s of the face region, where the area s is the product of the width value w and the height value h, and the units of the width value, the height value, and the area are all the number of pixels of the video image frame. Determining the size of the face region based on the rectangular frame includes: determining the width value of the rectangular frame identifying the face region in the video image frame as the width value of the face region, and determining the height value of the rectangular frame as the height value of the face region.

[0091] S2053, calculating the ratio between the size of the face region and the size of the video image frame, and obtaining the ratio of the size of the face region in the video image frame.

[0092] In one embodiment of the present application, the size of the video image frame may include a width value W, a height value H, and an area S of the video image frame, where the area S is the product of the width value W and the height value H, and the width value W, the height value H, and the area S of the video image frame are all preset values, the width value W is the number of pixels at the horizontal edge of the video image frame, the height value H is the number of pixels at the vertical edge of the video image frame, and the area S is the number of pixels of the video image frame. For example, if the resolution of the video image frame is 640*480, the number of pixels at the horizontal edge of the video image frame is 640, and the number of pixels at the vertical edge of the video image frame is 480, then the number of pixels of the video image frame is 307200.

[0093] In one embodiment of the present application, calculating the ratio between the size of the face region and the size of the video image frame includes: calculating the ratio between the width value of the face region and the width value of the video image frame. For example, if the width value of the face region is 400 and the width value of the video image frame is 640, then the ratio between the width value of the face region and the width value of the video image frame is Rw=400 / 640=0.625.

[0094] In another embodiment of the present application, calculating the ratio between the size of the face region and the size of the video image frame includes: calculating the ratio between the height value of the face region and the height value of the video image frame. For example, if the height value of the face region is 240 and the width value of the video image frame is 480, then the ratio between the width value of the face region and the width value of the video image frame Rh=240 / 480=0.5.

[0095] In another embodiment of the present application, calculating the ratio between the size of the face region and the size of the video image frame includes: calculating the ratio between the area of ​​the face region and the area of ​​the video image frame. For example, if the area of ​​the face region is 10500 and the area of ​​the video image frame is 307200, then the ratio between the width value of the face region and the width value of the video image frame is Rs=10500 / 307200=0.34.

[0096] Step S206, obtaining the shooting distance between the camera and the shooting object.

[0097] In one embodiment of the present application, different motor focus code values ​​of the voice coil motor of the camera of the mobile phone correspond to different motor movement data values. In one embodiment of the present application, since each motor focus code value corresponds to a current value, and the current value is used to generate thrust to drive the lens of the camera to move, each motor focus code value can correspond to the motor movement data value of the camera. In one embodiment of the present application, the mobile phone obtains the motor focus code value of the voice coil motor, searches the object distance mapping table according to the motor focus code value, and determines the camera distance corresponding to the motor focus code value. The object distance mapping table includes multiple motor focus code values ​​and multiple camera distances, and each motor focus code value corresponds to a camera distance. In one embodiment of the present application, the camera distance between the camera and the photographed object can be measured in advance according to experiments when the camera is taking pictures, when the motor of the camera is at different motor focus code values ​​(for example, at different motor movement data values), and the motor focus code value and the corresponding camera distance are recorded to establish an object distance mapping table.

[0098] In another embodiment of the present application, the camera of the mobile phone may be a Time of Flight (TOF) camera. The mobile phone measures the reflection time of infrared rays emitted by the TOF camera and determines the distance between the TOF camera and the subject based on the reflection time of the infrared rays.

[0099] In another embodiment of the present application, the mobile phone can also obtain the distance between the camera and the subject through a laser ranging device.

[0100] Step S207, determining the real portrait proportion corresponding to the shooting distance according to the shooting distance.

[0101] In one embodiment of the present application, the mobile phone searches the face size relationship table according to the camera distance to determine the real portrait ratio corresponding to the camera distance. The face size relationship table includes multiple camera distances and multiple real portrait ratios, and each camera distance corresponds to a real portrait ratio. In one embodiment of the present application, it is possible to use a mobile phone to shoot real portraits at different camera distances according to experiments in advance, record the size of the face in the captured image, obtain the size information corresponding to the real face in the captured image at different camera distances, and form a face size relationship table.

[0102] Step S208, determining whether the calculated portrait ratio is smaller than the real portrait ratio. If the calculated portrait ratio is smaller than the real portrait ratio, executing step S209, otherwise, if the calculated portrait ratio is greater than or equal to the real portrait ratio, executing step S210.

[0103] Step S209, determining that the scene of the video image frame is a card scene, determining an image optimization algorithm and picture effect parameters of the card scene according to the card scene, and taking a photo based on the image optimization algorithm and image effect parameters of the card scene.

[0104] In one embodiment of the present application, the mobile phone determines the image optimization algorithm and picture effect parameters corresponding to the card scene according to the scene search parameter relationship table. In one embodiment of the present application, the mobile phone determines the image optimization algorithm corresponding to the card scene according to the scene search parameter relationship table to be at least one of the multi-frame noise reduction algorithm and the text algorithm, and determines the image effect parameters corresponding to the card scene to include at least one of sharpness, contrast, and noise. Fig.12 In one embodiment of the present application, the mobile phone displays a prompt control of the card scene on the camera preview interface (for example Fig.12 The card control in the interface of the mobile phone is used to indicate that the current scene of the mobile phone's camera preview stream is the card scene. The mobile phone responds to the user clicking the camera preview interface's photo control (for example Fig.12 The camera controls in the interface of the card scene are operated to take a photo based on at least one image optimization algorithm among the multi-frame noise reduction algorithm and the text algorithm, and at least one image effect parameter among sharpness, contrast, and noise to obtain a photo image, or the camera controls in response to the user clicking on the prompt control of the card scene are operated to take a photo based on at least one image optimization algorithm among the multi-frame noise reduction algorithm and the text algorithm, and at least one image effect parameter among sharpness, contrast, and noise to obtain a photo image.

[0105] Step S210, determining that the scene of the video image frame is a real portrait scene, determining an image optimization algorithm and picture effect parameters of the real portrait scene according to the real portrait scene, and taking a photo based on the image optimization algorithm and image effect parameters of the real portrait scene.

[0106] In one embodiment of the present application, the mobile phone determines the image optimization algorithm and picture effect parameters corresponding to the real portrait scene according to the scene search parameter relationship table. In one embodiment of the present application, the mobile phone determines the image optimization algorithm corresponding to the real portrait scene according to the real portrait scene search parameter relationship table as at least one of the portrait enhancement algorithm, the beauty algorithm, and the beauty makeup algorithm, and determines that the image effect parameters corresponding to the real portrait scene include at least one of color and brightness. Fig.13The mobile phone displays a prompt control of a real portrait scene on the camera preview interface, which is used to indicate that the current scene of the camera preview stream of the mobile phone is a real portrait scene. The mobile phone responds to the user clicking the photo control of the camera preview interface, and takes a photo based on at least one image optimization algorithm among the portrait enhancement algorithm, the beauty algorithm, and the beauty makeup algorithm, and at least one image effect parameter among color and brightness to obtain a photo image, or responds to the user clicking the prompt control of the card scene, and takes a photo based on at least one image optimization algorithm among the portrait enhancement algorithm, the beauty algorithm, and the beauty makeup algorithm, and at least one image effect parameter among color and brightness to obtain a photo image.

[0107] In the above scheme, when the scene of the video image frame in the camera preview stream is identified as a portrait and text scene (that is, the video image frame is identified to include a portrait and text), the proportion of the size of the face area in the video image frame in the video image frame is further determined as the portrait ratio, and the real portrait ratio corresponding to the camera distance is determined according to the camera distance, and when the portrait ratio is smaller than the real portrait ratio, the portrait and text scene is determined to be a card scene, and the image optimization algorithm and picture effect parameters of the card scene are determined according to the card scene, and the photo is taken based on the image optimization algorithm and image effect parameters of the card scene. In this way, when it is identified that the video image frame includes a portrait, the image optimization algorithm and camera parameters set for the portrait photography effect are prioritized to take the photo, which will cause the text on the image after the photo to be unclear.

[0108] The following is an introduction to the terminal device involved in the embodiment of the present application. Fig.14 FIG. 1 is a schematic diagram of the hardware structure of a terminal device in an embodiment of the present application. The terminal device may be Figure 1 The terminal device 100 in.

[0109] In this embodiment, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0110] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0111] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0112] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0113] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0114] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0115] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 100.

[0116] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0117] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0118] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0119] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.

[0120] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0121] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices 100, such as AR devices, etc.

[0122] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0123] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device 100 through the power management module 141.

[0124] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0125] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0126] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0127] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0128] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0129] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0130] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0131] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.

[0132] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0133] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0134] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0135] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0136] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0137] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0138] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0139] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0140] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0141] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.

[0142] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0143] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0144] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.

[0145] The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 110. The one or more computer programs include multiple instructions. When the multiple instructions are executed by the processor 110, the method for executing a photograph on the terminal device 100 in the above embodiment can be implemented to implement the photographing function of the terminal device 100.

[0146] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0147] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0148] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0149] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.

[0150] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.

[0151] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0152] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 100 detects the touch operation intensity according to the pressure sensor 180A. The terminal device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0153] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. In some embodiments, the angular velocity of the terminal device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0154] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0155] The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the terminal device 100 is a flip phone, the terminal device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover automatic unlocking and other features are set.

[0156] The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in all directions (generally three axes). When the terminal device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the terminal device 100 and applied to applications such as horizontal and vertical screen switching and pedometers.

[0157] The distance sensor 180F is used to measure the distance. The terminal device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the terminal device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

[0158] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The terminal device 100 emits infrared light outward through the light emitting diode. The terminal device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the terminal device 100. When insufficient reflected light is detected, the terminal device 100 can determine that there is no object near the terminal device 100. The terminal device 100 can use the proximity light sensor 180G to detect that the user holds the terminal device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode, and pocket mode automatically unlocks and locks the screen.

[0159] The ambient light sensor 180L is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the terminal device 100 is in a pocket to prevent accidental touch.

[0160] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0161] The temperature sensor 180J is used to detect temperature. In some embodiments, the terminal device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 heats the battery 142 to avoid abnormal shutdown of the terminal device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the terminal device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0162] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 100, which is different from the position of the display screen 194.

[0163] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.

[0164] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0165] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0166] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0167] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0168] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the photo-taking method in the above-mentioned embodiment.

[0169] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the photographing method in the above-mentioned embodiment.

[0170] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the photo-taking method in the above-mentioned method embodiments.

[0171] Among them, the terminal device 100, computer storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0172] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0173] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0174] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.

[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0176] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0177] The above implementation modes are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the above preferred implementation modes, a person skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A photographing method, applied to a terminal device, characterized in that: The method comprises: Get the video image frame of the camera preview stream through the camera preview interface; If a face and text are recognized from the video image frame, calculating the ratio of the size of the face area of ​​the video image frame to the video image frame as the portrait ratio; Obtaining a camera distance between a camera of the terminal device and a photographed object; Determining the proportion of a real portrait corresponding to the shooting distance according to the shooting distance includes: when shooting a real portrait at the shooting distance, determining the proportion of the real portrait based on the size of the face in the shot image; If the portrait ratio is smaller than the real portrait ratio, determining that the scene corresponding to the video image frame is a card scene; An image optimization algorithm and picture effect parameters corresponding to the card scene are determined, and photographing is performed based on the image optimization algorithm and image effect parameters of the card scene.

2. The photographing method according to claim 1, characterized in that: The taking of photos based on the image optimization algorithm and image effect parameters of the card scene includes: Displaying a prompt control of the card scene on the camera preview interface, for indicating that the scene of the video image frame is the card scene; In response to the user clicking on the prompt control of the card scene, a photo is taken based on the image optimization algorithm and image effect parameters of the card scene to obtain a photographed image.

3. The photographing method according to claim 1, wherein: The taking of photos based on the image optimization algorithm and image effect parameters of the card scene includes: In response to a user clicking on a photo control on the camera preview interface, a photo image is obtained based on an image optimization algorithm and image effect parameters of the card scene.

4. The photographing method according to claim 1, wherein: Determining the real portrait ratio corresponding to the camera distance according to the camera distance includes: A face size relationship table is searched according to the camera distance to determine the real portrait proportion corresponding to the camera distance, wherein the face size relationship table includes correspondences between multiple camera distances and multiple real portrait proportions.

5. The photographing method according to claim 1, characterized in that: The step of determining the image optimization algorithm and picture effect parameters corresponding to the card scene includes: According to the card scene, the parameter relationship table is searched to determine the image optimization algorithm and the picture effect parameter corresponding to the card scene, wherein the parameter relationship table includes multiple scenes, multiple image optimization algorithms and multiple picture effect parameters, and each scene corresponds to at least one image optimization algorithm and at least one image optimization parameter.

6. The photographing method according to claim 1, wherein: The image optimization algorithm of the card scene includes at least one of a multi-frame noise reduction algorithm and a text algorithm, and the image effect parameters of the card scene include at least one of sharpness, contrast, and noise.

7. The photographing method according to claim 1, wherein: The method further comprises: If the portrait ratio is greater than or equal to the real portrait ratio, determining that the scene of the video image frame is a real portrait scene; According to the real portrait scene, searching a parameter relationship table to determine an image optimization algorithm and picture effect parameters corresponding to the real portrait scene, wherein the image optimization algorithm of the real portrait scene includes at least one of a portrait enhancement algorithm, a beauty algorithm, and a beauty makeup algorithm, and the image effect parameters of the real portrait scene include at least one of color and brightness; Taking photos based on the image optimization algorithm and image effect parameters of the real portrait scene.

8. The photographing method according to claim 7, characterized in that: The taking of photos based on the image optimization algorithm and image effect parameters of the real portrait scene includes: Displaying a prompt control of the real portrait scene on the camera preview interface, for indicating that the scene of the video image frame is the real portrait scene; In response to a user clicking on a prompt control of the real portrait scene, a photo is taken based on an image optimization algorithm and image effect parameters of the real portrait scene to obtain a photographed image.

9. The photographing method according to claim 7, characterized in that: The taking of photos based on the image optimization algorithm and image effect parameters of the real portrait scene includes: In response to a user clicking on a photo control on the camera preview interface, a photographed image is obtained based on an image optimization algorithm and image effect parameters of the real portrait scene.

10. The photographing method according to claim 1, characterized in that: The obtaining of the shooting distance between the camera of the terminal device and the shooting object comprises: Obtain a motor focus code value of the voice coil motor of the camera, and determine a camera distance corresponding to the motor focus code value by searching an object distance mapping table according to the motor focus code value, wherein the object distance mapping table includes a correspondence between multiple motor focus code values ​​and multiple camera distances.

11. The photographing method according to claim 1, wherein: The obtaining of the shooting distance between the camera of the terminal device and the shooting object comprises: The reflection time of the infrared light emitted by the TOF camera of the terminal device is measured, and the distance between the TOF camera and the photographed object is determined according to the reflection time to obtain the photographing distance.

12. The photographing method according to claim 1, wherein: The obtaining of the shooting distance between the camera of the terminal device and the shooting object comprises: The shooting distance between the camera and the shooting object is obtained by a laser ranging device of the terminal device.

13. The photographing method according to claim 1, wherein: The calculating the proportion of the size of the face area of ​​the video image frame in the video image frame as the portrait proportion includes: Using a rectangular frame to mark the face area identified in the video image frame; Determine the size of the face region based on the rectangular frame; According to the size of the face area and the size of the video image frame, a ratio of the size of the face area in the video image frame is determined as the portrait ratio.

14. The photographing method according to claim 13, wherein: Determining the size of the face area based on the rectangular frame includes: Determine the width of the rectangular frame as the width of the face area, and determine the height of the rectangular frame as the height of the face area; One of the width value, height value and area value of the face region is used as the size of the face region.

15. A terminal device, characterized in that: The terminal device includes a camera, a memory and a processor, wherein: The memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the terminal device executes the photographing method as described in any one of claims 1 to 14.

16. A chip coupled to a memory in a terminal device, characterized in that: The chip is used to control the terminal device to execute the photographing method according to any one of claims 1 to 14.

17. A computer storage medium, characterized in that: The computer storage medium stores program instructions, and when the program instructions are executed on a terminal device, the terminal device executes the photographing method according to any one of claims 1 to 14.