Image-based command processing method and electronic equipment
By using the AO camera in the terminal device to collect images and extract lip motion features, and match preset commands, the problem of limited application of AI assistants when it is inconvenient for users to speak is solved, and the expanded application and low-power processing of AI assistants are realized.
Patent Information
- Application Number
- CN202411170466.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-09-24
AI Technical Summary
In some scenarios, it is inconvenient for users to speak, which limits the application scenarios of AI assistants and makes existing speech recognition technology difficult to meet demand.
By using the AO camera in the terminal device to collect images, command processing is performed based on lip motion features, and the convolutional neural network and Transformer model are used to extract lip motion sequence features, match them with the preset command sequence features, and execute the corresponding preset commands.
In the case where it is inconvenient for the user to speak, the command processing of the AI assistant is realized, the application scenarios of the AI assistant are expanded, the power consumption of the terminal device is reduced, the processing efficiency and accuracy are improved, and the problem of mistaken activation is avoided.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an image-based command processing method and electronic device. Background Art
[0002] With the development of artificial intelligence (AI) models in the field of voice processing, AI assistants have become a common feature of smartphones. Users can use keywords to wake up AI assistants to make function requests, such as calling a contact or checking the weather.
[0003] In current implementations, AI assistants usually rely on speech recognition technology, which can be implemented through deep learning technology. When a user issues a command in the form of voice, the terminal device can collect voice information and use neural networks to perform feature extraction and speech recognition. Through this process, the terminal device can determine the semantic information of the voice command issued by the user and make corresponding operations.
[0004] However, in some special scenarios, speech recognition is difficult to meet real needs. For example, in some scenarios, it is inconvenient for users to speak, which will limit the application scenarios of AI assistants. Summary of the invention
[0005] The embodiment of the present application provides an image-based command processing method and electronic device, which are applied to the field of terminal technology. The technical solution of the present application can drive an AI assistant based on lip movement commands in scenarios where it is inconvenient for the user to speak, thereby effectively expanding the use scenarios of the AI assistant.
[0006] In a first aspect, an embodiment of the present application provides an image-based command processing method. The method includes: Acquire a plurality of images captured by a first camera within a first period of time; Extracting a first sequence of features according to the multiple images, where the first sequence of features is used to indicate lip movement features corresponding to lip regions in the multiple images; Determine a target preset sequence feature that matches the first sequence feature among multiple preset sequence features, wherein the multiple preset sequence features correspond to respective preset commands, and the preset sequence features are used to indicate lip movement features corresponding to the preset commands; Execute the preset command corresponding to the target preset sequence feature.
[0007] In this implementation, in this embodiment, by using the first camera to capture images, and then identifying lip movement sequence features based on the image, and matching the identified lip movement sequence features with the preset sequence features corresponding to multiple preset commands, so as to execute the preset commands corresponding to the matched target preset sequence features, thereby achieving the purpose of driving the terminal device to execute the corresponding commands based on lip movements, avoiding the limitations caused by the user's inconvenience in using the AI assistant by voice in some scenarios, and effectively expanding the application scenarios of the AI assistant.
[0008] Furthermore, by acquiring multiple images captured by the first camera within the first period, the accuracy of lip movement detection can be effectively improved by using the multiple images for lip movement detection. By extracting the first sequence feature and comparing the obtained first sequence feature with multiple preset sequence features, the meaning of the lip movement command input by the user can be quickly determined, thereby improving processing efficiency. By executing the preset command corresponding to the target preset sequence feature, the actual needs of the user are met.
[0009] In a possible implementation manner, acquiring a plurality of images captured by a first camera within a first period of time includes: For any first image captured by the first camera, obtain a plurality of second images that are adjacent to the first image at the time of capture; Determine a starting image among the first image and the plurality of second images, wherein the starting image is an image in which the start of lip movement is detected; Starting from the acquisition time of the starting image, multiple images acquired by the first camera within a preset time length are acquired to obtain multiple images acquired within a first time period, wherein the first time period is a time period corresponding to the preset time length after the acquisition time of the starting image.
[0010] In this implementation, by determining whether lip movement has started after acquiring the first image and multiple second images, images acquired in scenes such as daily conversations can be filtered out. By acquiring multiple images captured by the first camera within a preset time period to determine whether the lip movement has ended, the power consumption of the terminal device due to erroneous storage of lip movement images can be reduced.
[0011] In a possible implementation manner, determining a starting image among a first image and a plurality of second images includes: Performing comparison processing on the first image and each two adjacent images in the plurality of second images respectively, so as to obtain lip movement detection results corresponding to each two adjacent images; According to the lip movement detection results corresponding to each of two adjacent images, a starting image at which the start of the lip movement is detected is determined.
[0012] In this implementation, by comparing the lip movement detection results corresponding to each of two adjacent images, the image and time when the lip movement starts are detected, thereby effectively avoiding unnecessary power consumption in image processing when no lip movement occurs.
[0013] In a possible implementation, the method further includes: Performing face detection on the first image, and / or performing eye gaze detection on the first image; For any first image captured by the first camera, a plurality of second images adjacent to the first image at the time of capture are acquired, including: When a human face is detected in the first image, and / or when a gaze of a human eye is detected in the first image, a plurality of second images adjacent to the first image at the time of acquisition are acquired.
[0014] In this implementation, through face detection, images that do not contain faces can be filtered out, that is, there is no need to perform subsequent processing on images that do not contain faces, thereby reducing the overall algorithm power consumption of the solution proposed in this application and reducing unnecessary losses for the terminal device. Through human eye detection, a large number of images containing faces collected in scenarios where the user does not interact with the terminal device can also be filtered out to reduce the high power consumption generated by processing these images, and at the same time, the problem of false activation can be effectively avoided.
[0015] In a possible implementation, the method further includes: Determining whether the lip movement is completed in the first time period according to a plurality of images whose collection moments are arranged later in the first time period; Based on multiple images, the first sequence features are extracted, including: When it is determined that the lip movement ends within the first time period, a first sequence feature is extracted based on the multiple images.
[0016] In this implementation, by determining whether the lip movement has ended within the first period, the power consumption of the terminal device due to erroneous storage of the lip movement image is reduced. At the same time, by extracting the first sequence feature, the meaning of the lip movement password input by the user can be quickly determined, thereby improving processing efficiency.
[0017] In a possible implementation, extracting a first sequence of features from a plurality of images includes: Cutting out lip regions from the multiple images respectively to obtain sub-images corresponding to the multiple images; A first sequence of features is extracted according to the sub-images corresponding to the plurality of images.
[0018] In this implementation, by capturing the lip areas in multiple images respectively, the efficiency and accuracy of feature extraction can be improved, and the related interference caused by the large image range can be avoided.
[0019] In a possible implementation, determining a target preset sequence feature that matches the first sequence feature among multiple preset sequence features includes: Determining the similarities between the plurality of preset sequence features and the first sequence feature respectively; Determine, among the plurality of preset sequence features, a preset sequence feature having the highest similarity to the first sequence feature; When the similarity corresponding to the preset sequence feature with the highest similarity is greater than a preset threshold, the preset sequence feature with the highest similarity is determined as the target preset sequence feature.
[0020] In this implementation, through feature matching, the meaning of the user's command password can be quickly and accurately determined to solve the user's actual needs.
[0021] In a possible implementation, the method further includes: When the user records the lip movement instruction corresponding to the first preset command, a plurality of lip movement images are collected; Generating a preset sequence feature corresponding to a first preset command according to the plurality of lip movement images; A first preset command and a preset sequence feature corresponding to the first preset command are stored.
[0022] In this implementation, by recording and storing the first preset command and the preset sequence feature corresponding to the first preset command, the user can compare the preset sequence feature corresponding to the preset command with the first sequence feature in subsequent operations to solve the user's current needs and avoid the inconvenience caused by not being able to solve the user's needs due to the inconvenience of speaking in some scenarios.
[0023] In a second aspect, an embodiment of the present application provides an image-based command processing device, which may be an electronic device, or a chip or chip system in an electronic device. The image-based command processing device may include a display unit and a processing unit.
[0024] When the image-based command processing device is an electronic device, the display unit may be a display screen. The display unit is used to perform the display step so that the electronic device implements an image-based command processing method described in the first aspect or any possible implementation of the first aspect.
[0025] When the image-based command processing device is an electronic device, the processing unit may be a processor. The image-based command processing device may also include a storage unit, which may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit to enable the electronic device to implement an image-based command processing method described in the first aspect or any possible implementation of the first aspect.
[0026] When the image-based command processing device is a chip or chip system in an electronic device, the processing unit may be a processor. The processing unit executes instructions stored in the storage unit so that the electronic device implements an image-based command processing method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit in the chip (e.g., a register, a cache, etc.), or a storage unit in the electronic device located outside the chip (e.g., a read-only memory, a random access memory, etc.).
[0027] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being used to store code instructions, and the processor being used to run the code instructions to execute the method described in the first aspect or any possible implementation of the first aspect.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored. When the computer program or instructions are run on a computer, the computer executes the method described in the first aspect or any possible implementation of the first aspect.
[0029] In a fifth aspect, an embodiment of the present application provides a computer program product including a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect or any possible implementation manner of the first aspect.
[0030] In a sixth aspect, the present application provides a chip or a chip system, the chip or chip system comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.
[0031] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).
[0032] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of the use scenario of the AI assistant provided in the embodiment of the present application; Figure 2 A schematic diagram of a usage scenario of the AO camera provided in an embodiment of the present application; Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application; Figure 4 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application; Figure 5 A schematic diagram of the process of an image processing method provided in an embodiment of the present application; Figure 6 A schematic diagram of an AO camera capturing an image provided in an embodiment of the present application; Figure 7 A schematic diagram of a captured image provided by an embodiment of the present application; Figure 8 A schematic diagram of the implementation of the AO camera provided in an embodiment of the present application to detect human eye gaze; Fig. 9 A schematic diagram of detecting the start of lip movement provided in an embodiment of the present application; Fig.10 A schematic diagram of the timing of collecting lip movement images provided in an embodiment of the present application; Fig.11 A schematic diagram of detecting the end of lip movement provided in an embodiment of the present application; Fig.12 A schematic diagram of capturing key areas of a lip movement image provided in an embodiment of the present application; Fig.13 A schematic diagram of first lip movement sequence feature extraction provided in an embodiment of the present application; Fig.14 A schematic diagram of matching the first lip movement sequence feature with the preset command sequence feature provided in an embodiment of the present application; Fig.15 A flowchart of an image-based command processing method provided in an embodiment of the present application; Fig.16 An example diagram of a method for implementing pre-recorded lip movement instructions for users; Fig.17 is a schematic diagram of a recorded command template; Fig.18 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below: 1. AO Camera AO (Always-On) cameras are a common configuration of current high-end intelligent terminal devices. They have low power consumption and always-on capabilities. They can run continuously in the background for 24 hours, continuously capturing lower-quality images (common pixel resolutions are 320*240, 160*120, etc.) at a rate of K frames per second (common values of K are 10, 15, 30, etc.). Images obtained from AO cameras can be processed and analyzed in the low-power area of the processor, so that the entire continuous detection and recognition link can be completed with lower power consumption.
[0035] 2. Convolutional Neural Networks Convolutional Neural Network (CNN) is a deep learning model commonly used in image and video processing. CNN has relatively efficient two-dimensional image processing capabilities and can act on each frame of the image in turn to extract low-level features.
[0036] 3. Transformer Transformer is a neural network model used to process sequence data. Transformer neural network has strong temporal and global feature extraction capabilities, and can extract overall sequence features based on low-order features of each frame.
[0037] 4. Other terms In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0038] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in 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 specific way.
[0039] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, a--c, bc, or abc, where a, b, and c can be single or multiple.
[0040] 5. Electronic equipment The electronic devices of the embodiments of the present application may include handheld devices, vehicle-mounted devices, etc. with data acquisition and image processing functions. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or future evolved public land mobile communication networks (PLANs). The embodiments of the present application do not limit this.
[0041] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0042] In addition, in the embodiments of the present application, the electronic device may also be a terminal device in the Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0043] The electronic device in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0044] In an embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0045] In order to better understand the technical solution of the present application, the relevant technologies involved in the present application are further introduced in detail below.
[0046] With the development of artificial intelligence (AI) models in the field of voice processing, AI assistants have become a common feature of current smartphones. Users can make function requests to AI assistants by waking them up with keywords. For example, when a user needs to call a contact, they only need to wake up the AI assistant and issue a voice command "Call XX" to dial the contact's phone. It can be seen that the emergence of AI assistants has brought great convenience to people's lives.
[0047] In current implementations, AI assistants usually rely on speech recognition technology, which can be implemented through deep learning technology. When a user issues a command in the form of voice, the terminal device can collect voice information and use neural networks to perform feature extraction and speech recognition. Through this process, the terminal device can determine the semantic information of the voice command issued by the user and make corresponding operations.
[0048] Combine the following Figure 1 The above process is introduced as an example. Figure 1 Schematic diagram of the AI assistant usage scenario provided in the embodiment of the present application.
[0049] like Figure 1 As shown, after the user 101 sends a voice command to the mobile phone 102, the AI assistant 103 collects the voice information, and then performs voice recognition through the neural network, finally understands the needs of the user 101 and performs operations. For example, suppose the user 101 sends a voice command "yoyo, call XX" in voice form, the mobile phone 101 collects the user's voice information, wakes up the AI assistant 103 through the keyword "yoyo", and then recognizes the voice information "call XX" through the neural network, finally determines the needs of the user 101, and performs corresponding operations on the mobile phone 101.
[0050] However, in some special scenarios, voice recognition can hardly meet actual needs. For example, in noisy environments, AI assistants are easily disturbed by the environment, making it difficult to receive and recognize sounds. Also, in quiet environments such as libraries, using wake-up words to wake up voice assistants can appear uncivilized or embarrassing. In addition, it is difficult for people with congenital disabilities, late vocal cord injuries, and other vocal difficulties to use AI assistants, which brings an unfriendly user experience.
[0051] In order to solve the problem that it is inconvenient to use AI assistants through voice in the above-mentioned scenarios, the present application proposes a technical concept: when the user uses the terminal device, the user's image is captured, and the user's lip movement features are analyzed based on the captured image. Then, the AI assistant is instructed to perform corresponding operations based on the analyzed lip movement features.
[0052] In the process of recognizing the lip movement features of the user, it is necessary to continuously collect images of the user. In one implementation, for example, the image can be collected by a conventional camera (such as a front camera) in the terminal device to perform subsequent processing. However, if the conventional camera is enabled for a long time, the terminal device may have a problem of high power consumption.
[0053] Therefore, this application uses the AO camera in the terminal device for image acquisition. The AO camera has the advantages of low power consumption and always on, and is a common configuration of current high-end intelligent terminal devices. The AO camera can run 24 hours a day in the background, and the acquired images are analyzed and processed in the low power consumption area of the processor, reducing the power consumption of the entire process. Therefore, in the technical solution of this application, it is possible to achieve continuous image acquisition of users while avoiding excessive power consumption of the terminal device.
[0054] However, it should be noted that, in the actual implementation process, the technical solution of the present application can still be implemented by using a conventional camera. The specific camera used for image acquisition may depend on actual needs, and this embodiment does not impose any restrictions on this.
[0055] Combine the following Figure 2 The following is an illustrative introduction to the usage scenarios of the above-mentioned AO cameras. Figure 2 Schematic diagram of the usage scenario of the AO camera provided in an embodiment of the present application.
[0056] In this embodiment, the AO camera can continuously acquire images. Figure 2 In the case where the user 201 shown holds the terminal device 202 , the AO camera 203 can capture a facial image containing the user 201 .
[0057] Furthermore, when the user does not hold the terminal device, or when the user holds the terminal device but is not facing the terminal device, the image captured by the AO camera may not contain a face. This application does not limit the content of the image captured by the AO camera.
[0058] The AO camera can be, for example, always on for 24 hours and collect images at a frequency of K frames per second. For example, assuming that the value of K is 15, the AO camera can collect 15 images per second. Afterwards, the terminal device can process the images collected by the AO camera to implement the technical solution of the present application.
[0059] The image processing method of the embodiment of the present application can be executed by an electronic device equipped with an AO camera and a processor, or by a chip, a chip system or a processor that supports the electronic device to implement the image processing method, or by a logic module or software that can implement all or part of the functions of the electronic device, and the present application does not impose specific restrictions on this. The image processing method of the embodiment of the present application is described in detail below, taking the electronic device as the execution subject as an example.
[0060] The electronic device may be, for example, a terminal device. Figure 3 and Figure 4 Provide a brief introduction to the terminal equipment.
[0061] For example, Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application.
[0062] Figure 3 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. The terminal device 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, a sensor hub 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0063] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain 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.
[0064] 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.
[0065] Among them, Sensorhub is a microcontroller or processor for collecting and processing data from multiple sensors. In this embodiment, Sensorhub can, for example, execute the image processing method provided in this application based on the image collected by the camera module. That is to say, the image processing solutions provided in each embodiment of this application can be executed by the Sensorhub introduced here.
[0066] Or in another implementation, the image processing method introduced in each embodiment of the present application may also be executed by the processor introduced above, and the present application does not limit this.
[0067] The terminal device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor. In this embodiment, camera 193 may include a conventional camera, for example, wherein the conventional camera may be understood as a front camera or a rear camera in the terminal device. And, camera 193 may also include an AO camera, for example. In the process of executing the image processing method provided in the present application, image acquisition may be performed through a conventional camera, or may also be performed through an AO camera, and the present application does not limit this.
[0068] The software system of the terminal device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the terminal device.
[0069] For example, Figure 4 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application.
[0070] like Figure 4 As shown, the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system may include an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, a hardware abstraction layer (HAL) and a kernel layer. It should be noted that the embodiment of the present application is illustrated by taking the Android system as an example. In other operating systems (such as Hongmeng system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those of the embodiment of the present application, the solution of the present application can also be implemented.
[0071] Among them, the application layer can include a series of application packages.
[0072] like Figure 4 As shown, the application package may include camera, calendar, phone, map, phone, music, settings, mailbox, video, social and other applications. Of course, the application layer may also include other application packages, such as payment applications, shopping applications, banking applications, social applications and other third-party applications, which are not limited in this application.
[0073] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0074] like Figure 4 As shown, the application framework layer may include a window manager, a content provider, a resource manager, a view system, a camera manager, etc. In this embodiment, the camera manager may manage the camera of the terminal device. For example, the camera manager may control the AO camera to acquire images. Figure 2 The camera manager may include an AO camera management module, which may be used to manage the AO camera. For example, the AO camera management module may control the opening or closing of the AO camera, and may control the AO camera to acquire images at a certain frequency.
[0075] The HAL layer is a package of the Linux kernel driver, providing an interface to the upper layer and shielding the implementation details of the low-level hardware. Figure 4 The HAL layer may include, for example, an AO camera HAL, wherein the AO camera HAL may receive, for example, an image acquisition instruction sent by the AO camera management module, and instruct the AO camera driver in the kernel layer to perform an image acquisition action. Also, the HAL layer may also include a processing module, wherein the processing module may, for example, execute the command processing method provided in the present application based on the image acquired by the AO camera.
[0076] Exemplarily, the HAL layer may also include a Wi-Fi HAL, an audio HAL, a camera service (Camera HAL Server) unit of the HAL layer, a software code library, etc., which is not limited in this embodiment.
[0077] The kernel layer is a layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver. In this embodiment, the kernel layer may include, for example, an AO camera driver for driving the AO camera in the hardware layer to perform image acquisition.
[0078] The following, in conjunction with the accompanying drawings, describes in detail the technical solutions of the embodiments of the present application and how the technical solutions of the embodiments of the present application solve the above-mentioned technical problems with specific embodiments. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0079] Based on the above introduction, the technical solution provided by this application is described in detail below with reference to specific drawings. Figure 5 A flowchart of an image processing method provided in an embodiment of the present application is shown in FIG. Figure 6 A schematic diagram of an AO camera capturing an image provided in an embodiment of the present application, Figure 7 A schematic diagram of capturing an image provided in an embodiment of the present application, Figure 8 This is a schematic diagram of the implementation of the AO camera provided in the embodiment of the present application to detect human eye gaze. Fig. 9 A schematic diagram of detecting the start of lip movement provided in an embodiment of the present application, Fig.10 A schematic diagram of the timing of collecting lip movement images provided in an embodiment of the present application, Fig.11 A schematic diagram of detecting the end of lip movement provided in an embodiment of the present application, Fig.12 A schematic diagram of capturing key areas of a lip movement image provided in an embodiment of the present application, Fig.13 A schematic diagram of first lip movement sequence feature extraction provided in an embodiment of the present application, Fig.14 A schematic diagram of the matching of the first lip movement sequence features and the preset command sequence features provided in an embodiment of the present application.
[0080] like Figure 5 As shown, the method includes: S501, obtaining a first image captured by an AO camera.
[0081] Referring to the above introduction, it can be determined that the AO camera can acquire images at a certain frequency, such as Figure 6 As shown, for example, the image captured by the AO camera 601 may include Figure 6 As shown in the figure, images 1 to n. It should be understood that the AO camera captures images continuously. Figure 6 The figure only illustrates a plurality of images captured by the AO camera within a period of time, and does not limit the time period for which the AO camera captures the images.
[0082] The first image may be any one of the multiple images captured by the AO camera, for example Figure 6 Image 1 to image n in the figure can be understood as the first image introduced in this application.
[0083] At the same time, it can be understood that the processing methods for multiple images captured by the AO camera are similar, so the first image is taken as an example for introduction below, and the implementation methods for the remaining images are not repeated.
[0084] S502: Detect whether the first image contains a face. If so, execute S503; if not, end the process.
[0085] In this application, the AI assistant is controlled based on lip movements. It can be understood that lip movements can only be detected when the captured image contains a face image of the user. Therefore, subsequent processing can be performed only when the first image contains a face. In one implementation, after acquiring the first image, it can be first detected whether the first image contains a face, and then subsequent operations are performed when it is detected that the first image contains a face.
[0086] Therefore, the operation of detecting whether the first image contains a face can filter out images that do not contain faces, that is, there is no need to perform subsequent processing on images that do not contain faces, thereby reducing the overall algorithm power consumption of the solution proposed in this application and reducing unnecessary losses for the terminal device.
[0087] Exemplarily, a face detection algorithm may be used to determine whether the first image contains a face. For example, the face detection algorithm may process the first image through a face detection model to determine whether the first image contains a face. The specific face detection algorithm may be selected according to actual needs, and this embodiment does not limit this.
[0088] Combine the following Figure 7 An exemplary introduction is given to whether the first image contains a human face.
[0089] like Figure 7 As shown in (a), assuming that user 701 holds terminal device 702, terminal device 702 will collect a first image of the user, and the first image may include the user's face.
[0090] like Figure 7 As shown in (b), in some scenarios, for example, user 701 does not hold terminal device 702, and the image captured by terminal device 702 does not contain a face, such as a flower. In this case, the specific image content contained in the image captured by the AO camera can be determined according to actual needs, and this embodiment does not limit this.
[0091] In this embodiment, when it is detected that the first image does not contain a face, it can be determined that the current user has not input a lip movement instruction to the terminal device, so there is no need to perform subsequent operations, and the current process can be terminated accordingly, that is, the processing of the first image is terminated.
[0092] Alternatively, when it is detected that the first image contains a face, it can be preliminarily determined that the current user is facing the terminal device, and thus subsequent judgment operations can be performed to determine whether the user inputs a lip movement instruction to the terminal device.
[0093] S503: Determine whether human eye gaze is detected in the first image. If so, execute S504; if not, end the process.
[0094] It is understandable that in some scenarios, although the first image collected contains the user's facial information, it is possible that the user is not looking at the phone at this time. In the scenario where the user is not looking at the phone, the probability of the user interacting with the terminal device is very low. It is understandable that in this scenario, although the user's facial image is collected, the user is not interacting with the terminal device at this time.
[0095] Therefore, in this embodiment, after determining that the first image contains a face, it is possible to further determine whether human eye gaze is detected in the first image. In one implementation, after obtaining the first image containing face information, the first image can be detected again to determine whether the first image detects human eyes gazing at the screen. Thus, a large number of images containing faces collected in scenarios where the user does not interact with the terminal device can also be filtered out. For these images, the current processing flow can be directly terminated to reduce the high power consumption generated by processing these images, and the problem of false activation can also be effectively avoided.
[0096] Exemplarily, computer vision technology can be used to determine whether a person's eyes are looking at the screen. It is understandable that after the camera captures the face image, an image processing algorithm is used to detect and track the position of the eyes, and by analyzing the characteristic points of the eyes, such as the corners of the eyes, the position of the eyeballs, etc., it is determined whether the person's eyes are looking at the screen. However, it should be noted that in the actual implementation process, there are many methods for determining whether the person's eyes are looking at the screen. The specific method to be selected can be based on actual needs, and this embodiment does not limit this.
[0097] Combine the following Figure 8 An exemplary introduction is given to whether the first image detects human eye gaze.
[0098] like Figure 8 As shown in (a), when the user 801 holds the terminal device 802, the user 801 looks at the screen of the terminal device 802, and the terminal device 802 obtains a first image containing facial information and showing the user's eyes looking at the screen.
[0099] like Figure 8 As shown in (b), when user 801 holds terminal device 802, user 801 is not looking at the screen of terminal device 802, for example, closing eyes, and terminal device 802 obtains face information that is not looking at the screen. In this case, the state of not looking at the screen needs to be determined according to actual conditions, and this implementation does not limit this.
[0100] In this embodiment, when it is detected that the human eyes in the first image are not looking at the screen, it can be determined that the user is not currently interacting with the terminal device, so there is no need to perform subsequent operations, and the current process can be terminated accordingly, that is, the processing of the first image is terminated.
[0101] Alternatively, when it is detected that the human eyes in the first image are looking at the screen, it can be determined that the user is currently facing the terminal device and looking at the terminal device, so subsequent judgment operations can be continued to determine whether the user inputs lip movement instructions to the terminal device.
[0102] S504: Determine whether lip movement is detected based on the first image and a plurality of second images adjacent to the first image. If so, execute S505; if not, terminate the process.
[0103] When the face and eye gaze of a person are detected based on the first image, it can be determined that the current user is facing the terminal device and is looking at the terminal device. Based on this, in this embodiment, it can be further detected based on the first image whether the user inputs a lip movement instruction to the terminal device.
[0104] It can be understood that if you want to detect whether the user inputs a lip movement instruction to the terminal device, you need to compare multiple images to determine whether the user has lip movement. Therefore, in this embodiment, multiple second images adjacent to the first image can be obtained, and then based on the first image and the multiple second images adjacent to the first image, it is determined whether lip movement is detected. Therefore, using multiple images for lip movement detection can effectively improve the accuracy of lip movement detection.
[0105] For example, to determine whether lip movement has started, key point detection technology can be used, which requires identifying and locating key points in the first image and multiple second images, that is, specific positions of the lips. By detecting the movement of these key points, it is possible to accurately determine whether lip movement has occurred. However, it should be noted that in the actual implementation process, there are many methods for detecting the start of lip movement. The specific method can be selected according to actual needs, and this embodiment does not limit this.
[0106] Combine the following Fig. 9 An exemplary introduction to determining the start of lip movement is given.
[0107] like Fig. 9 As shown in (a) in FIG, assuming that image 1 is the first image, and m images that are acquired after image 1 and adjacent to image 1 are determined as the second image, for example, the value of m is 3, then it can be determined that Fig. 9 Image 2, Image 3 and Image 4 shown in (a) are second images.
[0108] Reference Fig. 9 In (a), it can be determined that the lip information of image 1 is consistent with that of image 2, the lip information of image 2 is inconsistent with that of image 3, and the lip information of image 3 is inconsistent with that of image 4. Because the lip information of images 2 and 3 is inconsistent, and the lip information of images 3 and 4 is inconsistent, it can be determined that the lip movement has started. And, in Fig. 9In the example of (a), based on the fact that the lip information of image 2 and image 3 is first detected to be inconsistent, it can be determined that the time when image 3 is captured is the time when the lip movement starts.
[0109] In another case, if Fig. 9 As shown in (b) in FIG. 1 , image 1 is the first image, and image 2 to image 4 are multiple second images adjacent to the first image. Among them, the lip information shown in image 1, image 2, image 3 and image 4 are all consistent. Since the lip information of the compared image frames is consistent, it can be determined that the lip movement has not occurred.
[0110] The above combination Fig. 9 (a) and (b) in the figure introduce that when lip movement detection starts, four frames of images, image 1 to image 4, are selected for comparison and judgment. In actual implementation, the number of frames for lip movement detection can be selected according to actual needs, and the comparison in this embodiment is not limited.
[0111] In the above Fig. 9 In the example, it is introduced that by comparing the first image and two adjacent images in the plurality of second images, it is determined whether the lip movement information of the two adjacent images is consistent, so as to determine whether the lip movement has started. And the above Fig. 9 The decision strategy adopted in the method is that as long as the lip movement information of any two adjacent images is inconsistent, it can be determined that lip movement has occurred. This implementation method can effectively enhance the sensitivity of lip movement detection.
[0112] In another implementation, the following determination strategy may be adopted: when the lip movement information of two adjacent images is inconsistent, it is determined that lip movement occurs. For example, only when the lip information of image 1 and image 2 is inconsistent, the lip information of image 2 and image 3 is inconsistent, and the lip information of image 3 and image 4 is inconsistent, it is determined that lip movement is detected. This implementation method can effectively improve the reliability of lip movement detection and avoid false detection.
[0113] And, the above combination Fig. 9 The implementation introduced in (a) is to determine m images whose acquisition time is after image 1 and adjacent to image 1 as the second image. In the actual implementation process, t images whose acquisition time is before image 1 and adjacent to image 1 can also be determined as the second image. Alternatively, a images whose acquisition time is before image 1 and adjacent to image 1 and b images whose acquisition time is after image 1 and adjacent to image 1 can also be determined as the second image. This embodiment does not limit the specific implementation of determining the second image. Regardless of the method used to determine the second image, the implementation method of determining whether lip movement is detected based on the first image and multiple second images is the same as the above. Fig. 9 The introduction is similar and will not be repeated here.
[0114] In this embodiment, based on the comparison between the first image and the plurality of second images, if it is determined that the start of lip movement is not detected, then no subsequent operation is required and the current process can be terminated accordingly for the first image currently being processed.
[0115] Alternatively, when it is detected that the lip information of the first image is inconsistent with that of a second image, it can be determined that the lip movement has started. It can be understood that the user is currently facing the terminal device and has made lip movements, so the subsequent judgment operation can be continued to determine whether the lip movement command input by the user is a short sentence similar to the command template.
[0116] It can be understood that the command template itself is a sequence of lip movement images and the extracted sequence features. The user can customize the command template within a certain range (i.e., how to move the lips). The user can also customize the specific operation execution corresponding to the command template within the capabilities of the terminal system, i.e., the preset command.
[0117] S505 , storing a plurality of images in a first time period from time t0 to time t0+T.
[0118] In this embodiment, time t0 is the time when the lip movement starts to be detected. For example, multiple images within a period of time can be acquired starting from time t0, and the lip movement characteristics of the user can be analyzed based on the multiple images within this period of time.
[0119] However, it is understandable that when the user faces the terminal device and looks at the terminal device, if the user moves his lips, there may be the following two situations. The first situation is that the user inputs a lip movement instruction to the terminal device, and the second situation is that the user is having a daily conversation or talking to himself. That is to say, in the second situation introduced here, although the user moves his lips for a period of time, the user is not actually inputting a lip movement instruction to the terminal device. In this embodiment, lip movement recognition should be performed for the first situation, while lip movement recognition is not required for the second situation.
[0120] In order to effectively filter out the second situation, the maximum duration of lip movement detection can be set in this embodiment, where the maximum duration can be expressed as T, for example. The meaning of the maximum duration here is that when it is detected that the duration of the user's lip movement exceeds the duration T, it can be determined that the user is not inputting a lip movement instruction to the terminal device, but is performing the action described in the second situation above. When it is detected that the user ends the lip movement within the duration T, it can be determined that the user is inputting a lip movement instruction to the terminal device. The specific setting of the duration T can be selected according to actual needs, and this embodiment does not limit this.
[0121] And in order to ensure that the setting of duration T can effectively distinguish the two situations introduced above, in the present application, when the user pre-records the command template, a certain duration display can be provided for the command template recorded by the user. Exemplarily, the limited duration of the command template recorded by the user can be, for example, within the duration range of a~b. That is to say, the shortest required duration of the command template recorded by the user is a, and the longest required duration is b. The duration T introduced above as the distinguishing threshold can, for example, be equal to the longest required duration b of the command template, or can also be greater than the longest required duration b of the command template. In this way, it can be ensured that the set duration T can effectively serve as a basis for distinguishing whether the user is inputting lip movement instructions or having daily conversations.
[0122] Based on the above introduction, in this embodiment, multiple images captured by the AO camera between t0 and t0+T can be acquired and stored. It can be understood that the first period can be the time period between t0 when the lip movement starts and t0+T.
[0123] It should be noted that, in the actual implementation process, the storage format and storage path of the image frames in the first time period can be set according to actual needs, and this embodiment does not limit this.
[0124] Combine the following Fig.10 The moment of storing the plurality of images in the first period of time is exemplarily described.
[0125] like Fig.10 As shown, image 1 is the first image, and it is assumed that the acquisition time of image 3 is the time when the lip movement starts, that is, Fig.10 The time T after t0 is t0. Fig.10 The time t0+T shown, and the image collected at the time t0+T is assumed to be Fig.10 As shown in the image n, multiple images from time t0 to time t0+T, that is, image 3 to image n, can be stored.
[0126] For example, when the value of T is 10, in seconds, all frame images from time t0 to time t0+10, which lasts for 10 seconds, need to be stored. However, it should be noted that in the actual implementation process, the specific value of T needs to be determined according to actual needs, and this embodiment does not limit this.
[0127] S506. Based on the third image corresponding to the time t0+T and the plurality of fourth images adjacent to the third image, determine whether the lip movement is finished. If so, execute step S507; if not, terminate the process.
[0128] After acquiring the images in the first time period, in order to determine whether the lip movement command input by the user ends within the T time period, it is necessary to determine whether the lip movement at time t0+T ends. At the same time, in order to improve the accuracy of the determination, multiple images need to be selected for comparison and determination. Therefore, in this embodiment, by acquiring the third image corresponding to time t0+T and multiple fourth images adjacent to the third image, it is determined whether the lip movement ends. Thus, by determining whether the image corresponding to time t0+T and multiple adjacent images remain unchanged, it is determined whether the lip movement ends, thereby reducing the consumption of power in the terminal device due to erroneous storage of lip movement images.
[0129] Exemplarily, whether the lip movement is finished can be determined by key point detection technology, which is similar to the method of detecting the occurrence of lip movement, and will not be described in detail here. However, it should be noted that in the actual implementation process, the method of detecting the end of lip movement needs to be selected according to actual needs, and this embodiment does not limit this.
[0130] Combine the following Fig.11 An exemplary description of determining the end of lip movement is given below.
[0131] like Fig.11 As shown in (a) in FIG. 1 , it is assumed that image n is the third image, and m images that are located before image n and adjacent to image n at the acquisition time are determined as the fourth image. For example, the value of m is 3, then it can be determined that Fig.11 Image n-3, image n-2, and image n-1 shown in (a) are fourth images.
[0132] Reference Fig.11 In (a), it can be determined that the lip information of image n is consistent with that of image n-1, that of image n-1 is consistent with that of image n-2, and that of image n-2 is consistent with that of image n-3. Because the lip information of image n is consistent with that of image n-1, that of image n-1 is consistent with that of image n-2, and that of image n-2 is consistent with that of image n-3, that is, the lip information of the four images acquired later in the first period is consistent, it can be determined that the lip movement has ended.
[0133] In another case, if Fig.11 As shown in (b), image n is the third image, and image n-3, image n-2, and image n-1 are a plurality of fourth images adjacent to the third image. Among them, the lip information of image n, image n-1, image n-2, and image n-3 are all inconsistent, so it can be determined that the lip movement has not ended.
[0134] The above combination Fig.11(a) and (b) in the introduction describe that when detecting the end of lip movement, four frames of images, image n-3 to image n, are selected for comparison and judgment. In actual implementation, the number of frames for lip movement end detection can be selected according to actual needs, and this embodiment does not limit this.
[0135] In the above Fig.11 In the example, it is introduced that by comparing the third image and two adjacent images in the plurality of fourth images, it is determined whether the lip movement information of the two adjacent images is consistent, so as to determine whether to end the lip movement. Fig.11 The judgment strategy adopted in is that the lip movement can be determined to end only when the lip movement information of two adjacent images is consistent. This implementation method can effectively improve the reliability of lip movement end detection and avoid false detection.
[0136] In another implementation, the following determination strategy may be adopted: when the image captured at time t0+T is consistent with the image captured at time t0+T-1, it can be determined that the lip movement is ended. For example, when the lip information of image n and image n-1 is consistent, it can be determined that the lip movement is ended. This implementation method can effectively enhance the sensitivity of lip movement detection.
[0137] In this embodiment, when it is detected that the lip information of the third image is inconsistent with that of multiple fourth images, it can be obtained that the lip movement is not completed. In this case, there is no need to perform subsequent operations, and the current process can be terminated accordingly, that is, the processing of the first image is terminated.
[0138] Alternatively, when it is detected that the lip information of the third image is consistent with that of a fourth image at an adjacent time, it can be determined that the lip movement is finished. It can be understood that the length of the command currently input by the user is within the time T, which is similar to the preset command in the command template, so the subsequent judgment operation can be continued to determine the operation corresponding to the lip movement command input by the user.
[0139] S507 . For the multiple images in the first time period, respectively capture the lip regions to obtain multiple regional sub-images.
[0140] In order to accurately extract the lip movement features, it is necessary to intercept the key areas of the face image. Therefore, in this embodiment, the lip areas of the multiple images obtained in the first time period are intercepted respectively to obtain multiple regional sub-images. Therefore, by intercepting the key areas of the image, the efficiency and accuracy of feature extraction can be improved, and the related interference caused by the excessively large image range can be avoided.
[0141] For example, this embodiment captures a sub-image including the lip area in the face image, but does not include other parts such as the nose area. However, it should be noted that in the actual implementation process, the size of the specific range of the lip movement area captured is not limited in this embodiment.
[0142] Combine the following Fig.12 An exemplary illustration of key area capture is given below.
[0143] like Fig.12 As shown, image 1 to image n are multiple images facing the terminal device, with lip movement and containing face information in the first period, and the lip area of each image is intercepted to obtain multiple regional sub-images 1.1 to image n.1. Among them, image 1.1 to image n.1 are regional sub-images containing only lip information.
[0144] S508. Obtain a first lip movement sequence feature according to the multiple regional sub-images.
[0145] In order to determine the operation corresponding to the lip movement command input by the user, it is necessary to extract features from the regional sub-image captured by the user's lip movement. In this embodiment, multiple regional sub-images are input into the neural network for processing to obtain the first lip movement sequence feature. Therefore, by comparing the obtained first lip movement sequence feature with the command template, the meaning of the lip movement command input by the user can be quickly determined, thereby improving processing efficiency.
[0146] Exemplarily, the present application uses a convolutional neural network to extract features, and automatically learns and extracts hierarchical feature representations from the original image through structures such as convolutional layers and pooling layers. After that, a Transformer with strong timing and global feature extraction capabilities is used to process the sequence data. Among them, the first lip movement sequence feature is the lip movement sequence feature after being processed by the neural network. However, it should be noted that in the actual implementation process, there are many methods for feature extraction. The specific method to be used depends on actual needs, and this embodiment does not limit this.
[0147] Combine the following Fig.13 An exemplary description of first lip movement sequence feature extraction is performed.
[0148] like Fig.13 As shown, image 1.1 to image n.1 are multiple regional sub-images, namely key area images. The convolutional neural network CNN is used to act on each frame image in turn to extract low-order features. After obtaining the low-order features, they are input into the Transformer neural network model, and the overall sequence features are extracted based on the low-order features of each frame, thereby obtaining the first lip movement sequence features required for subsequent operations.
[0149] S509. According to the first lip movement sequence feature, determine whether there is a matching preset lip movement sequence feature among multiple preset lip movement sequence features. If so, execute step S510; if not, end the process.
[0150] After obtaining the first lip movement sequence feature, it needs to be matched with multiple preset lip movement sequence features. It can be understood that the preset lip movement sequence feature is a sequence feature corresponding to the command pre-stored in the terminal device, that is, the preset lip movement sequence feature in the command template. At the same time, it can be understood that when the similarity value obtained after the first lip movement sequence feature and the preset command sequence feature are compared for similarity is greater than the threshold, the command is considered to match, and if the similarity value is less than or equal to the threshold, the command is considered to not match.
[0151] Therefore, this embodiment matches the first lip movement sequence feature with the preset lip movement sequence feature in the command template to determine the operation corresponding to the user's lip movement command. Thus, through feature matching, the meaning of the user's command command can be quickly and accurately determined to meet the user's actual needs.
[0152] Exemplarily, the feature matching method used in this application is based on the comparison of similarity. It can be understood that the highest similarity is first determined by comparing the size, and then compared with the set threshold to determine whether it matches. However, it should be noted that there are many methods for similarity comparison. The specific similarity comparison method used depends on actual needs, and this embodiment does not limit this. At the same time, the threshold value X also needs to be set according to actual needs, and this embodiment does not limit this.
[0153] Combine the following Fig.14 An exemplary description is given of whether the first lip movement sequence feature matches the preset lip movement sequence feature.
[0154] like Fig.14 As shown, the first lip movement sequence feature is compared with the preset command 1 sequence feature, the preset command 2 sequence feature, ... the preset command n sequence feature for similarity, assuming that the preset command 2 has the highest similarity, and the similarity value S of command 2 is obtained. If the similarity S is higher than the set threshold value X, it is confirmed that the command to be verified matches the preset command 2. If the similarity S is less than or equal to the set threshold value X, it is considered that the command to be verified does not match the preset command 2.
[0155] In this embodiment, if the similarity S is less than or equal to the threshold value X, it means that the command to be verified does not match the preset command in the command template, and the operation corresponding to the user's lip movement password cannot be determined, so no subsequent operation is required, and the current process can be terminated accordingly. It can be understood that the processing of the first image is terminated, and no operation is performed on the terminal device.
[0156] Alternatively, if the similarity S is higher than the threshold X, it means that the first lip movement sequence feature matches the preset lip movement sequence feature in the command template. It can be determined that the operation corresponding to the user's lip movement command is consistent with the operation corresponding to the preset command with the highest similarity. Therefore, subsequent operations can be continued to determine whether the operation corresponding to the preset command can be implemented.
[0157] S510: Determine a preset command corresponding to the matched preset lip movement sequence feature.
[0158] The preset command is the operation indicated by the command pre-stored in the terminal device. According to the above process, the preset lip movement sequence feature contains the preset command. If the first lip movement sequence feature matches the preset lip movement sequence feature, the preset command corresponding to the first lip movement sequence feature can be determined.
[0159] For example, the lip movement pattern of "open mouth-close mouth-open mouth" is stored in the terminal device in advance to represent the command of "open camera". When the user makes "open mouth-close mouth-open mouth", the first lip movement sequence feature is extracted, and after matching with the preset lip movement sequence feature, it is determined that the user's demand is "open camera".
[0160] However, it should be noted that the preset command can be set according to the needs of the user and can be in various forms. How to set the preset command depends on the needs of the user, and this embodiment does not limit this.
[0161] S511. Determine whether there is a conflict between the device status and the preset command. If not, execute step S512. If so, end the process.
[0162] When the user's needs are determined based on the result of matching the first lip movement sequence feature with the preset sequence feature, the operation corresponding to the preset command is determined. It can be understood that the operation that the user currently wants to perform on the terminal device is determined. Then it is necessary to determine whether the device state conflicts with the preset command. Therefore, this embodiment needs to determine whether there is a conflict with the preset command based on the current state of the terminal device. In this way, the user's needs can be accurately implemented to avoid damage to the terminal device and malfunctions caused by forced operations when there is a conflict with the current state of the terminal device.
[0163] For example, when the terminal device is in a call state, after receiving the preset command of "call XX", it conflicts with the terminal device state because the terminal device cannot make two calls at the same time. At this time, the operation indicated by the preset command is not performed.
[0164] In this embodiment, when it is detected that the current state conflicts with the preset command, it can be understood that the terminal device cannot perform multiple operations at the same time, so there is no need to perform subsequent operations and the current process can be terminated accordingly.
[0165] Alternatively, when it is detected that there is no conflict between the current state and the preset command, it can be determined that the preset command can be executed. It can be understood that the current terminal device can perform subsequent operations. S512: Execute the operation indicated by the preset command.
[0166] When it is determined that there is no conflict between the current terminal device and the preset command, the terminal device can perform the operation. This embodiment will perform corresponding operations on the terminal device according to the preset command. It can be understood that after the first lip movement sequence feature matches the preset command sequence feature, the operation to be performed by the user is determined. When there is no conflict between the terminal device and the preset command, the terminal device will perform the corresponding operation according to the preset command.
[0167] In the example introduced above, it is determined that the final matching preset command is preset command 2, and assuming that preset command 2 is the command of "turn on the camera", and the current state of the terminal device is standby, the terminal device can execute preset command 2 to turn on the camera, thereby meeting the user's actual needs for currently inputting lip movement commands.
[0168] In summary, this embodiment collects the user's lip movement image sequence, extracts features based on the lip movement image sequence, and then matches the extracted lip movement sequence features with multiple preset sequence features. This method can determine the command content specifically expressed by the lip movement instruction currently input by the user based on feature matching, without the need to accurately understand the lip movement semantics. That is to say, the lip movement recognition value in this embodiment needs to identify the lip movement features, and matching based on the lip movement features can achieve the purpose of executing the corresponding command, without identifying what semantic information is expressed by the lip movement. This method can significantly improve the robustness of the interactive system, and this method is more advanced than identifying semantic information, so that this method can be effectively run on a small terminal device with low power consumption. At the same time, because this embodiment only focuses on the features corresponding to the lip movement information, and does not need to perform semantic recognition, this embodiment can collect relatively low-quality images based on the AO camera to effectively reduce the power consumption of the terminal device, so that the above-mentioned implementation method can be effectively deployed on a small terminal device on the basis of low power consumption.
[0169] In addition, this embodiment proposes a complete set of strategies to prevent false activation. By restricting faces, gazes, starting lip movements, and ending lip movements, a large number of meaningless calculations and ordinary conversation scenarios are filtered out, the overall algorithm power consumption is controlled, the overall computing efficiency is improved, and the possibility of false activation is significantly reduced, making the entire interaction solution more stable and more feasible.
[0170] Specifically, it is first necessary to detect whether the first image contains a face. Only the first image containing a face is necessary for subsequent operations. Based on this, a large number of images that do not contain faces can be filtered out, thereby reducing the overall algorithm power consumption of the terminal device.
[0171] After that, it is necessary to perform eye gaze detection on the first image to determine whether the user is facing the terminal device. In this solution, lip movement interaction is effective when the user is looking at the screen. It is understandable that the interaction will not be activated when the user is chatting with other people around or talking to himself. This can significantly avoid the problem of users causing false activation in other normal conversation scenarios.
[0172] Furthermore, in this embodiment, a lip movement start detection algorithm is required to analyze the image features of the current frame and several previous frames to determine the moment when the lip movement starts. At the same time, a lip movement end detection algorithm is also required to analyze the image features of the current frame and several previous frames to determine whether the lip movement has ended within T seconds. The combination of the two can more clearly capture a lip movement image sequence that is no longer than T seconds, further filtering out the daily speech scenes of users talking in long sentences, so that short sentences similar to command templates can be subsequently analyzed.
[0173] Based on the above embodiments, Fig.15 The image-based command processing method provided in this application is further explained. Fig.15 A flowchart of an image-based command processing method provided in an embodiment of the present application.
[0174] like Fig.15 As shown, the method includes: S1501. Acquire multiple images captured by a first camera within a first period of time.
[0175] In this embodiment, the first camera is used to perform image acquisition, and may be, for example, the AO camera introduced in the above embodiment, or it may also be a conventional camera (front camera) in the terminal device, which is not limited in this embodiment.
[0176] In one implementation, when acquiring multiple images captured by the first camera within the first time period, for example, the following method may be used: First, for any first image captured by the first camera, a plurality of second images adjacent to the first image at the time of capture are acquired.
[0177] Before acquiring the plurality of second images, for example, face detection may be first performed on the first image, and / or eye gaze detection may be performed on the first image. When a face is detected on the first image, and / or when eye gaze is detected on the first image, a plurality of second images adjacent to the first image at the time of acquisition are acquired.
[0178] Exemplarily, the specific implementation of acquiring the multiple second images may refer to the introduction of S504 in the above embodiment, and will not be repeated here.
[0179] Secondly, after acquiring the plurality of second images, a starting image may be determined from the first image and the plurality of second images, where the starting image is the image where the start of lip movement is detected.
[0180] In the process of determining the starting image, for example, the first image and each two adjacent images in the plurality of second images may be compared to obtain the lip movement detection results corresponding to each of the two adjacent images. Then, the starting image at which the lip movement is detected is determined based on the lip movement detection results corresponding to each of the two adjacent images.
[0181] Exemplarily, the specific implementation of determining the starting image may refer to the introduction of S506 in the above embodiment, and will not be described in detail here.
[0182] Finally, starting from the capture moment of the starting image, multiple images captured by the first camera within a preset time length can be obtained to obtain multiple images captured within a first time period, wherein the first time period is a time period corresponding to the preset time length after the capture moment of the starting image.
[0183] Among them, the acquisition time of the starting image can be, for example, the time t0 introduced in the above embodiment, and the preset duration introduced here can be, for example, the duration T introduced above. Correspondingly, the first time period introduced here is also the time period from t0 to t0+T introduced above.
[0184] Exemplarily, the specific implementation of the current step may refer to the introduction of S505 in the above embodiment, and will not be repeated here.
[0185] S1502. Extract a first sequence feature based on the multiple images, where the first sequence feature is used to indicate lip movement features corresponding to the lip regions in the multiple images.
[0186] The first sequence feature may be, for example, the first lip movement sequence feature introduced in the above embodiment.
[0187] In the process of extracting the first sequence features, for example, it is possible to first determine whether the lip movement ends in the first time period based on a plurality of images that are collected later in the first time period.
[0188] Exemplarily, the specific implementation of the current step may refer to the introduction of S506 in the above embodiment, and will not be repeated here.
[0189] Afterwards, when it is determined that the lip movement ends within the first time period, a first sequence feature is extracted based on the multiple images.
[0190] In one implementation, the first sequence features are extracted from the multiple images, for example, in the following manner: First, lip regions are respectively captured from multiple images to obtain sub-images corresponding to the multiple images.
[0191] Exemplarily, the specific implementation of the current step may refer to the introduction of S507 in the above embodiment, and will not be repeated here.
[0192] Afterwards, a first sequence feature is extracted according to the sub-images corresponding to each of the multiple images.
[0193] Exemplarily, the specific implementation of the current step may refer to the introduction of S508 in the above embodiment, and will not be repeated here.
[0194] S1503. Determine a target preset sequence feature that matches the first sequence feature among multiple preset sequence features, wherein the multiple preset sequence features correspond to respective preset commands, and the preset sequence features are used to indicate lip movement features corresponding to the preset commands.
[0195] In one implementation, among multiple preset sequence features, determining a target preset sequence feature that matches the first sequence feature may be performed in the following manner, for example: First, similarities between multiple preset sequence features and the first sequence feature are determined respectively; then, among the multiple preset sequence features, a preset sequence feature with the highest similarity to the first sequence feature is determined; finally, when the similarity corresponding to the preset sequence feature with the highest similarity is greater than a preset threshold, the preset sequence feature with the highest similarity is determined as the target preset sequence feature.
[0196] Exemplarily, the specific implementation of the current step may refer to the introduction of S509 in the above embodiment, and will not be repeated here.
[0197] S1504: Execute a preset command corresponding to the target preset sequence feature.
[0198] In one implementation, the preset command corresponding to the target preset sequence feature is executed, for example, in the following manner: First, the preset command corresponding to the matching preset lip movement sequence feature is determined.
[0199] Exemplarily, the specific implementation of the current step may refer to the introduction of S510 in the above embodiment, and will not be repeated here.
[0200] Afterwards, when the device status conflicts with the preset command, the current process ends.
[0201] Exemplarily, the specific implementation of the current step may refer to the introduction of S511 in the above embodiment, and will not be repeated here.
[0202] Finally, if there is no conflict between the device state and the preset command, the preset command corresponding to the target preset sequence feature is executed.
[0203] Exemplarily, the specific implementation of the current step may refer to the introduction of S512 in the above embodiment, and will not be repeated here.
[0204] In this embodiment, image processing is performed based on lip movement features, which avoids the inconvenience caused by not being able to meet user needs in some scenarios where it is inconvenient to speak, and expands the application scope of AI assistants. It can be understood that processing based on lip movement images does not require understanding the semantics of lip movements, that is, there is no need to perform lip reading recognition, and only focuses on the similarity comparison of the features of the lip movement sequence itself. Under the premise of meeting user needs, the complexity of the technology is reduced.
[0205] At the same time, when the terminal device collects images, the quality requirements for lip movement images are lower. It only needs to obtain images that can reflect the changes in lip movements, without the need to obtain high-quality images to bring unnecessary power consumption. This embodiment uses the AO camera to implement a low-power always-on function, and can process the collected images in a low-power area, reducing the loss to the terminal device. This embodiment also proposes strategies to prevent false activation such as face detection, eye detection, lip movement start and lip movement end, which can achieve intelligent interaction with higher accuracy.
[0206] Based on the contents of the above embodiments, the contents and operations of the user input command template are further introduced. Fig.16 An example diagram of how to implement pre-recorded lip movement instructions for users. Fig.17 A diagram of a recorded command template.
[0207] In this application, image processing is performed based on lip movement features, so the user needs to pre-record lip movement instructions, extract features, and store the pre-recorded lip movement instructions and command features in a command template, so that the user can retrieve the user's needs after entering the lip movement command later. Therefore, pre-recording lip movement instructions can effectively improve the processing efficiency of the user entering the lip movement command.
[0208] For example, the terminal device may be used to set a prompt for recording a lip movement password to guide the user to record a lip movement password. This application does not limit the operation of setting the recording lip movement password.
[0209] Combine the following Fig.16 Instructions for implementing commands to execute user recorded lip movements.
[0210] like Fig.16As shown, in the process of user 1601 recording a preset command based on terminal device 1602, a control box 1603 for inputting command content can be provided in the interface of the terminal device, and the user can determine the command content to be currently recorded based on the control box 1603. Exemplarily, for example, a plurality of supported command contents can be pre-set by the terminal device, and then the user selects one of the plurality of pre-set command contents, and records each lip movement information for the currently selected command content, so the user can select the preset command to be recorded in the control box 1603, for example.
[0211] Alternatively, in some implementations, the user may input command content in the control box 1603, and then the terminal device parses the command content input by the user and generates execution logic corresponding to the command content input by the user, so that the preset command input by the user can be implemented later. Fig.16 In the example, the command content of the lip movement instruction selected by the user is "play weather briefing", and this embodiment does not limit the specific selection of the command content.
[0212] And reference Fig.16 It can be determined that a prompt message "Please record a lip movement command template within 2 to 3 seconds" can be displayed in the command recording interface to allow the user to confirm the relevant requirements for lip movement information recording. At the same time, a start control 1604 can also be displayed in the command recording interface. After the user selects the command content, for example, the start control 1604 can be clicked to record the lip movement instruction.
[0213] Reference Fig.16 During the process of user 1601 recording lip movement instructions based on terminal device 1602, for example, the camera 1604 of the terminal device can capture images of the user's lip movement instructions, where camera 1604 can be the AO camera introduced above, or it can also be a conventional camera, and this embodiment does not impose any limitation on this.
[0214] Afterwards, the terminal device can input the user image collected by camera 1604 during the recording process into the neural network. After processing, the lip movement features corresponding to the user image are extracted, and the extracted lip movement features are used as the preset lip movement sequence features corresponding to the preset command currently being recorded. Finally, the currently recorded preset command and the corresponding preset lip movement sequence features are associated and stored, thereby completing the lip movement recording of a preset command.
[0215] Combine the following Fig.17 Describe the contents of the command template.
[0216] like Fig.17As shown, the command template includes lip movement instructions and preset commands. Assume that when the user is recording the lip movement instructions, the lip movement instructions output for the preset command "Play Weather Briefing" are "A, B, C, D", that is, the user's mouth shape information during the recording process corresponds to the mouth shape of "A, B, C, D". Then it can be understood that when the user makes the lip movements of "A, B, C, D", the terminal device will correspondingly execute the action of playing the weather briefing. The understanding of the remaining preset instructions is similar and will not be repeated here.
[0217] And reference Fig.17 It can be determined that, in this embodiment, for each preset command, a preset lip movement sequence feature corresponding to the preset command is generated according to the lip movement instruction corresponding to the preset command in the pre-recording process, and then matching can be performed based on the preset lip movement sequence feature to determine the preset command corresponding to the lip movement instruction input by the user to the terminal device. Fig.17 In the figure, 1701 represents the preset lip movement sequence feature corresponding to the preset command of "play weather briefing", and 1702 represents the preset lip movement sequence feature corresponding to the preset command of "keep the screen on for ten minutes".
[0218] It should be noted that the module names involved in the embodiments of the present application can be defined as other names as long as the functions of each module can be achieved, and there is no specific restriction on the names of the modules.
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0220] The image-based command processing method of the embodiment of the present application has been described above, and the device for executing the above method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above-mentioned image-based command processing method.
[0221] The image-based command processing method provided in the embodiment of the present application can be applied to electronic devices with image acquisition and data processing functions. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above-mentioned related description, which will not be repeated here.
[0222] In one implementation, an embodiment of the present application provides an electronic device, Fig.18A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0223] like Fig.18 As shown, the electronic device 180 includes: a processor 1801 and a memory 1802; the memory 1802 stores computer-executable instructions; the processor 1801 executes the computer-executable instructions stored in the memory 1802, so that the electronic device 180 executes the above method.
[0224] When the memory 1802 is independently provided, the electronic device further includes a bus 1803 for connecting the memory 1802 and the processor 1801 .
[0225] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0226] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0227] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0228] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0229] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0230] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A command processing method based on an image, characterized in that: include: Acquire a plurality of images captured by a first camera within a first period of time; Extracting a first sequence feature according to the multiple images, where the first sequence feature is used to indicate a lip movement feature corresponding to a lip region in the multiple images; Determine a target preset sequence feature that matches the first sequence feature from a plurality of preset sequence features, wherein the plurality of preset sequence features correspond to respective preset commands, and the preset sequence features are used to indicate lip movement features corresponding to the preset commands; Execute the preset command corresponding to the target preset sequence feature.
2. The method according to claim 1, characterized in that The step of acquiring a plurality of images captured by the first camera within a first period of time includes: For any first image captured by the first camera, acquiring a plurality of second images that are adjacent to the first image at the time of capture; Determine a starting image among the first image and the plurality of second images, wherein the starting image is an image in which the start of lip movement is detected; Starting from the acquisition moment of the starting image, multiple images acquired by the first camera within a preset time length are acquired to obtain multiple images acquired within the first time period, wherein the first time period is a time period corresponding to the preset time length after the acquisition moment of the starting image.
3. The method according to claim 2, characterized in that Determining a starting image among the first image and the plurality of second images includes: Performing comparison processing on the first image and each two adjacent images in the plurality of second images respectively, so as to obtain lip movement detection results corresponding to each two adjacent images; A starting image where the start of lip movement is detected is determined according to the lip movement detection results corresponding to each of the two adjacent images.
4. The method according to claim 2, characterized in that: The method further comprises: Performing face detection on the first image, and / or performing eye gaze detection on the first image; The step of acquiring, for any first image captured by the first camera, a plurality of second images adjacent to the first image at a capture time, comprises: When a human face is detected in the first image, and / or when a gaze of a human eye is detected in the first image, a plurality of second images adjacent to the first image at the time of acquisition are acquired.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: determining whether the lip movement ends within the first time period according to a plurality of images whose collection moments within the first time period are ranked later; The step of extracting a first sequence feature according to the plurality of images comprises: When it is determined that the lip movement ends within the first time period, a first sequence feature is extracted based on the multiple images.
6. The method according to claim 5, characterized in that The step of extracting a first sequence feature according to the plurality of images comprises: Cutting out lip regions from the multiple images respectively to obtain sub-images corresponding to the multiple images; A first sequence feature is extracted according to the sub-images corresponding to each of the multiple images.
7. The method according to any one of claims 1 to 4, characterized in that: Determining a target preset sequence feature that matches the first sequence feature among multiple preset sequence features includes: respectively determining similarities between the plurality of preset sequence features and the first sequence feature; Among the plurality of preset sequence features, determining a preset sequence feature with the highest similarity to the first sequence feature; When the similarity corresponding to the preset sequence feature with the highest similarity is greater than a preset threshold, the preset sequence feature with the highest similarity is determined as the target preset sequence feature.
8. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the user records the lip movement instruction corresponding to the first preset command, a plurality of lip movement images are collected; generating a preset sequence feature corresponding to the first preset command according to the plurality of lip movement images; The first preset command and a preset sequence feature corresponding to the first preset command are stored.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 8.
10. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises a computer program code, and when the computer program code is run on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for executing preset operations based on mouth shapes
CN104199545A
Lip language recognition method, service equipment and storage medium
CN112633208A
Lip language recognition method, sample labeling method, model training method and device, equipment and storage medium
CN114822543A
Voice interaction method, related device, equipment, system and storage medium
CN116386639A
Lip language recognition method and device and model training method and device
CN117351555A
