Micro-expression vertex positioning method and device based on feature difference
By using the feature difference analysis method in long videos to quickly locate the micro-expression vertex frame position, it solves the problem of strong dependence on database annotation in the existing technology, and realizes the rapid automatic detection of micro-expression occurrence time points in public places. Improved recognition efficiency and accuracy.
Patent Information
- Application Number
- CN202111309542.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-06
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-11-06
AI Technical Summary
The difficulty with the existing technology in directly detecting micro-expressions in long videos is that the vertex frame needs to be detected in the long video before subsequent micro-expression recognition can be carried out, and it relies on the database to label the start frame and end frame in the long video, resulting in The detection is highly dependent and it is difficult to quickly and automatically detect the time when micro-expressions occur in public places.
By dividing the image sequence into multiple image blocks, the feature value of each frame of image is extracted, and the position of the micro-expression vertex frame is determined based on the feature difference vector of the current frame, the first frame and the last frame, and the feature difference analysis method is used to quickly locate the micro-expression The time point of occurrence reduces dependence on database annotations.
It achieves rapid and automatic detection of the time points when micro-expressions occur in long videos, improves the efficiency and accuracy of micro-expression recognition, reduces dependence on database annotation, and is suitable for emotion detection in public places.
Smart Images

Figure CN113920569B
Abstract
Description
Technical Field
[0001] The present application relates to the field of public safety technology, and in particular to a method and device for locating micro-expression vertices based on feature differences. Background Art
[0002] Micro-expressions are facial expressions that can express a person's true emotional state. Therefore, micro-expression recognition has great application prospects in the fields of public security, judicial identification, medical diagnosis, etc. In the field of public security, micro-expression recognition can be used to detect the emotions of people passing through the entrances of personnel passages in some important places, so as to more comprehensively identify abnormal people.
[0003] Micro-expression is a dynamic facial change, and its changing order is: neutral facial expression-start-vertex-end-neutral facial expression. At present, the micro-expression recognition method of some public place emotion detection equipment is mainly: first collect long videos of passers-by during the passage process, annotate the start frame and end frame in the long video through the micro-expression database, obtain short video data from the start frame to the end frame, and then extract image texture features (LBP) and image motion information (i.e., optical flow features) from the face area of the short video data to detect the vertex frame in the video, and finally perform micro-expression recognition from the vertex frame image.
[0004] The above method is based on short video data to identify micro-expressions. This method relies heavily on the database to annotate the start and end frames in long videos, and requires training and learning. Usually, in public places, emotion detection requires more direct detection of micro-expressions in long videos. The difficulty of directly detecting micro-expressions in long videos lies in the need to detect the apex frame in the long video before subsequent micro-expression recognition can be performed. Summary of the invention
[0005] In order to realize the rapid and automatic detection of the time point when micro-expressions occur in long videos, the present application provides a method and device for locating micro-expression vertices based on feature differences.
[0006] In a first aspect of the present application, a method for locating micro-expression vertices based on feature differences is provided. The method comprises:
[0007] Acquire an image sequence when a pedestrian passes through the emotion collection area, and divide each frame of the image in the image sequence into m*m image blocks, wherein the image sequence includes a face image, and m is a natural number greater than zero;
[0008] Extracting a feature value of each image block in the image sequence;
[0009] In the image sequence, a current frame image is selected, and a head frame image and a tail frame image corresponding to the current frame image are determined, wherein the head frame image is a frame image located before the current frame image and the interval is a preset interval, and the tail frame image is a frame image located after the current frame image and the interval is a preset interval;
[0010] In the current frame image, the head frame image and the tail frame image, for an image block at the same position, determining whether to retain the current frame image according to a feature value of the image block at the position in the current frame image, a feature value of the image block at the position in the head frame image and a feature value of the image block at the position in the tail frame image;
[0011] If yes, determine the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image;
[0012] Determine a feature difference vector according to the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image;
[0013] The micro-expression vertex frame image position is determined according to the feature difference vector.
[0014] By adopting the above technical solution, each frame image in the acquired image sequence is divided into multiple image blocks, and then each frame image in the image sequence is used as the current frame image. The image block of the current frame image is used to perform feature difference analysis with the image blocks at the same position of the head frame and the tail frame, and several frames with large feature differences are retained for the second feature selection to obtain a feature difference vector. The position of the micro-expression vertex frame image is determined according to the feature difference vector, and the position of the vertex frame image is the time point when the micro-expression occurs.
[0015] Preferably, determining whether to retain the current frame image according to a feature value of the image block at the position in the current frame image, a feature value of the image block at the position in the first frame image, and a feature value of the image block at the position in the last frame image comprises:
[0016] Determine the forward vector distance according to the feature value of the image block at the position in the current frame image and the feature value of the image block at the position in the head frame image, and determine the backward vector distance according to the feature value of the image block at the position in the current frame image and the feature value of the image block at the position in the tail frame image;
[0017] Calculate the total vector distance of the image block at the position according to the forward vector distance and the backward vector distance;
[0018] Determining whether the total vector distance is greater than an average vector distance of the image sequence;
[0019] If yes, the frame image is retained.
[0020] Preferably, the forward vector distance includes chi-square distance or Euclidean distance, and the backward vector distance includes chi-square distance or Euclidean distance;
[0021] Determining the forward vector distance according to the characteristic value of the image block at the position in the current frame image and the characteristic value of the image block at the position in the head frame image, and determining the backward vector distance according to the characteristic value of the image block at the position in the current frame image and the characteristic value of the image block at the position in the tail frame image includes:
[0022] When the vector distance is the chi-square distance, the following formula is used for calculation:
[0023]
[0024]
[0025] Among them, P 1,i is the forward chi-square distance of the image block, P 2,i is the backward chi-square distance of the image patch, C i is the LBP feature value of the image block when the i-th frame is used as the current frame image, H i is the LBP feature value of the head frame image block of the i-th frame, T i is the LBP feature value of the last frame image block of the i-th frame;
[0026] When the vector distance is Euclidean distance, the following formula is used for calculation:
[0027]
[0028]
[0029] Among them, Q 1,i is the forward Euclidean distance of the image block, Q 2,i is the backward Euclidean distance of the image block, C i is the optical flow feature value of the image block when the i-th frame is used as the current frame image, H i is the optical flow feature value of the head frame image block of the i-th frame, T i is the optical flow feature value of the last frame image block of the i-th frame.
[0030] Preferably, the calculating the total vector distance of the image block at the position according to the forward vector distance and the backward vector distance comprises:
[0031] When the vector distance is the chi-square distance, the total vector distance is calculated using the following formula:
[0032] P i =P 1,i +P2,i
[0033] When the vector distance is Euclidean distance, the total vector distance is calculated using the following formula:
[0034] Q i =Q 1,i +Q 2,i
[0035] Among them, P i is the total chi-square distance, Q i is the total Euclidean distance.
[0036] Preferably, the method for determining the average vector distance of the image sequence includes:
[0037] When the vector distance is the chi-square distance, the average vector distance is calculated using the following formula:
[0038]
[0039] Among them, P mean is the average chi-square distance, n is the number of frames, and k is the preset distance;
[0040] When the vector distance is the Euclidean distance, the average vector distance is calculated using the following formula:
[0041]
[0042] Among them, Q mean is the average chi-square distance, n is the number of frames, and k is the preset distance.
[0043] Preferably, determining the total characteristic value of the current frame image includes:
[0044] The characteristic matrix of the frame image is determined according to the characteristic value of each image block in the current frame image that is retained:
[0045]
[0046] Among them, D i,j is the feature matrix of the i-th frame image, j is the number of image blocks in the i-th frame image, MF i is the average eigenvalue of the i-th frame image;
[0047] Calculate the total eigenvalue of the current frame image according to the eigenmatrix:
[0048]
[0049] Among them, D i is the total eigenvalue of the i-th frame image.
[0050] Preferably, determining the characteristic difference vector according to the total characteristic value of the current frame image, the maximum characteristic value in the head frame image, and the maximum characteristic value in the tail frame image comprises:
[0051] The characteristic difference vector is calculated using the following formula:
[0052]
[0053]
[0054] Among them, F i is the feature difference vector of the i-th frame image, is the maximum eigenvalue between the head frame and the tail frame of the i-th frame.
[0055] In a second aspect of the present application, a micro-expression vertex positioning device based on feature differences is provided. The device comprises:
[0056] An acquisition module, used for acquiring an image sequence when a pedestrian passes through an emotion collection area, and dividing each frame of the image in the image sequence into m*m image blocks, wherein the image sequence includes a face image, and m is a natural number greater than zero;
[0057] An extraction module, used for extracting a feature value of each image block in the image sequence;
[0058] A first determining module is used to select a current frame image in the image sequence, and determine a head frame image and a tail frame image corresponding to the current frame image, wherein the head frame image is a frame image located before the current frame image and the interval is a preset interval, and the tail frame image is a frame image located after the current frame image and the interval is a preset interval;
[0059] A second determination module is used to determine whether to retain the current frame image according to a feature value of the image block at the same position in the current frame image, the head frame image and the tail frame image, the feature value of the image block at the same position in the current frame image, the feature value of the image block at the same position in the head frame image and the feature value of the image block at the same position in the tail frame image;
[0060] A third determination module is used to determine the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image while retaining the current frame image;
[0061] A fourth determination module, configured to determine a feature difference vector according to the total feature value of the current frame image, the maximum feature value in the head frame image, and the maximum feature value in the tail frame image;
[0062] The fifth determination module is used to determine the micro-expression vertex frame image position according to the feature difference vector.
[0063] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0064] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.
[0065] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0067] Figure 1 is a flow chart of a method for locating micro-expression vertices based on feature differences in an embodiment of the present application;
[0068] Figure 2 is a schematic diagram of image blocks in the current frame, the head frame and the tail frame images in the example of the present application;
[0069] Figure 3 is a block diagram of a micro-expression vertex positioning device based on feature differences in an embodiment of the present application;
[0070] Figure 4 It is a block diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0072] In order to facilitate the understanding of the embodiments of the present application, some terms involved in the embodiments of the present application are first explained.
[0073] In the description of the present application, the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific position, be constructed and operate in a specific position, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0074] In addition, the head frame image refers to a frame image that is located before the current frame image and the interval is a preset interval. The tail frame image refers to a frame image that is located after the current frame image and the interval is a preset interval.
[0075] The feature values in the embodiment of the present application include image texture feature values (LBP feature values) and optical flow feature values. LBP feature is an operator used to describe local texture features of an image; while optical flow feature is a convenient and effective feature that can describe image motion.
[0076] Figure 1 FIG. 4 is a flowchart of a method for locating micro-expression vertices based on feature differences in an embodiment of the present application. Figure 1 , the method comprises the following steps:
[0077] Step 110: Obtain an image sequence of pedestrians passing through the emotion collection area, and divide each frame of the image sequence into m*m image blocks.
[0078] Step 120: extracting the feature value of each image block in the image sequence.
[0079] Step 130: In the image sequence, a current frame image is selected, and a head frame image and a tail frame image corresponding to the current frame image are determined.
[0080] Step 140: In the current frame image, the head frame image, and the tail frame image, for the image block at the same position, determine whether to retain the current frame image based on the feature value of the image block at that position in the current frame image, the feature value of the image block at that position in the head frame image, and the feature value of the image block at that position in the tail frame image.
[0081] Step 150: If the current frame image is retained, the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image are determined.
[0082] Step 160: Determine a feature difference vector according to the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image.
[0083] Step 170: Determine the micro-expression vertex frame image position according to the feature difference vector.
[0084] The above steps are described in detail below.
[0085] In step 110, an image sequence of pedestrians passing through the emotion collection area is obtained, and each frame of the image sequence contains facial information. Specifically, at the entrances of some important public places, such as banks, subways and other places, extreme emotions of entrants are screened. Emotion collection areas are set at the entrances of these public places, and passers-by must pass through the emotion collection areas to enter. When passers-by pass through the emotion collection area, the faces of the passers-by are photographed. In this embodiment, the emotion collection area is provided with a shooting device capable of continuous shooting, such as a camera.
[0086] In some implementations, after obtaining an image sequence containing face information, the image sequence needs to be preprocessed before subsequent work is performed. It should be noted that the preprocessing includes face registration and cropping.
[0087] Among them, face registration refers to performing digital image processing on the image sequence when the head of the pedestrian photographed in the image sequence rotates slightly, so that the image is corrected after translation, rotation and scaling transformation, thereby eliminating the influence of head offset and slight rotation on micro-expression detection. Face registration is an existing technology and will not be introduced in detail here.
[0088] Cropping is the process of cropping an image after face registration to remove interference caused by background information other than the face in the image.
[0089] After the image sequence is preprocessed, each frame of the image sequence is divided into m*m image blocks, where m is a natural number greater than zero. By dividing each frame of the face image into blocks, the efficiency of subsequent feature extraction can be greatly improved, and the foundation for subsequent feature selection is laid.
[0090] In step 120, the feature values include LBP feature values and optical flow feature values. The LBP feature values can be extracted using an existing LBP feature extractor, and the extracted LBP feature values are used to analyze the texture features of the image. The optical flow feature values can be extracted using an existing optical flow feature extractor, and the extracted optical flow feature values are used to analyze the motion information of the image.
[0091] In step 130 , in order to determine whether each frame image in the image sequence is a vertex frame image of the target, during the detection process, each frame image in the image sequence is analyzed as a current frame image.
[0092] Before determining the head frame image and the tail frame image of the current frame image, it is necessary to first determine the value of the preset interval. The specific method of determining the preset interval is: first obtain the number of frames in the micro-expression continuation interval, and then calculate the preset interval according to the number of frames using the following formula:
[0093]
[0094] Wherein, k is the preset interval, and N is the number of frames in the micro-expression duration interval.
[0095] In step 140, the image blocks at the same position refer to the image blocks of the current frame having the same number of rows and columns as the image blocks of the first frame image and the last frame image. Figure 2 When the image block in the first row and first column of the current frame image is selected, the image block in the first row and first column of the head frame image and the tail frame image is also selected to analyze the feature differences of the image blocks at this position. The shaded part in the figure is the selected image block.
[0096] In some implementations, step 140 further includes the following steps:
[0097] Step 141: Determine the forward vector distance according to the eigenvalue of the image block at the position in the current frame image and the eigenvalue of the image block at the position in the head frame image, and determine the backward vector distance according to the eigenvalue of the image block at the position in the current frame image and the eigenvalue of the image block at the position in the tail frame image.
[0098] Step 142: Calculate the total vector distance of the image block at the position according to the forward vector distance and the backward vector distance.
[0099] Step 143: Determine whether the total vector distance is greater than the average vector distance of the image sequence.
[0100] Step 144: If yes, keep the frame image.
[0101] It should be noted that step 141, step 142, step 143 and step 144 are not shown in the figure. In this embodiment, the forward vector distance includes chi-square distance or Euclidean distance, and the backward vector distance includes chi-square distance or Euclidean distance.
[0102] In some implementations, when the vector distance in step 141 is a chi-square distance, the forward vector distance and the backward vector distance are calculated using the following formula:
[0103]
[0104]
[0105] Among them, P 1,i is the forward chi-square distance of the image block, P2,i is the backward chi-square distance of the image patch, C i is the LBP feature value of the image block when the i-th frame is used as the current frame image, H i is the LBP feature value of the head frame image block of the i-th frame, T i is the LBP feature value of the last frame image block of the i-th frame.
[0106] In some implementations, when the vector distance in step 141 is the Euclidean distance, the forward vector distance and the backward vector distance are calculated using the following formula:
[0107]
[0108]
[0109] Among them, Q 1,i is the forward Euclidean distance of the image block, Q 2,i is the backward Euclidean distance of the image block, C i is the optical flow feature value of the image block when the i-th frame is used as the current frame image, H i is the optical flow feature value of the head frame image block of the i-th frame, T i is the optical flow feature value of the last frame image block of the i-th frame.
[0110] Specifically, when selecting images in an image sequence according to the LBP feature value, the chi-square distance is calculated; and when selecting images in an image sequence according to the optical flow feature, the Euclidean distance is calculated. In this embodiment, assuming that the preset interval is k, it is necessary to calculate the forward vector distance and the backward vector distance for all frame images except the first k frames and the last k frames of the image sequence frame by frame.
[0111] In step 142, after calculating the forward vector distance and the backward vector distance to each image block of each frame image, the forward vector distance and the backward vector distance of the image block are summed in dimension to obtain the total vector distance of the image block.
[0112] In some implementations, when the vector distance in step 142 is a chi-square distance, the total vector distance is calculated using the following formula:
[0113] P i =P 1,i +P 2,i
[0114] When the vector distance in step 142 is the Euclidean distance, the total vector distance is calculated using the following formula:
[0115] Q i =Q 1,i +Q 2,i
[0116] Among them, P i is the total chi-square distance, Q i is the total Euclidean distance.
[0117] In step 143, before determining whether the total vector distance is greater than the average vector distance of the image sequence, the average vector distance of the image sequence needs to be calculated. In some embodiments, when the vector distance is a chi-square distance, the average vector distance is calculated using the following formula:
[0118]
[0119] Among them, P mean is the average chi-square distance, n is the number of frames, and k is the preset distance.
[0120] When the vector distance is Euclidean distance, the average vector distance is calculated using the following formula:
[0121]
[0122] Among them, Q mean is the average chi-square distance, n is the number of frames, and k is the preset distance.
[0123] Specifically, the average chi-square distance can represent the average feature difference of the image block at the same position with respect to the LBP feature. If the total chi-square distance of the image block at that position is greater than the average chi-square distance of the image block at that position, it means that the feature difference of the image block with respect to the LBP feature is greater than the average difference level. Similarly, if the total Euclidean distance of the image block at that position is greater than the average Euclidean distance of the image block at that position, it means that the feature difference of the image block with respect to the optical flow feature is greater than the average difference level. If the feature differences of the LBP feature and the optical flow feature of the image block both meet the requirement of being greater than the average difference level, the image of the frame where the image block is located is retained.
[0124] In step 150, after the above screening, it is determined to retain the total eigenvalues of multiple current frame images, as well as the maximum eigenvalue in the head frame image and the maximum eigenvalue in the tail frame image corresponding to the current frame image. It should be noted that the maximum eigenvalue in the head frame image refers to the maximum LBP eigenvalue and the maximum optical flow eigenvalue screened out from the LBP eigenvalues and the optical flow eigenvalues in all image blocks of the head frame image; similarly, the maximum LBP eigenvalue and the maximum optical flow eigenvalue of the tail frame image are obtained.
[0125] In some implementations, the total feature value of the current frame in step 150 is determined in the following manner:
[0126] First, determine the feature matrix of the frame image according to the eigenvalues of each image block in the retained current frame image:
[0127]
[0128] Among them, D i,j is the feature matrix of the i-th frame image, j is the number of image blocks in the i-th frame image, MF i is the average eigenvalue of the i-th frame image.
[0129] After obtaining the feature matrix of the current frame image, the total eigenvalue of the current frame image is calculated based on the feature matrix:
[0130]
[0131] Among them, D i is the total eigenvalue of the i-th frame image.
[0132] For example, assuming that the current frame image is divided into a 2*2 matrix, the LBP eigenvalues of the image blocks from left to right and from top to bottom are 1, 2, 3, and 4, respectively, and the average LBP eigenvalue of the current frame image is 2.5. Substitute the LBP eigenvalue and the average LBP eigenvalue of each image block of the current frame image into the following formula:
[0133]
[0134] The resulting feature matrix is:
[0135] Then, the total LBP eigenvalue of the current frame image is calculated based on the eigenvalues in the feature matrix, which is 7. Similarly, the total optical flow eigenvalue of the optical flow feature of the current frame image can be obtained.
[0136] In some implementations, the feature difference vector in step 160 is determined using the following formula:
[0137]
[0138]
[0139] Among them, F i is the feature difference vector of the i-th frame image, is the maximum eigenvalue between the head frame and the tail frame of the i-th frame.
[0140] Figure 3 A block diagram of a micro-expression vertex positioning device based on feature differences in an embodiment of the present application is shown.
[0141] See also Figure 3 , the device comprises:
[0142] The acquisition module 210 is used to acquire an image sequence when a pedestrian passes through the emotion collection area, and divide each frame of the image sequence into m*m image blocks, wherein the image sequence includes a face image, and m is a natural number greater than zero.
[0143] The extraction module 220 is used to extract the feature value of each image block in the image sequence.
[0144] The first determination module 230 is used to select a current frame image in an image sequence, and determine a head frame image and a tail frame image corresponding to the current frame image, wherein the head frame image is a frame image located before the current frame image and the interval is a preset interval, and the tail frame image is a frame image located after the current frame image and the interval is a preset interval.
[0145] The second determination module 240 is used to determine whether to retain the current frame image for an image block at the same position in the current frame image, the head frame image and the tail frame image according to the feature value of the image block at the position in the current frame image, the feature value of the image block at the position in the head frame image and the feature value of the image block at the position in the tail frame image.
[0146] The third determination module 250 is used to determine the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image while retaining the current frame image.
[0147] The fourth determination module 260 is used to determine a feature difference vector according to the total feature value of the current frame image, the maximum feature value in the first frame image, and the maximum feature value in the last frame image.
[0148] The fifth determination module 270 is used to determine the micro-expression vertex frame image position according to the feature difference vector.
[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0150] Figure 4 A block diagram of an electronic device in an embodiment of the present application is shown.
[0151] like Figure 4 As shown, Figure 4 The electronic device 300 shown includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the example of the present application.
[0152] Processor 301 may be a CPU (Central Processing Unit), a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0153] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0154] The memory 303 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0155] The memory 303 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method example.
[0156] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the examples of the present application.
[0157] The present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the micro-expression vertex positioning method based on feature differences described in the present application.
[0158] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.
Claims
1. A micro-expression vertex positioning method based on feature difference, characterized in that: include: Obtain an image sequence when a pedestrian passes through the emotion collection area, and divide each frame of the image in the image sequence into m*m image blocks, wherein the image sequence includes a face image, and m is a natural number greater than zero; extract a feature value of each image block in the image sequence; In the image sequence, a current frame image is selected, and a head frame image and a tail frame image corresponding to the current frame image are determined, wherein the head frame image is a frame image located before the current frame image and the interval is a preset interval, and the tail frame image is a frame image located after the current frame image and the interval is a preset interval; among the current frame image, the head frame image and the tail frame image, for an image block at the same position, according to a feature value of the image block at the position in the current frame image, a feature value of the image block at the position in the head frame image, and a feature value of the image block at the position in the tail frame image, it is determined whether to retain the current frame image; If yes, determine the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image; Determine a feature difference vector according to the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image; Determine the micro-expression vertex frame image position according to the feature difference vector; Determining the total characteristic value of the current frame image includes: The characteristic matrix of the frame image is determined according to the characteristic value of each image block in the current frame image that is retained: Where Di,j is the feature matrix of the i-th frame image, j is the number of image blocks in the i-th frame image, and MFi is the average eigenvalue of the i-th frame image; Calculate the total eigenvalue of the current frame image according to the eigenmatrix: Wherein, Di is the total eigenvalue of the i-th frame image; Determining the feature difference vector according to the total feature value of the current frame image, the maximum feature value in the head frame image, and the maximum feature value in the tail frame image comprises: The characteristic difference vector is calculated using the following formula: Wherein, Fi is the characteristic difference vector of the i-th frame image, is the maximum eigenvalue between the head frame and the tail frame of the i-th frame.
2. The micro-expression vertex positioning method according to claim 1, characterized in that: The determining whether to retain the current frame image according to the feature value of the image block at the position in the current frame image, the feature value of the image block at the position in the first frame image, and the feature value of the image block at the position in the last frame image comprises: Determine the forward vector distance according to the feature value of the image block at the position in the current frame image and the feature value of the image block at the position in the head frame image, and determine the backward vector distance according to the feature value of the image block at the position in the current frame image and the feature value of the image block at the position in the tail frame image; Calculate the total vector distance of the image block at the position according to the forward vector distance and the backward vector distance; and determine whether the total vector distance is greater than the average vector distance of the image sequence; If yes, the frame image is retained.
3. The micro-expression vertex positioning method according to claim 2, characterized in that: The forward vector distance includes a chi-square distance or a Euclidean distance, and the backward vector distance includes a chi-square distance or a Euclidean distance; determining the forward vector distance according to the characteristic value of the image block at the position in the current frame image and the characteristic value of the image block at the position in the head frame image, and determining the backward vector distance according to the characteristic value of the image block at the position in the current frame image and the characteristic value of the image block at the position in the tail frame image includes: When the vector distance is the chi-square distance, the following formula is used for calculation: Wherein, P1,i is the forward chi-square distance of the image block, P2,i is the backward chi-square distance of the image block, Ci is the LBP feature value of the image block when the i-th frame is used as the current frame image, Hi is the LBP feature value of the head frame image block of the i-th frame, and Ti is the LBP feature value of the tail frame image block of the i-th frame; When the vector distance is Euclidean distance, the following formula is used for calculation: Among them, Q1,i is the forward Euclidean distance of the image block, Q2,i is the backward Euclidean distance of the image block, Ci is the optical flow feature value of the image block when the i-th frame is used as the current frame image, Hi is the optical flow feature value of the head frame image block of the i-th frame, and Ti is the optical flow feature value of the tail frame image block of the i-th frame.
4. The micro-expression vertex positioning method according to claim 3, characterized in that: The calculating the total vector distance of the image block at the position according to the forward vector distance and the backward vector distance comprises: when the vector distance is a chi-square distance, the total vector distance is calculated using the following formula: Pi=P1,i+P2,i When the vector distance is Euclidean distance, the total vector distance is calculated using the following formula: Qi=Q1,i+Q2,i Wherein, Pi is the total chi-square distance, and Qi is the total Euclidean distance.
5. The micro-expression vertex positioning method according to claim 4, characterized in that: The method for determining the average vector distance of the image sequence includes: When the vector distance is the chi-square distance, the average vector distance is calculated using the following formula: Wherein, Pmean is the average chi-square distance, n is the number of frames, and k is the preset distance; When the vector distance is the Euclidean distance, the average vector distance is calculated using the following formula: Wherein, Qmean is the average chi-square distance, n is the number of frames, and k is the preset distance.
6. A micro-expression vertex positioning device based on feature difference, characterized in that: include: An acquisition module, used for acquiring an image sequence when a pedestrian passes through an emotion collection area, and dividing each frame of the image in the image sequence into m*m image blocks, wherein the image sequence includes a face image, and m is a natural number greater than zero; An extraction module, used for extracting a feature value of each image block in the image sequence; A first determining module is used to select a current frame image in the image sequence, and determine a head frame image and a tail frame image corresponding to the current frame image, wherein the head frame image is a frame image located before the current frame image and the interval is a preset interval, and the tail frame image is a frame image located after the current frame image and the interval is a preset interval; A second determination module is used to determine whether to retain the current frame image according to a feature value of the image block at the same position in the current frame image, the head frame image and the tail frame image, the feature value of the image block at the same position in the current frame image, the feature value of the image block at the same position in the head frame image and the feature value of the image block at the same position in the tail frame image; A third determination module is used to determine the total eigenvalue of the current frame image, the maximum eigenvalue in the head frame image, and the maximum eigenvalue in the tail frame image while retaining the current frame image; A fourth determination module, configured to determine a feature difference vector according to the total feature value of the current frame image, the maximum feature value in the head frame image, and the maximum feature value in the tail frame image; A fifth determination module, used to determine the micro-expression vertex frame image position according to the feature difference vector; The characteristic matrix of the frame image is determined according to the characteristic value of each image block in the current frame image that is retained: Where Di,j is the feature matrix of the i-th frame image, j is the number of image blocks in the i-th frame image, and MFi is the average eigenvalue of the i-th frame image; Calculate the total eigenvalue of the current frame image according to the eigenmatrix: Wherein, Di is the total eigenvalue of the i-th frame image; Determining the feature difference vector according to the total feature value of the current frame image, the maximum feature value in the head frame image, and the maximum feature value in the tail frame image comprises: The characteristic difference vector is calculated using the following formula: Wherein, Fi is the characteristic difference vector of the i-th frame image, is the maximum eigenvalue between the head frame and the tail frame of the i-th frame.
7. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Micro-expression moment detection method and device based on face image sequence
CN112329663A
Micro-expression detection method based on optical flow and windmill mode feature fusion
CN113361297A
System and Method for Extremely Efficient Image and Pattern Recognition and Artificial Intelligence Platform
US20180204111A1
Method, apparatus and computer program product for human-face features extraction
WO2014001610A1
Micro-expression description method and device, computer device and readable storage medium
WO2020119058A1
