Motion detection method and device, electronic device, and computer-readable storage medium

Through image processing technology and tracking algorithms, the problem of insufficient accuracy and speed of existing motion detection systems is solved, and more accurate and fast motion detection is achieved, suitable for a variety of motion scenarios.

CN112292688BActive Publication Date: 2024-11-26焦旭
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202080001060.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-02
Publication Date
2024-11-26
Estimated Expiration
2040-06-02

Smart Images

  • Figure CN112292688B_ABST
    Figure CN112292688B_ABST
Patent Text Reader

Abstract

The present invention relates to a motion detection method and device, an electronic device and a computer-readable storage medium, the motion detection method comprising: photographing the motion of a detected person to form a picture frame sequence, the detected person wearing a calibration component; detecting the calibration component in the picture frame sequence to obtain the position information of the calibration component; tracking the calibration component in the picture frame sequence according to a tracking algorithm; and determining the moving distance of the calibration component. According to the motion detection method and device, the electronic device and the computer-readable storage medium of the present invention, more accurate and faster target detection, tracking and measurement can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of detection equipment, and in particular relates to a motion detection method and device, an electronic device and a computer-readable storage medium. Background Art

[0002] Distance measurement exists in all aspects of human life and plays a very important role in human progress and development. The social development of human beings has promoted the development and improvement of distance measurement technology. With the development of human society, the theory of distance measurement technology has become more complete, from the most primitive estimation to the production of measuring tools to the birth of modern high-tech measuring instruments. There are many distance measurement methods, which can be divided into two types based on whether there is contact: contact measurement and non-contact measurement. Non-contact measurement does not require contact with the measured surface, and generally obtains the final measured distance through optical, electrical, imaging and other technologies. Contact measurement has high distance measurement accuracy and good stability, but it is not widely used due to factors such as volume, mass, installation conditions, structure and inconvenient operation; although non-contact measurement is not as accurate and stable as contact measurement, it has the advantages of high degree of automation, fast measurement speed, rich information and large dynamic range, and has gradually attracted people's attention. Especially with the rapid development of technology, non-contact measurement has approached contact measurement in terms of measurement accuracy and stability. A commonly used method in non-contact measurement is image measurement. Image measurement is a measurement method that uses an image acquisition device to acquire an image, and then uses image processing technology to process the image to obtain the final distance measurement result. This method has no special requirements for the measuring tool and the object being measured, and is more suitable for applications where traditional contact measurement cannot be implemented.

[0003] Distance measurement can be applied to all aspects of life, especially in human motion scenes, where it is often necessary to detect, track and measure body movements, such as the detection, tracking and measurement of cardiopulmonary resuscitation operation detection scenes, as well as the detection, tracking and measurement of various limb movement scenes such as fitness and rehabilitation, such as sports scoring (gymnastics, etc.), fitness (such as rapid pedaling on the spot and detecting its frequency inflection point), rehabilitation, body function measurement, dance, playing the violin (such as violin), and drumming.

[0004] Although there are some motion detection systems and methods in the prior art, the accuracy and speed of these motion detection systems and methods need to be further improved. Summary of the invention

[0005] The present invention provides a motion detection method and device, an electronic device and a computer-readable storage medium, which can further improve the accuracy and speed of motion detection, and the provided method and device can be applied to various motion detection scenarios.

[0006] According to a first aspect of the present invention, there is provided a motion detection method, comprising:

[0007] Capturing the movement of a subject to form a sequence of picture frames, wherein the subject wears a calibration component;

[0008] Detecting the calibration component in the picture frame sequence to obtain position information of the calibration component;

[0009] Tracking the calibration component in the sequence of picture frames according to a tracking algorithm; and

[0010] The movement distance of the calibration component is measured.

[0011] According to a second aspect of the present invention, there is provided a motion detection device, comprising:

[0012] A shooting module, used for shooting the movement of a detected person to form a sequence of picture frames, wherein the detected person wears a calibration component;

[0013] A detection module, used to detect the calibration component in the picture frame sequence and obtain position information of the calibration component;

[0014] a tracking module, configured to track the calibration component in the picture frame sequence according to a tracking algorithm; and

[0015] The measuring module is used to measure the moving distance of the calibration component.

[0016] According to a third aspect of the present application, an electronic device is provided, including:

[0017] processor;

[0018] A memory storing a computer program, which, when executed by the processor, enables the processor to execute the method described in the first aspect.

[0019] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes the method described in the first aspect.

[0020] According to the motion detection method and device, electronic device and computer-readable storage medium of the present invention, through the process of motion target detection, by detecting the target color and the object in motion, the position of the marker component can be roughly identified. After the expansion corrosion and connected domain screening processing, the noise and interference in the image can be removed. Then, through edge detection and corresponding transformation of the extracted edges, the marker component can be accurately identified and the position information of the marker component can be obtained. Finally, after obtaining the position information of the marker, tracking and distance measurement are performed. The motion detection device of the present invention can achieve more accurate and faster target detection, tracking and measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic diagram of a motion detection auxiliary system according to an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of a calibration component according to an embodiment of the present invention;

[0023] Figure 3 is a flow chart of a motion detection method according to an embodiment of the present invention;

[0024] Figure 4 According to one embodiment of the present invention Figure 3 The flowchart of step S32 shown;

[0025] Figure 5 is a flow chart of moving target detection according to an embodiment of the present invention;

[0026] Figure 6 is a flow chart of moving target detection according to another embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of a square marking component according to an embodiment of the present invention;

[0028] Figure 8 is a schematic diagram of the up and down movement of a marking component according to an embodiment of the present invention;

[0029] Fig. 9 is a schematic diagram of a motion detection device according to an embodiment of the present invention;

[0030] Fig.10 According to one embodiment of the present invention Fig. 9 A schematic diagram of the detection module 92 shown;

[0031] Fig.11 is a schematic diagram of a moving target detection module according to an embodiment of the present invention;

[0032] Fig.12is a schematic diagram of a moving target detection module according to another embodiment of the present invention. DETAILED DESCRIPTION

[0033] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present invention. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.

[0034] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.

[0035] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or can communicate with each other; it can be directly connected, or indirectly connected through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0036] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply means that the first feature is lower in level than the second feature.

[0037] The disclosure below provides many different embodiments or examples to realize different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplicity and clarity, which itself does not indicate the relationship between the various embodiments and / or settings discussed. In addition, the present invention provides various specific examples of processes and materials, but those of ordinary skill in the art can appreciate the application of other processes and / or the use of other materials.

[0038] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0039] like Figure 1 As shown, an embodiment of the present invention provides a motion detection auxiliary system. The motion detection auxiliary system includes a calibration component 100 and a detection terminal bracket 400. The motion detection auxiliary system cooperates with the detection terminal 200 to detect parameters during motion. The detection terminal 200 can be a smart device such as a mobile phone or iPad.

[0040] like Figure 2 As shown, the calibration component 100 for motion detection includes a fixing component 101 and a marking component 102. When exercising, the fixing component 101 is used to fix the calibration component 100 to the wrist, leg, waist, etc. of the athlete. The marking component 102 is arranged on the fixing component 101 and is formed into a pattern with predetermined size parameters, which serves as an optical beacon to facilitate identification in the video image of the calibration component 100. For example, the marking component 102 can be a LOGO. The marking component 102 includes a self-luminous structure and / or a reflective structure.

[0041] The figure formed by the marking component 102 and the size of the figure are pre-stored in the detection terminal to facilitate subsequent processing by the detection terminal. In this embodiment, the figure formed by the marking component 102 is a circle, the diameter of the circle is determined, and the diameter of the circle is pre-stored in the detection terminal. In another embodiment, the figure of the marking component 102 can be a rectangle or a square, and the side length of the rectangle or the square is pre-stored in the detection terminal. The figure of the marking component 102 can also be other specific shapes with a determined size.

[0042] According to an optional technical solution of the present invention, there are multiple marking components 102, which are sequentially arranged on the fixing component 101 to facilitate the recognition of the spatial posture of the calibration component 100. The multiple marking components 102 can also be set in different colors to improve the accuracy of spatial posture recognition.

[0043] The calibration component 100 may be a wristband, which is worn on the wrist of the athlete. The calibration component 100 may also be a device that can be fixed relative to the arm, such as a watch or an arm guard. For example, when performing cardiopulmonary resuscitation, the calibration component 100 is preferably worn on the wrist, because in this case the error between the movement distance of the wristband and the movement distance of the palm is minimal.

[0044] In accordance with Figure 1 In the system shown, the detection terminal 200 shoots the process of movement. There are many factors that affect the accuracy of ranging, among which the influence of hardware factors can be reduced by selecting high-resolution CCD (Charge Coupled Device) cameras, high-sampling frequency image acquisition cards and other high-quality hardware to reduce the limitations of various environmental factors. Because the styles of detection terminals (for example, mobile phones) are different, the method of improving the system's ranging accuracy through software algorithms is relatively the most effective way. The detection terminal 200 shoots the process of movement to obtain video input. In order to perform target detection, target tracking and distance measurement on the calibration component 100, it is first necessary to convert the video input into a single-frame picture so that the video input becomes a picture frame sequence. In an optional embodiment, in order to extract the target in a simple and efficient way, the RGB (Red Green Blue) color space is converted into the HSV (Hue, Saturation, Value) color space to facilitate color screening and extraction. Compared with the RGB color space used in normal pictures, the description method of the HSV color space is closer to the recognition method of the human eye, which can better describe the color and brightness. In addition, due to the complexity of the target background and the presence of rich colors, multiple targets appear during segmentation, resulting in the inability to locate the image and corner detection errors. The H of the HSV space model can be represented by a circle.

[0045] According to one aspect of the present invention, a motion detection method is provided. Figure 3 As shown, the method comprises the following steps:

[0046] Step S31, photographing the movement of the detected person to form a sequence of picture frames, wherein the detected person wears a calibration component.

[0047] The detected person wears the calibration component, which may be a wristband, anklet, etc. After the detected person wears the calibration component, the detection terminal can capture the movement of the detected person to form a video input, and then convert the video input into a picture frame sequence to form a picture frame sequence.

[0048] Step S32: Detect the calibration component in the picture frame sequence to obtain position information of the calibration component.

[0049] After converting the video input into a sequence of picture frames, we first need to identify the position of the calibration component in the picture. After obtaining the position information of the calibration position, it is convenient to track the calibration component and measure the movement distance of the calibration component based on the tracking results. Figure 4 , Figure 5 and Figure 6 Step S32 will be described in more detail in the following.

[0050] Step S33: Track the calibration component in the picture frame sequence according to a tracking algorithm.

[0051] In order to ensure the speed of ranging, it is necessary to detect and track the calibration component. After obtaining the position information of the calibration component through step S32, since the calibration component is in a moving state, it is necessary to keep tracking the calibration component. Through the tracking algorithm, it is ensured that a good tracking effect is achieved when the target is only slightly deformed and moves quickly, and the trajectory of the movement of the calibration component can be extracted.

[0052] In a preferred embodiment, the tracking algorithm may include a KCF algorithm (Kernel Correlation Filter). The KCF algorithm has the following advantages: concise implementation, good effect, and fast speed. The problem is solved by generating a large number of samples through circulant matrix displacement, and the calculation speed in the frequency domain is extremely fast through the derivation of discrete Fourier transform. In the case of lack of samples, simple method detection is used to connect the kernel operation for tracking, which ensures the generalization ability of tracking.

[0053] Step S34, measuring the moving distance of the calibration component.

[0054] First, the detection terminal 200 knows in advance the predetermined size of the marking component 102 on the calibration component 100, and after capturing the marking component 102, the pixel value occupied by the marking component 102 is obtained. Then, in the process of tracking the calibration component, the position information of the extreme points during the movement of the calibration component is extracted. The position information of the extreme points includes the position information of the uppermost position and the lowermost position of the up and down movement, or includes the position information of the leftmost position and the rightmost position of the left and right movement. Of course, the position information of the extreme points can also include information on other extreme positions of movement. By taking the position information of the extreme points during the movement of the calibration component, the pixel value occupied by the calibration component during the movement is obtained, and then the movement distance of the calibration component is obtained based on the size of the marking component 102 and the pixel value occupied by the marking component 102. Figure 7 and Figure 8 Step S32 will be described in more detail in the following.

[0055] Figure 4 According to one embodiment of the present invention Figure 3 The flowchart of step S32 is shown in FIG. Figure 4 As shown, step S32 includes the following sub-steps:

[0056] Sub-step S41, performing moving target detection on the picture frame sequence.

[0057] Moving target detection is used to extract information about the calibration components in the picture frame. There are many moving target detection algorithms, including background subtraction, optical flow, and frame difference. In a preferred embodiment, the frame difference method is used to implement moving target detection. Figure 5 and Figure 6 As shown, it will be introduced in detail below.

[0058] In an optional embodiment, in order to reduce the amount of calculation, step S32 may further include the following sub-steps:

[0059] Sub-step S42, binarization processing is performed on the result after the moving target detection.

[0060] Through binarization, redundant information is filtered out and color information is processed into black and white, which can greatly reduce the amount of calculation.

[0061] In another optional embodiment, in order to reduce and filter out the noise interference of a small area other than the calibration component, step S32 may further include the following sub-steps:

[0062] Sub-step S43, performing expansion and corrosion processing on the result after the binarization processing; and

[0063] Sub-step S44, performing connected domain screening processing on the result after dilation and corrosion.

[0064] Among them, the size of the appropriate expansion corrosion can be set, and the area of ​​the connected domain screening can also be set, for example, the connected domains less than 300 pixels are screened out. After completing the screening of the moving target detection, the target of interest can be roughly obtained in the picture frame, including the marker component, but a small part of the interference cannot be excluded. Therefore, the specific position of the marker component will be identified according to the edge features of the marker component. Thus, step S32 includes:

[0065] Sub-step S45, performing edge detection processing on the result of the moving target detection. During the edge detection processing, the extracted edges include the edges of the calibration components.

[0066] In a specific embodiment, the algorithm for edge detection includes the Canny algorithm.

[0067] After edge detection, the extracted edges include the edges of the calibration component and may also include the edges of other objects that are not the calibration component. Therefore, in order to more accurately determine the position of the calibration component, step S32 includes:

[0068] Sub-step S46, according to the preset shape of the calibration component, the extracted edge is transformed accordingly, so as to obtain the position information of the calibration component.

[0069] For example, if the calibration component is a bracelet, then its preset shape is a rectangle. The corresponding transformation algorithm, such as Hough transformation, can be used to extract the straight line segments of the rectangle, thereby determining that the extracted edge is the edge of the bracelet. More specifically, a threshold value of the number of straight line segments is set, such as 2 or 3. When the number of straight line segments extracted by Hough transformation is greater than or equal to the threshold, it can be confirmed that the edge is the edge of the rectangle, that is, the edge of the bracelet is detected.

[0070] For another example, if the preset shape of the editing component is a circle or an ellipse, the circle or ellipse can be extracted through a corresponding transformation algorithm, such as another Hough transformation, so as to determine that the extracted edge is the edge of the marking component or a component of the edge.

[0071] When extracting the edge or component of the edge of the calibration component, a corresponding transformation algorithm is set according to the characteristics of the preset shape of the calibration component to extract the edge or component of the edge of the calibration component. The present invention does not limit the type of transformation algorithm to be used, as long as the transformation algorithm can extract and determine the edge of the calibration component.

[0072] After obtaining the edge of the marker component, the position information of the marker component can be known. For example, if the marker component is a bracelet, the position of the bracelet can be represented by coordinates [X, Y, H, W]. In a specific embodiment, X and Y represent the horizontal and vertical coordinates of the upper left corner of the bracelet rectangle, respectively, and H and W represent the height and width of the bracelet rectangle, respectively.

[0073] Figure 5 1 is a flow chart of moving target detection according to an embodiment of the present invention. For a picture frame sequence of a video input, two adjacent picture frames are selected (these two picture frames are preferably the first two adjacent picture frames of the picture frame sequence) for moving target detection. The moving target detection process includes:

[0074] Step S51: Acquire a first picture frame and a second picture frame that are adjacent to each other in the picture frame sequence.

[0075] Step S52: extracting target colors from the first picture frame and the second picture frame respectively.

[0076] The target color is the color of the marking component, and the target color is extracted to facilitate the detection of the marking component. The target color is preferably a color different from the human skin color, clothing, and video background, such as red or green.

[0077] Step S53: performing differential analysis on the target colors extracted from the first picture frame and the second picture frame to obtain a result of moving target detection.

[0078] Figure 6 is a flow chart of moving target detection according to another embodiment of the present invention. Figure 5 The difference is that, for the picture frame sequence of the video input, three adjacent picture frames are selected (these three picture frames are preferably the first three adjacent picture frames of the picture frame sequence) for moving target detection. The moving target detection process includes:

[0079] Step S61, obtaining a first picture frame, a second picture frame and a third picture frame that are adjacent to each other in the picture frame sequence.

[0080] Step S62: extract target colors from the first picture frame, the second picture frame and the third picture frame respectively.

[0081] The target color is the color of the marking component, and the target color is extracted to facilitate the detection of the marking component. The target color is preferably a color different from the human skin color, clothing, and video background, such as red or green.

[0082] Step S63: Differentiate the target color extracted from the first picture frame and the second picture frame to obtain a first difference result.

[0083] Step S64, performing a difference between the target color extracted from the second picture frame and the target color extracted from the third picture frame to obtain a second difference result.

[0084] There is no limitation on the execution order of step S63 and step S64. Step S63 can be executed before step S64, after step S64, or simultaneously with step S64.

[0085] Step S65: taking the intersection of the first differential result and the second differential result to obtain a moving target detection result.

[0086] Figure 6 The moving target detection process shown is relatively Figure 5 It can effectively reduce the noise in the image. Figure 5 and Figure 6 In light of the illustrated embodiments, those skilled in the art may conceive that, for a picture frame sequence of a video input, more adjacent picture frames may be selected for motion target detection, which are all within the scope of this application.

[0087] In addition, in a preferred embodiment, to ensure the reliability of tracking, after the number of tracked picture frames reaches a set number, it is necessary to perform the detection of the calibration component again to obtain the position information of the calibration component. Therefore, the motion detection method of the present invention may also include: obtaining the number of frames tracked by the picture frame sequence; and in response to the number of tracked frames reaching a preset value, performing the detection of the calibration component in the picture frame sequence of the video input again to obtain the position information of the calibration component, that is, performing step S32 or step S41 again.

[0088] Figure 7 and Figure 8 Determination of the distance traveled by the calibration component is described. Figure 7 As shown, the shape of the marking component 102 is a square as an example. The side length L of the marking component 102 is 2 cm. The detection terminal 200 determines that the first number of pixels corresponding to the side of the square in the video image of the calibration component 100 is 100, and the actual distance corresponding to the pixel in the video image of the calibration component 100 is 0.02 cm.

[0089] Take the implementation of cardiopulmonary resuscitation by movement as an example. During the implementation of cardiopulmonary resuscitation, the rescuer performs compression and when the calibration component 100 moves, the detection terminal 200 determines the upper limit image frame and the lower limit image frame from the video image of the calibration component. The second number of pixels corresponding to the movement distance of the calibration component is determined based on the upper limit image frame and the lower limit image frame.

[0090] like Figure 8As shown, when the calibration component 100 moves, the detection terminal 200 can identify the upper limit image frame and the lower limit image frame of a pressing operation from each image frame of the video image of the calibration component 100. The number of pixels between the upper limit position and the lower limit position of the marking component 102 in the upper limit image frame and the lower limit image frame is used as the second number of pixels corresponding to the moving distance of the calibration component 100.

[0091] When the first press is performed, the image frame in the image when the calibration component 100 does not move is used as the upper limit image frame of the first press; as the calibration component 100 moves downward, the pixels corresponding to the marking component 102 in the video image continue to move downward; when the detection terminal 200 recognizes that the pixels corresponding to the marking component 102 no longer move downward, the image frame at this time is used as the lower limit image frame of the first press. As the calibration component 100 moves upward, the second submodule of the processing module 202 recognizes that the pixels corresponding to the marking component 102 no longer move upward, and the image frame at this time is used as the upper limit image frame of the second press; then the calibration component 100 moves downward, and the detection terminal 200 recognizes that the pixels corresponding to the marking component 102 no longer move downward, and the image frame at this time is used as the lower limit image frame of the second press. In this way, the detection terminal 200 can identify the upper limit image frame and the lower limit image frame corresponding to each press. Through the upper limit image frame and the lower limit image frame, the second pixel number corresponding to the moving distance of the calibration component 100 during each press is determined. The detection terminal 200 determines the movement distance of the calibration component according to the actual distance corresponding to the pixels in the video image of the calibration component and the second pixel number.

[0092] For example, in one press, the detection terminal 200 determines that the second pixel number corresponding to the movement distance S of the calibration component 100 is 200, and the actual distance corresponding to the pixel in the video image of the calibration component is 0.02 cm, and the calculated movement distance S of the calibration component is 4 cm. 4 cm is taken as the pressing depth this time.

[0093] In actual scenarios, the normal of the marker component 102 on the calibration component may not point to the detection terminal 200, that is, the detection terminal 200 shoots the calibration component from an oblique direction. At this time, the processing module 202 can determine from which direction the detection terminal 200 shoots the calibration component 100 according to the image deformation of the marker component; according to the cosine relationship conversion of the corresponding angle, the detection terminal 200 determines the actual distance corresponding to the pixel in the video image of the calibration component. This design is mainly related to the fact that when a person wears the calibration component 100 for treatment, the plane where the marker component 102 of the calibration component 100 is located is not necessarily perpendicular to the direction of the connection between the calibration component 100 and the detection terminal 200. When it is not perpendicular, the marker component 102 detected by the detection terminal 200 will form a certain distortion. For example, when the marker component is originally circular, when the plane where the marker component of the calibration component is located is not perpendicular to the direction of the connection between the calibration component and the detection terminal, the detected marker component will appear elliptical. At this time, although the detection terminal knows the size of the marking component, for example, the diameter of the circle is 2cm, the major axis of the ellipse in the detected image is 2cm, while the minor axis is less than 2cm. At this time, the detection terminal 200 will identify the actual size of the marking component based on the graphics it actually photographed, for example, using the major axis of the ellipse to represent the diameter of the circle. In the case where the circle becomes an ellipse, it is relatively simple, but in the case of, for example, using rectangles, polygons, etc., the distortion will become complicated. For example, a rectangle includes long and short sides, and when it is not vertical, a parallelogram may be photographed. At this time, it is necessary to determine the angle between the plane where the rectangle is located and the connecting line (between the calibration component and the detection terminal) based on the angle between the two adjacent sides of the parallelogram, and then calculate the length of the physical object represented by each side of the photographed parallelogram according to the cosine relationship conversion, and then calculate the actual distance represented by each pixel in the pressing direction.

[0094] When the plane where the marking component 102 of the calibration component 100 is located is not perpendicular to the direction of the line connecting the calibration component 100 and the detection terminal 200, in addition to the above-mentioned detection terminal 200 correcting the distortion formed by the detected marking component 102 according to the specific shape of the marking component 102 to obtain the actual reference size of the marking component 102, the actual reference size of the marking component 102 can also be obtained by correcting the reference coordinate system in which the calibration component 100 and the detection terminal 200 are located.

[0095] In addition, regarding the accuracy of the distance measured by the detection terminal 200, on the one hand, the higher the definition of the camera used by the detection terminal 200 during the motion shooting, the smaller the accuracy loss, that is, the higher the accuracy; on the other hand, according to the following accuracy loss formula:

[0096]

[0097] Among them, ε eref and εpref They represent the error caused by edge selection during measurement and the error of the pixel itself, ε ereal and ε preal The error of the actual target distance to be measured and the error of the reference distance, respectively, ref and l real They represent the reference distance and the actual distance of the target to be measured, respectively. The reference distance represents the distance from the first set reference datum line of the calibration component 100 at the first extreme position point to the second set reference datum line of the calibration component 100 at the second extreme position point during the movement, while the actual distance of the target to be measured represents the distance from the first set reference datum line of the calibration component 100 at the first extreme position point to the first set reference datum line of the calibration component 100 at the second extreme position point during the movement. For example, for an up-and-down movement (such as cardiopulmonary resuscitation), the reference distance represents the distance from the upper edge of the calibration component 100 (such as a wristband) at the highest point of the movement to the lower edge of the calibration component 100 at the lowest point, while the actual distance of the target to be measured represents the distance from the upper edge of the calibration component 100 (such as a wristband) at the highest point of the movement to the upper edge of the calibration component 100 at the lowest point.

[0098] From the above formula, we can see that the larger the reference distance, the smaller the precision loss E will be. Therefore, we can know that the pixel value of the camera during shooting and the actual distance measurement will cause precision errors during the experiment. On the one hand, by using a high-definition camera, and on the other hand, by increasing the reference distance, the error in the experiment can be effectively reduced.

[0099] Although the above embodiment describes a specific algorithm in conjunction with cardiopulmonary resuscitation detection, the present solution is not limited to application in this scenario, but can also be applied to tracking and measuring limb and body movements, and further can be applied to motion detection in various limb movement scenarios such as fitness and rehabilitation, for example: sports scoring (gymnastics, etc.), fitness (for example, rapid pedaling on the spot and detecting its frequency inflection point), rehabilitation, body application function measurement, dance, playing a violin (such as a violin), playing drums, etc.

[0100] This solution can not only collect upper body movement data during cardiopulmonary resuscitation, but also collect human body training data in situ at ordinary times, such as calculating the frequency, number, depth and other indicators of rapid leg lifting and lowering in situ, push-ups, etc. The body parts that need to be exercised by the rehabilitator, such as arms, legs, and waist, are equipped with calibration devices, such as bracelets and leg rings, etc., and the mobile phone camera is used to shoot and monitor the movement process, monitor the movement amplitude, frequency, trajectory, etc., and can provide amplitude measurement records (resolution 2mm, accuracy 5mm), frequency records, trajectory drawing on video and other functions.

[0101] According to the motion detection method of the present invention, through the process of motion target detection, by detecting the target color and the object in motion, the position of the marker component can be roughly identified. After the expansion corrosion and connected domain screening processing, the noise and interference in the image can be removed. Then, by edge detection and corresponding transformation of the extracted edges, the marker component can be accurately identified and the position information of the marker component can be obtained. Finally, after obtaining the position information of the marker, tracking and distance measurement are performed. The motion detection method of the present invention can achieve more accurate and faster target detection, tracking and measurement.

[0102] According to another aspect of the present invention, a motion detection device is provided. Fig. 9 As shown, the device includes the following modules:

[0103] The shooting module 91 is used to shoot the movement of the detected person to form a sequence of picture frames. The detected person wears the calibration component.

[0104] The detected person wears the calibration component, which may be a wristband, anklet, etc. After the detected person wears the calibration component, the detection terminal can capture the movement of the detected person to form a video input, and then convert the video input into a picture frame sequence to form a picture frame sequence.

[0105] The detection module 92 is used to detect the calibration component in the picture frame sequence and obtain the position information of the calibration component.

[0106] After converting the video input into a sequence of picture frames, we first need to identify the position of the calibration component in the picture. After obtaining the position information of the calibration position, it is convenient to track the calibration component and measure the movement distance of the calibration component based on the tracking results. Fig.10 , Fig.11 and Fig.12 The detection module 92 will be described in more detail in .

[0107] The tracking module 93 is used to track the calibration component in the picture frame sequence according to a tracking algorithm.

[0108] In order to ensure the speed of ranging, it is necessary to detect and track the calibration component. After obtaining the position information of the calibration component through the detection module 92, since the calibration component is in a moving state, it is necessary to keep tracking the calibration component. Through the tracking algorithm, it is ensured that a good tracking effect is achieved when the target has only slight deformation and moves quickly, and the trajectory of the movement of the calibration component can be extracted.

[0109] In a preferred embodiment, the tracking algorithm may include a KCF algorithm (Kernel Correlation Filter). The KCF algorithm has the following advantages: concise implementation, good effect, and fast speed. The problem is solved by generating a large number of samples through circulant matrix displacement, and the calculation speed in the frequency domain is extremely fast through the derivation of discrete Fourier transform. In the case of lack of samples, simple method detection is used to connect the kernel operation for tracking, which ensures the generalization ability of tracking.

[0110] The measuring module 94 is used to measure the moving distance of the calibration component.

[0111] First, the detection terminal 200 knows in advance the predetermined size of the marking component 102 on the calibration component 100, and after capturing the marking component 102, the pixel value occupied by the marking component 102 is obtained. Then, in the process of tracking the calibration component, the position information of the extreme point during the movement of the calibration component is extracted. The position information of the extreme point includes the position information of the uppermost position and the lowermost position of the up-down movement, or includes the position information of the leftmost position and the rightmost position of the left-right movement. Of course, the position information of the extreme point can also include information of other extreme positions of movement. By taking the position information of the extreme point during the movement of the calibration component, the pixel value occupied during the movement of the calibration component is obtained, and then the movement distance of the calibration component is obtained according to the size of the marking component 102 and the pixel value occupied by the marking component 102.

[0112] Fig.10 According to one embodiment of the present invention Fig. 9 Schematic diagram of the detection module 92 shown. Fig.10 As shown, the detection module 92 includes the following units:

[0113] The moving object detection unit 101 is used to perform moving object detection on the picture frame sequence.

[0114] Moving target detection is used to extract information about the calibration components in the picture frame. There are many moving target detection algorithms, including background subtraction, optical flow, and frame difference. In a preferred embodiment, the frame difference method is used to implement moving target detection. Fig.11 and Fig.12 As shown, it will be introduced in detail below.

[0115] In an optional embodiment, in order to reduce the amount of calculation, the detection module 92 may further include the following units:

[0116] The binarization processing unit 102 is used to perform binarization processing on the result after the moving target detection.

[0117] Through binarization, redundant information is filtered out and color information is processed into black and white, which can greatly reduce the amount of calculation.

[0118] In another optional embodiment, in order to reduce and filter out the noise interference of a small area other than the calibration component, the detection module 92 may further include the following units:

[0119] The expansion and corrosion processing unit 103 is used to perform expansion and corrosion processing on the result after the binarization processing; and

[0120] The connected domain screening processing unit 104 is used to perform connected domain screening processing on the result after the expansion and corrosion.

[0121] Among them, the size of the appropriate expansion erosion can be set, and the area for connected domain screening can also be set, for example, connected domains smaller than 300 pixels can be screened out.

[0122] After completing the screening of moving target detection, the target of interest can be roughly obtained in the picture frame, including the marker component, but a small part of interference cannot be eliminated. Therefore, the specific position of the marker component will be identified based on the edge features of the marker component. Therefore, the detection module 92 includes:

[0123] The edge processing unit 105 is used to perform edge detection processing on the result of the moving target detection. During the edge detection processing, the extracted edges include the edges of the calibration components.

[0124] In a specific embodiment, the algorithm for edge detection includes the Canny algorithm. After edge detection processing, the extracted edge includes the edge of the calibration component and may also include the edge of other objects that are not the calibration component. Therefore, in order to more accurately determine the position of the calibration component, the detection module 92 includes:

[0125] The edge transformation unit 106 is used to transform the extracted edge accordingly according to the preset shape of the calibration component, so as to obtain the position information of the calibration component.

[0126] For example, if the calibration component is a bracelet, then its preset shape is a rectangle. The corresponding transformation algorithm, such as Hough transformation, can be used to extract the straight line segments of the rectangle, thereby determining that the extracted edge is the edge of the bracelet. More specifically, a threshold value of the number of straight line segments is set, such as 2 or 3. When the number of straight line segments extracted by Hough transformation is greater than or equal to the threshold, it can be confirmed that the edge is the edge of the rectangle, that is, the edge of the bracelet is detected.

[0127] For another example, if the preset shape of the editing component is a circle or an ellipse, the circle or ellipse can be extracted through a corresponding transformation algorithm, such as another Hough transformation, so as to determine that the extracted edge is the edge of the marking component or a component of the edge.

[0128] When extracting the edge or component of the edge of the calibration component, a corresponding transformation algorithm is set according to the characteristics of the preset shape of the calibration component to extract the edge or component of the edge of the calibration component. The present invention does not limit the type of transformation algorithm to be used, as long as the transformation algorithm can extract and determine the edge of the calibration component.

[0129] After obtaining the edge of the marker component, the position information of the marker component can be known. For example, if the marker component is a bracelet, the position of the bracelet can be represented by coordinates [X, Y, H, W]. In a specific embodiment, X and Y represent the horizontal and vertical coordinates of the upper left corner of the bracelet rectangle, respectively, and H and W represent the height and width of the bracelet rectangle, respectively.

[0130] Fig.11 Schematic diagram of a moving target detection module according to an embodiment of the present invention. For a picture frame sequence of a video input, two adjacent picture frames are selected (these two picture frames are preferably the first two adjacent picture frames of the picture frame sequence) for moving target detection. The moving target detection unit includes:

[0131] The first picture frame acquisition subunit 111 is configured to acquire a first picture frame and a second picture frame that are adjacent to each other in the picture frame sequence.

[0132] The first color extraction subunit 112 is configured to extract target colors from the first picture frame and the second picture frame respectively.

[0133] The target color is the color of the marking component, and the target color is extracted to facilitate the detection of the marking component. The target color is preferably a color different from the human skin color, clothing, and video background, such as red or green.

[0134] The first differential subunit 113 is used to perform differential operation on the target color extracted from the first picture frame and the second picture frame to obtain a result of moving target detection.

[0135] Fig.12 is a schematic diagram of a moving target detection module according to an embodiment of the present invention. Fig.11 The difference is that, for the picture frame sequence of the video input, three adjacent picture frames are selected (these three picture frames are preferably the first three adjacent picture frames of the picture frame sequence) for moving target detection. The moving target detection unit includes:

[0136] The second picture frame acquisition subunit 121 is used to acquire the adjacent first picture frame, second picture frame and third picture frame in the picture frame sequence.

[0137] The second color extraction subunit 122 is used to extract target colors from the first picture frame, the second picture frame and the third picture frame respectively.

[0138] The target color is the color of the marking component, and the target color is extracted to facilitate the detection of the marking component. The target color is preferably a color different from the human skin color, clothing, and video background, such as red or green.

[0139] The second differential subunit 123 is used to differentiate the target color extracted from the first picture frame and the second picture frame to obtain a first differential result.

[0140] The third differential subunit 124 is used to perform differential analysis on the target color extracted from the second picture frame and the third picture frame to obtain a second differential result.

[0141] The intersection subunit 125 is used to intersect the first difference result and the second difference result to obtain a result of moving target detection.

[0142] Fig.12 The moving target detection process shown is relatively Fig.11 It can effectively reduce the noise in the image. Fig.11 and Fig.12 In light of the illustrated embodiments, those skilled in the art may conceive that, for a picture frame sequence of a video input, more adjacent picture frames may be selected for motion target detection, which are all within the scope of this application.

[0143] In addition, in a preferred embodiment, to ensure the reliability of tracking, after the number of tracked picture frames reaches a set number, it is necessary to perform the detection of the calibration component again to obtain the position information of the calibration component. Therefore, the motion detection device of the present invention may also include: an acquisition module, which is used to obtain the number of frames tracked by the picture frame sequence. In this way, after the number of tracked frames reaches a preset value, the detection module 92 performs the detection of the calibration component in the picture frame sequence of the video input again to obtain the position information of the calibration component.

[0144] According to the motion detection device of the present invention, through the process of motion target detection, by detecting the target color and the object in motion, the position of the marker component can be roughly identified. After the expansion corrosion and connected domain screening processing, the noise and interference in the image can be removed. Then, through edge detection and corresponding transformation of the extracted edges, the marker component can be accurately identified and the position information of the marker component can be obtained. Finally, after obtaining the position information of the marker, tracking and distance measurement are performed. The motion detection device of the present invention can achieve more accurate and faster target detection, tracking and measurement.

[0145] According to another aspect of the present application, an electronic device is provided, which includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the motion detection method as described in any one of the above embodiments.

[0146] According to another aspect of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, and when the instructions are executed by a processor, the processor can execute the motion detection method as described in any of the above embodiments. Specifically, the motion detection method includes: photographing the motion of a detected person to form a picture frame sequence, wherein the detected person wears a calibration component; detecting the calibration component in the picture frame sequence to obtain position information of the calibration component; tracking the calibration component in the picture frame sequence according to a tracking algorithm; and determining the movement distance of the calibration component.

[0147] Among them, the detecting of the calibration component in the picture frame sequence and obtaining the position information of the calibration component includes: performing motion target detection on the picture frame sequence; performing edge detection processing on the result of the motion target detection, during which the extracted edge includes the edge of the calibration component; and performing corresponding transformation on the extracted edge according to the preset shape of the calibration component, so as to obtain the position information of the calibration component.

[0148] Among them, the motion target detection on the picture frame sequence includes: obtaining the adjacent first picture frame and second picture frame in the picture frame sequence; extracting target colors from the first picture frame and the second picture frame respectively; and differentiating the target colors extracted from the first picture frame and the second picture frame to obtain the result of motion target detection.

[0149] Among them, the moving target detection on the picture frame sequence includes: obtaining the adjacent first picture frame, second picture frame and third picture frame in the picture frame sequence; extracting target colors from the first picture frame, second picture frame and third picture frame respectively; differentiating the target colors extracted from the first picture frame and the second picture frame to obtain a first differential result; differentiating the target colors extracted from the second picture frame and the third picture frame to obtain a second differential result; taking the intersection of the first differential result and the second differential result to obtain the result of moving target detection.

[0150] The detecting of the calibration components in the picture frame sequence of the video input and obtaining the position information of the calibration components further comprises: binarizing the result after the motion target detection.

[0151] The detecting of the calibration components in the picture frame sequence of the video input and obtaining the position information of the calibration components further comprises: performing expansion and corrosion processing on the result after the binarization processing; and performing connected domain screening processing on the result after the expansion and corrosion.

[0152] Wherein, the tracking algorithm includes a KCF algorithm, the edge detection processing includes using a canny algorithm, and / or the moving target detection includes a background subtraction method, an optical flow method and a frame difference method.

[0153] Furthermore, the motion detection method also includes: obtaining the number of frames tracked by the picture frame sequence; and in response to the number of tracked frames reaching a preset value, again executing the detection of the calibration components in the picture frame sequence of the video input to obtain the position information of the calibration components.

[0154] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through its communication components, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0155] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0156] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a search unit, and a sending unit. The names of these units do not constitute a limitation on the units themselves in some cases. For example, the receiving unit may also be described as a "unit that receives a user request for obtaining blockchain account address information."

[0158] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the device executes the above method.

[0159] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention. Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A motion detection method, comprising: The movement of the detected person is photographed to form a sequence of picture frames. The detected person wears a calibration component, the calibration component includes a fixing component and a marking component, the marking component is arranged on the fixing component and is formed into a pattern with a predetermined size parameter, and the marking component has a target color; Detecting the calibration component in the picture frame sequence to obtain position information of the calibration component; Tracking the calibration component in the sequence of picture frames according to a tracking algorithm; as well as The moving distance of the calibration component is determined by knowing in advance the predetermined size of the marking component on the calibration component and obtaining the pixel value occupied by the marking component after capturing the marking component; in the process of tracking the calibration component, the position information of the extreme points of the calibration component during movement is extracted; by obtaining the position information of the extreme points during movement of the calibration component, the pixel value occupied by the calibration component during movement is obtained; and then the movement distance of the calibration component is obtained according to the size of the marking component and the pixel value occupied by the marking component, wherein, when the detection terminal shoots the calibration component from an oblique direction, the processing module determines the direction in which the detection terminal shoots the calibration component according to the image deformation of the marking component, and according to the cosine relationship conversion of the corresponding angle, the detection terminal determines the actual distance corresponding to the pixel in the video image of the calibration component.

2. The method according to claim 1, in, The detecting the calibration component in the picture frame sequence and obtaining the position information of the calibration component comprises: Performing moving target detection on the picture frame sequence; Performing edge detection processing on the result of the moving target detection, during which the extracted edge includes the edge of the calibration component; as well as According to the preset shape of the calibration component, the extracted edge is transformed accordingly, so as to obtain the position information of the calibration component.

3. The method according to claim 2, in, The performing moving target detection on the picture frame sequence comprises: Acquire a first picture frame and a second picture frame that are adjacent to each other in the picture frame sequence; Extracting target colors from the first picture frame and the second picture frame respectively; The target colors extracted from the first picture frame and the second picture frame are differentiated to obtain a result of moving target detection.

4. The method according to claim 2, in, The performing moving target detection on the picture frame sequence comprises: Acquire a first picture frame, a second picture frame and a third picture frame that are adjacent to each other in the picture frame sequence; Extracting target colors from the first picture frame, the second picture frame, and the third picture frame respectively; Differencing the target color extracted from the first picture frame and the second picture frame to obtain a first difference result; Differencing the target color extracted from the second picture frame and the third picture frame to obtain a second difference result; The first difference result and the second difference result are intersected to obtain a result of moving target detection.

5. The method according to claim 2, detecting the calibration component in the picture frame sequence of the video input, and obtaining the position information of the calibration component further comprises: The result after the moving target detection is binarized.

6. The method according to claim 5, wherein detecting the calibration component in the picture frame sequence of the video input and obtaining the position information of the calibration component further comprises: Performing expansion and corrosion processing on the result after binarization processing; and The connected domains are screened for the results after expansion and corrosion.

7. The method according to claim 2, in, The tracking algorithm includes a KCF algorithm, The edge detection process includes using a canny algorithm, and / or The moving target detection includes background subtraction method, optical flow method and frame difference method.

8. The method of claim 1, further comprising: Obtaining the number of frames tracked in tracking the picture frame sequence; and In response to the number of tracked frames reaching a preset value, the calibration component in the picture frame sequence of the video input is detected again to obtain the position information of the calibration component.

9. A motion detection device, comprising: A shooting module, used for shooting the movement of the detected person to form a picture frame sequence, wherein the detected person wears a calibration component, wherein the calibration component comprises a fixing component and a marking component, wherein the marking component is arranged on the fixing component and is formed into a pattern with a predetermined size parameter, and the marking component has a target color; A detection module, used for detecting the calibration component in the picture frame sequence and obtaining position information of the calibration component; A tracking module, configured to track the calibration component in the picture frame sequence according to a tracking algorithm; as well as A measuring module is used to measure the moving distance of the calibration component, by knowing in advance the predetermined size of the marking component on the calibration component, and after capturing the marking component, obtaining the pixel value occupied by the marking component; in the process of tracking the calibration component, extracting the position information of the extreme point during the movement of the calibration component; by obtaining the position information of the extreme point during the movement of the calibration component, obtaining the pixel value occupied during the movement of the calibration component; then according to the size of the marking component and the pixel value occupied by the marking component, obtaining the movement distance of the calibration component, wherein, when the detection terminal shoots the calibration component from an oblique direction, the processing module determines the direction in which the detection terminal shoots the calibration component according to the image deformation of the marking component, and according to the cosine relationship conversion of the corresponding angle, the detection terminal determines the actual distance corresponding to the pixel in the video image of the calibration component.

10. An electronic device comprising: Processor; and A memory storing a computer program, which, when executed by the processor, enables the processor to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for locating license plate under a complicated background

    CN101408942A

  • Human motion capture method

    CN103198492A

  • Motion detection method and device, electronic equipment and storage medium

    CN110111364A

  • Positioning tracking method and device and wearable equipment thereof

    CN110968182A

  • Measurement device

    US20190318645A1