Concentration analysis method, device, equipment and storage medium based on sitting posture recognition
Through edge feature comparison and probabilistic queue analysis, the problem of high resource consumption of sitting posture recognition and concentration analysis in the existing technology is solved, and fast and reliable concentration judgment is achieved.
Patent Information
- Application Number
- CN202410725789.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-06-06
AI Technical Summary
The development and use of existing attention analysis methods based on sitting posture recognition require a large amount of resources, including massive sample images and high-performance hardware, resulting in a long development cycle and high consumption of manpower and material resources.
By acquiring the target image, preprocessing and edge feature extraction are performed, edge coordinate comparison is used to construct a similar feature queue, and the concentration index is determined based on the low-frequency characteristics of the sitting posture probability queue, and the comparison method is used to reduce the amount of calculation and sample requirements.
It simplifies the construction and verification process of the analysis method, reduces manpower consumption, improves the reliability of judgment, weakens the impact of occlusion on sitting posture judgment, and requires less calculation than supervised learning algorithms.
Smart Images

Figure CN118314631B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sitting posture recognition based on image analysis, and in particular to a concentration analysis method, device, equipment and storage medium based on sitting posture recognition. Background Art
[0002] Concentration is the driving force of cognitive activities, which include auditory perception, visual perception, memory, thinking, feedback and other activities. Concentration is the driving force for the smooth development of cognitive activities. Classroom concentration reflects the learning status of students and the quality of the teaching process as a whole.
[0003] A person's concentration can be reflected from his or her sitting posture and changes in sitting posture. Therefore, some related technologies use supervised learning algorithms, such as convolutional neural network (CNN) algorithms, to identify the sitting posture and analyze the concentration based on the results of sitting posture recognition.
[0004] This concentration analysis method based on a supervised learning algorithm requires a massive amount of sitting posture sample images to train the supervised learning algorithm. The sample images, data volume and algorithm optimization required for the early development are large, and the development cycle is long. In the later use, it relies on strong computing power to analyze the images, and the hardware requirements are high. Therefore, the construction of a concentration analysis system based on sitting posture recognition requires a large investment of manpower and material resources.
[0005] Based on this, it is necessary to develop and design a concentration analysis method. Summary of the invention
[0006] The embodiments of the present invention provide a concentration analysis method, device, equipment and storage medium based on sitting posture recognition, which are used to solve the problem that a large amount of resources are invested in the development and use of the concentration analysis method based on sitting posture recognition in the prior art.
[0007] In a first aspect, an embodiment of the present invention provides a method for analyzing concentration based on sitting posture recognition, comprising:
[0008] Acquire multiple target images, wherein the target images contain identification subjects;
[0009] Preprocessing the multiple target images respectively and extracting edge lines in the images to obtain multiple edge feature maps;
[0010] Extracting edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting edge images, and constructing similar feature queues according to the edge pixel coordinate differences, thereby obtaining a plurality of similar feature queues;
[0011] The multiple similar feature queues are respectively classified into corresponding target sitting posture categories, a sitting posture probability queue is constructed according to the maximum sitting posture probability of each target sitting posture category and the sitting posture corresponding to the maximum sitting posture probability, and the concentration index is determined according to the low-frequency characteristics of the sitting posture probability queue.
[0012] In a possible implementation, the preprocessing of the plurality of target images respectively and extracting edge lines in the images to obtain a plurality of edge feature maps includes:
[0013] For each target image in the plurality of target images, the following steps are performed respectively:
[0014] Obtain a fuzzy processing operator, a horizontal difference operator, and a vertical difference operator;
[0015] Decolorizing the target image, and adjusting multiple pixel values in the decolorized image to a preset range to obtain a grayscale image;
[0016] Using the fuzzy processing operator, the grayscale image is fuzzy processed to obtain a fuzzy grayscale image, and using the horizontal difference operator and the vertical difference operator to perform difference calculation on the fuzzy grayscale image to obtain a horizontal edge image and a vertical edge image;
[0017] The differential amplitude and differential angle are calculated for the horizontal edge map and the vertical edge map to obtain a differential amplitude map and a differential angle map respectively, the differential amplitude map is subjected to maximum value processing to obtain a primary edge map, and non-extreme value suppression is performed on the primary edge map according to the differential angle map to obtain an edge feature map.
[0018] In a possible implementation, the fuzzy processing operator is used to perform fuzzy processing on the grayscale image to obtain a fuzzy grayscale image, and the horizontal difference operator and the vertical difference operator are used to perform differential calculation on the fuzzy grayscale image to obtain a horizontal edge image and a vertical edge image, including:
[0019] Sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block;
[0020] According to a first formula, the first data block and the blur processing operator, a blurred pixel is extracted, wherein the first formula is:
[0021]
[0022] In the formula, To blur pixels, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The first data block Line Column pixels, The fuzzy processing operator Line The value of the column;
[0023] The extracted blurred pixels are stored in the intermediate grayscale image according to the fetching position of the first data block;
[0024] If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block;
[0025] Otherwise, the intermediate grayscale image is used as a fuzzy grayscale image;
[0026] For each of the horizontal difference operators and the vertical difference operators, the following steps are performed respectively:
[0027] Sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as second data blocks;
[0028] The differential pixel is extracted according to the second formula, the second data block and the operator, wherein the second formula is:
[0029]
[0030] In the formula, is the difference pixel, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The second data block Line Column pixels, The fuzzy processing operator Line The value of the column;
[0031] Storing the extracted differential pixels into the edge map according to the fetching position of the first data block;
[0032] If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as the second data block.
[0033] In a possible implementation, the horizontal edge map and the vertical edge map are subjected to differential amplitude and differential angle calculations to obtain a differential amplitude map and a differential angle map, respectively; the differential amplitude map is subjected to maximum value processing to obtain a primary edge map; and the primary edge map is subjected to non-extreme value suppression according to the differential angle map to obtain an edge feature map, including:
[0034] The differential amplitude map and the differential angle map are constructed according to the third formula, the horizontal edge map and the vertical edge map, wherein the third formula is:
[0035]
[0036] In the formula, The differential amplitude diagram Line The pixel value of the column, For vertical edge diagram Line The pixel value of the column, For horizontal edge map Line The pixel value of the column, The difference angle diagram Line The pixel value of the column;
[0037] Performing zero processing on values in the differential amplitude map that are less than a first threshold value to obtain the primary edge map;
[0038] For each non-zero value in the primary edge map, perform the following steps respectively:
[0039] Extracting a square data block centered on a non-zero value as the third data block;
[0040] The pixel value corresponding to the non-zero value position is extracted from the differential angle map as the differential angle value, and the differential angle is determined according to the fourth formula and the differential angle value, wherein the fourth formula is:
[0041]
[0042] In the formula, is the differential angle, is the inverse tangent function;
[0043] Find a plurality of data to be processed from the third data block with a non-zero value as the center along the direction of the differential angle;
[0044] The non-maximum values in the plurality of data to be processed are set to zero.
[0045] In a possible implementation, extracting edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting edge images, and constructing a similar feature queue according to the edge pixel coordinate differences, including:
[0046] Acquire multiple sitting posture edge sample sets, wherein each sitting posture edge sample set corresponds to a sitting posture, and the sitting posture edge sample set includes multiple sitting posture edge images;
[0047] Scaling and / or stretching the edge feature map so that the edge feature map has the same pixel size as the sitting edge image, to obtain an edge feature map to be processed;
[0048] Sequentially take out sitting edge images from the plurality of sitting edge sample sets as the sitting edge images to be processed, and after each taking out, construct a similar feature queue of the edge feature map by executing the following steps:
[0049] Extracting a plurality of horizontal edge coordinate differences and a plurality of vertical edge coordinate differences according to the sitting edge image to be processed and the edge feature map to be processed, wherein the coordinate difference is a difference between an edge pixel of the sitting edge image to be processed and a nearest non-zero pixel coordinate in the edge feature map to be processed;
[0050] respectively calculating a sum of the plurality of horizontal edge coordinate differences and a sum of the plurality of vertical edge coordinate differences as cumulative horizontal coordinate differences and cumulative vertical coordinate differences;
[0051] Calculate the sum of squares of the accumulated horizontal coordinate difference and the accumulated vertical coordinate difference as a similarity eigenvalue;
[0052] The similar feature value is added to a similar feature queue.
[0053] In a possible implementation, the step of respectively classifying the plurality of similar feature queues into corresponding target sitting posture classes, and constructing a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, includes:
[0054] For each of the multiple similar feature queues, the following steps are performed respectively:
[0055] Acquire multiple sitting posture classes, wherein the sitting posture class includes multiple similar feature queue samples obtained by clustering, and the similar feature queue samples are constructed by comparing edge coordinates of edge feature map samples with multiple sitting posture edge images;
[0056] The distance from the similar feature queue to each sitting posture class center is calculated according to the fifth formula, thereby obtaining multiple distances, wherein the sitting posture class center is the class center of the sitting posture class, and the fifth formula is:
[0057]
[0058] In the formula, For similar features, queue to The distance between the centers of the sitting postures, For the similar characteristics queue data, For the Seated center data, is the total number of cohort data with similar characteristics;
[0059] Selecting the distance with the smallest value from the multiple distances as the target distance, and classifying the sitting posture class corresponding to the target distance as the target sitting posture class to be included in the similar feature queue;
[0060] Extracting the sitting postures corresponding to the samples of multiple source edge feature maps of the target sitting posture class, and extracting the probability of the most common sitting posture, wherein the sitting posture includes a focused sitting posture and a non-focused sitting posture;
[0061] If the most common sitting posture is a non-focused sitting posture, then the opposite number of the probability of the most common sitting posture is added to the sitting posture probability queue;
[0062] Otherwise, the probability of the most sitting postures is added to the sitting posture probability queue.
[0063] In a possible implementation, determining the concentration index according to the low-frequency features of the sitting posture probability queue includes:
[0064] The effective value of the sitting posture probability queue is extracted according to the sixth formula, wherein the sixth formula is:
[0065]
[0066] In the formula, is the effective value of the sitting probability queue, is the first data, is the total number of sitting probability cohort data;
[0067] According to the target low-frequency frequency, the effective value of the sitting posture probability queue and the seventh formula, the low-frequency feature is extracted, and the low-frequency feature is used as the concentration index, wherein the seventh formula is:
[0068]
[0069] In the formula, is the concentration index, is a natural constant, is an imaginary unit, is the target low frequency, The number of target images collected by the period length corresponding to the target low frequency, is the ratio of pi.
[0070] In a second aspect, an embodiment of the present invention provides a concentration analysis device based on sitting posture recognition, which is used to implement the concentration analysis method based on sitting posture recognition as described in the first aspect or any possible implementation of the first aspect, and the concentration analysis device based on sitting posture recognition includes:
[0071] An image acquisition module is used to acquire a plurality of target images, wherein the target images contain the identification subject;
[0072] An image edge extraction module is used to preprocess the multiple target images respectively and extract edge lines in the images to obtain multiple edge feature maps;
[0073] A sitting posture comparison module, configured to extract edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting posture edge images, and construct similar feature queues according to the edge pixel coordinate differences, thereby obtaining a plurality of similar feature queues;
[0074] as well as,
[0075] The concentration analysis module is used to classify the multiple similar feature queues into corresponding target sitting posture categories, construct a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture category and the sitting posture corresponding to the maximum sitting posture probability, and determine the concentration index according to the low-frequency characteristics of the sitting posture probability queue.
[0076] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0077] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0078] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0079] The embodiment of the present invention discloses a method for analyzing concentration based on sitting posture recognition, which first obtains multiple target images, wherein the target images contain an identification subject; then the multiple target images are preprocessed and edge lines in the images are extracted to obtain multiple edge feature maps; then each edge feature map in the multiple edge feature maps is respectively extracted by comparing edge coordinates with multiple sitting posture edge images, and a similar feature queue is constructed according to the edge pixel coordinate difference, thereby obtaining multiple similar feature queues; finally, the multiple similar feature queues are respectively classified into corresponding target sitting posture classes, and a sitting posture probability queue is constructed according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, and the concentration index is determined according to the low-frequency features of the sitting posture probability queue. Since the embodiment of the present invention does not adopt a supervised learning algorithm, it only needs to compare with images of known sitting postures to extract the probability of sitting postures. Therefore, the construction process and verification process of the analysis method are short, fewer samples are required, and less manpower is consumed. Since the comparison is performed by the comparison method, the calculation amount is small compared with the complicated calculation nodes of the artificial neural network.
[0080] Since the embodiments of the present invention perform similarity judgment by means of coordinate comparison, when the target subject is partially occluded, since the judgment of the similarity with multiple sitting edge samples is roughly the same due to the occlusion, the judgment result is relatively not much different from when the subject is not occluded. Therefore, the influence of occlusion on sitting posture judgment is weakened. This method is more reliable than the judgment method using a supervised learning algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0082] Figure 1 is a flow chart of a concentration analysis method based on sitting posture recognition provided by an embodiment of the present invention;
[0083] Figure 2 is a schematic diagram of a process of extracting image features through an operator provided in an embodiment of the present invention;
[0084] Figure 3 is a schematic diagram of a similar feature queue construction process provided by an embodiment of the present invention;
[0085] Figure 4 It is a principle diagram of the process of constructing a sitting posture probability queue provided by an embodiment of the present invention;
[0086] Figure 5 It is a functional block diagram of a concentration analysis device based on sitting posture recognition provided by an embodiment of the present invention;
[0087] Figure 6 It is a functional block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0088] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary details.
[0089] In order to make the purpose, technical solutions and advantages of the present invention more clear, a specific implementation method will be described below in conjunction with the accompanying drawings.
[0090] The following is a detailed description of an embodiment of the present invention. This example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0091] Figure 1 A flowchart of a concentration analysis method based on sitting posture recognition provided in an embodiment of the present invention.
[0092] like Figure 1 As shown, it shows a flowchart of the implementation of the concentration analysis method based on sitting posture recognition provided by an embodiment of the present invention, which is described in detail as follows:
[0093] In step 101, a plurality of target images are acquired, wherein the target images contain identification subjects.
[0094] In step 102, the plurality of target images are preprocessed respectively and edge lines in the images are extracted to obtain a plurality of edge feature maps.
[0095] In some implementations, step 102 includes:
[0096] For each target image in the plurality of target images, the following steps are performed respectively:
[0097] Obtain a fuzzy processing operator, a horizontal difference operator, and a vertical difference operator;
[0098] Decolorizing the target image, and adjusting multiple pixel values in the decolorized image to a preset range to obtain a grayscale image;
[0099] Using the fuzzy processing operator, the grayscale image is fuzzy processed to obtain a fuzzy grayscale image, and using the horizontal difference operator and the vertical difference operator to perform difference calculation on the fuzzy grayscale image to obtain a horizontal edge image and a vertical edge image;
[0100] The differential amplitude and differential angle are calculated for the horizontal edge map and the vertical edge map to obtain a differential amplitude map and a differential angle map respectively, the differential amplitude map is subjected to maximum value processing to obtain a primary edge map, and non-extreme value suppression is performed on the primary edge map according to the differential angle map to obtain an edge feature map.
[0101] In some implementations, the using the blur processing operator to perform blur processing on the grayscale image to obtain a blurred grayscale image, and using the horizontal difference operator and the vertical difference operator to perform difference calculation on the blurred grayscale image to obtain a horizontal edge image and a vertical edge image, respectively, includes:
[0102] Sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block;
[0103] According to a first formula, the first data block and the blur processing operator, a blurred pixel is extracted, wherein the first formula is:
[0104]
[0105] In the formula, To blur pixels, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The first data block Line Column pixels, The fuzzy processing operator Line The value of the column;
[0106] The extracted blurred pixels are stored in the intermediate grayscale image according to the fetching position of the first data block;
[0107] If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block;
[0108] Otherwise, the intermediate grayscale image is used as a fuzzy grayscale image;
[0109] For each of the horizontal difference operators and the vertical difference operators, the following steps are performed respectively:
[0110] Sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as second data blocks;
[0111] The differential pixel is extracted according to the second formula, the second data block and the operator, wherein the second formula is:
[0112]
[0113] In the formula, is the difference pixel, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The second data block Line Column pixels, The fuzzy processing operator Line The value of the column;
[0114] storing the extracted differential pixels into the edge map according to the fetching position of the first data block;
[0115] If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as the second data block.
[0116] In some embodiments, the performing differential amplitude and differential angle calculation on the horizontal edge map and the vertical edge map to obtain a differential amplitude map and a differential angle map respectively, performing maximum value processing on the differential amplitude map to obtain a primary edge map, and performing non-extreme value suppression on the primary edge map according to the differential angle map to obtain an edge feature map includes:
[0117] The differential amplitude map and the differential angle map are constructed according to the third formula, the horizontal edge map and the vertical edge map, wherein the third formula is:
[0118]
[0119] In the formula, The differential amplitude diagram Line The pixel value of the column, For vertical edge diagram Line The pixel value of the column, For horizontal edge graph Line The pixel value of the column, The difference angle diagram Line The pixel value of the column;
[0120] Performing zero processing on values in the differential amplitude map that are less than a first threshold value to obtain the primary edge map;
[0121] For each non-zero value in the primary edge map, perform the following steps respectively:
[0122] Extracting a square data block centered on a non-zero value as the third data block;
[0123] The pixel value corresponding to the non-zero value position is extracted from the differential angle map as the differential angle value, and the differential angle is determined according to the fourth formula and the differential angle value, wherein the fourth formula is:
[0124]
[0125] In the formula, is the differential angle, is the inverse tangent function;
[0126] Find a plurality of data to be processed from the third data block with a non-zero value as the center along the direction of the differential angle;
[0127] The non-maximum values in the plurality of data to be processed are set to zero.
[0128] For example, as mentioned above, in the related art, the sitting posture recognition of images is performed through supervised learning methods, but there are disadvantages that the model construction process requires a lot of sample materials and the model adjustment workload is large. It also has the characteristic of high hardware requirements when applied. In addition, in some applications, the recognition result is affected by the partial occlusion of the recognition subject. The relationship between sitting posture and concentration should also be considered from the time dimension. For example, when directly analyzing the sitting posture, some short-term sitting postures may be misjudged as low-concentration sitting postures.
[0129] In order to overcome the above-mentioned shortcomings, an embodiment of the present invention performs edge processing on the target image, extracts the edge lines of the target image, compares the edge coordinates with the sample sitting edge image based on the edge lines in the image, and determines the similarity with the sitting edge image. Note that the sitting posture of the sample sitting edge image here is known, from which the sitting posture of the identified subject in the image can be roughly inferred.
[0130] In order to enhance the recognition results, the present invention compares the coordinates of the edge lines in the image with multiple sample sitting edge images (similarly, the sitting postures of the multiple sample sitting edge images are all known), and the similarity results are arranged in the order of the multiple sample sitting edge images to construct a similar feature queue.
[0131] At the same time, we obtained some sample similar feature queues (these sample similar feature queues are constructed based on the edge feature map samples and the aforementioned multiple sample sitting edge images, and the sitting postures of the edge feature map samples are also known). These sample similar feature queues are divided into multiple classes through clustering methods. We classify the similar feature queues into one of the classes through classification methods, and extract the most sitting postures and the probability of the most sitting postures in this class as the sitting posture and sitting posture probability of the target image.
[0132] It can be known that by arranging the sitting posture probabilities according to the time sequence of multiple target images, the changes in sitting posture can be known. If it is a relatively stable and normal sitting posture probability, it means that the concentration of the recognition subject is high, otherwise, the concentration is low.
[0133] The above is the overall concept of the implementation mode of the present invention. Each process is expanded and discussed in detail below.
[0134] In terms of image edge line extraction, an embodiment of the present invention first decolorizes the target image to obtain a basic grayscale image (for example, only retaining one color channel, or calculating the average value of three color channels as the pixel value of the grayscale image), and then adjusts the pixel values in the basic grayscale image so that the pixel values are distributed within a range to obtain a grayscale image.
[0135] Then, the grayscale image is fuzzy processed, horizontal edge features are extracted, and vertical edge features are extracted using the fuzzy processing operator, the horizontal difference operator, and the vertical difference operator, respectively, to obtain the horizontal edge map and the vertical edge map. Finally, the two edge maps are calculated to obtain the differential amplitude map and the differential angle map. The threshold is used to extract the edge of the differential amplitude map, and the differential angle map is used to suppress the non-extreme value of the primary edge map to obtain the edge feature map.
[0136] The application process of the three operators is roughly the same. The blurring operator is used to remove isolated edge points and noise points in the grayscale image, so that the extracted edge continuity is better and the image noise is less. The horizontal difference operator and the vertical difference operator extract the horizontal and vertical edges in the blurred image by the difference method. A 3×3 blurring operator is:
[0137]
[0138] A 3×3 horizontal difference operator is:
[0139]
[0140] A 3×3 vertical difference operator is:
[0141]
[0142] Figure 2 The schematic diagram of the process of applying the operator to process the image is shown. During the processing, a data block 203 of the same type as the operator is taken out from the image 201, and then the taken out data block 203 is multiplied with the operator 204 at the corresponding position. The result 205 of the multiplication operation is rearranged according to the position of the operator 204 in the image 201, and a processed image 206 is generated. Then, the taken out position 202 is offset in a predetermined order until the original image is completely traversed.
[0143] For the fuzzy processing operator in multiplication operation, the first formula is used:
[0144]
[0145] In the formula, To blur pixels, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The first data block Line Column pixels, The fuzzy processing operator Line The numeric value of the column.
[0146] The multiplication operation uses the second formula for the horizontal and vertical difference operators:
[0147]
[0148] In the formula, is the difference pixel, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The second data block Line Column pixels, The fuzzy processing operator Line The numeric value of the column.
[0149] After obtaining the horizontal edge map and the vertical edge map, the differential amplitude map and the differential angle map are constructed using the third formula. The third formula is:
[0150]
[0151] In the formula, The differential amplitude diagram Line The pixel value of the column, For vertical edge diagram Line The pixel value of the column, For horizontal edge graph Line The pixel value of the column, The difference angle diagram Line The pixel value of the column.
[0152] According to the differential amplitude map constructed by the third formula, the values less than the threshold are set to zero to obtain a primary edge map. Then, the non-zero values in the primary edge map are used as the center to construct an oblique line with the angles in the corresponding differential angle map, and the non-maximum values in the oblique line are set to zero. After the above steps, a clear edge line is obtained.
[0153] In step 103, edge pixel coordinate differences are extracted for each edge feature map in the multiple edge feature maps by comparing edge coordinates with multiple sitting edge images, and similar feature queues are constructed based on the edge pixel coordinate differences, thereby obtaining multiple similar feature queues.
[0154] In some implementations, step 103 includes:
[0155] Acquire multiple sitting posture edge sample sets, wherein each sitting posture edge sample set corresponds to a sitting posture, and the sitting posture edge sample set includes multiple sitting posture edge images;
[0156] Scaling and / or stretching the edge feature map so that the edge feature map has the same pixel size as the sitting edge image, to obtain an edge feature map to be processed;
[0157] Sequentially take out sitting edge images from the plurality of sitting edge sample sets as the sitting edge images to be processed, and after each taking out, construct a similar feature queue of the edge feature map by executing the following steps:
[0158] Extracting a plurality of horizontal edge coordinate differences and a plurality of vertical edge coordinate differences according to the sitting edge image to be processed and the edge feature map to be processed, wherein the coordinate difference is a difference between an edge pixel of the sitting edge image to be processed and a nearest non-zero pixel coordinate in the edge feature map to be processed;
[0159] respectively calculating a sum of the plurality of horizontal edge coordinate differences and a sum of the plurality of vertical edge coordinate differences as cumulative horizontal coordinate differences and cumulative vertical coordinate differences;
[0160] Calculate the sum of squares of the accumulated horizontal coordinate difference and the accumulated vertical coordinate difference as a similarity eigenvalue;
[0161] The similar feature value is added to a similar feature queue.
[0162] Exemplarily, an embodiment of the present invention obtains multiple sitting edge samples, and these sitting edge samples are divided into multiple data sets according to sitting posture. For example, in one division method, one data set is multiple sitting edge samples in focused states, and the other data set is multiple sitting edge samples in non-focused states.
[0163] Then the edge feature map obtained in each of the previous steps is stretched and scaled so that the pixel size is the same as the sitting edge sample. Then, as Figure 3 As shown, edge distances are compared with the scaled and stretched edge feature map 301 from multiple sitting edge samples 302 (the upper and lower groups of sitting edge samples in the figure are two data sets) in turn, and the comparison results are added to the similar feature queue 303 as data.
[0164] In terms of the comparison method, one implementation method is to extract an edge pixel from the sitting edge sample 302 in turn, and then find the non-zero pixel value closest to its position from the scaled and stretched edge feature map 301 according to the position of this pixel, calculate the horizontal coordinate difference and vertical coordinate difference of the two pixels, and traverse in this way. After the traversal is completed, multiple horizontal coordinate differences are summed to obtain the cumulative horizontal coordinate difference. Similarly, multiple vertical coordinate differences are summed to obtain the cumulative vertical coordinate difference. The square sum of the two cumulative values is calculated as the similarity feature value.
[0165] Since the embodiments of the present invention perform similarity judgment by means of coordinate comparison, when the target subject is partially occluded, since the judgment of the similarity with multiple sitting edge samples is roughly the same due to the occlusion, the judgment result is relatively not much different from when the subject is not occluded. Therefore, the influence of occlusion on sitting posture judgment is weakened. This method is more reliable than the judgment method using a supervised learning algorithm.
[0166] In step 104, the multiple similar feature queues are respectively classified into corresponding target sitting posture categories, a sitting posture probability queue is constructed according to the maximum sitting posture probability of each target sitting posture category and the sitting posture corresponding to the maximum sitting posture probability, and the concentration index is determined according to the low-frequency characteristics of the sitting posture probability queue.
[0167] In some implementations, the step of respectively classifying the plurality of similar feature queues into corresponding target sitting posture classes, and constructing a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, comprises:
[0168] For each of the multiple similar feature queues, the following steps are performed respectively:
[0169] Acquire multiple sitting posture classes, wherein the sitting posture class includes multiple similar feature queue samples obtained by clustering, and the similar feature queue samples are constructed by comparing edge coordinates of edge feature map samples with multiple sitting posture edge images;
[0170] The distance from the similar feature queue to each sitting posture class center is calculated according to the fifth formula, thereby obtaining multiple distances, wherein the sitting posture class center is the class center of the sitting posture class, and the fifth formula is:
[0171]
[0172] In the formula, For similar features, queue to The distance between the centers of the sitting postures, For the similar characteristics queue data, For the Seated center data, is the total number of cohort data with similar characteristics;
[0173] Selecting the distance with the smallest value from the multiple distances as the target distance, and classifying the sitting posture class corresponding to the target distance as the target sitting posture class to be included in the similar feature queue;
[0174] Extracting the sitting postures corresponding to the samples of multiple source edge feature maps of the target sitting posture class, and extracting the probability of the most common sitting posture, wherein the sitting posture includes a focused sitting posture and a non-focused sitting posture;
[0175] If the most common sitting posture is a non-focused sitting posture, then the opposite number of the probability of the most common sitting posture is added to the sitting posture probability queue;
[0176] Otherwise, the probability of the most sitting postures is added to the sitting posture probability queue.
[0177] In some embodiments, determining the concentration index according to the low-frequency features of the sitting posture probability queue includes:
[0178] The effective value of the sitting posture probability queue is extracted according to the sixth formula, wherein the sixth formula is:
[0179]
[0180] In the formula, is the effective value of the sitting probability queue, is the sitting probability queue data, is the total number of sitting probability cohort data;
[0181] According to the target low-frequency frequency, the effective value of the sitting posture probability queue and the seventh formula, the low-frequency feature is extracted, and the low-frequency feature is used as the concentration index, wherein the seventh formula is:
[0182]
[0183] In the formula, is the concentration index, is a natural constant, is an imaginary unit, is the target low frequency, The number of target images collected by the period length corresponding to the target low frequency, is the ratio of pi.
[0184] For example, in order to enhance the accuracy of judging the sitting posture, the embodiment of the present invention uses the sitting posture probability to estimate the sitting posture probability, such as Figure 4 As shown, the embodiment of the present invention first obtains a plurality of similar feature queue samples 402, and these similar feature queue samples 402 are classified into a plurality of sitting posture classes 403 by clustering.
[0185] The method for obtaining similar feature queue samples is generally the same as the aforementioned method for obtaining similar feature queues. First, a batch of sitting edge images 401 are obtained (for the convenience of expression, only one sitting edge image is drawn in the figure). The sitting postures of these sitting edge images 401 are marked according to whether they are concentrated sitting postures. Then, these sitting edge images 401 are respectively compared with multiple sitting edge samples 302 for similarity, and similar feature queue samples 402 are extracted.
[0186] Since the sitting posture class 403 may contain two different forms, similar feature queue samples of focused forms and similar feature queue samples of non-focused forms (the upper and lower classes in the figure), therefore, by extracting the identification of the sitting posture in the sitting posture class 403 and calculating the proportion, the main sitting posture form in this sitting posture class 403 and the proportion of the main sitting posture form, that is, the probability of the main sitting posture form, can be determined.
[0187] When the distance between the similar feature array 303 obtained in the above step and the class center of these sitting posture classes 403 is calculated, for example, the fifth formula is used for calculation:
[0188]
[0189] In the formula, For similar features, queue to The distance between the centers of the sitting postures, For the similar characteristics queue data, For the Seated center data, The similar feature queue 303 obtained in the above step can be classified into one of the sitting posture classes, and the main sitting posture form and the probability of the main sitting posture form of this sitting posture class are used as the sitting posture and sitting posture probability of the target image.
[0190] Since multiple target images are arranged in time sequence, these sitting posture probabilities are also arranged in the corresponding time sequence, and when the sitting posture is a non-focused form, the probability value is reversed to obtain a sitting posture probability queue.
[0191] As mentioned above, when judging concentration in a short period of non-concentrated sitting posture, it is easy to make a misjudgment. Therefore, the embodiment of the present invention adopts the method of extracting the low-frequency features of the sitting posture probability queue to perform concentration analysis. One analysis method is to first calculate the effective value of the sitting posture probability queue using the sixth formula:
[0192]
[0193] In the formula, is the effective value of the sitting probability queue, is the first data, is the total number of sitting probability cohort data.
[0194] Then, using the seventh formula, calculate the ratio of the amplitude of the low-frequency feature of the sitting probability queue to the effective value of the sitting probability queue as the concentration index:
[0195]
[0196] In the formula, is the concentration index, is a natural constant, is an imaginary unit, is the target low frequency, The number of target images collected by the period length corresponding to the target low frequency, is the ratio of pi.
[0197] Obviously, this index reflects the degree of concentration and is negatively correlated with concentration. In other words, the larger the value, the worse the concentration, and vice versa. In addition, the distribution range of this index is relatively certain (theoretical range 0-1.414), which facilitates the judgment of concentration.
[0198] The embodiment of the present invention adopts similar feature queue samples of known sitting postures to construct sitting posture classes, classifies similar feature queues into the nearest sitting posture class, extracts the sitting posture probability of the sitting posture class as the sitting posture probability of the target image, and the sitting posture judgment accuracy is more accurate after two comparisons of known sitting posture images. In addition, since the concentration analysis is performed by using the low-frequency features of the sitting posture queue, the possibility of misjudgment of concentration is reduced, and the analysis result is more reliable.
[0199] The present invention is based on the concentration analysis method implementation method of sitting posture recognition, which first obtains multiple target images, wherein the target image contains the recognition subject; then the multiple target images are preprocessed and the edge lines in the image are extracted to obtain multiple edge feature maps; then each edge feature map in the multiple edge feature maps is respectively extracted by comparing the edge coordinates with multiple sitting posture edge images, and a similar feature queue is constructed according to the edge pixel coordinate difference, thereby obtaining multiple similar feature queues; finally, the multiple similar feature queues are respectively classified into the corresponding target sitting posture class, and a sitting posture probability queue is constructed according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, and the concentration index is determined according to the low-frequency features of the sitting posture probability queue. Since the implementation method of the present invention does not adopt a supervised learning algorithm, it only needs to compare with the image of the known sitting posture to extract the probability of the sitting posture. Therefore, the analysis method construction process and verification process are short, fewer samples are required, and less manpower is consumed. Since the comparison is performed by the comparison method, the calculation amount is small compared with the complicated calculation nodes of the artificial neural network.
[0200] It should be understood that the size of the serial numbers of the steps in the above implementation does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation method of the present invention.
[0201] The following is an implementation of the device of the present invention. For details not described in detail, reference may be made to the corresponding method implementation described above.
[0202] Figure 5 is a functional block diagram of a concentration analysis device based on sitting posture recognition provided by an embodiment of the present invention, referring to Figure 5 The concentration analysis device based on sitting posture recognition includes: an image acquisition module 501, an image edge extraction module 502, a sitting posture comparison module 503 and a concentration analysis module 504, wherein:
[0203] An image acquisition module 501 is used to acquire a plurality of target images, wherein the target images contain a recognition subject;
[0204] An image edge extraction module 502 is used to pre-process the multiple target images respectively and extract edge lines in the images to obtain multiple edge feature maps;
[0205] A sitting posture comparison module 503 is used to extract edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting posture edge images, and to construct similar feature queues according to the edge pixel coordinate differences, thereby obtaining a plurality of similar feature queues;
[0206] The concentration analysis module 504 is used to classify the multiple similar feature queues into corresponding target sitting posture categories, construct a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture category and the sitting posture corresponding to the maximum sitting posture probability, and determine the concentration index according to the low-frequency characteristics of the sitting posture probability queue.
[0207] Figure 6 is a functional block diagram of an electronic device provided by an embodiment of the present invention. Figure 6 As shown, the electronic device 6 of this embodiment includes: a processor 600 and a memory 601, wherein the memory 601 stores a computer program 602 that can be run on the processor 600. When the processor 600 executes the computer program 602, the steps in the above-mentioned concentration analysis method based on sitting posture recognition and the embodiments are implemented, for example Figure 1 Steps 101 to 104 are shown.
[0208] Exemplarily, the computer program 602 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 601 and executed by the processor 600 to implement the present invention.
[0209] The electronic device 6 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 6 may include, but is not limited to, a processor 600 and a memory 601. Those skilled in the art will appreciate that Figure 6 It is only an example of the electronic device 6 and does not constitute a limitation of the electronic device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 6 may also include input and output devices, network access devices, buses, etc.
[0210] The processor 600 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0211] The memory 601 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. The memory 601 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 6. Further, the memory 601 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 601 is used to store the computer program 602 and other programs and data required by the electronic device 6. The memory 601 may also be used to temporarily store data that has been output or is to be output.
[0212] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the implementation method can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, which will not be repeated here.
[0213] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0214] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0215] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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.
[0216] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0217] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0218] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various methods and device implementation methods can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.
[0219] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A concentration analysis method based on sitting posture recognition, It is characterized in that include: Acquire multiple target images, wherein the target images contain identification subjects; Preprocessing the multiple target images respectively and extracting edge lines in the images to obtain multiple edge feature maps; Extracting edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting edge images, and constructing similar feature queues according to the edge pixel coordinate differences, thereby obtaining a plurality of similar feature queues; Classifying the multiple similar feature queues into corresponding target sitting posture classes respectively, constructing a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, and determining a concentration index according to the low-frequency features of the sitting posture probability queue; in, The step of respectively classifying the plurality of similar feature queues into corresponding target sitting posture classes, and constructing a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture class and the sitting posture corresponding to the maximum sitting posture probability, comprises: For each of the multiple similar feature queues, the following steps are performed respectively: Acquire multiple sitting posture classes, wherein the sitting posture class includes multiple similar feature queue samples obtained by clustering, and the similar feature queue samples are constructed by comparing edge coordinates of edge feature map samples with multiple sitting posture edge images; The distance from the similar feature queue to each sitting posture class center is calculated according to the fifth formula, thereby obtaining multiple distances, wherein the sitting posture class center is the class center of the sitting posture class, and the fifth formula is: In the formula, For similar features, queue to The distance between the centers of the sitting postures, For the similar characteristics queue data, For the Seated center data, is the total number of cohort data with similar characteristics; Selecting the distance with the smallest value from the multiple distances as the target distance, and classifying the sitting posture class corresponding to the target distance as the target sitting posture class to be included in the similar feature queue; Extracting the sitting postures corresponding to the samples of multiple source edge feature maps of the target sitting posture class, and extracting the probability of the most common sitting posture, wherein the sitting posture includes a focused sitting posture and a non-focused sitting posture; If the most common sitting posture is a non-focused sitting posture, then the opposite number of the probability of the most common sitting posture is added to the sitting posture probability queue; Otherwise, adding the probability of the most sitting postures to the sitting posture probability queue; in, The determining of the concentration index according to the low-frequency characteristics of the sitting posture probability queue includes: The effective value of the sitting posture probability queue is extracted according to the sixth formula, wherein the sixth formula is: In the formula, is the effective value of the sitting probability queue, is the first data, is the total number of sitting probability cohort data; According to the target low-frequency frequency, the effective value of the sitting posture probability queue and the seventh formula, the low-frequency feature is extracted, and the low-frequency feature is used as the concentration index, wherein the seventh formula is: In the formula, is the concentration index, is a natural constant, is an imaginary unit, is the target low frequency, The number of target images collected by the period length corresponding to the target low-frequency frequency, is the ratio of pi.
2. The method for analyzing concentration based on sitting posture recognition according to claim 1, It is characterized in that The preprocessing of the plurality of target images is performed respectively and edge lines in the images are extracted to obtain a plurality of edge feature maps, including: For each target image in the plurality of target images, the following steps are performed respectively: Obtain a fuzzy processing operator, a horizontal difference operator, and a vertical difference operator; Decolorizing the target image, and adjusting multiple pixel values in the decolorized image to a preset range to obtain a grayscale image; Using the fuzzy processing operator, the grayscale image is fuzzy processed to obtain a fuzzy grayscale image, and using the horizontal difference operator and the vertical difference operator to perform difference calculation on the fuzzy grayscale image to obtain a horizontal edge image and a vertical edge image; The differential amplitude and differential angle are calculated for the horizontal edge map and the vertical edge map to obtain a differential amplitude map and a differential angle map respectively, the differential amplitude map is subjected to maximum value processing to obtain a primary edge map, and non-extreme value suppression is performed on the primary edge map according to the differential angle map to obtain an edge feature map.
3. The method for analyzing concentration based on sitting posture recognition according to claim 2, It is characterized in that The method of using the fuzzy processing operator to perform fuzzy processing on the grayscale image to obtain a fuzzy grayscale image, and using the horizontal difference operator and the vertical difference operator to perform differential calculation on the fuzzy grayscale image to obtain a horizontal edge image and a vertical edge image, includes: Sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block; According to a first formula, the first data block and the blur processing operator, a blurred pixel is extracted, wherein the first formula is: In the formula, To blur pixels, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The first data block Line Column pixels, The fuzzy processing operator Line The value of the column; The extracted blurred pixels are stored in the intermediate grayscale image according to the fetching position of the first data block; If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the fuzzy processing operator from the grayscale image as the first data block; Otherwise, the intermediate grayscale image is used as a fuzzy grayscale image; For each of the horizontal difference operators and the vertical difference operators, the following steps are performed respectively: Sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as second data blocks; The differential pixel is extracted according to the second formula, the second data block and the operator, wherein the second formula is: In the formula, is the difference pixel, is the number of rows of fuzzy processing operators, is the number of columns of fuzzy processing operators, The second data block Line Column pixels, The fuzzy processing operator Line The value of the column; storing the extracted differential pixels into the edge map according to the fetching position of the first data block; If the traversal is not completed, jump to the step of sequentially taking out data blocks of the same type as the operator from the fuzzy grayscale image as the second data block.
4. The method for analyzing concentration based on sitting posture recognition according to claim 2, It is characterized in that The step of performing differential amplitude and differential angle calculation on the horizontal edge map and the vertical edge map to obtain a differential amplitude map and a differential angle map respectively, performing maximum value processing on the differential amplitude map to obtain a primary edge map, and performing non-extreme value suppression on the primary edge map according to the differential angle map to obtain an edge feature map comprises: The differential amplitude map and the differential angle map are constructed according to the third formula, the horizontal edge map and the vertical edge map, wherein the third formula is: In the formula, The differential amplitude diagram Line The pixel value of the column, For vertical edge diagram Line The pixel value of the column, For horizontal edge graph Line The pixel value of the column, The difference angle diagram Line The pixel value of the column; Performing zero processing on values in the differential amplitude map that are less than a first threshold value to obtain the primary edge map; For each non-zero value in the primary edge map, perform the following steps respectively: Extracting a square data block centered on a non-zero value as the third data block; The pixel value corresponding to the non-zero value position is extracted from the differential angle map as the differential angle value, and the differential angle is determined according to the fourth formula and the differential angle value, wherein the fourth formula is: In the formula, is the differential angle, is the inverse tangent function; Find a plurality of data to be processed from the third data block with a non-zero value as the center along the direction of the differential angle; The non-maximum values in the plurality of data to be processed are set to zero.
5. The method for analyzing concentration based on sitting posture recognition according to claim 1, It is characterized in that The step of extracting edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting edge images, and constructing a similar feature queue according to the edge pixel coordinate differences comprises: Acquire multiple sitting posture edge sample sets, wherein each sitting posture edge sample set corresponds to a sitting posture, and the sitting posture edge sample set includes multiple sitting posture edge images; Scaling and / or stretching the edge feature map so that the edge feature map has the same pixel size as the sitting edge image, to obtain an edge feature map to be processed; Sequentially take out sitting edge images from the plurality of sitting edge sample sets as the sitting edge images to be processed, and after each taking out, construct a similar feature queue of the edge feature map by executing the following steps: Extracting a plurality of horizontal edge coordinate differences and a plurality of vertical edge coordinate differences according to the sitting edge image to be processed and the edge feature map to be processed, wherein the coordinate difference is a difference between an edge pixel of the sitting edge image to be processed and a nearest non-zero pixel coordinate in the edge feature map to be processed; respectively calculating a sum of the plurality of horizontal edge coordinate differences and a sum of the plurality of vertical edge coordinate differences as cumulative horizontal coordinate differences and cumulative vertical coordinate differences; Calculate the sum of squares of the accumulated horizontal coordinate difference and the accumulated vertical coordinate difference as a similarity eigenvalue; The similar feature value is added to a similar feature queue.
6. A concentration analysis device based on sitting posture recognition, It is characterized in that Used to implement the concentration analysis method based on sitting posture recognition as described in any one of claims 1 to 5, the concentration analysis device based on sitting posture recognition comprises: An image acquisition module is used to acquire a plurality of target images, wherein the target images contain the identification subject; An image edge extraction module is used to preprocess the multiple target images respectively and extract edge lines in the images to obtain multiple edge feature maps; A sitting posture comparison module, configured to extract edge pixel coordinate differences from each edge feature map in the plurality of edge feature maps by comparing edge coordinates with a plurality of sitting posture edge images, and construct similar feature queues according to the edge pixel coordinate differences, thereby obtaining a plurality of similar feature queues; as well as, The concentration analysis module is used to classify the multiple similar feature queues into corresponding target sitting posture categories, construct a sitting posture probability queue according to the maximum sitting posture probability of each target sitting posture category and the sitting posture corresponding to the maximum sitting posture probability, and determine the concentration index according to the low-frequency characteristics of the sitting posture probability queue.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Sitting posture detection method and device
CN103810478A
DR blurred image blind deconvolution restoration method and system
CN114092416A
