An interactive method and a sand table display system based on gesture control

By generating and comparing multi-angle gesture images, the problem of insufficient accuracy and real-time performance of gesture recognition in traditional sand table display systems is solved, and low-latency control and user experience improvement of the sand table display system are achieved.

CN117453050BActive Publication Date: 2024-10-01BEIDOU TIANHUI (BEIJING) TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311620751.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2024-10-01
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

The interaction method of the traditional sand table display system is based on the mouse and keyboard, which is complicated to operate and has poor user experience. Moreover, the accuracy and real-time performance of gesture recognition technology in the sand table display system are insufficient.

Method used

By obtaining sample gesture images from multiple shooting angles, extracting pixels in different gray gradient ranges, generating a series of sample comparison gesture images, marking the location of feature points, collecting user gesture images in real time, and generating user comparison gesture images one after another. For comparison recognition, priority is given to comparison operations with low computing resources to improve the speed and accuracy of gesture recognition.

Benefits of technology

It achieves low-latency control of the sand table display system, improves the accuracy and real-time performance of gesture recognition, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117453050B_ABST
    Figure CN117453050B_ABST
Patent Text Reader

Abstract

The present invention discloses an interactive method and a sand table display system based on gesture control, and relates to the technical field of human-computer interaction. The present invention includes obtaining the relative position distribution between feature points in a series of sample comparison gesture images corresponding to each gesture; in the interactive process, real-time acquisition of user hand images; according to the gradient of the grayscale of each pixel point in the user hand image on the plane, sequentially extracting pixels within different gradient ranges from low to high, and successively generating a series of user comparison gesture images until the interactive instructions indicated by the user gesture are identified; obtaining the relative position distribution between feature points in each user comparison gesture image; comparing the relative position distribution between feature points in the user comparison gesture image with the relative position distribution between feature points in the series of sample comparison gesture images corresponding to each gesture, and obtaining the interactive instructions indicated by the user gesture. The present invention improves the accuracy and real-time performance of gesture recognition, and realizes low-latency control and display of the sand table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of human-computer interaction, and in particular relates to an interaction method and a sandbox display system based on gesture control. Background Art

[0002] Sand table display is a common display method, which is widely used in real estate, urban planning, traffic management, military simulation and other fields. It can intuitively display geographical location, topography, buildings and other information. Traditional sand table displays are mostly static displays. Although they can well display spatial structures, they have poor interactivity and cannot meet people's needs for information acquisition and understanding.

[0003] In recent years, with the development of computer technology and display technology, many computer-based sandbox display systems have emerged. These systems can dynamically display and transform sandbox models through computer graphics technology, enhancing the display effect. However, the interaction methods of these systems are mainly based on input devices such as mouse and keyboard, which have complicated operation processes and poor user experience.

[0004] The application of gesture recognition technology makes the interaction between people and computers more natural and intuitive. However, applying gesture recognition technology to the sandbox display system requires solving problems such as the accuracy and real-time performance of gesture recognition. Summary of the invention

[0005] The purpose of the present invention is to provide an interactive method and a sandbox display system based on gesture control, which improves the accuracy and real-time performance of gesture recognition by performing differentiated comparison and recognition on gesture images, and realizes low-latency control and display of the sandbox.

[0006] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:

[0007] The present invention provides an interactive method, comprising:

[0008] Get hand gestures and corresponding interaction instructions;

[0009] Obtain sample gesture images of each gesture at multiple shooting angles;

[0010] According to the grayscale gradient of each pixel point in each sample gesture image on the plane, pixels within different gradient ranges are extracted to generate a series of sample comparison gesture images;

[0011] Marking the relative position distribution between feature points in each of the sample comparison gesture images;

[0012] Summarize the relative position distribution between the feature points in the series of samples corresponding to each gesture and compare them in the gesture image;

[0013] During the interaction, the user's hand image is collected in real time;

[0014] According to the gradient of the grayscale of each pixel point in the user's hand image on the plane, pixels within different gradient ranges are extracted sequentially from low to high, and a series of user comparison gesture images are generated one by one until the interaction instruction indicated by the user's gesture is identified;

[0015] Obtaining the relative position distribution between feature points in each of the user's comparison gesture images;

[0016] The relative position distribution between the feature points in the user comparison gesture image is compared with the relative position distribution between the feature points in the series of sample comparison gesture images corresponding to each gesture to obtain the interaction instruction indicated by the user gesture.

[0017] The present invention also discloses an interaction method, comprising:

[0018] Get the interaction instruction indicated by the user's gesture;

[0019] The interactive instruction is sent to an instruction receiving unit.

[0020] The present invention also discloses an interaction method, comprising:

[0021] Receive interactive instructions.

[0022] The present invention also discloses a sand table display system based on gesture control, comprising:

[0023] A gesture template building unit, used to obtain hand gestures and corresponding interaction instructions;

[0024] Obtain sample gesture images of each gesture at multiple shooting angles;

[0025] According to the grayscale gradient of each pixel point in each sample gesture image on the plane, pixels within different gradient ranges are extracted to generate a series of sample comparison gesture images;

[0026] Marking the relative position distribution between feature points in each of the sample comparison gesture images;

[0027] Summarize and obtain the relative position distribution between the feature points in the series of gesture images corresponding to each gesture;

[0028] During the interaction, the image acquisition unit is used to acquire the user's hand image in real time;

[0029] The recognition unit is used to extract pixels within different gradient ranges from low to high according to the gradient of the grayscale of each pixel in the user's hand image on the plane, and successively generate a series of user comparison gesture images until the interaction instruction indicated by the user's gesture is recognized;

[0030] Obtaining the relative position distribution between feature points in each of the user's comparison gesture images;

[0031] Comparing the relative position distribution between the feature points in the user comparison gesture image with the relative position distribution between the feature points in the series of sample comparison gesture images corresponding to each gesture, to obtain the interaction instruction indicated by the user gesture;

[0032] An instruction sending unit, used to obtain an interaction instruction indicated by a user's gesture;

[0033] Sending the interactive instruction to an instruction receiving unit;

[0034] The instruction receiving unit is used to receive an interaction instruction.

[0035] The present invention constructs a series of sample comparison gesture images through a gesture template construction unit, and the different grayscale gradients make them have different numbers of feature points. In the process of gesture comparison and recognition, the sample comparison gesture images with a lower grayscale gradient range can be compared first, and the feature point comparison calculation amount required in this process is relatively small. If the comparison with a sufficiently high recognition accuracy cannot be completed, the sample comparison gesture images with a higher grayscale gradient range will continue to be compared. Although the feature point comparison calculation amount is large, the recognition accuracy is improved. In this process, comparison operations with low computing resource requirements are given priority, which improves the speed of gesture recognition comparison and enables rapid response of sandbox control instructions during sandbox display.

[0036] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0038] Figure 1 A schematic diagram of functional modules and information flow of a sandbox display system based on gesture control in one embodiment of the present invention;

[0039] Figure 2 A schematic diagram of the steps of the gesture template construction unit, the image acquisition unit, and the recognition unit in one embodiment of the present invention;

[0040] Figure 3 A schematic diagram of a step flow chart of an instruction sending unit according to an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of a step flow chart of an instruction receiving unit according to an embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram of the step flow of step S3 in one embodiment of the present invention;

[0043] Figure 6 A schematic diagram of a step flow chart of step S34 in an embodiment of the present invention;

[0044] Figure 7 This is a schematic diagram of the step flow of step S7 in one embodiment of the present invention;

[0045] Figure 8 This is a schematic diagram of the step flow of step S9 in one embodiment of the present invention;

[0046] Fig. 9 A schematic diagram of a step flow chart of step S92 in an embodiment of the present invention;

[0047] Fig.10 FIG. 4 is a schematic diagram of a step flow chart of step S93 in an embodiment of the present invention.

[0048] In the accompanying drawings, the components represented by the reference numerals are listed as follows:

[0049] 1-gesture template building unit, 2-image acquisition unit, 3-recognition unit, 4-instruction sending unit, 5-instruction receiving unit. DETAILED DESCRIPTION

[0050] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0051] It should be noted that the terms "first", "second", etc. in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0052] Sandbox display models are widely used in various fields, such as education, urban planning, geographic information systems, military simulation, architectural design, etc. They provide an intuitive, concrete and visual way to display and convey information, promote understanding, decision-making and communication. In order to facilitate the control of the sandbox display, it is usually controlled by the user's gestures.

[0053] This requires rapid recognition of user gestures and the issuance of interactive instructions. In the traditional solution, the convolutional neural network based on computer vision realizes the judgment of gesture images, but the recognition accuracy of the convolutional neural network is low under a reliable recognition rate, and the operation of the convolutional neural network requires a lot of computing power, which will also slow down the speed of gesture recognition and ultimately increase the response delay of the user control sandbox display. In order to solve this problem, the present invention provides the following solution.

[0054] See also Figures 1 to 4 As shown, the present invention provides a sandbox display system based on gesture control, which is divided into a gesture template construction unit 1, an image acquisition unit 2, a recognition unit 3, an instruction sending unit 4 and an instruction receiving unit 5 in terms of functional modules. The gesture template construction unit 1 can be a pure calculation unit, which directly generates hand gestures, and relies on the space virtual model to extract sample gesture images of gestures at multiple shooting angles, and of course, it can also be obtained by actual shooting. The image acquisition unit 2 can be an ordinary camera, an infrared camera, or a combined depth of field camera. The recognition unit 3 can be a pure calculation unit. The instruction sending unit 4 can be a communication sending end, and the instruction receiving unit 5 can be a communication receiving end, and directly controls the sandbox for display.

[0055] Before performing gesture recognition on the user, the gesture template construction unit 1 needs to execute step S1 to obtain the hand gesture and the corresponding interaction instruction. The interaction instruction can be preset and may vary according to the specific sandbox system and application. The following are some examples of common sandbox control interaction instructions.

[0056] Move: Move the prop or model in your hand to a specific location in the sandbox through gestures or controller instructions, for example, move a car model from one place to another. Rotate: Rotate the prop or model in your hand in the sandbox through gestures, for example, rotate a house model to change its orientation. Place: Place the prop or model in your hand at a specific location in the sandbox through gestures, for example, place a tree model at a specified location in the sandbox. Change properties: Change the properties of the prop or model in the sandbox through gestures, for example, adjust the height of a mountain model through gestures. Create / Delete: Create new props or models in the sandbox through gestures, or delete existing props or models from the sandbox. Zoom: Zoom the scene in the sandbox through gestures. For example, zoom in or out the entire sandbox environment. Play / Pause: Control the play and pause of the animation or scene demonstration in the sandbox through gestures or controller instructions. Reset: Restore the sandbox to the initial state through gestures, clearing all operations and changes.

[0057] Since the user's hand posture may be changeable during the human-computer interaction process, it is necessary to execute step S2 to obtain sample gesture images of each gesture at multiple shooting angles. Next, step S3 can be executed to extract pixels within different gradient ranges according to the gradient of the grayscale of each pixel in each sample gesture image on the plane to generate a series of sample comparison gesture images. Next, step S4 can be executed to mark the relative position distribution between feature points in each sample comparison gesture image. Next, step S5 can be executed to summarize the relative position distribution between feature points in the series of gesture images corresponding to each gesture; in short, the sample comparison gesture image corresponding to the smaller gradient range records the contour in the original image, and the sample comparison gesture image corresponding to the larger gradient range records the details in the original image. The former has a faster comparison speed, and the latter has a higher comparison accuracy.

[0058] During the interaction process, the image acquisition unit 2 executes step S6 to acquire the user's hand image in real time. Since the user may control the sandbox at any time, it is necessary to maintain the real-time acquisition of the user's hand image to avoid a long interaction delay.

[0059] Next, the recognition unit 3 executes step S7 to extract pixels within different gradient ranges from low to high according to the gradient of the grayscale of each pixel in the user's hand image on the plane, and successively generates a series of user comparison gesture images until the interactive instruction indicated by the user gesture is identified. Next, step S8 can be executed to obtain the relative position distribution between the feature points in each user comparison gesture image. Next, step S9 can be executed to compare the relative position distribution between the feature points in the user comparison gesture image with the relative position distribution between the feature points in the series of sample comparison gesture images corresponding to each gesture, and obtain the interactive instruction indicated by the user gesture. In this way, the user comparison gesture image and the sample comparison gesture image with lower computational complexity can be compared first. If the comparison cannot be successfully achieved, the one with higher computational complexity can be compared. In this way, both the accuracy and efficiency of gesture recognition can be taken into account.

[0060] After completing the gesture recognition, the instruction sending unit 4 may execute step S011 to obtain the interaction instruction indicated by the user gesture, and then execute step S012 to send the interaction instruction to the instruction receiving unit. The interaction instruction may be sent by wire or wirelessly, and the instruction receiving unit 5 executes step S021 to receive the interaction instruction. The user gesture recognition and the transmission of the interaction instruction are completed through the above process.

[0061] See also Figure 5As shown, for each sample gesture image, in an image recording gesture information, only part of the hand contour needs to be extracted to achieve gesture comparison, which means that most of the detail information in the image is redundant, and this redundant information will increase the computational complexity of gesture comparison. In order to achieve fast gesture comparison, the detail information in the image can be removed, but removing too much detail information will make it impossible to complete the comparison. In order to take into account both the accuracy and speed of the comparison, in the process of setting a series of sample comparison gesture images, first, step S31 can be executed to obtain the maximum grayscale gradient value of the grayscale gradient of the pixel points in the sample gesture image. Next, step S32 can be executed to uniformly select multiple critical grayscale gradient values ​​within the maximum grayscale gradient value range. Next, step S33 can be executed to extract and arrange the pixel points of the sample gesture image within each critical grayscale gradient value to obtain the sample comparison gesture image corresponding to each critical grayscale gradient value. Finally, step S34 can be executed to combine the sample comparison gesture images generated by each sample gesture image within each critical grayscale gradient value range to obtain a series of sample comparison gesture images. It can be understood that the larger the critical grayscale gradient value is, the more information is recorded by the pixels within the critical grayscale gradient value, and the more accurate the comparison is.

[0062] In order to supplement the implementation process of the above steps S31 to S34, the source code of some functional modules is provided, and the explanation is compared in the comment section. In order to avoid the leakage of data involving commercial secrets, some data that does not affect the implementation of the solution are desensitized, the same below.

[0063] #include<opencv2 / opencv.hpp>

[0064] #include <vector>

[0065] #include <algorithm>

[0066] using namespace cv;

[0067] using namespace std;

[0068] / / Calculate the gradient of the image

[0069] Mat computeGradient(const Mat& src) {

[0070] Mat grad_x, grad_y;

[0071] Sobel(src, grad_x, CV_16S, 1, 0, 3, 1, 0, BORDER_DEFAULT);

[0072] Sobel(src, grad_y, CV_16S, 0, 1, 3, 1, 0, BORDER_DEFAULT);

[0073] Mat abs_grad_x, abs_grad_y;

[0074] convertScaleAbs(grad_x, abs_grad_x);

[0075] convertScaleAbs(grad_y, abs_grad_y);

[0076] Mat grad;

[0077] addWeighted(abs_grad_x, 0.5, abs_grad_y, 0.5, 0, grad);

[0078] return grad;

[0079] }

[0080] / / Generate comparison images based on different gradient values

[0081] vector <mat>generateComparativeImages(const Mat& src, intthresholdCount) {

[0082] Mat grad = computeGradient(src);

[0083] double minVal, maxVal;

[0084] minMaxLoc(grad, &minVal, &maxVal);

[0085] vector <int>thresholds(thresholdCount);

[0086] iota(thresholds.begin(), thresholds.end(), maxVal / thresholdCount);

[0087] vector <mat>comparativeImages;

[0088] for (int threshold : thresholds) {

[0089] Mat comparativeImage;

[0090] threshold(grad, comparativeImage, threshold, 255, THRESH_BINARY);

[0091] comparativeImages.push_back(comparativeImage);

[0092] }

[0093] return comparativeImages;

[0094] }

[0095] int main() {

[0096] Mat src = imread("gesture.jpg", IMREAD_GRAYSCALE);

[0097] if (src.empty()) {

[0098] cout << "Could not open or find the image" << endl;

[0099] return -1;

[0100] }

[0101] vector <mat>comparativeImages = generateComparativeImages(src,10);

[0102] / / Output comparison image

[0103] for (int i = 0; i < comparativeImages.size(); ++i) {

[0104] imshow("Comparative Image " + to_string(i), comparativeImages[i]);

[0105] }

[0106] waitKey(0);

[0107] return 0;

[0108] }

[0109] This code first reads an image of a gesture and calculates the gradient map of the image, then applies different thresholds to the gradient map to generate a series of comparison images. These comparison images can be used for subsequent gesture recognition.

[0110] See also Figure 6 As shown, due to the large number of sample comparison gesture images, in order to facilitate rapid comparison, step S341 can be executed to classify the sample comparison gesture images with the same critical grayscale gradient value range into the same comparison pool, and then step S342 can be executed to arrange the multiple comparison pools in order from small to large according to the corresponding critical grayscale gradient values. In the comparison process, the comparison is performed according to the arrangement order between the multiple comparison pools. Finally, step S343 can be executed to obtain a series of sample comparison gesture images according to the arrangement and combination of the comparison chain and the sample comparison gesture images in the comparison pool.

[0111] Of course, multiple sample comparison gesture images generated from the same sample gesture image within different critical grayscale gradient value ranges can also be arranged in ascending order according to the corresponding critical grayscale gradient values ​​to form a comparison chain. During the comparison process, the comparison is performed in the order of the comparison chain, which can also increase the comparison speed.

[0112] See also Figure 7 As shown, in order to improve the speed of comparison, the user comparison gesture image with a smaller gradient range can be compared with the corresponding sample comparison gesture image. If the comparison is completed, the user gesture is obtained. If the comparison cannot be completed, the gradient range is increased. In this way, even if the comparison with a smaller gradient range has no result, it will not consume a lot of computing time, thereby avoiding the lengthening of the gesture recognition calculation response time. In view of this, in the specific real-time process of the above-mentioned step S7, step S71 can be first executed to extract the pixel points in the corresponding range of the user hand image according to the minimum value of multiple critical grayscale gradient values ​​to generate a user comparison gesture image. Next, step S72 can be executed to compare the user comparison gesture image with multiple sample comparison gesture images in the comparison pool corresponding to the critical grayscale gradient value with the smallest value. Next, step S73 can be executed to determine whether the interaction instruction referred to by the user gesture is recognized. If so, step S74 can be executed next to complete the comparison. If not, step S75 can be executed next to update and generate the user comparison gesture image in the order from small to large of multiple critical grayscale gradient values. Finally, steps S72 to S75 can be executed to compare the updated user comparison gesture image with multiple sample comparison gesture images in the comparison pool corresponding to the critical grayscale gradient value until the interaction instruction indicated by the user gesture is identified. At the same time, the comparison calculations within different gradient ranges can be calculated in parallel, which can also shorten the response time of the comparison calculation.

[0113] See also Figure 8 As shown, due to the large number of sample comparison gesture images, in order to achieve fast comparison, the relative position distribution between the feature points of the sample comparison gesture image and the user comparison gesture image can be compared, because the feature points fully represent the feature information of the image. Specifically, in the specific implementation process of the above-mentioned step S9, step S91 can be first executed to obtain the gesture recognition setting accuracy. Next, step S92 can be executed to calculate the deviation between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image. Next, step S93 can be executed to obtain the user gesture and the corresponding recognition accuracy according to the deviation between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image. Next, step S94 can be executed to determine whether the user gesture is obtained and the corresponding recognition accuracy is greater than or equal to the gesture recognition setting accuracy. If so, step S95 can be finally executed to obtain the interaction instruction referred to by the user gesture according to the user gesture. By comparing the feature points, complex image direct comparison is replaced, and the accuracy of the comparison will not be lost.

[0114] See also Fig. 9 As shown, since the feature points are distributed in two-dimensional discrete manner, in order to quantify the degree of deviation between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image, the above step S92 can firstly perform step S921 to eliminate the sample comparison gesture image with different feature points in the user comparison gesture image during the specific implementation process. Next, step S922 can be performed to obtain the centroid of the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image. Next, step S923 can be performed to scale the sample comparison gesture image so that the maximum distance between the feature points in the user comparison gesture image and each sample comparison gesture image and their corresponding centroids are the same. Next, step S924 can be performed to rotate the feature points in the sample comparison gesture image with the feature points in the user comparison gesture image in the process of comparing the feature points in each sample comparison gesture image with the feature points in the user comparison gesture image, and the feature points in the sample comparison gesture image are rotated with their centroids as the rotation points. During the rotation process, the minimum value of the accumulated value of the distance difference between the feature points in the sample comparison gesture image and the corresponding feature points in the user comparison gesture image is obtained as the accumulated error value of the sample comparison gesture image. Finally, step S925 can be executed to take the ratio of the cumulative error value of each sample comparison gesture image to the sum of the cumulative error values ​​of all sample comparison gesture images as the deviation between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image, which represents the degree of inconsistency between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image.

[0115] In order to provide additional explanation for the implementation process of the above-mentioned steps S921 to S925, source codes of some functional modules are provided, and comparative explanations are provided in the comment section.

[0116] #include <vector>

[0117] #include <cmath>

[0118] struct Point {

[0119] double x;

[0120] double y;

[0121] };

[0122] using Gesture = std::vector <point>;

[0123] / / Calculate the center of mass

[0124] Point computeCentroid(const Gesture& gesture) {

[0125] Point centroid{0, 0};

[0126] for (const auto& point : gesture) {

[0127] centroid.x += point.x;

[0128] centroid.y += point.y;

[0129] }

[0130] centroid.x / = gesture.size();

[0131] centroid.y / = gesture.size();

[0132] return centroid;

[0133] }

[0134] / / Calculate the distance between two points

[0135] double computeDistance(const Point& a, const Point& b) {

[0136] return std::sqrt(std::pow(ax - bx, 2) + std::pow(ay - by,2));

[0137] }

[0138] / / Calculate the maximum distance

[0139] double computeMaxDistance(const Gesture& gesture, const Point¢roid) {

[0140] double maxDistance = 0;

[0141] for (const auto& point : gesture) {

[0142] double distance = computeDistance(point, centroid);

[0143] if (distance > maxDistance) {

[0144] maxDistance = distance;

[0145] }

[0146] }

[0147] return maxDistance;

[0148] }

[0149] / / Zoom gesture

[0150] void scaleGesture(Gesture& gesture, double scale) {

[0151] for (auto& point : gesture) {

[0152] point.x *= scale;

[0153] point.y *= scale;

[0154] }

[0155] }

[0156] / / Calculate the rotated point

[0157] Point rotatePoint(const Point& point, double angle) {

[0158] return {point.x * cos(angle) - point.y * sin(angle),

[0159] point.x * sin(angle) + point.y * cos(angle)};

[0160] }

[0161] / / Calculate the gesture after rotation

[0162] Gesture rotateGesture(const Gesture& gesture, double angle) {

[0163] Gesture rotatedGesture;

[0164] for (const auto& point : gesture) {

[0165] rotatedGesture.push_back(rotatePoint(point, angle));

[0166] }

[0167] return rotatedGesture;

[0168] }

[0169] / / Calculate the deviation

[0170] double computeDeviation(const Gesture& userGesture, const Gesture&sampleGesture) {

[0171] / / Eliminate samples with different number of feature points

[0172] if (userGesture.size() != sampleGesture.size()) {

[0173] return 1.0;

[0174] }

[0175] / / Get the centroid

[0176] Point userCentroid = computeCentroid(userGesture);

[0177] Point sampleCentroid = computeCentroid(sampleGesture);

[0178] / / Calculate the maximum distance

[0179] double userMaxDistance = computeMaxDistance(userGesture,userCentroid);

[0180] double sampleMaxDistance = computeMaxDistance(sampleGesture,sampleCentroid);

[0181] / / Scale samples

[0182] double scale = userMaxDistance / sampleMaxDistance;

[0183] Gesture scaledSampleGesture = sampleGesture;

[0184] scaleGesture(scaledSampleGesture, scale);

[0185] / / Calculate the cumulative error value

[0186] double minSumOfDistance = std::numeric_limits <double>::max();

[0187] for (double angle = 0; angle < 2 * M_PI; angle += M_PI / 180) {

[0188] Gesture rotatedSampleGesture = rotateGesture(scaledSampleGesture, angle);

[0189] double sumOfDistance = 0;

[0190] for (std::size_t i = 0; i < userGesture.size(); ++i) {

[0191] sumOfDistance += computeDistance(userGesture[i],rotatedSampleGesture[i]);

[0192] }

[0193] if (sumOfDistance < minSumOfDistance) {

[0194] minSumOfDistance = sumOfDistance;

[0195] }

[0196] }

[0197] / / Calculate the deviation

[0198] double deviation = minSumOfDistance / (userGesture.size() *userMaxDistance);

[0199] return deviation;

[0200] }

[0201] The above code first defines the data structure of the gesture, and then implements the functions of calculating the centroid, calculating the distance between two points, calculating the maximum distance, scaling the gesture, calculating the rotated point, calculating the rotated gesture, and calculating the deviation. In the function of calculating the deviation, samples with different numbers of feature points are first eliminated, then the centroid of the user gesture and the sample gesture is obtained, the maximum distance is calculated, the sample gesture is scaled, and then the minimum value of the accumulated error value is calculated in the process of rotating the sample gesture, and this value is used to calculate the deviation.

[0202] See also Fig.10 As shown, the low deviation between the feature points in a single user comparison gesture image and the feature points in each sample comparison gesture image does not mean that the comparison is consistent, and the distribution of all deviation values ​​needs to be considered. Specifically, in the specific implementation process of the above-mentioned step S93, step S931 can be first executed to take the ratio of the deviation corresponding to the feature point in each sample comparison gesture image to the sum of the deviations corresponding to the feature points in all sample comparison gesture images as the recognition error rate of each sample comparison gesture image. Next, step S932 can be executed to obtain the sample comparison gesture image with the highest recognition accuracy based on the recognition error rate of each sample comparison gesture image. Finally, step S933 can be executed to obtain the user gesture and the corresponding recognition accuracy based on the gesture corresponding to the sample comparison gesture image with the highest recognition accuracy. In this way, multiple deviations with small values ​​can be avoided, and the sample comparison gesture image corresponding to one of the smallest deviations is used as the comparison selected target.

[0203] In order to provide additional explanation for the implementation process of the above-mentioned steps S931 to S933, source codes of some functional modules are provided, and comparative explanations are provided in the comment section.

[0204] #include <vector>

[0205] #include <string>

[0206] #include <map>

[0207] struct GestureSample {

[0208] std::string name; / / Name of the sample gesture

[0209] Gesture gesture; / / Feature points of sample gesture

[0210] };

[0211] / / Calculate the recognition error rate of each sample

[0212] std::map<std::string, double> computeErrorRates(const Gesture&userGesture, const std::vector <gesturesample>& samples) {

[0213] std::map<std::string, double> errorRates;

[0214] double sumOfDeviations = 0;

[0215] / / Calculate the deviation of each sample and accumulate

[0216] for (const auto& sample : samples) {

[0217] double deviation = computeDeviation(userGesture,sample.gesture);

[0218] errorRates[sample.name] = deviation;

[0219] sumOfDeviations += deviation;

[0220] }

[0221] / / Calculate the recognition error rate of each sample

[0222] for (auto& [name, errorRate] : errorRates) {

[0223] errorRate / = sumOfDeviations;

[0224] }

[0225] return errorRates;

[0226] }

[0227] / / Find the sample gesture with the highest recognition accuracy

[0228] std::pair<std::string, double> findBestMatch(const std::map<std::string, double> & errorRates) {

[0229] std::string bestMatchName;

[0230] double minErrorRate = std::numeric_limits <double>::max();

[0231] for (const auto& [name, errorRate] : errorRates) {

[0232] if (errorRate < minErrorRate) {

[0233] bestMatchName = name;

[0234] minErrorRate = errorRate;

[0235] }

[0236] }

[0237] / / Convert the error rate to recognition accuracy

[0238] double accuracy = 1.0 - minErrorRate;

[0239] return {bestMatchName, accuracy};

[0240] }

[0241] The code first defines the data structure of gesture samples, and then implements the function of calculating the recognition error rate of each sample and the function of finding the sample gesture with the highest recognition accuracy. In the function of calculating the error rate, the code first calculates the deviation of each sample, accumulates it, and then calculates the recognition error rate of each sample. In the function of finding the best match, the code traverses all samples, finds the sample with the lowest error rate, and then converts its error rate into recognition accuracy. This process simulates a basic gesture recognition process, which needs to be optimized and improved according to specific application scenarios and requirements.

[0242] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in reverse order sometimes, depending on the functions involved.

[0243] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware that performs the corresponding function or action, such as a circuit or ASIC (Application Specific Integrated Circuit), or can be implemented by a combination of hardware and software, such as firmware.

[0244] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0245] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.< / double> < / gesturesample> < / map> < / string> < / vector> < / double> < / point> < / cmath> < / vector> < / mat> < / mat> < / int> < / mat> < / algorithm> < / vector>

Claims

1. An interactive method, characterized in that: include, Get hand gestures and corresponding interaction instructions; Obtain sample gesture images of each gesture at multiple shooting angles; According to the grayscale gradient of each pixel point in each sample gesture image on the plane, pixels within different gradient ranges are extracted to generate a series of sample comparison gesture images; Marking the relative position distribution between feature points in each of the sample comparison gesture images; Summarize the relative position distribution between the feature points in the series of samples corresponding to each gesture and compare them in the gesture image; During the interaction, the user's hand image is collected in real time; According to the gradient of the grayscale of each pixel point in the user's hand image on the plane, pixels within different gradient ranges are extracted sequentially from low to high, and a series of user comparison gesture images are generated one by one until the interaction instruction indicated by the user's gesture is identified; Obtaining the relative position distribution between feature points in each of the user's comparison gesture images; Comparing the relative position distribution between the feature points in the user comparison gesture image with the relative position distribution between the feature points in the series of sample comparison gesture images corresponding to each gesture, to obtain the interaction instruction indicated by the user gesture; The step of comparing the relative position distribution between feature points in the user comparison gesture image with the relative position distribution between feature points in the series of sample comparison gesture images corresponding to each gesture to obtain the interaction instruction indicated by the user gesture includes: Get the gesture recognition setting accuracy; Calculate and obtain the deviation between the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images; Acquire the user gesture and the corresponding recognition accuracy rate according to the deviation between the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images; Determine whether the user gesture is obtained and the corresponding recognition accuracy is greater than or equal to the gesture recognition set accuracy; If so, the interaction instruction indicated by the user gesture is obtained according to the user gesture.

2. The method according to claim 1, characterized in that The step of extracting pixels within different gradient ranges to generate a series of sample comparison gesture images according to the gradient of the grayscale of each pixel in each sample gesture image on a plane includes: For each sample gesture image, Obtaining the maximum grayscale gradient value of the grayscale gradient of the pixels in the sample gesture image, uniformly selecting a plurality of critical grayscale gradient values ​​within the maximum grayscale gradient value range, Extract and arrange the pixel points of the sample gesture image within each critical grayscale gradient value to obtain a sample comparison gesture image corresponding to each critical grayscale gradient value; The sample comparison gesture images generated by each sample gesture image within each critical grayscale gradient value range are combined to obtain a series of sample comparison gesture images.

3. The method according to claim 2, characterized in that The step of combining the sample comparison gesture images generated by each sample gesture image within each critical grayscale gradient value range to obtain a series of sample comparison gesture images includes: The sample comparison gesture images having the same critical grayscale gradient value range are classified into the same comparison pool, The plurality of comparison pools are arranged in ascending order according to the corresponding critical gray gradient values, Performing comparison according to the arrangement order among the plurality of comparison pools; A series of sample comparison gesture images are obtained according to the arrangement and combination of the sample comparison gesture images in the comparison pool.

4. The method according to claim 3, characterized in that The step of extracting pixels within different gradient ranges from low to high according to the gradient of the grayscale of each pixel in the user's hand image on the plane, and successively generating a series of user comparison gesture images until the interaction instruction indicated by the user's gesture is identified, include, Extracting pixel points within a corresponding range of the user hand image according to the minimum value among the plurality of critical grayscale gradient values ​​to generate the user comparison gesture image; Comparing the user comparison gesture image with a plurality of the sample comparison gesture images in the comparison pool corresponding to the critical gray gradient value with the smallest numerical value; Determining whether the interaction instruction indicated by the user gesture is recognized; If yes, the comparison is completed; If not, then updating and generating the user comparison gesture image in order of the plurality of critical grayscale gradient values ​​from small to large; The updated user comparison gesture image is compared with a plurality of the sample comparison gesture images in the comparison pool corresponding to the critical grayscale gradient value until the interaction instruction indicated by the user gesture is identified.

5. The method according to claim 1, characterized in that The step of calculating and obtaining the deviation between the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images, include, Eliminate the sample comparison gesture image that has a different number of feature points from the user comparison gesture image; Obtaining the centroid of the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images; Scaling the sample comparison gesture image so that the maximum distance between the feature point and its corresponding centroid in the user comparison gesture image and each of the sample comparison gesture images is the same; In the process of comparing the feature points in each of the sample comparison gesture images with the feature points in the user comparison gesture image, the feature points in the sample comparison gesture image are rotated with their centroid as the rotation point, and during the rotation process, the minimum value of the accumulated distance difference between the feature points in the sample comparison gesture image and the corresponding feature points in the user comparison gesture image is obtained as the accumulated error value of the sample comparison gesture image; The ratio of the accumulated error value of each sample comparison gesture image to the sum of the accumulated error values ​​of all the sample comparison gesture images is used as the deviation between the feature point in the user comparison gesture image and the feature point in each sample comparison gesture image.

6. The method according to claim 1, characterized in that The step of obtaining the user gesture and the corresponding recognition accuracy rate according to the deviation between the feature points in the user comparison gesture image and the feature points in each sample comparison gesture image, include, The ratio of the deviation corresponding to the feature point in each of the sample comparison gesture images to the sum of the deviations corresponding to the feature points in all of the sample comparison gesture images is used as the recognition error rate of each of the sample comparison gesture images; Obtaining the sample comparison gesture image with the highest recognition accuracy rate according to the recognition error rate of each sample comparison gesture image; The sample with the highest recognition accuracy is compared with the gesture corresponding to the gesture image to obtain the user gesture and the corresponding recognition accuracy.

7. An interactive method, characterized in that: include, Obtaining an interaction instruction indicated by a user gesture in an interaction method according to any one of claims 1 to 6; The interaction instruction is sent.

8. An interactive method, characterized in that: include, Receive an interaction instruction in an interaction method as described in claim 7.

9. A sand table display system based on gesture control, characterized in that: include, A gesture template building unit, used to obtain hand gestures and corresponding interaction instructions; Obtain sample gesture images of each gesture at multiple shooting angles; According to the grayscale gradient of each pixel point in each sample gesture image on the plane, pixels within different gradient ranges are extracted to generate a series of sample comparison gesture images; Marking the relative position distribution between feature points in each of the sample comparison gesture images; Summarize and obtain the relative position distribution between the feature points in the series of gesture images corresponding to each gesture; An image acquisition unit, used for acquiring a user's hand image in real time; A recognition unit, configured to extract pixels within different gradient ranges from low to high according to the gradient of the grayscale of each pixel in the user's hand image on the plane, and successively generate a series of user comparison gesture images until the interaction instruction indicated by the user's gesture is recognized; Obtaining the relative position distribution between feature points in each of the user's comparison gesture images; Comparing the relative position distribution between the feature points in the user comparison gesture image with the relative position distribution between the feature points in the series of sample comparison gesture images corresponding to each gesture, to obtain the interaction instruction indicated by the user gesture; A command sending unit, used to obtain the interaction command indicated by the user's gesture; Sending the interactive instruction to an instruction receiving unit; An instruction receiving unit, used for receiving an interaction instruction; Control the sandbox to display according to the interactive instructions; The step of comparing the relative position distribution between feature points in the user comparison gesture image with the relative position distribution between feature points in the series of sample comparison gesture images corresponding to each gesture to obtain the interaction instruction indicated by the user gesture includes: Get the gesture recognition setting accuracy; Calculate and obtain the deviation between the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images; Acquire the user gesture and the corresponding recognition accuracy rate according to the deviation between the feature points in the user comparison gesture image and the feature points in each of the sample comparison gesture images; Determine whether the user gesture is obtained and the corresponding recognition accuracy is greater than or equal to the gesture recognition set accuracy; If so, the interaction instruction indicated by the user gesture is obtained according to the user gesture.