WO2021243572A1 - 运动检测方法和装置、电子设备以及计算机可读存储介质 - Google Patents

运动检测方法和装置、电子设备以及计算机可读存储介质 Download PDF

Info

Publication number
WO2021243572A1
WO2021243572A1 PCT/CN2020/093981 CN2020093981W WO2021243572A1 WO 2021243572 A1 WO2021243572 A1 WO 2021243572A1 CN 2020093981 W CN2020093981 W CN 2020093981W WO 2021243572 A1 WO2021243572 A1 WO 2021243572A1
Authority
WO
WIPO (PCT)
Prior art keywords
calibration component
sequence
detection
picture frames
picture
Prior art date
Application number
PCT/CN2020/093981
Other languages
English (en)
French (fr)
Inventor
焦旭
Original Assignee
焦旭
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 焦旭 filed Critical 焦旭
Priority to PCT/CN2020/093981 priority Critical patent/WO2021243572A1/zh
Priority to CN202080001060.9A priority patent/CN112292688A/zh
Priority to TW110110400A priority patent/TWI778552B/zh
Publication of WO2021243572A1 publication Critical patent/WO2021243572A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition
    • G06V40/23Recognition of whole body movements, e.g. for sport training
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person

Definitions

  • the invention belongs to the field of detection equipment, and in particular relates to a motion detection method and device, electronic equipment, and computer-readable storage media.
  • the contact measurement has high precision and good stability, but it is not widely used due to factors such as volume, quality, installation conditions, structure and inconvenience of operation; although the measurement accuracy and stability of non-contact measurement are not as good as contact
  • 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.
  • non-contact measurement in measurement accuracy and stability has been Approaching contact measurement.
  • One common method used in non-contact measurement is image measurement.
  • Image measurement is a measurement method in which images are acquired through image acquisition equipment, and then the images are processed by image processing technology to obtain the final distance measurement results. This method has no special requirements for measuring tools and objects to be measured, and is more suitable for applications where traditional contact measurement cannot be implemented.
  • Ranging can be applied to all aspects of life, especially in human motion scenes, which often require detection, tracking and measurement of body motion.
  • detection, tracking and measurement of scenes for cardiopulmonary resuscitation operation detection including fitness, rehabilitation, etc.
  • Detection, tracking and measurement of various physical movement scenes for example, sports scoring (gymnastics, etc.), fitness (such as fast pedaling in place, detecting the frequency inflection point), rehabilitation, physical function measurement, dancing, playing the violin ( Such as violin), drums, etc.
  • the present invention provides a motion detection method and device, electronic equipment, and 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.
  • a motion detection method which includes:
  • the movement distance of the calibration component is measured.
  • a motion detection device which includes:
  • the photographing module is used to photograph the motion of the subject to form a sequence of picture frames, and the subject wears a calibration component;
  • a detection module configured to detect the calibration component in the picture frame sequence, and obtain position information of the calibration component
  • a tracking module for tracking the calibration component in the sequence of picture frames according to a tracking algorithm
  • the measuring module is used to measure the moving distance of the calibration component.
  • an electronic device including:
  • the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the method described in the first aspect.
  • a computer-readable storage medium having computer-readable instructions stored thereon, and when the instructions are executed by a processor, the processor is caused to execute the method described in the first aspect .
  • the motion detection method and device, electronic equipment, and computer-readable storage medium of the present invention through the moving target detection process, by detecting the color of the target and moving objects, the position of the marking component can be roughly identified. After the screening process, the noise and interference in the picture can also be removed, and then through edge detection and corresponding transformation of the extracted edge, the marking component can be accurately identified and the position information of the marking component can be obtained. Finally, the tracking and distance measurement are performed after obtaining the location information of the marker.
  • the motion detection device of the present invention can realize more accurate and faster target detection, tracking and measurement.
  • Fig. 1 is a schematic diagram of a motion detection assistance system according to an embodiment of the present invention
  • Figure 2 is a schematic diagram of a calibration component according to an embodiment of the present invention.
  • Fig. 3 is a flowchart of a motion detection method according to an embodiment of the present invention.
  • Fig. 4 is a flowchart of step S32 shown in Fig. 3 according to an embodiment of the present invention.
  • Fig. 5 is a flowchart of moving target detection according to an embodiment of the present invention.
  • Fig. 6 is a flowchart of moving target detection according to another embodiment of the present invention.
  • Fig. 7 is a schematic diagram of a square marking component according to an embodiment of the present invention.
  • Fig. 8 is a schematic diagram of a marking member moving up and down according to an embodiment of the present invention.
  • Fig. 9 is a schematic diagram of a motion detection device according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of the detection module 92 shown in FIG. 9 according to an embodiment of the present invention.
  • Fig. 11 is a schematic diagram of a moving target detection module according to an embodiment of the present invention.
  • Fig. 12 is a schematic diagram of a moving target detection module according to another embodiment of the present invention.
  • 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 indicated technical features. Therefore, the features defined with “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 than two, unless otherwise specifically defined.
  • connection should be understood in a broad sense, for example, it can be a fixed connection or a detachable connection.
  • Connected or integrally connected It can be mechanically connected, or electrically connected or can communicate with each other; it can be directly connected or indirectly connected through an intermediate medium, it can be the internal communication of two components or the interaction of two components relation.
  • the "on” or “under” of the first feature of the second feature may include the first and second features in direct contact, or may include the first and second features. Not in direct contact but through other features between them.
  • “above”, “above” and “above” the second feature of the first feature include the first feature being directly above and obliquely above the second feature, or it only means that the level of the first feature is higher than that of the second feature.
  • the “below”, “below” and “below” of the first feature of the second feature include the first feature directly above and obliquely above the second feature, or it simply means that the level of the first feature is smaller than the second feature.
  • an embodiment of the present invention provides a motion detection assistance 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 in the movement process.
  • the detection terminal 200 may be a smart device such as a mobile phone or an iPad.
  • the calibration assembly 100 for motion detection includes a fixing part 101 and a marking part 102.
  • the fixing component 101 is used to fix the calibration assembly 100 on the wrist, leg, waist, etc. of the athlete.
  • the marking component 102 is arranged on the fixed component 101 and formed into a figure with predetermined size parameters, which serves as an optical beacon to facilitate identification in the video image of the calibration assembly 100.
  • the marking component 102 may be a LOGO.
  • the marking component 102 includes a self-luminous structure and/or a light-reflecting structure.
  • 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.
  • the figure formed by the marking member 102 is a circle, the diameter of the circle is determined, and the diameter of the circle is pre-stored in the detection terminal.
  • the graphic of the marking component 102 may be a rectangle or a square, and the side length of the rectangle or the square is stored in the detection terminal in advance.
  • the graphic of the marking component 102 may also be of other specific shapes, as long as it has a certain size.
  • the number of the marking components 102 is multiple, which are arranged in sequence on the fixed component 101, so as to facilitate the recognition of the spatial posture of the calibration component 100.
  • the multiple marking components 102 can also be set to different colors to improve the accuracy of spatial gesture recognition.
  • the calibration component 100 may be a wristband, which is worn on the wrist of an athlete.
  • the calibration component 100 can also be a device that can be fixed relative to the arm, such as a watch or an arm guard.
  • the calibration assembly 100 is preferably used to be worn on the wrist, because in this case the error between the movement distance of the bracelet and the movement distance of the palm is minimal.
  • the detection terminal 200 photographs the movement process. There are many factors that affect the accuracy of distance measurement. Among them, the impact of hardware factors can be reduced by selecting high-quality hardware such as high-resolution CCD (Charge Coupled Device) cameras and high-sampling frequency image capture cards. limits. Because of the different styles of detection terminals (for example, mobile phones), it is the most effective way to improve the system's ranging accuracy through software algorithms.
  • the detection terminal 200 is photographing the movement process 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 sequence of picture frames.
  • the RGB (Red Green Blue) color space is converted to the HSV (Hue, Saturation, Value, hue, saturation, lightness) color space , To facilitate the selection and extraction of colors.
  • the description of the HSV color space is closer to the recognition method of the human eye, and can better describe the color and brightness.
  • the H of the HSV space model can be represented by a circle.
  • a motion detection method is provided. As shown in Figure 3, the method includes the following steps:
  • step S31 the motion of the subject is photographed to form a sequence of picture frames, and the subject wears a calibration component.
  • the subject wears a calibration component, which can be a hand ring, a foot ring, or the like.
  • the test terminal can shoot the motion of the testee to form a video input, and then convert the video input into a sequence of picture frames to form a sequence of picture frames.
  • Step S32 Detect the calibration component in the picture frame sequence, and obtain position information of the calibration component.
  • Step S32 After converting the video input into a sequence of picture frames, it is first necessary to identify the position of the calibration component in the picture. After obtaining the position information of the calibration position, it is convenient for subsequent tracking of the calibration component and the movement distance of the calibration component according to the tracking result. Measurement. Step S32 will be described in more detail in FIGS. 4, 5, and 6.
  • Step S33 tracking the calibration component in the sequence of picture frames according to a tracking algorithm.
  • step S32 After the position information of the calibration component is obtained through step S32, since the calibration component is in a moving state, it is necessary to keep track of the calibration component. Through the tracking algorithm, it is ensured that a good tracking effect is ensured when the target is only slightly deformed and moving quickly, and the trajectory of the movement of the calibration component can be extracted.
  • the tracking algorithm may include the KCF algorithm (Kernel Correlation Filter).
  • KCF algorithm Kernel Correlation Filter
  • the KCF algorithm has the following advantages: simple implementation, good effect, and fast speed. The problem is solved by generating a large number of samples through the displacement of the circulant matrix, and the calculation speed in the frequency domain is extremely fast through the derivation of the discrete Fourier transform. In the case of lack of samples, simple methods are used to detect and connect to core operations for tracking, which ensures the generalization ability of tracking.
  • Step S34 measuring the moving distance of the calibration component.
  • the detection terminal 200 knows the predetermined size of the marking component 102 on the calibration assembly 100 in advance, and after capturing the marking component 102, obtains the pixel value occupied by the marking component 102. Then, in the process of tracking the calibration component, extract the position information of the extreme point during the movement of the calibration component, the position information of the extreme point includes the position information of the uppermost position of the up and down movement and the position information of the lowermost position, or Including the position information of the leftmost position of the left and right movement and the position information of the rightmost position. Of course, the position information of the extreme point may also include information of other extreme positions of movement.
  • Step S32 will be described in more detail in FIGS. 7 and 8.
  • Fig. 4 is a flowchart of step S32 shown in Fig. 3 according to an embodiment of the present invention. As shown in Fig. 4, step S32 includes the following sub-steps:
  • Moving target detection is used to extract the information of the calibration components in the picture frame.
  • moving target detection algorithms including background subtraction, optical flow and frame difference.
  • the frame difference method is used to implement moving target detection.
  • Figures 5 and 6 the use of frame difference method to implement moving target detection is shown in Figures 5 and 6, which will be described in detail below.
  • step S32 may further include the following sub-steps:
  • sub-step S42 binarization processing is performed on the result of the detection of the moving target.
  • the redundant information is filtered out, and the color information is processed into black and white, which can greatly reduce the amount of calculation.
  • step S32 may further include the following sub-steps:
  • Sub-step S43 performing dilatation corrosion processing on the result after the binarization processing.
  • sub-step S44 the connected domain screening process is performed on the result after expansion and corrosion.
  • step S32 includes:
  • sub-step S45 edge detection processing is performed on the result of the detection of the moving target.
  • the extracted edge includes the edge of the calibration component.
  • the algorithm for edge detection includes the canny algorithm.
  • step S32 includes:
  • Sub-step S46 according to the preset shape of the calibration component, correspondingly transform the extracted edge, so as to obtain the position information of the calibration component.
  • the preset shape is a rectangle
  • the corresponding transformation algorithm such as Hough transform
  • Hough transform can be used to extract each straight line segment of the rectangle, so as to determine that the extracted edge is the edge of the bracelet.
  • set a threshold for the number of straight line segments such as 2 or 3.
  • the corresponding transformation algorithm such as another Hough transform, can be used to extract the circle or ellipse, so as to determine that the extracted edge is the edge of the marker component Or part of the edge.
  • the corresponding transformation algorithm When extracting the edge or part of the edge of the calibration component, according to the characteristics of the preset shape of the calibration component, set the corresponding transformation algorithm to extract the edge or the component part of the edge of the calibration component. What kind of transformation algorithm is used? The invention is not limited, as long as the transformation algorithm can extract and determine the edge of the calibration component.
  • the position information of the marking component can be known.
  • the marking component is a bracelet
  • the coordinates [X, Y, H, W] can be used to indicate the position of the bracelet.
  • X and Y represent the abscissa and ordinate of the top left corner of the rectangle of the bracelet, respectively.
  • the coordinates, and H and W respectively represent the height and width of the bracelet rectangle.
  • Fig. 5 is a flowchart of moving target detection according to an embodiment of the present invention.
  • the moving target detection process includes:
  • Step S51 Acquire adjacent first picture frames and second picture frames in the sequence of picture frames.
  • Step S52 extracting target colors from the first picture frame and the second picture frame respectively.
  • the target color is the color of the marking component, and the extraction of the target color is to facilitate the detection of the marking component.
  • the target color is preferably a color that is different from human skin color, clothing, and video background, for example, red or green.
  • Step S53 Difference the target color extracted from the first picture frame and the second picture frame to obtain a result of moving target detection.
  • Fig. 6 is a flowchart of moving target detection according to another embodiment of the present invention.
  • the difference from Figure 5 is that for the picture frame sequence of video input, three adjacent picture frames are selected (the three picture frames are preferably the first three adjacent picture frames of the picture frame sequence) to move the target Detection.
  • the moving target detection process includes:
  • Step S61 Acquire adjacent first picture frames, second picture frames, and third picture frames in the sequence of picture frames.
  • Step S62 extracting target colors from the first picture frame, the second picture frame and the third picture frame respectively.
  • the target color is the color of the marking component, and the extraction of the target color is to facilitate the detection of the marking component.
  • the target color is preferably a color that is different from human skin color, clothing, and video background, for example, red or green.
  • Step S63 Difference the target color extracted in the first picture frame and the second picture frame to obtain a first difference result.
  • Step S64 Difference the target color extracted in the second picture frame and the third picture frame to obtain a second difference result.
  • step S63 and step S64 are executed.
  • Step S63 can be executed before step S64, can also be executed after step S64, or can be executed simultaneously with step S64.
  • Step S65 taking the intersection of the first difference result and the second difference result to obtain a result of moving target detection.
  • the moving target detection process shown in FIG. 6 can effectively reduce the noise existing in the image compared to FIG. 5. Based on the teachings of the embodiments shown in FIGS. 5 and 6, those skilled in the art can imagine that for a sequence of video input picture frames, more adjacent picture frames can be selected for moving target detection. It belongs to the scope of this application.
  • the motion detection method of the present invention may further include: acquiring the number of frames tracked by tracking the picture frame sequence; and in response to the number of tracking frames reaching a preset value, executing the picture frame sequence input to the video again.
  • the calibration component in, performs detection, and obtains the position information of the calibration component, that is, step S32 or step S41 is executed again.
  • Figures 7 and 8 describe the measurement of the movement distance of the calibration component.
  • the graphic shape of the marking member 102 is a square as an example.
  • the side length L of the marking member 102 is 2 cm.
  • the detection terminal 200 determines from the video image of the calibration component 100 that the first pixel number corresponding to the square side is 100, and the actual distance corresponding to the pixel in the video image of the calibration component 100 is 0.02 cm.
  • 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 pixel number corresponding to the movement distance of the calibration component is determined according to the upper limit image frame and the lower limit image frame.
  • the detection terminal 200 can recognize the upper limit image frame and the lower limit image frame of a single 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 movement distance of the calibration component 100.
  • the image frame in the image when the calibration component 100 is not moving is used as the upper limit image frame of the first pressing; as the calibration component 100 moves down, the pixels corresponding to the marking component 102 in the video image continue to move down; the detection terminal When 200 recognizes that the pixel corresponding to the marking member 102 no longer moves down, an image frame at this time is regarded as the lower limit image frame of the first pressing.
  • the calibration component 100 moves up, when the second sub-module of the processing module 202 recognizes that the pixel corresponding to the marking component 102 is no longer moving up, it uses an image frame at this time as the upper limit image frame of the second pressing; The component 100 moves down, and when the detection terminal 200 recognizes that the pixel corresponding to the marking component 102 is no longer moving down, an image frame at this time is used as the lower limit image frame of the second press. In this cycle, 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 number of pixels corresponding to the movement distance of the calibration component 100 is determined each time it is pressed. The detection terminal 200 determines the movement distance of the calibration component according to the actual distance corresponding to the pixel in the video image of the calibration component and the second pixel number.
  • the detection terminal 200 determines that the second pixel number corresponding to the movement distance S of the calibration component 100 is 200, the actual distance corresponding to the pixel in the video image of the calibration component is 0.02cm, and the movement distance S of the calibration component is calculated to be 4cm. .
  • 4cm be the compression depth this time.
  • the normal line of the marking component 102 on the calibration component may not point to the detection terminal 200, that is, the detection terminal 200 photographs the calibration component in an oblique direction.
  • the processing module 202 can determine the direction from which the detection terminal 200 shoots the calibration component 100 according to the image deformation of the marking 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 mainly relates to when a person wears the calibration assembly 100 for treatment, the plane where the marking component 102 of the calibration assembly 100 is located is not necessarily perpendicular to the connection direction of the calibration assembly 100 and the detection terminal 200.
  • the marking component 102 detected by the detection terminal 200 When it is not vertical, the marking component 102 detected by the detection terminal 200 will form a certain distortion.
  • the marking component when the marking component is originally circular, when the plane of the marking component of the calibration component is not perpendicular to the connecting direction of the calibration component and the detection terminal, the detected marking component will appear elliptical.
  • the detection terminal knows the size of the marking component, for example, the diameter of the circle is 2 cm, but in the detected image, the long axis of the ellipse is 2 cm, and the short axis is less than 2 cm.
  • the detection terminal 200 needs to recognize the actual size of the marking component according to the actual image captured, for example, the long axis of the ellipse represents the diameter of the circle.
  • a rectangle When a circle becomes an ellipse, it is relatively simple, but when a rectangle or polygon is used, for example, the distortion becomes complicated.
  • a rectangle When it is not perpendicular, it may be a parallelogram. At this time, it is necessary to determine the angle between the plane of the rectangle and the connection line (between the calibration component and the detection terminal) based on the angle between the two adjacent sides of the parallelogram, and then convert and calculate the captured parallel according to the cosine relationship. The length of the object represented by each side of the quadrilateral, and then the actual distance represented by each pixel in the pressing direction is calculated.
  • the detection terminal 200 corrects 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 can also be obtained by correcting the reference coordinate system where the calibration component 100 and the detection terminal 200 are located.
  • the accuracy loss is based on the following The formula:
  • ⁇ eref and ⁇ pref respectively represent the error caused by the edge selection during measurement and the error of the pixel itself.
  • ⁇ ereal and ⁇ preal respectively represent the error of the actual target distance to be measured and the error of the reference distance
  • l ref and l real respectively represent the reference
  • the distance and the distance between the actual target to be measured, the reference distance represents the first set reference reference line of the calibration component 100 at the first extreme position point to the second set reference reference line of the calibration component 100 at the second extreme position point during the movement
  • the distance of the actual target to be measured represents the first set reference datum line of the calibration component 100 at the first extreme position point to the first set reference datum of the calibration component 100 at the second extreme position point in the movement process The distance of the line.
  • the reference distance represents the distance from the upper edge of the calibration component 100 (for example, a wristband) at the highest point of the exercise process to the lower edge of the calibration component 100 at the lowest point
  • the actual distance of the target to be measured represents the distance from the upper edge of the calibration component 100 (for example, a wristband) at the highest point of the movement process to the upper edge of the calibration component 100 at the lowest point.
  • this solution is not limited to being applied to this scenario, but can also be applied to tracking and measuring limbs and body movements, and can be applied to fitness, rehabilitation, etc.
  • Motion detection in scenes of physical movement such as: sports scoring (gymnastics, etc.), fitness (such as fast pedaling in place, detecting the frequency inflection point), rehabilitation, physical function measurement, dancing, playing the violin (such as violin) , Drumming, etc.
  • This solution can not only collect upper body movement data during cardiopulmonary resuscitation, but also collect human body training data at ordinary times, such as calculating the frequency, number, depth of push-ups and other indicators.
  • wear calibration devices such as bracelets, leg loops, etc.
  • use the mobile phone camera to monitor the movement process, monitor the movement amplitude, frequency, trajectory, etc., and give Amplitude measurement record (resolution 2mm, accuracy 5mm), frequency record, trace drawing on video and other functions.
  • the motion detection method of the present invention through the moving target detection process, by detecting the color of the target and moving objects, the position of the marking component can be roughly identified, and the noise in the picture can be removed after the process of expansion and corrosion and connected domain screening. And interference, and then through edge detection and corresponding transformation of the extracted edges, the marking components can be accurately identified and the position information of the marking components can be obtained. Finally, the tracking and distance measurement are performed after obtaining the location information of the marker.
  • the motion detection method of the present invention can realize more accurate and faster target detection, tracking and measurement.
  • a motion detection device As shown in Figure 9, the device includes the following modules:
  • the photographing module 91 is used to photograph the motion of the subject to form a sequence of picture frames, and the subject wears a calibration component.
  • the subject wears a calibration component, which can be a hand ring, a foot ring, or the like.
  • the test terminal can shoot the motion of the testee to form a video input, and then convert the video input into a sequence of picture frames to form a sequence of picture frames.
  • the detection module 92 is configured to detect the calibration component in the sequence of picture frames and obtain position information of the calibration component.
  • the detection module 92 After converting the video input into a sequence of picture frames, it is first necessary to identify the position of the calibration component in the picture. After obtaining the position information of the calibration position, it is convenient for subsequent tracking of the calibration component and the movement distance of the calibration component according to the tracking result. Measurement.
  • the detection module 92 will be described in more detail in FIGS. 10, 11 and 12.
  • the tracking module 93 is configured to track the calibration component in the sequence of picture frames according to a tracking algorithm.
  • the tracking algorithm may include the KCF algorithm (Kernel Correlation Filter).
  • KCF algorithm Kernel Correlation Filter
  • the KCF algorithm has the following advantages: simple implementation, good effect, and fast speed. The problem is solved by generating a large number of samples through the displacement of the circulant matrix, and the calculation speed in the frequency domain is extremely fast through the derivation of the discrete Fourier transform. In the case of lack of samples, simple methods are used to detect and connect to core operations for tracking, which ensures the generalization ability of tracking.
  • the measuring module 94 is used for measuring the moving distance of the calibration component.
  • the detection terminal 200 knows the predetermined size of the marking component 102 on the calibration assembly 100 in advance, and after capturing the marking component 102, it learns the pixel value occupied by the marking component 102. Then, in the process of tracking the calibration component, extract the position information of the extreme point during the movement of the calibration component.
  • the position information of the extreme point includes the position information of the uppermost position of the up and down movement and the position information of the lowermost position, or Including the position information of the leftmost position of the left and right movement and the position information of the rightmost position.
  • the position information of the extreme point may also include information of other extreme positions of movement.
  • 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 .
  • FIG. 10 is a schematic diagram of the detection module 92 shown in FIG. 9 according to an embodiment of the present invention. As shown in FIG. 10, the detection module 92 includes the following units:
  • the moving target detection unit 101 is configured to perform moving target detection on the picture frame sequence.
  • Moving target detection is used to extract the information of the calibration components in the picture frame.
  • moving target detection algorithms including background subtraction, optical flow and frame difference.
  • the frame difference method is used to implement moving target detection.
  • Figure 11 and Figure 12 the use of frame difference method to implement moving target detection is shown in Figure 11 and Figure 12, which will be described in detail below.
  • the detection module 92 may further include the following units:
  • the binarization processing unit 102 is configured to perform binarization processing on the result of the detection of the moving target.
  • the redundant information is filtered out, and the color information is processed into black and white, which can greatly reduce the amount of calculation.
  • the detection module 92 may further include the following units:
  • the expansion corrosion processing unit 103 is used to perform expansion corrosion processing on the result of the binarization processing.
  • the connected domain screening processing unit 104 is configured to perform connected domain screening processing on the result of expansion and corrosion.
  • the size of the expansion and corrosion can be set appropriately, and the area for filtering the connected domains can also be set, for example, the connected domains smaller than 300 pixels can be filtered out.
  • the detection module 92 includes:
  • the edge processing unit 105 is configured to perform edge detection processing on the result of the detection of the moving target. During the edge detection processing, the extracted edge includes the edge of the calibration component.
  • the algorithm for edge detection includes the canny algorithm.
  • the extracted edges include the edges of the calibration components, and may also include the edges of other objects that are not the calibration components. Therefore, in order to more accurately determine the position of the calibration component, the detection module 92 includes:
  • the edge transformation unit 106 is configured to perform 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.
  • the preset shape is a rectangle
  • the corresponding transformation algorithm such as Hough transform
  • Hough transform can be used to extract each straight line segment of the rectangle, so as to determine that the extracted edge is the edge of the bracelet.
  • set a threshold for the number of straight line segments such as 2 or 3.
  • the corresponding transformation algorithm such as another Hough transform, can be used to extract the circle or ellipse, so as to determine that the extracted edge is the edge of the marker component Or part of the edge.
  • the corresponding transformation algorithm When extracting the edge or part of the edge of the calibration component, according to the characteristics of the preset shape of the calibration component, set the corresponding transformation algorithm to extract the edge or the component part of the edge of the calibration component. What kind of transformation algorithm is used? The invention is not limited, as long as the transformation algorithm can extract and determine the edge of the calibration component.
  • the position information of the marking component can be known.
  • the marking component is a bracelet
  • the coordinates [X, Y, H, W] can be used to indicate the position of the bracelet.
  • X and Y represent the abscissa and ordinate of the top left corner of the rectangle of the bracelet, respectively.
  • the coordinates, and H and W respectively represent the height and width of the bracelet rectangle.
  • Fig. 11 is a schematic diagram of a moving target detection module according to an embodiment of the present invention.
  • the moving target detection unit includes:
  • the first picture frame obtaining subunit 111 is configured to obtain adjacent first picture frames and second picture frames in the sequence of picture frames.
  • the first color extraction subunit 112 is configured to extract target colors from the first picture frame and the second picture frame, respectively.
  • the target color is the color of the marking component, and the extraction of the target color is to facilitate the detection of the marking component.
  • the target color is preferably a color that is different from human skin color, clothing, and video background, for example, red or green.
  • the first difference numerator unit 113 is configured to perform a difference between the extracted target color in the first picture frame and the second picture frame to obtain a result of moving target detection.
  • Fig. 12 is a schematic diagram of a moving target detection module according to an embodiment of the present invention.
  • the difference from Fig. 11 is that for the picture frame sequence of video input, three adjacent picture frames are selected (the three picture frames are preferably the first three adjacent picture frames of the picture frame sequence) to move the target Detection.
  • the moving target detection unit includes:
  • the second picture frame obtaining subunit 121 is configured to obtain adjacent first picture frames, second picture frames, and third picture frames in the picture frame sequence.
  • the second color extraction subunit 122 is configured to extract target colors from the first picture frame, the second picture frame, and the third picture frame, respectively.
  • the target color is the color of the marking component, and the extraction of the target color is to facilitate the detection of the marking component.
  • the target color is preferably a color that is different from human skin color, clothing, and video background, for example, red or green.
  • the second difference numerator unit 123 is configured to perform a difference between the target color extracted in the first picture frame and the second picture frame to obtain a first difference result.
  • the third difference unit 124 is configured to perform a difference between the target color extracted in the second picture frame and the third picture frame to obtain a second difference result.
  • the intersection taking subunit 125 is configured to take the intersection of the first difference result and the second difference result to obtain the result of moving target detection.
  • the moving target detection process shown in FIG. 12 can effectively reduce the noise in the image compared to FIG. 11. Based on the teachings of the embodiments shown in FIGS. 11 and 12, those skilled in the art can imagine that for a sequence of video input picture frames, more adjacent picture frames can be selected for moving target detection. It belongs to the scope of this application.
  • the motion detection device of the present invention may further include: an acquisition module for acquiring the number of frames tracked by tracking the sequence of picture frames. In this way, after the number of tracking frames reaches the preset value, the detection module 92 is made to perform the detection of the calibration component in the sequence of video input picture frames again to obtain the position information of the calibration component.
  • the motion detection device of the present invention through the moving target detection process, by detecting the color of the target and moving objects, the position of the marking component can be roughly identified, and the noise in the picture can be removed after the process of expansion and corrosion and connected domain screening. And interference, and then through edge detection and corresponding transformation of the extracted edges, the marking component can be accurately identified and the position information of the marking component can be obtained. Finally, tracking and distance measurement are performed after obtaining the location information of the marker.
  • the motion detection device of the present invention can realize more accurate and faster target detection, tracking and measurement.
  • an electronic device which includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes any of the above implementations.
  • the motion detection method described in the method is provided, which includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes any of the above implementations.
  • the motion detection method includes: photographing the motion of a subject to form a sequence of picture frames, the subject wearing a calibration component; detecting the calibration component in the sequence of picture frames to obtain the calibration Position information of the component; tracking the calibration component in the sequence of picture frames according to a tracking algorithm; and determining the moving distance of the calibration component.
  • the detecting the calibration component in the sequence of picture frames and obtaining the position information of the calibration component includes: detecting a moving target on the sequence of picture frames; performing edge detection on the result of the moving target detection
  • the extracted edge includes the edge of the calibration component; and according to the preset shape of the calibration component, the extracted edge is correspondingly transformed, so as to obtain the calibration component The location information.
  • said performing the moving target detection on the sequence of picture frames includes: obtaining adjacent first picture frames and second picture frames in the sequence of picture frames; from the first picture frame and the second picture The target colors are extracted from the frames respectively; and the target colors extracted in the first picture frame and the second picture frame are differentiated to obtain the result of moving target detection.
  • said performing moving target detection on said picture frame sequence includes: acquiring adjacent first picture frame, second picture frame and third picture frame in said picture frame sequence; from said first picture frame, Extract the target color in the second picture frame and the third picture frame respectively; perform the difference of the target color extracted in the first picture frame and the second picture frame to obtain the first difference result; compare the second picture frame Perform difference with the target color extracted in the third picture frame to obtain a second difference result; take the intersection of the first difference result and the second difference result to obtain the result of moving target detection.
  • the detecting the calibration component in the sequence of picture frames of the video input, and obtaining the position information of the calibration component further includes: binarizing the result of the detection of the moving target.
  • said detecting the calibration component in the picture frame sequence of the video input, and obtaining the position information of the calibration component further includes: performing dilatation and corrosion processing on the result after the binarization processing; and performing the dilatation and corrosion processing on the result after the dilatation and corrosion Connected domain screening process.
  • the tracking algorithm includes the KCF algorithm
  • the edge detection processing includes using the canny algorithm
  • the moving target detection includes a background subtraction method, an optical flow method, and a frame difference method.
  • the motion detection method further includes: acquiring the number of frames tracked by tracking the picture frame sequence; and in response to the number of tracked frames reaching a preset value, re-executing the calibration in the picture frame sequence of the video input
  • the component detects and obtains the position information of the calibration component.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through its communication component, and/or can be installed from a removable medium.
  • the computer program is executed by a central processing unit (CPU), it executes the above-mentioned functions defined in the method of the present application.
  • the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • the computer program code used to perform the operations of the present application can be written in one or more programming languages or a combination thereof.
  • the programming languages include object-oriented programming languages—such as Java, Smalltalk, C++, and also conventional procedures.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user’s computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to pass Internet connection.
  • each block in the flowchart or block diagram can represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logic function.
  • Executable instructions can also occur in a different order from the order marked in the drawings. For example, two blocks shown one after the other can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in this application can be implemented in software or hardware.
  • the described unit can also be provided in the processor, for example, it can be described as: a processor includes a receiving unit, a searching unit, and a sending unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the receiving unit can also be described as "a unit that receives user requests for obtaining blockchain account address information.”
  • the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist alone without being assembled into the device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the apparatus, the apparatus is caused to execute the above-mentioned method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)
  • Burglar Alarm Systems (AREA)

Abstract

一种运动检测方法和装置、电子设备以及计算机可读存储介质,该运动检测方法包括:拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件(S31);对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息(S32);根据跟踪算法跟踪所述图片帧序列中的所述标定组件(S33);以及测定所述标定组件的移动距离(S34)。根据该方法能够实现更精确和更快速的目标检测、跟踪和测量。

Description

运动检测方法和装置、电子设备以及计算机可读存储介质 技术领域
本发明属于检测设备领域,具体涉及一种运动检测方法和装置、电子设备以及计算机可读存储介质。
背景技术
测距存在于人类生活的方方面面,对人类的进步与发展有着非常重要的作用,而人类的社会发展又促进了测距技术的发展与完善。随着人类社会的发展,测距从最原始的估测到测量工具的产生再到近现代高科技测量仪器的诞生,测距技术的理论已趋向完备。有关距离的测量方法很多,从是否接触层次上可以分为两种:接触式测量和非接触式测量。非接触式测量无须与被测表面接触,一般通过光学、电气学、影像学等技术获取最终测量距离。接触式测量测距精度高、稳定性好,但由于受到体积、质量、安装条件、结构以及操作不方便等因素影响而得不到广泛利用;非接触式测量虽然测量精度以及稳定性上不及接触式测量,但具有自动化程度高、测量速度快、信息量丰富、动态范围大等优势而逐渐受到人们的重视,特别是在现在技术的高速发展下,测量精度以及稳定性上非接触式测量已趋近于接触式测量。非接触式测量中使用普遍的一种方法是图像测量。图像测量就是通过图像获取设备获取图像,然后利用图像处理技术对图像进行相关处理获取最终测距结果的一种测量方法。该方法对测量工具和被测物体没有特殊要求,比较适合应用于传统接触式测量无法实施的场合。
测距可以应用到生活的各个方面,尤其在人体运动场景时,往往需要对身体运动进行检测、跟踪和测量,例如,心肺复苏操作检测的场景的检测、跟踪和测量,还包括健身、康复等各种肢体运动的场景的检测、跟踪和测,例如,体育运动打分(体操等)、健身(例如原地快速蹬踏,检测其频率拐点)、康复、身体运用机能测量、舞蹈、拉琴(如小提琴)、打鼓等。
现有技术中虽然存在一些运动检测的系统和方法,但是,这些运动检测系统和方法的精度和速度有待进一步提升。
发明内容
本发明提供一种运动检测方法和装置、电子设备以及计算机可读存储介质,能够进一步提升运动检测的精度和速度,并且所提供的方法和装置能够应用与各种运动检测的场景。
根据本发明的第一方面,提供一种运动检测方法,其包括:
拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件;
对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息;
根据跟踪算法跟踪所述图片帧序列中的所述标定组件;以及
测定所述标定组件的移动距离。
根据本发明的第二方面,提供一种运动检测装置,其包括:
拍摄模块,用于拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件;
检测模块,用于对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息;
跟踪模块,用于根据跟踪算法跟踪所述图片帧序列中的所述标定组件;以及
测定模块,用于测定所述标定组件的移动距离。
根据本申请的第三方面,提供了一种电子设备,包括:
处理器;
存储器,存储有计算机程序,当所述计算机程序被所述处理器执行时,使得所述处理器执行第一方面所述的方法。
根据本申请的第四方面,提供了一种计算机可读存储介质,其上存储有计算机可读指令,当所述指令被处理器执行时,使得所述处理器执行第一方面所述的方法。
根据本发明的运动检测方法和装置、电子设备以及计算机可读存储介质,通过运动目标检测过程,通过检测目标颜色且处于运动的物体,能够大致识别标记组件的位置,在经过膨胀腐蚀和连通域筛选处理后,还能够去除图片中的噪声和干扰,然后通过边缘检测并将所提取的边缘进行对应的变换,能够精确识别标记组件,并获取标记组件的位置信息。最后,在获取标记的位置信息后再进行跟踪和距离测量。本发明的运动检测装置能够实现更精确和更快速的目标检测、跟踪和测量。
附图说明
图1是根据本发明实施例的运动检测辅助系统的示意图;
图2是根据本发明实施例的标定组件的示意图;
图3是根据本发明一个实施例的运动检测方法的流程图;
图4是根据本发明一个实施例的图3所示的步骤S32的流程图;
图5是根据本发明一个实施例的运动目标检测的流程图;
图6是根据本发明另一个实施例的运动目标检测的流程图;
图7是根据本发明一个实施例的正方形标记部件的示意图;
图8是根据本发明一个实施例的标记部件上下移动的示意图;
图9是根据本发明一个实施例的运动检测装置的示意图;
图10是根据本发明一个实施例的图9所示的检测模块92的示意图;
图11是根据本发明一个实施例的运动目标检测模块的示意图;
图12是根据本发明另一个实施例的运动目标检测模块的示意图。
具体实施方式
在下文中,仅简单地描述了某些示例性实施例。正如本领域技术人员可认识到的那样,在不脱离本发明的精神或范围的情况下,可通过各种不同方式修改所描述的实施例。因此,附图和描述被认为本质上是示例性的而非限制性的。
在本发明的描述中,需要理解的是,术语"中心"、"纵向"、"横向"、"长度"、"宽度"、"厚度"、"上"、"下"、"前"、"后"、"左"、"右"、"坚直"、"水平"、"顶"、"底"、"内"、"外"、"顺时针"、"逆时针"等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语"第一"、"第二"仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有"第一"、"第二"的特征可以明示或者隐含地包括一个或者更多个所述特征。在本发明的描述中,"多个"的含义是两个或两个以上,除非另有明确具体的限定。
在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语"安装"、"相连"、"连接"应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接:可以是机械连接,也可以是电连接或可以相互通讯;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本发明中的具体含义。
在本发明中,除非另有明确的规定和限定,第一特征在第二特征之"上"或之"下"可以包括第一和第二特征直接接触,也可以包括第一和第二特征不是直接接触而是通过它们之间的另外的特征接触。而且,第一特征在第二特征"之上"、"上方"和"上面"包括第一特征在第二特征正上方和斜上方,或仅仅表示第一特征水平高度高于第二特征。第一特征在第二特征"之下"、"下方"和"下面"包括第一特征在第二特征正上方和斜上方,或仅仅表示第一特征水平高度小于第二特征。
下文的公开提供了许多不同的实施方式或例子用来实现本发明的不同结构。为了简化本发明的公开,下文中对特定例子的部件和设置进行描述。当然,它们仅仅为示例,并且目的不在于限制本发明。此外,本发明可以在不同例子中重复参考数字和/或参考字母,这种重复是为了简化和清楚的目的,其本身不指示所讨论各种实施方式和/或设置之间的关系。此外,本发明提供了的各种特定的工艺和材料的例子,但是本领域普通技术人员可以意识到其他工艺的应用和/或其他材料的使用。
以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
如图1所示,本发明的实施例提供一种运动检测辅助系统。运动检测辅助系统包括标定组件100和检测终端支架400,运动检测辅助系统与检测终端200配合,可检测运动过程中的参数。检测终端200可以为手机、iPad等智能设备。
如图2所示,运动检测用的标定组件100包括固定部件101和标记部件102。进行运动时,固定部件101用于将标定组件100固定于运动者的手腕部、腿、腰上等。标记部件102设置于固定部件101上,并形成为具有预定尺寸参数的图形,作为光学信标,便于在标定组件100的视频图像中进行识别,例如,该标记部件102可以是一种LOGO。标记部件102包括自发光结构和/或反光结构。
标记部件102形成的图形及图形的尺寸预先存储于检测终端中,便于检测终端进行后续的处理。本实施例中,标记部件102形成的图形为圆形,圆形的直径是确定的,将圆形的直径预先存储于检测终端中。另一种方案中,标记部件102的图形可为矩形或正方形,将矩形或正方形的边长预先存储于检测终端中。标记部件102的图形也可以为其他特定的形状,具有确定的尺寸即可。
根据本发明一个可选的技术方案,标记部件102的数量为多个,在固定部件101上依次设置,便于对标定组件100的空间姿态进行识别。多个标记部件102还可设置为不同的颜色,提高空间姿态识别的准确性。
标定组件100可以为手环,将手环带在运动人员的手腕上。标定组件100也可以为手表或护臂套等可相对手臂进行固定的设备。例如,在进行心肺复苏时,标定组件100优选地用于佩戴于手腕处,因为这种情况下手环的移动距离与手掌的移动距离之间的误差最小。
在根据图1所示的系统中,检测终端200对运动的过程进行拍摄。影响测距精度的因素很多,其中,硬件因素的影响可以通过选取高分辨率的CCD(Charge Coupled Device,电荷耦合器件)摄像机、高采样频率的图像采集卡等高品质硬件,降低各种环境因素的限制。因为检测终端(例如,手机)的款式不同,通过软件算法来提高系统测距精度的方法是相对最有效的途径。检测终端200在对运动的过程进行拍摄, 获得视频输入。为了对标定组件100进行目标检测、目标跟踪和距离测量,首先需要将视频输入转换为单帧图片,使得视频输入成为图片帧序列。在一个可选的实施例中,为了通过简单高效的方式提取目标,将RGB(Red Green Blue,红绿蓝)颜色空间转换为HSV(Hue,Saturation,Value,色调、饱和度、明度)颜色空间,便于颜色的筛选和提取。相比正常图片所使用的RGB颜色空间,HSV颜色空间的描述方式更接近人的肉眼的识别方式,可以更好的描述颜色和亮度的情况。另外,由于目标背景的复杂化,存在颜色丰富后,进行分割出现多个目标,导致图像存在无法定位和角点检测错误的情况,可以将HSV空间模型的H为用圆周表示。
根据本发明的一个方面,提供一种运动检测方法。如图3所示,该方法包括如下步骤:
步骤S31,拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件。
被检测者佩戴标定组件,所述标定组件可以为手环、脚环等。在被检测者佩戴标定组件后,检测终端可以拍摄被检测者的运动,形成视频输入,然后将视频输入转换为图片帧序列,形成图片帧序列。
步骤S32,对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息。
在将视频输入转换为图片帧序列后,首先需要识别图片中标定组件的位置,在获取标定位置的位置信息后,才便于后续对标定组件的跟踪以及根据跟踪后的结果对标定组件移动距离的测量。在图4、图5和图6中将会对步骤S32进行更详细的描述。
步骤S33,根据跟踪算法跟踪所述图片帧序列中的所述标定组件。
为了保证测距的速度,需要对标定组件进行目标检测并进行跟踪。在通过步骤S32获得标定组件的位置信息后,由于标定组件处于运动的状态,需要保持对标定组件的跟踪。通过跟踪算法,保证在目标在仅仅有微弱形变且快速移动的时候保证良好的跟踪效果,能够提取出标定组件移动的轨迹。
在一个优选的实施例中,跟踪算法可以包括KCF算法(Kernel Correlation Filter,核相关滤波算法)。KCF算法具有如下优点:实现简洁、效果好、速度快。通过循环矩阵位移产生大量样本来解决问题,并且通过离散傅里叶变换的推导,在频域计算速度极快。在缺少样本的情况下,通过简单的方法检测,连接核运算进行跟踪,保证了跟踪的泛化能力。
步骤S34,测定所述标定组件的移动距离。
首先,检测终端200预先知道标定组件100上的标记部件102的预定尺寸,并在捕捉到标记部件102后,获知标记部件102所占用的像素值。然后,在跟踪标定组件的过程中,提取标定组件运动过程中的极值点的位置信息,该极值点的位置信息包括上下运动的最上位置时的位置信息以及最下位置的位置信息, 或者包括左右运动的最左位置时的位置信息以及最右位置的位置信息,当然,极值点的位置信息还可以包括其他运动极限位置的信息。通过取标定组件运动过程中的极值点的位置信息,获知标定组件运动过程中所占用的像素值,然后依据标记部件102的尺寸以及标记部件102所占用的像素值,获得标定组件的运动距离。在图7和图8中将会对步骤S32进行更详细的描述。
图4是根据本发明一个实施例的图3所示的步骤S32的流程图。如图4所示,步骤S32包括如下子步骤:
子步骤S41,对所述图片帧序列进行运动目标检测。
运动目标检测用于提取图片帧中标定组件的信息。运动目标检测算法有很多种,包括背景减除法、光流法和帧差法。在一个优选的实施例中,采用帧差法实施运动目标检测。其中,采用帧差法实施运动目标检测如图5和图6所示,下文将会进行详细介绍。
在一个可选的实施例中,为了减少计算量,步骤S32还可以包括如下子步骤:
子步骤S42,对所述运动目标检测后的结果进行二值化处理。
通过二值化处理,滤除掉多余信息,将颜色信息处理为黑和白,能够大大减少计算量。
在另一个可选的实施例中,为了减少滤除掉除了标定组件外的小面积的噪声干扰,步骤S32还可以包括如下子步骤:
子步骤S43,对二值化处理后的结果进行膨胀腐蚀处理;以及
子步骤S44,对膨胀腐蚀后的结果进行连通域筛选处理。
其中,可以设置合适的膨胀腐蚀的大小,也可以设置连通域筛选的面积,例如,筛选掉小于300像素的连通域。在完成运动目标检测的筛选后,可以在图片帧中大致得到感兴趣的目标,包括标记组件,但是仍然不能排除掉一小部分的干扰。因此,将根据标记组件的边缘特征来识别标记组件的具体位置。从而,步骤S32包括:
子步骤S45,将所述运动目标检测的结果进行边缘检测处理,在边缘检测处理过程中,所提取的边缘包括所述标定组件的边缘。
在一个具体的实施例中,进行边缘检测的算法包括canny算法。
在进行边缘检测处理后,所提取的边缘包含标定组件的边缘,也可能包含不是标定组件的其他物体的边缘。从而,为了更精确确定标定组件的位置,步骤S32包括:
子步骤S46,根据所述标定组件的预设形状,将所提取的边缘进行对应的变换,从而获取所述标定组件的所述位置信息。
例如,标定组件为手环,那么其预设形状为矩形,可以通过相应的变换算法,例如,霍夫变换,提取矩形的各个直线段,从而确定所提取的边缘为手环的边缘。更为具体地,设定一个直线段的数量的阈值,例如2或3,当经过霍夫变换提取的直线段的数量大于等于该阈值时,可以确认该边缘为矩形的边缘,即检测到手环的边缘。
再如,如果编辑组件的预设形状为圆形或椭圆,可以通过相应的变换算法,例如,另一种霍夫变换,提取圆形或椭圆形,从而确定所提取的边缘为标记组件的边缘或边缘的组成部分。
在提取标定组件的边缘或边缘的组成部分时,根据标定组件的预设形状的特点,设置对应的变换算法,提取出标定组件的边缘或边缘的组成部分,对于采用什么样的变换算法,本发明不做限定,只要该变换算法能够提取并确定标定组件的边缘即可。
在获取标记组件的边缘后,就能够知道标记组件的位置信息。例如,标记组件为手环,可以以坐标[X,Y,H,W]表示手环的位置,在一个具体实施例中,X和Y分别表示手环矩形的左上角顶点的横坐标和纵坐标,而H和W分别表示手环矩形的高度和宽度。
图5是根据本发明一个实施例的运动目标检测的流程图。对于视频输入的图片帧序列,选择其中的两个相邻的图片帧(这两个图片帧优选的为图片帧序列的前两个相邻的图片帧)进行运动目标检测。该运动目标检测流程包括:
步骤S51,获取所述图片帧序列中的相邻的第一图片帧和第二图片帧。
步骤S52,从所述第一图片帧和所述第二图片帧中分别提取目标颜色。
目标颜色是标记组件的颜色,提取目标颜色是为了便于对标记组件的检测。目标颜色优选与人体肤色、衣着以及视频背景均不同的颜色,例如,红色或绿色等。
步骤S53,将所述第一图片帧和所述第二图片帧中提取目标颜色进行差分,获得运动目标检测的结果。
图6是根据本发明另一个实施例的运动目标检测的流程图。与图5不同的是,对于视频输入的图片帧序列,选择其中的三个相邻的图片帧(这三个图片帧优选的为图片帧序列的前三个相邻的图片帧)进行运动目标检测。该运动目标检测流程包括:
步骤S61,获取所述图片帧序列中的相邻的第一图片帧、第二图片帧和第三图片帧。
步骤S62,从所述第一图片帧、第二图片帧和第三图片帧中分别提取目标颜色。
目标颜色是标记组件的颜色,提取目标颜色是为了便于对标记组件的检测。目标颜色优选与人体肤色、衣着以及视频背景均不同的颜色,例如,红色或绿色等。
步骤S63,将所述第一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得第一差分结果。
步骤S64,将所述第二图片帧和所述第三图片帧中提取的目标颜色进行差分,获得第二差分结果。
其中,对步骤S63和步骤S64执行的顺序没有限定,步骤S63可以在步骤S64之前执行,也可以在步骤S64之后执行,还可以与步骤S64同时执行。
步骤S65,将所述第一差分结果与所述第二差分结果取交集,获得运动目标检测的结果。
图6所示的运动目标检测过程相对图5能够有效减少图像中存在的噪声。在图5和图6所示的实施例的教示下,本领域技术人员可以想到,对于视频输入的图片帧序列,还可以选择其中的更多个相邻的图片帧进行运动目标检测,这些都属于本申请覆盖的范围。
此外,在一个优选的实施例中,保证跟踪的可靠性,在跟踪图片帧达到设定数目后,需要再次执行对标定组件的检测,获取标定组件的位置信息。从而,本发明的运动检测方法还可以包括:获取跟踪所述图片帧序列所跟踪帧的数目;以及响应于所述跟踪帧的数目达到预设值,再次执行所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息,即再次执行步骤S32或步骤S41。
图7和图8描述了标定组件移动距离的测定。如图7所示,以标记部件102的图形形状为正方形为例。标记部件102的边长L为2cm。检测终端200由标定组件100的视频图像中确定正方形的边对应第一像素数为100,则标定组件100的视频图像中像素对应的实际距离为0.02cm。
以运动为实施心肺复苏为例。在实施心肺复苏的过程中,施救人员进行按压,标定组件100移动时,检测终端200由标定组件的视频图像中确定上极限图像帧和下极限图像帧。根据上极限图像帧和下极限图像帧确定标定组件移动距离对应的第二像素数。
如图8所示,标定组件100移动时,检测终端200由标定组件100的视频图像的各个图像帧中可识别出一次按压操作的上极限图像帧和下极限图像帧。上极限图像帧和下极限图像帧中标记部件102的上极限位和下极限位之间的像素数作为标定组件100移动距离对应的第二像素数。
进行初次按压时,将标定组件100未移动时图像中的图像帧作为初次按压的上极限图像帧;随着标定组件100的下移,视频图像中标记部件102对应的像素不断下移;检测终端200识别到标记部件102对应的像素不再下移时,将此时的一图像帧作为初次按压的下极限图像帧。随着标定组件100的上移,处理模 块202的第二子模块识别到标记部件102对应的像素不再上移时,将此时的一图像帧作为二次按压的上极限图像帧;之后标定组件100下移,检测终端200识别到标记部件102对应的像素不再下移时,将此时的一图像帧作为二次按压的下极限图像帧。如此循环,检测终端200可识别出每次按压对应的上极限图像帧和下极限图像帧。通过上极限图像帧和下极限图像帧,确定每次按压时标定组件100移动距离对应的第二像素数。检测终端200根据述标定组件的视频图像中像素对应的实际距离和第二像素数确定标定组件移动距离。
例如,一次按压中,检测终端200确定标定组件100移动距离S对应的第二像素数为200,标定组件的视频图像中像素对应的实际距离为0.02cm,计算得出标定组件移动距离S为4cm。将4cm作为此次的按压深度。
在实际场景中,标定组件上的标记部件102的法线可能并不指向检测终端200,即检测终端200由斜向拍摄标定组件。此时,处理模块202可根据标记部件的图像变形量确定检测终端200由哪个方向拍摄标定组件100;根据相应角度的余弦关系转换,检测终端200确定标定组件的视频图像中像素对应的实际距离。此设计主要是涉及到人在佩戴标定组件100进行救治时,标定组件100的标记部件102所在平面不一定与标定组件100与检测终端200的连线方向是垂直的。当不垂直时,检测终端200检测到的标记部件102就会形成一定的畸变。例如本来标记部件是圆形时,在标定组件的标记部件所在平面与标定组件和检测终端的连线方向不垂直时,检测到的标记部件就呈现椭圆形。此时虽然检测终端知道标记部件的尺寸,例如圆的直径是2㎝,但在其检测到的图像中椭圆的长轴是2厘米,而短轴不到2㎝。此时,检测终端200就要根据其实际拍摄到的图形来识别出实际的标记部件的尺寸,例如以椭圆的长轴来代表圆形的直径。在圆变为椭圆的情况下,还相对比较简单,而在例如使用矩形、多边形等情况下,畸变会变得复杂。例如矩形包括长、短边,在不垂直时,可能拍摄到的是一个平行四边形。此时需要根据平行四边形的两条相邻边的夹角,判断出该矩形所在平面与(标定组件与检测终端之间的)连线的夹角,进而根据余弦关系转换计算所拍摄到的平行四边形的各边所代表的实物的长度,进而计算出在按压方向上,各像素代表的实际距离。
当标定组件100的标记部件102所在平面不与标定组件100与检测终端200的连线方向垂直时,除了上述检测终端200根据标记部件102的具体形状纠正检测到的标记部件102形成的畸变,获取标记部件102的实际参考尺寸的方式,还可以通过矫正标定组件100与检测终端200所处的参考坐标系的方式,获取标记部件102的实际参考尺寸。
此外,对于检测终端200测量的距离的精度,一方面,检测终端200在拍摄运动过程中使用的摄像头的清晰度越高,精度损失越小,即精度越高;另一方面,依据如下精度损失的公式:
Figure PCTCN2020093981-appb-000001
其中,ε eref和ε pref分别表示测量时的边缘选取造成的误差和像素本身的误差,ε ereal和ε preal分别实际待测目标距离的误差和参考距离的误差,l ref和l real分别代表参考距离和实际待测目标的距离,参考距离表示运动过程中第一极限位置点的标定组件100的第一设定参考基准线至第二极限位置点的标定组件100的第二设定参考基准线的距离,而实际待测目标的距离表示运动过程中第一极限位置点的标定组件100的第一设定参考基准线至第二极限位置点的标定组件100的所述第一设定参考基准线的距离。例如,对于进行上下运动(例如心肺复运动)过程来说,参考距离表示运动过程最高点的标定组件100(例如,手环)的上边沿至最低点的标定组件100的下边沿的距离,而实际待测目标的距离表示运动过程最高点的标定组件100(例如,手环)的上边沿至最低点的标定组件100的上边沿的距离。
从上述公式可以看出,以看到当参考距离越大,精度损失E就会逐渐变小。从而可知,拍摄时的摄像头的像素值和实际距离的测量都会造成实验时的精度误差,一方面通过使用高清摄像头,另一方面通过增加参考距离,可以有效缩减实验中的误差。
尽管上面实施例结合心肺复苏检测描述了具体的算法,但本方案不限于应用于该场景,而是还可以应用于诸如肢体、身体运动的跟踪和测量上,进而可以应用到健身、康复等各种肢体运动的场景中的运动检测,例如:体育运动打分(体操等)、健身(例如原地快速蹬踏,检测其频率拐点)、康复、身体运用机能测量、舞蹈、拉琴(如小提琴)、打鼓等。
本方案不仅可以采集心肺复苏时的上半身运动数据,还可以在平时采集人体原地训练数据,如计算原地快速抬落腿,俯卧撑的频率、次数、深度等指标。在康复者需要运动的身体部分,比如手臂、腿、腰上带上标定装置,比如手环、腿环等,利用手机摄像头拍摄监控运动过程,监测运动幅度、频率、轨迹等,并能給出幅度测量记录(分辨率2mm,精度5mm)、频率记录、轨迹在视频上画出等功能。
根据本发明的运动检测方法,通过运动目标检测过程,通过检测目标颜色且处于运动的物体,能够大致识别标记组件的位置,在经过膨胀腐蚀和连通域筛选处理后,还能够去除图片中的噪声和干扰,然后通过边缘检测并将所提取的边缘进行对应的变换,能够精确识别标记组件,并获取标记组件的位置信息。最后,在获取标记的位置信息后再进行跟踪和距离测量。本发明的运动检测方法能够实现更精确和更快速的目标检测、跟踪和测量。
根据本发明的另一个方面,提供一种运动检测装置。如图9所示,该装置包括如下模块:
拍摄模块91,用于拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件。
被检测者佩戴标定组件,所述标定组件可以为手环、脚环等。在被检测者佩戴标定组件后,检测终端可以拍摄被检测者的运动,形成视频输入,然后将视频输入转换为图片帧序列,形成图片帧序列。
检测模块92,用于所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息。
在将视频输入转换为图片帧序列后,首先需要识别图片中标定组件的位置,在获取标定位置的位置信息后,才便于后续对标定组件的跟踪以及根据跟踪后的结果对标定组件移动距离的测量。在图10、图11和图12中将会对检测模块92进行更详细的描述。
跟踪模块93,用于根据跟踪算法跟踪所述图片帧序列中的所述标定组件。
为了保证测距的速度,需要对标定组件进行目标检测并进行跟踪。在通过检测模块92获得标定组件的位置信息后,由于标定组件处于运动的状态,需要保持对标定组件的跟踪。通过跟踪算法,保证在目标在仅仅有微弱形变且快速移动的时候保证良好的跟踪效果,能够提取出标定组件移动的轨迹。
在一个优选的实施例中,跟踪算法可以包括KCF算法(Kernel Correlation Filter,核相关滤波算法)。KCF算法具有如下优点:实现简洁、效果好、速度快。通过循环矩阵位移产生大量样本来解决问题,并且通过离散傅里叶变换的推导,在频域计算速度极快。在缺少样本的情况下,通过简单的方法检测,连接核运算进行跟踪,保证了跟踪的泛化能力。
测定模块94,用于测定所述标定组件的移动距离。
首先,检测终端200预先知道标定组件100上的标记部件102的预定尺寸,并在捕捉到标记部件102后,获知标记部件102所占用的像素值。然后,在跟踪标定组件的过程中,提取标定组件运动过程中的极值点的位置信息,该极值点的位置信息包括上下运动的最上位置时的位置信息以及最下位置的位置信息,或者包括左右运动的最左位置时的位置信息以及最右位置的位置信息,当然,极值点的位置信息还可以包括其他运动极限位置的信息。通过取标定组件运动过程中的极值点的位置信息,获知标定组件运动过程中所占用的像素值,然后依据标记部件102的尺寸以及标记部件102所占用的像素值,获得标定组件的运动距离。
图10是根据本发明一个实施例的图9所示的检测模块92的示意图。如图10所示,检测模块92包括如下单元:
运动目标检测单元101,用于对所述图片帧序列进行运动目标检测。
运动目标检测用于提取图片帧中标定组件的信息。运动目标检测算法有很多种,包括背景减除法、光流法和帧差法。在一个优选的实施例中,采用帧差法实施运动目标检测。其中,采用帧差法实施运动目标检测如图11和图12所示,下文将会进行详细介绍。
在一个可选的实施例中,为了减少计算量,检测模块92还可以包括如下单元:
二值化处理单元102,用于对所述运动目标检测后的结果进行二值化处理。
通过二值化处理,滤除掉多余信息,将颜色信息处理为黑和白,能够大大减少计算量。
在另一个可选的实施例中,为了减少滤除掉除了标定组件外的小面积的噪声干扰,检测模块92还可以包括如下单元:
膨胀腐蚀处理单元103,用于对二值化处理后的结果进行膨胀腐蚀处理;以及
连通域筛选处理单元104,用于对膨胀腐蚀后的结果进行连通域筛选处理。
其中,可以设置合适的膨胀腐蚀的大小,也可以设置连通域筛选的面积,例如,筛选掉小于300像素的连通域。
在完成运动目标检测的筛选后,可以在图片帧中大致得到感兴趣的目标,包括标记组件,但是仍然不能排除掉一小部分的干扰。因此,将根据标记组件的边缘特征来识别标记组件的具体位置。从而,检测模块92包括:
边缘处理单元105,用于将所述运动目标检测的结果进行边缘检测处理,在边缘检测处理过程中,所提取的边缘包括所述标定组件的边缘。
在一个具体的实施例中,进行边缘检测的算法包括canny算法。在进行边缘检测处理后,所提取的边缘包含标定组件的边缘,也可能包含不是标定组件的其他物体的边缘。从而,为了更精确确定标定组件的位置,检测模块92包括:
边缘变换单元106,用于根据所述标定组件的预设形状,将所提取的边缘进行对应的变换,从而获取所述标定组件的所述位置信息。
例如,标定组件为手环,那么其预设形状为矩形,可以通过相应的变换算法,例如,霍夫变换,提取矩形的各个直线段,从而确定所提取的边缘为手环的边缘。更为具体地,设定一个直线段的数量的阈值,例如2或3,当经过霍夫变换提取的直线段的数量大于等于该阈值时,可以确认该边缘为矩形的边缘,即检测到手环的边缘。
再如,如果编辑组件的预设形状为圆形或椭圆,可以通过相应的变换算法,例如,另一种霍夫变换,提取圆形或椭圆形,从而确定所提取的边缘为标记组件的边缘或边缘的组成部分。
在提取标定组件的边缘或边缘的组成部分时,根据标定组件的预设形状的特点,设置对应的变换算法,提取出标定组件的边缘或边缘的组成部分,对于采用什么样的变换算法,本发明不做限定,只要该变换算 法能够提取并确定标定组件的边缘即可。
在获取标记组件的边缘后,就能够知道标记组件的位置信息。例如,标记组件为手环,可以以坐标[X,Y,H,W]表示手环的位置,在一个具体实施例中,X和Y分别表示手环矩形的左上角顶点的横坐标和纵坐标,而H和W分别表示手环矩形的高度和宽度。
图11是根据本发明一个实施例的运动目标检测模块的示意图。对于视频输入的图片帧序列,选择其中的两个相邻的图片帧(这两个图片帧优选的为图片帧序列的前两个相邻的图片帧)进行运动目标检测。该运动目标检测单元包括:
第一图片帧获取子单元111,用于获取所述图片帧序列中的相邻的第一图片帧和第二图片帧。
第一颜色提取子单元112,用于从所述第一图片帧和所述第二图片帧中分别提取目标颜色。
目标颜色是标记组件的颜色,提取目标颜色是为了便于对标记组件的检测。目标颜色优选与人体肤色、衣着以及视频背景均不同的颜色,例如,红色或绿色等。
第一差分子单元113,用于将所述第一图片帧和所述第二图片帧中提取目标颜色进行差分,获得运动目标检测的结果。
图12是根据本发明一个实施例的运动目标检测模块的示意图。与图11不同的是,对于视频输入的图片帧序列,选择其中的三个相邻的图片帧(这三个图片帧优选的为图片帧序列的前三个相邻的图片帧)进行运动目标检测。该运动目标检测单元包括:
第二图片帧获取子单元121,用于获取所述图片帧序列中的相邻的第一图片帧、第二图片帧和第三图片帧。
第二颜色提取子单元122,用于从所述第一图片帧、第二图片帧和第三图片帧中分别提取目标颜色。
目标颜色是标记组件的颜色,提取目标颜色是为了便于对标记组件的检测。目标颜色优选与人体肤色、衣着以及视频背景均不同的颜色,例如,红色或绿色等。
第二差分子单元123,用于将所述第一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得第一差分结果。
第三差分子单元124,用于将所述第二图片帧和所述第三图片帧中提取的目标颜色进行差分,获得第二差分结果。
取交集子单元125,用于将所述第一差分结果与所述第二差分结果取交集,获得运动目标检测的结果。
图12所示的运动目标检测过程相对图11能够有效减少图像中存在的噪声。在图11和图12所示的实施例的教示下,本领域技术人员可以想到,对于视频输入的图片帧序列,还可以选择其中的更多个相邻的图片帧进行运动目标检测,这些都属于本申请覆盖的范围。
此外,在一个优选的实施例中,保证跟踪的可靠性,在跟踪图片帧达到设定数目后,需要再次执行对标定组件的检测,获取标定组件的位置信息。从而,本发明的运动检测装置还可以包括:获取模块,用于获取跟踪所述图片帧序列所跟踪帧的数目。这样,在跟踪帧的数目达到预设值后,使得检测模块92再次执行所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息。
根据本发明的运动检测装置,通过运动目标检测过程,通过检测目标颜色且处于运动的物体,能够大致识别标记组件的位置,在经过膨胀腐蚀和连通域筛选处理后,还能够去除图片中的噪声和干扰,然后通过边缘检测并将所提取的边缘进行对应的变换,能够精确识别标记组件,并获取标记组件的位置信息。最后,在获取标记的位置信息后再进行跟踪和距离测量。本发明的运动检测装置能够实现更精确和更快速的目标检测、跟踪和测量。
根据本申请的另一方面,提供了一种电子设备,其包括处理器和存储器,该存储器存储有计算机程序,当该计算机程序被该处理器执行时,使得该处理器执行如以上任一个实施方式所述的运动检测方法。
根据本申请的另一方面,提供了一种计算机可读存储介质,其上存储有计算机可读指令,当该指令被处理器执行时,能够使得该处理器执行如以上任一个实施方式所述的运动检测方法。具体来说,该运动检测方法包括:拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件;对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息;根据跟踪算法跟踪所述图片帧序列中的所述标定组件;以及测定所述标定组件的移动距离。
其中,所述对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息包括:对所述图片帧序列进行运动目标检测;将所述运动目标检测的结果进行边缘检测处理,在边缘检测处理过程中,所提取的边缘包括所述标定组件的边缘;以及根据所述标定组件的预设形状,将所提取的边缘进行对应的变换,从而获取所述标定组件的所述位置信息。
其中,所述对所述图片帧序列进行运动目标检测包括:获取所述图片帧序列中的相邻的第一图片帧和第二图片帧;从所述第一图片帧和所述第二图片帧中分别提取目标颜色;将所述第一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得运动目标检测的结果。
其中,所述对所述图片帧序列进行运动目标检测包括:获取所述图片帧序列中的相邻的第一图片帧、第二图片帧和第三图片帧;从所述第一图片帧、第二图片帧和第三图片帧中分别提取目标颜色;将所述第 一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得第一差分结果;将所述第二图片帧和所述第三图片帧中提取的目标颜色进行差分,获得第二差分结果;将所述第一差分结果与所述第二差分结果取交集,获得运动目标检测的结果。
其中,所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息还包括:对所述运动目标检测后的结果进行二值化处理。
其中,所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息还包括:对二值化处理后的结果进行膨胀腐蚀处理;以及对膨胀腐蚀后的结果进行连通域筛选处理。
其中,所述跟踪算法包括KCF算法,所述边缘检测处理包括采用canny算法,并且/或者所述运动目标检测包括背景减除法、光流法和帧差法。
进一步地,该运动检测方法还包括:获取跟踪所述图片帧序列所跟踪帧的数目;以及响应于所跟踪帧的数目达到预设值,再次执行所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过其通信部件从网络上被下载和安装,和/或从可拆卸介质被安装。在该计算机程序被中央处理单元(CPU)执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括接收单元、查找单元、发送单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,接收单元还可以被描述为“接收用于索取区块链账户地址信息的用户请求的单元”。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置执行如上所述的方法。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (11)

  1. 一种运动检测方法,其包括:
    拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件;
    对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息;
    根据跟踪算法跟踪所述图片帧序列中的所述标定组件;以及
    测定所述标定组件的移动距离。
  2. 如权利要求1所述的方法,其中,所述对所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息包括:
    对所述图片帧序列进行运动目标检测;
    将所述运动目标检测的结果进行边缘检测处理,在边缘检测处理过程中,所提取的边缘包括所述标定组件的边缘;以及
    根据所述标定组件的预设形状,将所提取的边缘进行对应的变换,从而获取所述标定组件的所述位置信息。
  3. 如权利要求2所述的方法,其中,所述对所述图片帧序列进行运动目标检测包括:
    获取所述图片帧序列中的相邻的第一图片帧和第二图片帧;
    从所述第一图片帧和所述第二图片帧中分别提取目标颜色;
    将所述第一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得运动目标检测的结果。
  4. 如权利要求2所述的方法,其中,所述对所述图片帧序列进行运动目标检测包括:
    获取所述图片帧序列中的相邻的第一图片帧、第二图片帧和第三图片帧;
    从所述第一图片帧、第二图片帧和第三图片帧中分别提取目标颜色;
    将所述第一图片帧和所述第二图片帧中提取的目标颜色进行差分,获得第一差分结果;
    将所述第二图片帧和所述第三图片帧中提取的目标颜色进行差分,获得第二差分结果;
    将所述第一差分结果与所述第二差分结果取交集,获得运动目标检测的结果。
  5. 如权利要求2所述的方法,所述对视频输入的图片帧序列中的标定组件进 行检测,获取所述标定组件的位置信息还包括:
    对所述运动目标检测后的结果进行二值化处理。
  6. 如权利要求5所述的方法,所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息还包括:
    对二值化处理后的结果进行膨胀腐蚀处理;以及
    对膨胀腐蚀后的结果进行连通域筛选处理。
  7. 如权利要求2所述的方法,其中,
    所述跟踪算法包括KCF算法,
    所述边缘检测处理包括采用canny算法,并且/或者
    所述运动目标检测包括背景减除法、光流法和帧差法。
  8. 如权利要求1所述的方法,还包括:
    获取跟踪所述图片帧序列所跟踪帧的数目;以及
    响应于所跟踪帧的数目达到预设值,再次执行所述对视频输入的图片帧序列中的标定组件进行检测,获取所述标定组件的位置信息。
  9. 一种运动检测装置,其包括:
    拍摄模块,用于拍摄被检测者的运动,形成图片帧序列,所述被检测者佩戴标定组件;
    检测模块,用于所述图片帧序列中的所述标定组件进行检测,获取所述标定组件的位置信息;
    跟踪模块,用于根据跟踪算法跟踪所述图片帧序列中的所述标定组件;以及
    测定模块,用于测定所述标定组件的移动距离。
  10. 一种电子设备,包括:
    处理器;以及
    存储器,存储有计算机程序,当所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1-8中任一项所述的方法。
  11. 一种计算机可读存储介质,其上存储有计算机可读指令,当所述指令被处理器执行时,使得所述处理器执行如权利要求1-8中任一项所述的方法。
PCT/CN2020/093981 2020-06-02 2020-06-02 运动检测方法和装置、电子设备以及计算机可读存储介质 WO2021243572A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2020/093981 WO2021243572A1 (zh) 2020-06-02 2020-06-02 运动检测方法和装置、电子设备以及计算机可读存储介质
CN202080001060.9A CN112292688A (zh) 2020-06-02 2020-06-02 运动检测方法和装置、电子设备以及计算机可读存储介质
TW110110400A TWI778552B (zh) 2020-06-02 2021-03-23 運動檢測方法和裝置、電子設備以及內儲程式之電腦可讀取記錄媒體

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/093981 WO2021243572A1 (zh) 2020-06-02 2020-06-02 运动检测方法和装置、电子设备以及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2021243572A1 true WO2021243572A1 (zh) 2021-12-09

Family

ID=74425093

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093981 WO2021243572A1 (zh) 2020-06-02 2020-06-02 运动检测方法和装置、电子设备以及计算机可读存储介质

Country Status (3)

Country Link
CN (1) CN112292688A (zh)
TW (1) TWI778552B (zh)
WO (1) WO2021243572A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132925A (zh) * 2023-10-26 2023-11-28 成都索贝数码科技股份有限公司 一种体育赛事的智能场记方法及装置

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023123213A1 (zh) * 2021-12-30 2023-07-06 焦旭 手部按压深度检测方法及装置
WO2023123214A1 (zh) * 2021-12-30 2023-07-06 焦旭 电子设备、手部按压深度检测方法、系统以及穿戴设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408942A (zh) * 2008-04-17 2009-04-15 浙江师范大学 一种复杂背景下的车牌定位方法
CN103198492A (zh) * 2013-03-28 2013-07-10 沈阳航空航天大学 一种人体运动捕获方法
CN108986141A (zh) * 2018-07-03 2018-12-11 百度在线网络技术(北京)有限公司 物体运动信息处理方法、装置、增强现实设备及存储介质
US20190318645A1 (en) * 2016-12-27 2019-10-17 Coaido Inc. Measurement device
CN110968182A (zh) * 2018-09-30 2020-04-07 广东虚拟现实科技有限公司 定位追踪方法、装置及其穿戴式设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110111364B (zh) * 2019-04-30 2022-12-27 腾讯科技(深圳)有限公司 运动检测方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408942A (zh) * 2008-04-17 2009-04-15 浙江师范大学 一种复杂背景下的车牌定位方法
CN103198492A (zh) * 2013-03-28 2013-07-10 沈阳航空航天大学 一种人体运动捕获方法
US20190318645A1 (en) * 2016-12-27 2019-10-17 Coaido Inc. Measurement device
CN108986141A (zh) * 2018-07-03 2018-12-11 百度在线网络技术(北京)有限公司 物体运动信息处理方法、装置、增强现实设备及存储介质
CN110968182A (zh) * 2018-09-30 2020-04-07 广东虚拟现实科技有限公司 定位追踪方法、装置及其穿戴式设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117132925A (zh) * 2023-10-26 2023-11-28 成都索贝数码科技股份有限公司 一种体育赛事的智能场记方法及装置
CN117132925B (zh) * 2023-10-26 2024-02-06 成都索贝数码科技股份有限公司 一种体育赛事的智能场记方法及装置

Also Published As

Publication number Publication date
TWI778552B (zh) 2022-09-21
TW202145957A (zh) 2021-12-16
CN112292688A (zh) 2021-01-29

Similar Documents

Publication Publication Date Title
TWI778552B (zh) 運動檢測方法和裝置、電子設備以及內儲程式之電腦可讀取記錄媒體
US10963041B2 (en) Gesture recognition using multi-sensory data
WO2018176938A1 (zh) 红外光斑中心点提取方法、装置和电子设备
CN109583304A (zh) 一种基于结构光模组的快速3d人脸点云生成方法及装置
Liang et al. A novel multicamera system for high-speed touchless palm recognition
JP2008152622A (ja) ポインティング装置
US11328535B1 (en) Motion identification method and system
WO2017161734A1 (zh) 通过电视和体感配件矫正人体动作及系统
CN111012353A (zh) 一种基于人脸关键点识别的身高检测方法
WO2016143402A1 (ja) 情報処理装置及び情報処理方法
WO2022087846A1 (zh) 图像的处理方法、装置、设备以及存储介质
Yang et al. Multiple marker tracking in a single-camera system for gait analysis
TWM610371U (zh) 動作識別系統
CN111387987A (zh) 一种基于图像识别的身高测量方法、装置、设备及存储介质
KR20100025048A (ko) 모션 캡쳐를 위한 영상 분석 방법 및 장치
CN110781712B (zh) 一种基于人脸检测与识别的人头空间定位方法
JP2008288684A (ja) 人物検出装置及びプログラム
KR20100071822A (ko) 이미지에서의 의류 검출 장치와 그 방법
CN114463663A (zh) 一种人员身高的计算方法、装置、电子设备及存储介质
Scebba et al. Multispectral camera fusion increases robustness of ROI detection for biosignal estimation with nearables in real-world scenarios
WO2019097690A1 (ja) 画像処理装置、制御方法及び制御プログラム
KR101738589B1 (ko) 영상인식을 이용한 스트레칭 가이드 시스템
Huang et al. Accurate and efficient pulse measurement from facial videos on smartphones
JP2018101285A (ja) 生体画像処理装置、生体画像処理方法および生体画像処理プログラム
CN110222688A (zh) 一种基于多层次相关滤波的仪表定位方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20938614

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20938614

Country of ref document: EP

Kind code of ref document: A1