Face recognition method and device, vehicle and storage medium
By setting a preset area in the vehicle, and extracting the target image for face recognition based on the facial positions of multiple users with different upper body lengths, the problem of long recognition time and high error recognition rate in the prior art is solved, and a more efficient and accurate recognition effect is achieved.
Patent Information
- Application Number
- CN202311491533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-13
AI Technical Summary
When identifying drivers, face recognition systems in existing vehicles will be affected by the surrounding environment, resulting in extended recognition time and high misrecognition rate, affecting the car use experience.
By setting a preset area in the vehicle, the target image is extracted based on the facial positions of multiple users with different upper body lengths, thereby performing facial recognition and avoiding identifying other users and environments.
It shortens the time for facial recognition, reduces the rate of error recognition, improves the recognition accuracy of target users, and improves the car use experience.
Smart Images

Figure CN119992613A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicles, and more specifically, to a method, device, vehicle and storage medium for face recognition in the field of vehicles. Background Art
[0002] At present, more and more vehicles are equipped with face recognition functions to identify users sitting in the seats of the vehicles. However, the surrounding environment of the user is often complex, which will lead to a long recognition time and a high misrecognition rate, bringing a bad car experience to users.
[0003] Taking the main driver's seat as an example, when performing face recognition on the driver, the surrounding environment such as the main driver's window, the co-pilot seat, and the back seat are often taken into account while collecting the driver's image. Therefore, during the face recognition process, the recognition object is not just the driver, resulting in a longer recognition time and a higher misrecognition rate. Summary of the invention
[0004] The present application provides a method, device, vehicle and storage medium for face recognition, which can avoid identifying other users next to the target user (users outside the window, users on the back seat, users on the left and right seats, etc.) and other parts of the target user, thereby shortening the recognition time and reducing the false recognition rate.
[0005] In a first aspect, a method for face recognition is provided, the method comprising: in response to a face recognition instruction, obtaining a first image captured by an in-vehicle camera corresponding to a target user in a vehicle; extracting a target image from the first image based on a preset area, the preset area being used to indicate an area where the face of the target user is located in the first image, the preset area being determined based on different positions of the faces of multiple users with different upper body lengths in the vehicle when the users sit in vehicle seats at a target position; performing face recognition on the target image to determine user information of the target user.
[0006] In the above technical solution, before performing face recognition on the first image, a target image is extracted from the first image based on a preset area. Since the preset area is used to indicate the area where the face of the target user on the vehicle seat is located in the first image, and the preset area is determined based on the different positions of the faces of multiple users with different upper body lengths sitting in the vehicle seat at the target position, the preset area can infer the area of the target user's face in the first image. After the target image is extracted from the first image based on the preset area, in the process of performing face recognition on the target image, it is possible to avoid identifying other users next to the target user (users outside the window, users on the back seat, users on the left and right seats) and other parts of the target user, which can shorten the recognition time and reduce the false recognition rate.
[0007] In combination with the first aspect, in certain possible implementations, the target position is the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted, and the method for determining the preset area includes: determining the upper body lengths of multiple users on the vehicle seat when the vehicle seat is in the frontmost position or the rearmost position; when the upper body lengths of the multiple users are different, acquiring multiple images when the faces of the multiple users are in different positions; and determining the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
[0008] In the above technical solution, for any user sitting on the vehicle seat, the range of the user's activities around the vehicle seat is determined, so the position of the user's face moving around the vehicle seat is also determined. The vehicle seat in the vehicle is adjustable forward and backward, and the heights of different users (specifically referring to the length of the upper body) are different. These two factors will affect the movable position of the face. Through the testing process, the solution determines multiple images (multiple images corresponding to the front position and multiple images corresponding to the rear position) collected when the faces of multiple users with different upper body lengths are in different positions. Since the upper body length of the target user can be within the upper body length range corresponding to multiple users, the preset area determined based on the multiple images can be used to indicate the area where the face of the target user is located in the first image, so that the target image can be extracted from the first image based on the preset area to perform face recognition on the target image, shorten the recognition time and reduce the false recognition rate.
[0009] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, determining the upper body lengths of multiple users on the vehicle seat includes: for any one of the multiple users, obtaining an upper body image of the user, and determining from the upper body image the relative position between the user's head and multiple reference points in the vehicle; determining the position of the head in the vehicle based on the positions of the multiple reference points in the vehicle and the relative positions; determining the upper body length of the user based on the position of the head in the vehicle and the position of the seat cushion on the vehicle seat.
[0010] In the above technical solution, the upper body length refers to the distance between the head of the user and the cushion on the vehicle seat when the user sits on the vehicle seat. Since the positions of multiple reference points in the vehicle are fixed, the solution determines the position of the head in the vehicle based on the relative positions between the user's head and the multiple reference points and the positions of the multiple reference points in the vehicle; and then determines the upper body length of the user based on the position of the head in the vehicle and the position of the cushion. In other words, the position of the user's head in the vehicle is inferred based on multiple reference points, and then the upper body length of the user is determined based on the position of the cushion on the vehicle seat. By analogy, the solution can accurately determine the upper body lengths of multiple users based on the positions of multiple reference points and the position of the cushion on the vehicle seat.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the preset area is determined based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position, including: integrating the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position into a fourth image, the size of which is the same as that of the multiple images; determining the area including the positions of the multiple faces in the fourth image as the preset area; or, in the horizontal direction and the vertical direction, determining the outermost N positions of the multiple faces, and determining the preset area based on the N positions, where N is a positive integer.
[0012] In the above technical solution, the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position are integrated into one image, i.e., the fourth image; and the preset area is determined based on the positions of the multiple faces in the fourth image. Compared with the solution that does not integrate the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position into one image, the solution in the present application can simply and quickly determine the preset area. Specifically, the preset area can be determined in two ways. The first is to directly determine the area including the positions of the multiple faces as the preset area. The second is to determine the preset area based on the N positions located at the outermost periphery in the horizontal and vertical directions. This solution can enrich the ways of determining the preset area.
[0013] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, based on a preset area, extracting a target image from the first image includes: determining an image area corresponding to the preset area in the first image; extracting the image area from the first image to obtain the target image.
[0014] In the above technical solution, based on the preset area, the area of the image where the face of the target user may be located is calibrated on the first image, and the image area is extracted as the target image. Through this solution, the image area where the face of the target user is located can be accurately obtained from the first image, thereby improving the accuracy of face recognition of the target user.
[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, determining the image area corresponding to the preset area in the first image includes: when the preset area is circular, based on the position of any boundary point in the preset area in the image, and the diameter or radius of the preset area, determining the image area corresponding to the preset area in the first image; when the preset area is rectangular, based on the position of any boundary endpoint in the preset area in the image, and the length and / or width of the preset area, determining the image area corresponding to the preset area in the first image; when the preset area is an irregular shape, based on the positions of multiple boundary points in the preset area in the image, determining the image area corresponding to the preset area in the first image, and the size of the image is the same as that of the first image.
[0016] In the above technical solution, the solution describes in detail the process of extracting the target image from the first image when the preset area is of different shapes. Therefore, for preset areas of different shapes, the solution can accurately extract the target image. This can avoid identifying other users next to the target user (users outside the window, users on the back seat, users on the left and right seats) and other parts of the target user. In other words, the solution helps to shorten the recognition time and reduce the false recognition rate.
[0017] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, face recognition is performed on the target image to determine the user information of the target user, including: inputting the target image into a face recognition model, and extracting facial features in the target image by the face recognition model; classifying the facial features by a classifier in the face recognition model to determine the user information.
[0018] In the above technical solution, since the face recognition model is trained based on a large amount of user data sets, the face recognition model can improve the accuracy of face recognition of the target image and increase the rate of determining the user information.
[0019] In a second aspect, a face recognition device is provided, which includes: an acquisition module, used to respond to a face recognition instruction and acquire a first image captured by an in-vehicle camera corresponding to a target user in a vehicle; an extraction module, used to extract a target image from the first image based on a preset area, wherein the preset area is used to indicate an area where the face of the target user is located in the first image, and the preset area is determined based on different positions of the faces of multiple users with different upper body lengths in the vehicle when the users sit in vehicle seats at a target position; and a recognition module, used to perform face recognition on the target image and determine user information of the target user.
[0020] In combination with the second aspect, in certain possible implementations, the target position is the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted, and the device also includes: a determination module, used to: determine the upper body lengths of multiple users on the vehicle seat when the vehicle seat is in the frontmost position or the rearmost position; when the upper body lengths of the multiple users are different, obtain multiple images of the faces of the multiple users in different positions; determine the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
[0021] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the determination module is specifically used to: for any user among the multiple users, obtain an upper body image of the user, and determine the relative position between the user's head and multiple reference points in the vehicle from the upper body image; determine the position of the head in the vehicle based on the positions of the multiple reference points in the vehicle and the relative positions; determine the length of the user's upper body based on the position of the head in the vehicle and the position of the seat cushion on the vehicle seat.
[0022] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the determination module is specifically used to: integrate faces at different positions in the multiple images corresponding to the front position and the multiple images corresponding to the rear position into a fourth image, the size of the fourth image being the same as that of the multiple images; determine the area including the positions of the multiple faces in the fourth image as the preset area; or, in the horizontal direction and the vertical direction, determine the outermost N positions of the multiple faces, and determine the preset area based on the N positions, where N is a positive integer.
[0023] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the extraction module is specifically used to: determine an image area corresponding to the preset area in the first image; extract the image area from the first image to obtain the target image.
[0024] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the determination module is specifically further used to: when the preset area is circular, based on the position of any boundary point in the preset area in the image, and the diameter or radius of the preset area, determine the image area corresponding to the preset area in the first image; when the preset area is rectangular, based on the position of any boundary endpoint in the preset area in the image, and the length and / or width of the preset area, determine the image area corresponding to the preset area in the first image; when the preset area is an irregular shape, based on the positions of multiple boundary points in the preset area in the image, determine the image area corresponding to the preset area in the first image, and the size of the image is the same as that of the first image.
[0025] In combination with the second aspect and the above-mentioned implementation methods, in some possible implementation methods, the recognition module is specifically used to: input the target image into a face recognition model, and extract the facial features in the target image by the face recognition model; classify the facial features by a classifier in the face recognition model to determine the user information.
[0026] In a third aspect, a vehicle is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the vehicle executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0027] In a fourth aspect, a computer-readable storage medium is provided, which stores instructions. When the instructions are executed on a computer or a processor, the computer or the processor executes the method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a schematic diagram of a scene of face recognition in a vehicle provided by an embodiment of the present application;
[0029] Figure 2 is a schematic flow chart of a face recognition method provided in an embodiment of the present application;
[0030] Figure 3 is a schematic diagram of a vehicle seat provided by an embodiment of the present application in a frontmost position or a rearmost position;
[0031] Figure 4 is a schematic diagram of a fourth image provided in an embodiment of the present application;
[0032] Figure 5 is a schematic diagram of determining a preset area provided in an embodiment of the present application;
[0033] Figure 6 It is a structural schematic diagram of a face recognition device provided in an embodiment of the present application;
[0034] Figure 7 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solutions in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, "multiple" means two or more than two. The terms "first" and "second" are used for descriptive purposes only and should not be understood as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0036] Figure 1 It is a schematic diagram of a scene of face recognition in a vehicle provided in an embodiment of the present application.
[0037] It should be understood that in some embodiments, the facial recognition function on the vehicle can identify the driver and confirm the driver's identity to confirm whether to start the vehicle, whether to adjust the position of the vehicle seat according to the driver's identity, and whether to enter the multimedia system, etc.
[0038] For example, the process of performing face recognition on the target user in the main driving seat is described by taking the vehicle seat as the main driving seat. Figure 1 In the vehicle shown, when the target user sits in the main driving seat, the vehicle collects an image of the target user through the in-vehicle camera P corresponding to the target user. The vehicle performs face recognition on the image to determine the user information of the target user. Usually, the field of view of the in-vehicle camera is wide, and the image may include the user behind the main driving seat, the user outside the window, or the user in the co-pilot seat. Therefore, the above face recognition process often requires a relatively long recognition time and has a high misrecognition rate.
[0039] In order to solve the above problems, the present application proposes a face recognition method to shorten the recognition time and reduce the false recognition rate. The specific implementation process of the method is as follows.
[0040] Figure 2 It is a schematic flow chart of a face recognition method provided in an embodiment of the present application.
[0041] It should be understood that the face recognition method provided in the embodiment of the present application can be applied to Figure 1 The vehicle shown. Specifically, the face recognition method can be applied to a target controller in the vehicle, and the target controller is any one of a vehicle controller and a body domain controller in the vehicle. The body domain controller is used to control various vehicle components in the vehicle. When the target controller is a body domain controller, the body domain controller can be used to control an in-vehicle camera in the vehicle.
[0042] For example, Figure 2 As shown, the method 200 includes:
[0043] Step 201: The vehicle controller responds to a face recognition instruction and obtains a first image captured by an in-vehicle camera corresponding to a target user in the vehicle.
[0044] It should be understood that the "in-vehicle camera corresponding to the target user" in step 201 refers to the in-vehicle camera used to capture the image of the target user. It should also be understood that the size of the image captured by the in-vehicle camera in this application is fixed.
[0045] In some embodiments, a facial recognition device is installed in the vehicle. Before step 201, the method 200 also includes: when the facial recognition device recognizes the face of the target user, the vehicle controller determines that a facial recognition instruction is received, and the facial recognition device includes the in-vehicle camera.
[0046] In some embodiments, a target button is provided on the vehicle, and the target button is used to trigger the face recognition function. Before step 201, the method 200 also includes: the vehicle controller responds to the triggering operation of the target button and determines that a face recognition instruction is received.
[0047] In some embodiments, the target button is a physical button or a virtual button in the vehicle.
[0048] In some embodiments, the trigger operation includes any one of the operations of clicking the target button, triggering the target button by voice, triggering the target button by gaze, and triggering the target button by target gesture.
[0049] Step 202, the vehicle controller extracts the target image from the first image based on a preset area, where the preset area is used to indicate the area where the face of the target user is located in the first image, and the preset area is determined based on different positions of the faces of multiple users in the vehicle when multiple users with different upper body lengths sit in vehicle seats at the target position.
[0050] It should be understood that the "preset area" in step 202 can be specifically understood as: the image area where the face of the target user may be located in the first image. The preset area is determined based on the faces of multiple users with different upper body lengths at different positions in the vehicle, that is, through the test process of the faces of multiple users (a large number of users) with different upper body lengths at different positions in the vehicle, the area where the faces of the large number of users are distributed in the image is obtained. The testing process of this solution is implemented by a large number of users, and the behavioral habits of the target user also conform to the behavioral habits of a large number of users. Therefore, this solution uses the area where the faces of a large number of users are distributed in the image as the preset area.
[0051] It should also be understood that the shape of the "preset area" in step 202 is not limited in this solution. In some embodiments, when the preset area is circular, the preset area can be characterized by the position of any boundary point in the image, and the diameter or radius of the preset area. When the preset area is rectangular, the preset area can be characterized by the position of any boundary endpoint in the image, and the length and / or width of the preset area. When the preset area is an irregular shape, the preset area can be characterized by the positions of multiple boundary points in the image. The image is the same size as the first image.
[0052] It should also be understood that the "target position" in step 202 refers to the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted. Specifically, the front-rear position adjustment of the vehicle seat is achieved through the seat slide rails of the vehicle seat.
[0053] It should also be understood that, except for the target image, the sizes of other images in the present application are the same.
[0054] In some embodiments, the upper body length ranges from [58cm, 80cm].
[0055] In a possible implementation, step 202 includes: the vehicle controller determines an image area corresponding to the preset area in the first image; and the vehicle controller extracts the image area from the first image to obtain the target image.
[0056] In the above technical solution, based on the preset area, the area of the image where the face of the target user may be located is calibrated on the first image, and the image area is extracted as the target image. Through this solution, the image area where the face of the target user is located can be accurately obtained from the first image, thereby improving the accuracy of face recognition of the target user.
[0057] In some embodiments, the vehicle controller determines the image area corresponding to the preset area in the first image, including: when the preset area is circular, the vehicle controller determines the image area corresponding to the preset area in the first image based on the position of any boundary point in the preset area in the image, and the diameter or radius of the preset area; when the preset area is rectangular, the vehicle controller determines the image area corresponding to the preset area in the first image based on the position of any boundary endpoint in the preset area in the image, and the length and / or width of the preset area; when the preset area is an irregular shape, the vehicle controller determines the image area corresponding to the preset area in the image based on the positions of multiple boundary points in the preset area in the image, and the image is the same size as the first image.
[0058] In the above technical solution, the solution describes in detail the process of extracting the target image from the first image when the preset area is of different shapes. Therefore, for preset areas of different shapes, the solution can accurately extract the target image. This can avoid identifying other users next to the target user (users outside the window, users on the back seat, users on the left and right seats) and other parts of the target user. In other words, the solution helps to shorten the recognition time and reduce the false recognition rate.
[0059] In one possible implementation, the target position is the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted, and the method for determining the preset area in step 202 includes: when the vehicle seat is in the frontmost position or the rearmost position, the vehicle controller determines the upper body lengths of multiple users on the vehicle seat; when the upper body lengths of the multiple users are different, obtains multiple images of the faces of the multiple users in different positions; the vehicle controller determines the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
[0060] It should be understood that the "vehicle seat corresponding to the target user" in the above scheme refers to the vehicle seat that the target user can sit in, and the vehicle seat is any seat in the vehicle that can move forward and backward. The "forward position" in the above scheme refers to the third position in the vehicle where the vehicle seat can no longer move toward the front of the vehicle, and the "last position" refers to the fourth position in the vehicle where the vehicle seat can no longer move toward the rear of the vehicle. The "user's upper body length" in the above scheme refers to the distance (vertical distance) between the user's head and the seat cushion of the vehicle seat when the user sits on the vehicle seat.
[0061] In some embodiments, the vehicle seats are a main driver's seat and a co-pilot's seat.
[0062] It should also be understood that the above scheme can be understood as: when the vehicle seat is in the frontmost position, a plurality of fifth images are collected when the faces of multiple users with different upper body lengths move at different positions in the vehicle; when the vehicle seat is in the rearmost position, a plurality of sixth images are collected when the faces of multiple users with different upper body lengths move at different positions in the vehicle; and the preset area is determined based on the plurality of fifth images and the plurality of sixth images. When the vehicle seat is in a position between the frontmost position and the rearmost position, the positions of the faces of the multiple users in the images when the faces of the multiple users move at different positions in the vehicle are in a first position range, and the first position range is determined by the positions of the faces of the multiple users in the images when the faces of the multiple users move at different positions in the vehicle when the vehicle seat is in the frontmost position and the rearmost position respectively. Therefore, the positions of the faces in the plurality of fifth images and the plurality of sixth images are boundary positions, which can cover the positions of the faces of the multiple users in the images obtained when the vehicle seat is in a position between the frontmost position and the rearmost position. Therefore, this solution only considers the multiple fifth images and the multiple sixth images corresponding to when the vehicle seat is in the frontmost position and the rearmost position, that is, the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
[0063] In the above technical solution, for any user sitting on the vehicle seat, the range of the user's activities around the vehicle seat is determined, so the position of the user's face moving around the vehicle seat is also determined. The vehicle seat in the vehicle is adjustable forward and backward, and the heights of different users (specifically referring to the length of the upper body) are different. These two factors will affect the movable position of the face. Through the testing process, the solution determines multiple images (multiple images corresponding to the front position and multiple images corresponding to the rear position) collected when the faces of multiple users with different upper body lengths are in different positions. Since the upper body length of the target user can be within the upper body length range corresponding to multiple users, the preset area determined based on the multiple images can be used to indicate the area where the face of the target user is located in the first image, so that the target image can be extracted from the first image based on the preset area to perform face recognition on the target image, shorten the recognition time and reduce the false recognition rate.
[0064] In one possible implementation, when the vehicle seat is in the forward position or the rearward position, before the vehicle controller determines the upper body lengths of multiple users on the vehicle seat, the method 200 also includes: when the vehicle seat is at the first end limit of the seat slide rail, the vehicle controller determines that the vehicle seat is in the forward position; when the vehicle seat is at the last end limit of the seat slide rail, the vehicle controller determines that the vehicle seat is in the rearward position; when the vehicle seat is in a position between the first end limit and the last end limit, the vehicle controller determines that the vehicle seat is not in the forward position or the rearward position.
[0065] It should be understood that the "first end limit" in the above scheme can be regarded as the "third position" in the above scheme, and the "end limit" can be regarded as the "fourth position" in the above scheme.
[0066] Figure 3 It is a schematic diagram of a vehicle seat in the frontmost position or the rearmost position provided in an embodiment of the present application.
[0067] For example, Figure 3 The figure shows the frontmost and rearmost positions that the vehicle seat can be in. Usually, the vehicle seat can slide forward and backward on the seat rails. When the vehicle seat slides to the front end limit of the seat rails, the vehicle seat can no longer slide toward the front of the vehicle, otherwise the legs of the user sitting on the vehicle seat will collide with the glove box O in front. At this time, the vehicle seat is in the frontmost position A. When the vehicle seat slides to the rear end limit of the seat rails, the vehicle seat can no longer slide toward the rear of the vehicle, otherwise the vehicle seat will collide with the legs of the user on the rear seat. At this time, the vehicle seat is in the frontmost position B.
[0068] In one possible implementation, the vehicle controller determines the upper body lengths of multiple users on the vehicle seat, including: for any one of the multiple users, the vehicle controller obtains an upper body image of the user, and determines from the upper body image the relative position between the user's head and multiple reference points in the vehicle; the vehicle controller determines the position of the head in the vehicle based on the positions of the multiple reference points in the vehicle and the relative positions; the vehicle controller determines the upper body length of the user based on the position of the head in the vehicle and the position of the seat cushion on the vehicle seat.
[0069] In the above technical solution, the upper body length refers to the distance between the head of the user and the cushion on the vehicle seat when the user sits on the vehicle seat. Since the positions of multiple reference points in the vehicle are fixed, the solution determines the position of the head in the vehicle based on the relative positions between the user's head and the multiple reference points and the positions of the multiple reference points in the vehicle; and then determines the upper body length of the user based on the position of the head in the vehicle and the position of the cushion. In other words, the position of the user's head in the vehicle is inferred based on multiple reference points, and then the upper body length of the user is determined based on the position of the cushion on the vehicle seat. By analogy, the solution can accurately determine the upper body lengths of multiple users based on the positions of multiple reference points and the position of the cushion on the vehicle seat.
[0070] In some embodiments, the vehicle controller obtains the upper body image of the user, including: the vehicle controller obtains the upper body image of the user through an in-vehicle camera.
[0071] In some embodiments, the plurality of reference points include position points on a headrest of the vehicle seat, position points on a backrest of the vehicle seat, position points on a ceiling in the vehicle, and the like.
[0072] In one possible implementation, a method for determining that the faces of the multiple users are in different positions includes: for a first user and a second user among the multiple users, the vehicle controller collects a second image of the face of the first user and a third image of the face of the second user through an in-vehicle camera; the vehicle controller recognizes the face in the second image and the face in the third image to obtain a first position of the face of the first user and a second position of the face of the second user; when the first position and the second position are different, the vehicle controller determines that the faces of the first user and the second user are in different positions.
[0073] In the above technical solution, the positions of the faces of two users (a first user and a second user) are taken as an example to describe the process of determining that the faces of multiple users are in different positions. Specifically, a second image of the face of the first user and a third image of the face of the second user are collected by an in-vehicle camera in the vehicle; a first position of the face of the first user and a second position of the face of the second user are determined respectively by a face recognition method; when the first position and the second position are different, it is determined that the faces of the first user and the second user are in different positions. By analogy, the solution can determine that the faces of multiple users are in different positions based on multiple images corresponding to the faces of multiple users.
[0074] In some embodiments, the vehicle controller recognizes the face in the second image and the face in the third image to obtain a first position of the first user's face and a second position of the second user's face, including: the vehicle controller sequentially inputs the second image and the third image into a facial detection model, and the facial detection module determines a first detection frame for the face in the second image and a second detection frame for the face in the third image; the vehicle controller determines the position of the first detection frame as the first position, and determines the position of the second detection frame as the second position.
[0075] In one possible implementation, the vehicle controller determines the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position, including: the vehicle controller integrates the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position into a fourth image, and the size of the fourth image is the same as that of the multiple images; the vehicle controller determines the area including the positions of the multiple faces in the fourth image as the preset area; or, in the horizontal and vertical directions, the vehicle controller determines the outermost N positions of the multiple faces, and determines the preset area based on the N positions, where N is a positive integer.
[0076] It should be understood that the "determine the outermost N positions among the multiple facial positions in the horizontal and vertical directions" in the above scheme can be understood as: among the multiple facial positions, search for the outermost N positions in the four directions of up, down, left and right. Therefore, the value range of N is [2, 4].
[0077] In the above technical solution, the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position are integrated into one image, i.e., the fourth image; and the preset area is determined based on the positions of the multiple faces in the fourth image. Compared with the solution that does not integrate the faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the last position into one image, the solution in the present application can simply and quickly determine the preset area. Specifically, the preset area can be determined in two ways. The first is to directly determine the area including the positions of the multiple faces as the preset area. The second is to determine the preset area based on the N positions located at the outermost periphery in the horizontal and vertical directions. This solution can enrich the ways of determining the preset area.
[0078] Figure 4 It is a schematic diagram of a fourth image provided in an embodiment of the present application.
[0079] For example, Figure 4 The fourth image is shown as an integration of faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position. Figure 4 It also specifically shows the result of integrating faces at different positions in multiple images corresponding to the frontmost position, and the result of integrating faces at different positions in multiple images corresponding to the rearmost position. It should be understood that when the vehicle seat is at the frontmost position, the imaging positions of the faces of multiple users with different upper body lengths in the image are relatively upward when the faces are at different positions, while when the vehicle seat is at the rearmost position, the imaging positions of the faces of multiple users with different upper body lengths in the image are relatively downward when the faces are at different positions. Therefore, Figure 4 As shown, in the fourth image, multiple faces in the integration result of multiple images corresponding to the frontmost position are located above multiple faces in the integration result of multiple images corresponding to the frontmost position.
[0080] In some embodiments, the vehicle controller determines the area including the positions of multiple faces in the fourth image as the preset area, including: the vehicle controller determines the area formed by connecting the positions of the multiple faces as the preset area.
[0081] The process of "the vehicle controller determines the preset area based on the N positions" is discussed as follows.
[0082] In some embodiments, the vehicle controller determines the preset area based on the N positions, including: when N is equal to 2, and the horizontal components and vertical components of the first facial position and the second facial position are different, the vehicle controller determines the area formed by the horizontal line and vertical line passing through the first facial position, and the horizontal line and vertical line passing through the second facial position as the preset area, and the N positions include the first facial position and the second facial position; when N is greater than 2, the vehicle controller determines the preset area based on the positional relationship between the N positions.
[0083] It should be understood that when the first facial position and the second facial position on the fourth image are described by the coordinate method, that is, when the first facial position is (a, b) and the second facial position is (c, d), the horizontal components and the vertical components of the first facial position and the second facial position are different, which means that a is different from c, and b is different from d.
[0084] In the above technical solution, the vehicle controller determines the preset area in a corresponding manner when N is of different sizes. This solution can not only enrich the methods of determining the preset area, but also accurately determine the preset area.
[0085] In some embodiments, the vehicle controller determines the preset area based on the positional relationship between the N positions, including: when N is 4, the first facial position among the N positions is at the lower left of the second facial position, the first facial position is at the upper left of the third facial position, and the third facial position is at the lower left of the fourth facial position, the vehicle controller determines the area formed by the vertical lines passing through the first facial position and the fourth facial position, and the horizontal lines passing through the second facial position and the third facial position as the preset area; when N is 3, the first facial position among the N positions is at the lower left of the second facial position, the first facial position is at the upper left of the third facial position, and the third facial position is at the lower left of the fourth facial position. When N is 3, the first facial position among the N positions is at the lower right of the second facial position, the vehicle controller determines the area formed by the vertical lines passing through the first facial position and the third facial position, and the horizontal lines passing through the second facial position and the third facial position as the preset area; when N is 3, the first facial position among the N positions is at the lower left of the second facial position, the first facial position is at the upper left of the third facial position, and the third facial position is at the lower left of the second facial position, the vehicle controller determines the area formed by the vertical lines passing through the first facial position and the second facial position, and the horizontal lines passing through the second facial position and the third facial position as the preset area.
[0086] In the above technical solution, the process of determining the preset area by the vehicle controller is specifically described when N is 3 or 4 and the N positions are in different positional relationships. This solution can accurately determine the preset area when N is different values, meeting the requirements of shortening the recognition time and reducing the false recognition rate when performing face recognition on the first image.
[0087] Figure 5 It is a schematic diagram of determining a preset area provided in an embodiment of the present application.
[0088] Exemplarily, when N is 2 and the horizontal components and vertical components of the first facial position and the second facial position of the two positions are different, the vehicle controller determines the process of the preset area. Specifically, Figure 5 As shown in (a) of FIG. 1 , the first face position and the second face position have different components in the horizontal direction and in the vertical direction. Figure 5 In the case shown in (a), the vehicle controller determines the first shadow area formed by the first horizontal line and the first vertical line passing through the first facial position, and the second horizontal line and the second vertical line passing through the second facial position as the preset area.
[0089] In another exemplary embodiment, when N is 3, the first facial position among the N positions is located at the lower left of the second facial position, the first facial position is located at the upper left of the third facial position, and the third facial position is located at the lower right of the second facial position, the vehicle controller determines the process of the preset area. Specifically, in the Figure 5 In the case shown in (b), the vehicle controller determines the second shadow area as the preset area based on the third vertical line passing through the first facial position and the fourth vertical line passing through the third facial position, and the third horizontal line passing through the second facial position and the fourth horizontal line passing through the third facial position.
[0090] In another exemplary embodiment, when N is 3, the first facial position among the N positions is located at the lower left of the second facial position, the first facial position is located at the upper left of the third facial position, and the third facial position is located at the lower left of the second facial position, the vehicle controller determines the process of the preset area. Specifically, in the Figure 5 In the case shown in (c), the vehicle controller determines the third shadow area as the preset area based on the fifth vertical line passing through the first facial position and the sixth vertical line passing through the second facial position, and the fifth horizontal line passing through the second facial position and the sixth horizontal line passing through the third facial position.
[0091] In another exemplary embodiment, when N is 4, the first facial position among the N positions is located at the lower left of the second facial position, the first facial position is located at the upper left of the third facial position, and the third facial position is located at the lower left of the fourth facial position, the vehicle controller determines the process of the preset area. Specifically, in the Figure 5 In the case shown in (d), the vehicle controller determines the fourth shadow area as the preset area based on the seventh vertical line passing through the first facial position and the eighth vertical line passing through the fourth facial position, and the seventh horizontal line passing through the second facial position and the eighth horizontal line passing through the third facial position.
[0092] Step 203: The vehicle controller performs face recognition on the target image to determine user information of the target user.
[0093] It should be understood that the “user information of the target user” in step 203 is information used to indicate the identity of the target user.
[0094] In some embodiments, the user information includes at least one of name, gender, age, occupation and date of birth.
[0095] In one possible implementation, step 203 includes: the vehicle controller inputs the target image into a face recognition model, and the face recognition model extracts facial features in the target image; the vehicle controller classifies the facial features through a classifier in the face recognition model to determine the user information.
[0096] In the above technical solution, since the face recognition model is trained based on a large amount of user data sets, the face recognition model can improve the accuracy of face recognition of the target image and increase the rate of determining the user information.
[0097] In some embodiments, the face recognition model is a Faster R-CNN (Region-Convolutional Neural Network) model or a DeepFace model.
[0098] Optionally, the face recognition model extracts facial features in the target image, including: the region generation network in the Faster R-CNN model extracts face candidate regions in the target image; the Faster R-CNN model extracts facial features in the face candidate regions.
[0099] Optionally, the face recognition model extracts facial features in the target image, including: the DeepFace model detects the target image to determine the position of the face; the DeepFace model aligns the position of the face to obtain an aligned face image; the DeepFace model extracts facial features in the aligned face image to obtain a high-dimensional feature vector.
[0100] In the above technical solution, the face position is aligned to eliminate the influence of factors such as head posture, ambient lighting and facial expression on the recognition result, so that the high-dimensional feature vector after feature extraction can accurately identify user information.
[0101] Figure 6 It is a structural schematic diagram of a face recognition device provided in an embodiment of the present application.
[0102] For example, Figure 6 As shown, the device 600 includes:
[0103] An acquisition module 601 is used to acquire a first image captured by an in-vehicle camera corresponding to a target user in a vehicle in response to a face recognition instruction;
[0104] An extraction module 602 is used to extract a target image from the first image based on a preset area, where the preset area is used to indicate an area where the face of the target user is located in the first image, and the preset area is determined based on different positions of the faces of multiple users in the vehicle when multiple users with different upper body lengths sit in the vehicle seats at the target position;
[0105] The recognition module 603 is used to perform face recognition on the target image to determine the user information of the target user.
[0106] Optionally, the target position is the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted, and the device 600 also includes: a determination module, used to: determine the upper body lengths of multiple users on the vehicle seat when the vehicle seat is in the frontmost position or the rearmost position; when the upper body lengths of the multiple users are different, obtain multiple images when the faces of the multiple users are in different positions; determine the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
[0107] Optionally, the determination module is further specifically used to: for any user among the multiple users, obtain an upper body image of the user, and determine the relative position between the user's head and multiple reference points in the vehicle from the upper body image; determine the position of the head in the vehicle based on the positions of the multiple reference points in the vehicle and the relative positions; determine the length of the user's upper body based on the position of the head in the vehicle and the position of the seat cushion on the vehicle seat.
[0108] Optionally, the determination module is further specifically used to: integrate faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position into a fourth image, the size of the fourth image being the same as that of the multiple images; determine an area including the positions of the multiple faces in the fourth image as the preset area; or, in the horizontal and vertical directions, determine the outermost N positions of the multiple faces, and determine the preset area based on the N positions, where N is a positive integer.
[0109] Optionally, the extraction module 602 is specifically used to: determine an image area corresponding to the preset area in the first image; and extract the image area from the first image to obtain the target image.
[0110] Optionally, the determination module is further specifically used to: when the preset area is circular, determine the image area corresponding to the preset area in the first image based on the position of any boundary point in the preset area in the image, and the diameter or radius of the preset area; when the preset area is rectangular, determine the image area corresponding to the preset area in the first image based on the position of any boundary endpoint in the preset area in the image, and the length and / or width of the preset area; when the preset area is an irregular shape, determine the image area corresponding to the preset area in the first image based on the positions of multiple boundary points in the preset area in the image, and the image is the same size as the first image.
[0111] Optionally, the recognition module 603 is specifically used to: input the target image into a face recognition model, and extract facial features in the target image by the face recognition model; classify the facial features by a classifier in the face recognition model to determine the user information.
[0112] Figure 7 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application.
[0113] For example, Figure 7 As shown, the vehicle 700 includes: a memory 701, a processor 702, and a computer program 703 stored in the memory 701 and running on the processor 702, wherein when the processor 702 executes the computer program 703, the vehicle can execute any one of the face recognition methods introduced above.
[0114] In this embodiment, the functional modules of the vehicle can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0115] In the case of dividing each functional module according to each function, the vehicle may include: an acquisition module, an extraction module, an identification module, a determination module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0116] The vehicle provided in this embodiment is used to execute the above-mentioned face recognition method, and thus can achieve the same effect as the above-mentioned implementation method.
[0117] In the case of an integrated unit, the vehicle may include a processing module and a storage module. The processing module may be used to control and manage the actions of the vehicle. The storage module may be used for the vehicle to execute mutual program codes and data.
[0118] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits disclosed in the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0119] This embodiment provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes any one of the face recognition methods described above.
[0120] This embodiment also provides a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes the above-mentioned related steps to implement any one of the face recognition methods introduced above.
[0121] Among them, the vehicle, computer-readable storage medium, computer program product or chip containing instructions provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0122] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0123] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0124] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for face recognition, characterized in that: The method comprises: In response to the face recognition instruction, obtaining a first image captured by an in-vehicle camera corresponding to a target user in the vehicle; Extracting a target image from the first image based on a preset area, the preset area being used to indicate an area where the face of the target user is located in the first image, the preset area being determined based on different positions of the faces of multiple users in the vehicle when multiple users with different upper body lengths sit in vehicle seats at a target position; Perform face recognition on the target image to determine user information of the target user.
2. The method according to claim 1, characterized in that The target position is the frontmost position or the rearmost position of the vehicle seat that can be slidably adjusted, and the method for determining the preset area includes: determining upper body lengths of a plurality of users on the vehicle seat with the vehicle seat in the forward-most position or the rearward-most position; When the upper bodies of the plurality of users are of different lengths, acquiring a plurality of images when the faces of the plurality of users are in different positions; The preset area is determined based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position.
3. The method according to claim 2, characterized in that The determining the upper body lengths of a plurality of users on the vehicle seat comprises: For any user among the multiple users, obtaining an upper body image of the user, and determining a relative position between the head of the user and multiple reference points in the vehicle from the upper body image; determining a position of the head in the vehicle based on the positions of the plurality of reference points in the vehicle and the relative positions; Based on the position of the head in the vehicle and the position of a cushion on the vehicle seat, an upper body length of the user is determined.
4. The method according to claim 2, characterized in that: The determining the preset area based on the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position includes: Integrate faces at different positions in the multiple images corresponding to the frontmost position and the multiple images corresponding to the rearmost position into a fourth image, wherein the size of the fourth image is the same as that of the multiple images; determining an area including the positions of the plurality of faces in the fourth image as the preset area; or, In the horizontal direction and the vertical direction, the outermost N positions of the multiple facial positions are determined, and based on the N positions, the preset area is determined, where N is a positive integer.
5. The method according to claim 1, characterized in that The step of extracting a target image from the first image based on a preset area includes: Determining an image area corresponding to the preset area in the first image; The image region is extracted from the first image to obtain the target image.
6. The method according to claim 5, characterized in that The determining, in the first image, an image area corresponding to the preset area includes: In the case where the preset area is circular, based on the position of any boundary point in the preset area in the image and the diameter or radius of the preset area, determining the image area corresponding to the preset area in the first image; In the case where the preset area is a rectangle, based on the position of any boundary endpoint of the preset area in the image, and the length and / or width of the preset area, determining the image area corresponding to the preset area in the first image; In the case where the preset area is an irregular shape, based on the positions of a plurality of boundary points in the preset area in the image, the image area corresponding to the preset area is determined in the first image, and the image has the same size as the first image.
7. The method according to claim 1, characterized in that The performing face recognition on the target image to determine the user information of the target user includes: Inputting the target image into a face recognition model, and extracting facial features in the target image by the face recognition model; The facial features are classified by a classifier in the facial recognition model to determine the user information.
8. A face recognition device, characterized in that: The device comprises: An acquisition module, configured to acquire, in response to a face recognition instruction, a first image captured by an in-vehicle camera corresponding to a target user in the vehicle; an extraction module, configured to extract a target image from the first image based on a preset area, wherein the preset area is used to indicate an area where the face of the target user is located in the first image, and wherein the preset area is determined based on different positions of the faces of multiple users in the vehicle when multiple users with different upper body lengths sit in vehicle seats at a target position; The determination module is used to perform face recognition on the target image to determine the user information of the target user.
9. A vehicle, characterized in that: The vehicle comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the vehicle executes the face recognition method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the face recognition method as described in any one of claims 1 to 7.