Video processing method, device, system, equipment, medium and program product
By combining the data of depth cameras and color cameras in sports scenes, using mask processing and target detection models, the problem of insufficient target object detection accuracy in traditional technology is solved, and high-precision, real-time video processing is achieved, which is suitable for sports videos. automated analysis.
Patent Information
- Application Number
- CN202410742033.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-30
AI Technical Summary
In sports scenes, traditional technology is difficult to accurately distinguish the target object from the background, resulting in insufficient accuracy and real-time performance of sports video processing, and cannot meet the needs of high-precision and real-time analysis.
Adopt an artificial intelligence-based video processing method to collect depth maps through a depth camera and two-dimensional images through a color camera. Combined with mask processing and target detection models, the video processing start time is determined, background interference is eliminated, and target object detection accuracy and video processing are improved. accuracy.
It achieves high-precision detection and video processing of target objects in complex sports scenes, avoids interference from equipment motion, improves the accuracy and real-time performance of video processing, and ensures the efficiency of automated processing and analysis of sports videos.
Smart Images

Figure CN118570179A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, specifically to technical fields such as computer vision, deep learning, and AIGC, and can be applied to scenarios such as smart sports. Background Art
[0002] With the development of computer technology and network technology, the application of artificial intelligence is becoming more and more extensive, and artificial intelligence has made breakthrough progress in various fields. For example, in the field of computer vision, deep learning models can be used to analyze collected images or videos.
[0003] In the field of sports, although the concept of smart sports has been proposed, how to combine artificial intelligence with specific needs remains to be studied. Due to the growing demand for high-precision, real-time sports performance analysis, it will be a general trend to combine artificial intelligence with specific needs in the field of sports. Summary of the invention
[0004] The present disclosure aims to provide an artificial intelligence-based video processing method, apparatus, system, device, medium and program product that can effectively avoid background interference.
[0005] According to a first aspect of the present disclosure, there is provided an artificial intelligence-based video processing method, comprising: determining a target pixel in a captured depth map whose depth value is within a predetermined depth range; performing mask processing on a captured two-dimensional image according to the target pixel to obtain a masked image; the two-dimensional image and the depth map are captured at the same time, and the two-dimensional image and the depth map are aligned pixel by pixel; and in response to detecting a target object in the masked image, determining a start time for video processing to start video processing for the target object.
[0006] According to a second aspect of the present disclosure, there is provided an artificial intelligence-based video processing device, comprising: a pixel determination module, for determining a target pixel whose depth value in a captured depth map is within a predetermined depth range; a mask processing module, for performing mask processing on a captured two-dimensional image according to the target pixel to obtain a masked image; the two-dimensional image and the depth map are captured at the same time, and the two-dimensional image and the depth map are aligned pixel by pixel; and a processing determination module, for determining a start time for video processing in response to detecting a target object in the masked image, so as to start video processing for the target object.
[0007] According to the third aspect of the present disclosure, there is provided an artificial intelligence-based video processing system, comprising: an image acquisition device for acquiring depth maps and two-dimensional images; and an electronic device, communicatively connected to the image acquisition device to receive the depth maps and two-dimensional images acquired by the image acquisition device, wherein the electronic device is configured to: execute the artificial intelligence-based video processing method provided by the first aspect of the present disclosure.
[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the artificial intelligence-based video processing method provided by the present disclosure.
[0009] According to a fifth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the artificial intelligence-based video processing method provided by the present disclosure.
[0010] According to a sixth aspect of the present disclosure, a computer program product is provided, comprising a computer program / instructions, wherein the computer program / instructions are stored on at least one of a readable storage medium and an electronic device, and wherein the computer program / instructions, when executed by a processor, implement the artificial intelligence-based video processing method provided by the present disclosure.
[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 is a schematic diagram of an application scenario of an artificial intelligence-based video processing method, device, and system according to an embodiment of the present disclosure;
[0014] Figure 2 is a flowchart of a video processing method based on artificial intelligence according to an embodiment of the present disclosure;
[0015] Figure 3 is a schematic diagram of the principle of performing mask processing on a two-dimensional image according to an embodiment of the present disclosure;
[0016] Figure 4 is a schematic diagram of the principle of determining the timing of starting video processing according to an embodiment of the present disclosure;
[0017] Figure 5 is a schematic diagram of an implementation principle of a video processing method based on artificial intelligence according to an embodiment of the present disclosure;
[0018] Figure 6 is a structural schematic diagram of a video processing device based on artificial intelligence according to an embodiment of the present disclosure; and
[0019] Figure 7 It is a block diagram of an electronic device used to implement the artificial intelligence-based video processing method of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0021] In the field of sports or fitness, there is a growing demand for high-precision, real-time recording and analysis of sports. This demand stems from athletes' constant pursuit of performance optimization. For example, athletes pursue projects such as accurate analysis of technical details, timely adjustment of sports strategies, and effective management of injury prevention. Traditional technologies for processing sports often rely on the results of manual observation to determine the timing of processing or determine the timing of processing when a target object is detected. However, due to the complex scenes of many people in sports venues, traditional detection technologies cannot accurately distinguish between target objects and other objects in motion, and therefore cannot achieve the required accuracy.
[0022] In order to improve the detection accuracy, a depth camera can be used to detect the target object, for example, to detect whether the object is included in a predetermined depth area, and if so, to determine that the target object is detected. The detection accuracy of this method may be affected by the sports equipment on which the target object relies when moving.
[0023] In order to solve the above problems, the present disclosure provides a video processing method, device, system, equipment, medium and program product based on artificial intelligence. Figure 1 The application scenarios of the method and device provided by the present disclosure are described.
[0024] Figure 1 It is a schematic diagram of an application scenario of an artificial intelligence-based video processing method, device, and system according to an embodiment of the present disclosure.
[0025] like Figure 1 As shown, the application scenario 100 may include an electronic device 110 and a collection device 120. The collection device 120 may be connected to the electronic device 110 via a network to communicate with the electronic device 110 so as to transmit the collected data to the electronic device 110.
[0026] The electronic device 110 may be any electronic device with processing capability, such as a smart phone, a tablet computer, a portable computer, a desktop computer or a server. The acquisition device 120 may include one or more image acquisition devices to acquire sports videos of a target object 130 (eg, an athlete or a bodybuilder).
[0027] The electronic device 110 may, for example, analyze the image captured by the acquisition device 120. For example, it may analyze whether there is a target object at a predetermined distance from the acquisition device 120 in the image captured by the acquisition device 120. And according to the presence of the target object, the video processing timing (for example, the video recording timing) is determined to process the video captured during the target object's participation in the sports event, so as to facilitate the subsequent analysis of the target object's movements based on the processed sports video.
[0028] In one embodiment, there may be one or more acquisition devices, and the acquisition device may not only acquire motion video, but also synchronously acquire depth images, and transmit the synchronously acquired motion video and depth images to the electronic device 110. For example, the electronic device 110 may refer to the depth map and the motion video to determine whether there is a target object at a predetermined distance from the acquisition device 120. For example, the acquisition device may include a depth camera and a color camera, etc., which is not limited in the present disclosure.
[0029] When capturing sports videos, the target object 130 may, for example, participate in sports such as rings, weightlifting, horizontal bar, parallel bars, pommel horse, and the like, and may also perform fitness exercises such as plank support, running, and yoga.
[0030] In one embodiment, the application scenario 100 may further include a playback device 140, which may be integrated into the electronic device 110 or may be independent of the electronic device 110. After the electronic device 110 completes processing of the sports video, the processed sports video may be played via the playback device 140, so that athletes or coaches and other relevant personnel may watch and analyze the sports movements in the sports video.
[0031] The application scenario may not only be a scenario involved in the professional sports field, but also a scenario involved in school sports activities or business sports activities, or a scenario involved in a gym, etc., and the present disclosure does not limit this.
[0032] It should be noted that the video processing method based on artificial intelligence provided in the present disclosure can be executed by the electronic device 110. Accordingly, the video processing device based on artificial intelligence provided in the present disclosure can be set in the electronic device 110.
[0033] It should be understood that Figure 1The number and type of the electronic devices 110, the acquisition devices 120 and the playback devices 140 in the embodiment are merely illustrative. Any number and type of electronic devices 110, the acquisition devices 120 and the playback devices 140 may be provided as required.
[0034] The following will be combined Figure 2~Figure 5 The artificial intelligence-based video processing method provided by the present disclosure is described in detail.
[0035] Figure 2 It is a flowchart of an artificial intelligence-based video processing method according to an embodiment of the present disclosure.
[0036] like Figure 2 As shown, the artificial intelligence-based video processing method 200 of this embodiment may include operations S210 to S230.
[0037] In operation S210 , a target pixel whose depth value in a collected depth map is located in a predetermined depth range is determined.
[0038] According to an embodiment of the present disclosure, the predetermined depth interval can be determined according to the distance between the acquisition device and the motion area of the target object. For example, if the motion area of the target object is located within a range of 3m to 5m from the acquisition device, the predetermined depth interval can be set to [3m, 5m]. It is understood that the setting of the predetermined depth interval is only used as an example to facilitate understanding of the present disclosure, and the present disclosure does not limit this.
[0039] The acquisition device may acquire the depth map in real time, and this embodiment may determine the target pixel for each depth map acquired by the acquisition device.
[0040] In operation S220, mask processing is performed on the acquired two-dimensional image according to the target pixel to obtain a masked image.
[0041] According to an embodiment of the present disclosure, the two-dimensional image may be a color image, such as an RGB image, etc., which is not limited in the present disclosure. The two-dimensional image may be acquired synchronously with the depth map, that is, the acquisition time of the two-dimensional image is the same as the acquisition time of the depth map. Furthermore, the depth map and the two-dimensional image are two images aligned pixel by pixel. For example, the alignment of the two images can be achieved based on the calibration of the internal and external parameters of the acquisition device that acquires the two images.
[0042] This embodiment can first determine the pixel position in the color image corresponding to the position of the target pixel in the depth map, and set the pixel values of all pixels in the color image except the pixel at the pixel position to 0, thereby completing the masking process of the two-dimensional image and obtaining a masked image.
[0043] In operation S230 , in response to the target object being detected in the masked image, a video processing start timing is determined to start video processing for the target object.
[0044] According to an embodiment of the present disclosure, a target detection model may be used to detect the masked image. The target detection model may be a deep learning model, for example, any one of the following models may be used: YOLO series model, RetinaNet model, Faster R-CNN model, Mask R-CNN model, CenterNet model, Detection Transformer (DETR) model, Cascade R-CNN model, Single Shot MultiBox Detector (SSD) model or Fully Convolutional One-Stage Object Detection (FCOS) model, etc., and the present disclosure does not limit this.
[0045] The embodiment of the present disclosure can determine that the timing of starting video processing has been reached after the target object is detected from the masked image, and start processing the video including the target object. The target object can be, for example, an athlete participating in a sport. For example, the processing of the video can include recording the video, and timely recording the motion video of the target object, which is not limited by the present disclosure.
[0046] The disclosed embodiment can effectively remove objects in the background from the image for target detection by performing masking on the two-dimensional image according to the target pixels whose depth values are located in a predetermined depth interval before detecting the target object and determining the start time of video processing, and detecting the target object on the masked image. This can improve the detection accuracy of the target object, improve the accuracy of the determined start time of video processing and the effectiveness and pertinence of the processed video, and realize automatic and accurate processing of the video. At the same time, compared with the technical solution of determining the start time of video processing based only on the depth map, since the start time of video processing is determined only when the target object is detected, rather than when the pixel located in the predetermined depth interval is detected, the start time of video processing is determined. Therefore, the influence of the instrument on the start time of video processing when the target object is based on the movement of the instrument can be effectively avoided, thereby further improving the accuracy of the determined start time of video processing and the effectiveness and pertinence of the processed video.
[0047] In one embodiment, the predetermined depth interval can be determined based on the position of the target device, and the target object is an object based on the movement of the target device. The target device can be, for example, a fitness device, a ring, a horizontal bar, a parallel bar, a pommel horse, or other devices, and the depth interval can be determined based on the position of the target device relative to the acquisition device, and the posture of the target object based on the movement of the target device. For example, the size of the predetermined depth interval can be determined based on the depth difference between the point where the target object's body is closest to the acquisition device and the point where the target object's body is farthest from the acquisition device when the target device moves. For example, if the target device is 4m away from the acquisition device and the depth difference between the target object's body and the acquisition device is 2m, the predetermined depth interval can be determined to be [3m, 5m]. It can be understood that the setting principle of the above-mentioned predetermined depth interval can be determined according to actual needs, and the present disclosure does not limit this.
[0048] Figure 3 It is a schematic diagram of the principle of performing mask processing on a two-dimensional image according to an embodiment of the present disclosure.
[0049] like Figure 3 As shown, in embodiment 300, a target pixel whose depth value is within a predetermined depth range in depth map 310 may be determined first. Then, based on the position of the target pixel in depth map 310, mask processing may be performed on the two-dimensional image 320 to obtain a masked image 340.
[0050] For example, a mask image 330 may be generated according to the position of the target pixel in the depth map 310 in the depth map 310. In the mask image 330, the pixel value of the pixel corresponding to the target pixel is 1, and the pixel value of the pixel corresponding to other pixels except the target pixel is 0. Subsequently, this embodiment may perform mask processing on the two-dimensional image 320 based on the mask image 330. For example, the mask image 330 may be multiplied pixel by pixel with the two-dimensional image 320 to obtain the masked image 340.
[0051] After obtaining the masked image 340 , the target detection model 350 may be used to perform target detection on the masked image 340 to determine whether the masked image 340 includes a target object.
[0052] In one embodiment, the depth map and the two-dimensional image are aligned pixel by pixel. For example, the depth map is acquired by a depth camera, and the two-dimensional image is acquired by a color camera. The depth camera and the color camera may be calibrated with intrinsic and extrinsic parameters in advance. By converting the depth map acquired by the depth camera into first point cloud data in a deep three-dimensional coordinate system based on the intrinsic parameters of the depth camera, the first point cloud data may be converted into second point cloud data in a color three-dimensional coordinate system based on the relative extrinsic parameters of the depth camera and the color camera, and the second point cloud data may be converted into a two-dimensional depth image based on the intrinsic parameters of the color camera. The target pixel determined in this embodiment is an image pixel in the two-dimensional depth image.
[0053] In one embodiment, a 3D somatosensory camera can be used to collect depth maps and two-dimensional images. In this way, the collected depth maps and two-dimensional images are two images aligned pixel by pixel. Among them, the 3D somatosensory camera can be, for example, Kinect, which has image alignment and coordinate conversion functions. In this way, there is no need to align the collected depth image and two-dimensional image, which can improve the timeliness of determining the timing of starting video processing. By executing the artificial intelligence-based video processing method provided by the present disclosure, the video can be processed in time when the target object performs movement, which is conducive to the real-time processing and analysis of motion video.
[0054] Figure 4 It is a schematic diagram of the principle of determining the timing of starting video processing according to an embodiment of the present disclosure.
[0055] In one embodiment, depth maps and two-dimensional images can be collected in real time and continuously. After the target object is detected from the masked image, the mask processing can continue to be performed on the subsequently collected two-dimensional image based on the subsequently collected depth map. When the target object is detected from a predetermined number of masked images obtained continuously, it is determined that the timing for starting video processing has been reached. In this way, it is possible to avoid the situation where inaccurate detection caused by the instability of the neural network for detecting the target object, and video processing is performed before the actual video processing timing has been reached. At the same time, it is also possible to avoid the situation where the processed video is invalid because the target object, etc., does not move but briefly stays in the moving area. For example, in a video recording scenario, the effectiveness of the recorded video can be improved, which is conducive to improving the accuracy and efficiency of subsequent video analysis.
[0056] For example, the masked image of the target object can also be used as the target image, and the duration of the target image being detected can be monitored. If the duration of the target image being detected is greater than the first predetermined duration, it is determined that the timing for starting video processing has been reached. The first predetermined duration can be determined, for example, based on the characteristics of the movement performed by the target object. For example, the first predetermined duration can be determined based on the duration of the preparation phase before performing a formal action during movement. If the duration of the preparation phase is longer, the first predetermined duration can be set to a larger value.
[0057] In one embodiment, the duration may be understood as the duration during which the target object is detected uninterruptedly from the masked images of the continuously acquired two-dimensional images.
[0058] In one embodiment, a certain fault tolerance can also be set for determining the duration of the target image being captured to improve the execution stability of the video processing method and avoid the phenomenon that the target object is always lost or misdetected during the detection process due to the instability of the neural network for detecting the target object, making it impossible to process the valid video in time.
[0059] For example, when the target image is obtained for the first time, the time when the target image is obtained can be determined as the starting time. For example, the starting time can be the time indicated by the timestamp of the target image, and specifically can be the time when the two-dimensional image corresponding to the target image is acquired. The target image is obtained by performing mask processing on the corresponding two-dimensional image. Alternatively, the starting time can also be the time when the target detection is completed on the current masked image, which is not limited in the present disclosure.
[0060] After the target image is obtained for the first time, the mask processing can be continued on the acquired two-dimensional image, and it can be determined whether the currently obtained masked image (which can be referred to as the current masked image) is the target image. If the current masked image is the target image, the latest obtained target image can be referred to as the current target image, and the time difference between the time when the current target image is obtained and the start time is used as the duration of the acquisition of the target image.
[0061] In one embodiment, if the target image is not detected for a long time, the start time can be re-determined to further avoid the situation where the target object only stays in the motion area for a short time but does not move. For example, if after determining the start time, the duration of the acquisition of non-target images is greater than the second predetermined duration, the start time can be re-determined based on the time when the target image is first obtained in the subsequent acquisition.
[0062] like Figure 4 As shown, in an embodiment 400, in the implementation of the video processing method, the start timing of the video processing can be determined through operations S401 to S411.
[0063] In operation S401 , a depth map and a two-dimensional image collected in real time are acquired.
[0064] In operation S402, mask processing is performed on the collected two-dimensional image based on the collected depth map to obtain a masked image. The implementation principle of this operation is similar to the implementation principle of the aforementioned operations S210 to S220, and will not be repeated here.
[0065] In operation S403, it is determined whether the masked image is a target image. If it is a target image, operation S404 is performed, and if it is a non-target image, operation S409 is performed.
[0066] In operation S404, it is determined whether it is the first time to obtain the target image. If it is the first time to obtain the target image, operations S405 to S406 are performed; if it is not the first time to obtain the target image, operation S406 is performed.
[0067] In operation S405, the time when the target image is first obtained is determined as the starting time. For example, the time when the current target image is obtained can be determined as the value of the parameter detect_start_time.
[0068] In operation S406, the termination time is updated according to the time when the current target image is obtained, and the duration of the target image being acquired is determined.
[0069] For example, the time when the current target image is obtained can be used as the termination time. For example, the time when the current target image is obtained can be determined as the value of the parameter detect_last_time, and the value of the parameter is updated every time the target image is obtained.
[0070] For example, the time difference between the time when the current target image is obtained and the start time can be used as the duration of the target image acquisition. For example, the duration of the target image acquisition sustain_time=time.now-detect_start_time. Among them, time.now is the current time, which can also be understood as the time when the current target image is obtained.
[0071] In operation S407, it is determined whether the duration of the target image acquisition is greater than the first predetermined duration. If yes, operation S408 is performed, otherwise, the process returns to operation S401 to reacquire the depth map and the two-dimensional image acquired in real time.
[0072] In operation S408 , it is determined that a video processing start timing has been reached.
[0073] In operation S409, in response to the masked image being a non-target image, a time difference between the moment when the current non-target image is obtained and the termination moment is determined, and the time difference is used as the duration of the non-target image being acquired.
[0074] In operation S410, determine whether the duration of the non-target image being collected is greater than the second predetermined duration. If greater, perform operation S411, otherwise directly return to perform operation S401. The second predetermined duration can be set according to actual needs. For example, the second predetermined duration can be equal to or different from the first predetermined duration. In one embodiment, the second predetermined duration can be determined, for example, based on the average duration or minimum duration that the target object stays in the motion area without performing motion, and the present disclosure does not limit this.
[0075] In operation S411, it is determined that the start time needs to be re-determined. For example, the value of the aforementioned parameter detect_start_time can be set to null. The aforementioned operation S404 can determine whether the target image is obtained for the first time by, for example, determining whether the value of the parameter detect_start_time is null. If the masked image is the target image and the value of detect_start_time is null, it can be determined that the target image is obtained for the first time.
[0076] In one embodiment, operations S401 to S403 can be continuously performed to perform mask processing on all two-dimensional images collected in real time and determine whether the target object is detected. It is not necessary to rely on the determination result of operation S407 or operation S410 to determine whether it needs to be performed again. This can avoid the situation where the timing of starting video processing cannot be determined in a timely and accurate manner due to low processing efficiency.
[0077] This embodiment can effectively avoid the phenomenon that the target object is always lost or misdetected during the detection process due to the instability of the neural network for detecting the target object, by setting the first predetermined time length and the second predetermined time length, resulting in the inability to process valid videos in time or processing invalid videos. Therefore, the accuracy of the processed video can be improved, and the movement of the target object can be analyzed based on the processed video.
[0078] Figure 5 It is a schematic diagram of the implementation principle of the video processing method based on artificial intelligence according to an embodiment of the present disclosure.
[0079] In one embodiment, after processing the video for the target object, the depth map and the two-dimensional image may continue to be collected, and the two-dimensional image may be masked based on the collected depth map, the target object may be detected on the masked image, and the timing for terminating the video processing may be determined based on the detection result.
[0080] For example, in response to the duration of the non-target image being captured being longer than the third predetermined duration, it can be determined that the video processing termination timing has been reached, and the operation of processing the video for the target object is terminated. For example, the principle of determining the duration of the non-target image being captured in this embodiment is similar to the principle described in the previous embodiment.
[0081] Based on this, Figure 5 As shown, in an embodiment 500, the implementation principle of the video processing method may involve operations S501 to S511. In an embodiment, the implementation principle of the video processing method may also involve the aforementioned operations S410 to S411.
[0082] Among them, the implementation principle of operation S501 to operation S507 is similar to the implementation principle of the aforementioned operation S401 to operation S407, and will not be repeated here.
[0083] It is understandable that after determining through operation S507 that the duration of the target image being collected is greater than the first predetermined duration, and determining through operation S508 that the timing of starting video processing has been reached, video processing can be started for the target object. During the video processing process, operations S501 to S503 can also be performed synchronously with the video processing process. During the video processing process, if the target image is collected, it can be determined that the target image is not obtained for the first time, and the termination time is updated. At the same time, it can be determined that the duration of the target image being collected is greater than or equal to the first predetermined duration, and operation S508 can be implemented as: being at the timing of video processing, to continue video processing for the target object.
[0084] During the video processing, if a non-target image is collected, operation S509 is performed. The implementation principle of operation S509 is similar to the implementation principle of the aforementioned operation S409, which will not be repeated here. Then, operation S510 is performed to determine whether the duration of the non-target image being collected is greater than the third predetermined duration. If so, operation S511 is performed to determine whether the timing for terminating the video processing has been reached; otherwise, the operation returns to continue to perform operation S501. Among them, the third predetermined duration may be the same as or different from the aforementioned second predetermined duration. For example, the third predetermined duration and the second predetermined duration may both be 5s, or any other duration, which is not limited in the present disclosure.
[0085] After determining that the video processing termination timing has been reached, the video processing may be terminated.
[0086] In one embodiment, after the acquisition device acquires the two-dimensional image, the electronic device may, for example, first cache the received two-dimensional image. At the same time, the received two-dimensional image may be masked based on the received depth map to determine the start time of video processing. After determining that the time to start video processing has been reached, the electronic device may, for example, store the two-dimensional image cached in real time in a predetermined storage space to process the video. Among them, the two-dimensional image may, for example, be cached in a storage space included in a processor in an electronic device, or cached in any pre-set storage space. After the time to start video processing is reached, the two-dimensional image cached in real time may be written into the hardware integrated in the electronic device to process the video. By caching the two-dimensional image while masking the two-dimensional image, timely video processing can be facilitated, which is beneficial to improving the performance and real-time nature of video processing.
[0087] For example, while caching the two-dimensional image, the depth map can also be cached. At the same time, when processing the video, the two-dimensional image and the depth map can also be stored in a predetermined storage space to facilitate 3D playback of the video.
[0088] Based on the artificial intelligence-based video processing method provided by the present disclosure, the present disclosure also provides an artificial intelligence-based video processing device. Figure 6 The device is described in detail.
[0089] Figure 6 It is a structural block diagram of an artificial intelligence-based video processing device according to an embodiment of the present disclosure.
[0090] like Figure 6 As shown, the artificial intelligence-based video processing device 600 of this embodiment may include a pixel determination module 610 , a mask processing module 620 , and a processing determination module 630 .
[0091] The pixel determination module 610 is used to determine the target pixel whose depth value in the acquired depth map is located in a predetermined depth range. In one embodiment, the pixel determination module 610 can be used to perform the operation S210 described above, which will not be described in detail here.
[0092] The mask processing module 620 is used to perform mask processing on the collected two-dimensional image according to the target pixel to obtain a masked image. The two-dimensional image and the depth map are collected at the same time, and the two-dimensional image and the depth map are aligned pixel by pixel. In one embodiment, the mask processing module 620 can be used to perform the operation S220 described above, which will not be repeated here.
[0093] The processing determination module 630 is used to determine the video processing start time in response to detecting the target object in the masked image, so as to start video processing for the target object. In one embodiment, the processing determination module 630 can be used to perform the operation S230 described above, which will not be repeated here.
[0094] According to an embodiment of the present disclosure, the processing determination module 630 may include a target image determination submodule and a start timing determination submodule. The target image determination submodule is used to determine that the masked image is the target image in response to detecting a target object in the masked image. The start timing determination submodule is used to determine that the video processing start timing has been reached in response to the duration of the target image being captured being greater than a first predetermined duration.
[0095] According to an embodiment of the present disclosure, the processing determination module 630 may further include a starting time determination submodule and a first duration determination submodule. The starting time determination submodule is used to determine the time when the current target image is obtained as the starting time in response to the first acquisition of the target image. The first duration determination submodule is used to determine the time difference between the time when the current target image is obtained and the starting time in response to determining that the current masked image is the target image, as the duration of the acquisition of the target image.
[0096] According to an embodiment of the present disclosure, the above-mentioned starting time determination submodule can be specifically used to: in response to the duration of the acquisition of non-target images being greater than the second predetermined duration, determine the starting time based on the moment when the target image is first obtained in subsequent acquisitions.
[0097] According to an embodiment of the present disclosure, the processing determination module 630 may further include a termination time determination submodule and a second duration determination submodule. The termination time determination submodule is used to update the termination time according to the time when the current target image is obtained in response to determining that the current masked image is a target image. The second duration determination submodule is used to, in response to determining that the current masked image is a non-target image, use the time difference between the time when the current non-target image is obtained and the termination time as the duration of the acquisition of the non-target image.
[0098] According to an embodiment of the present disclosure, the processing determination module 630 may further include a termination timing determination submodule and a processing termination submodule. The termination timing determination submodule is used to determine that the video processing termination timing has been reached in response to the duration of the non-target image being captured being greater than the third predetermined duration. The processing termination submodule is used to terminate the video processing for the target object.
[0099] According to an embodiment of the present disclosure, the above-mentioned artificial intelligence-based video processing device 600 may further include a cache module and a storage module. The cache module is used to cache the captured two-dimensional image to the first storage space. The storage module is used to store the two-dimensional image cached in real time to the second storage space in response to reaching the timing of starting video processing.
[0100] According to an embodiment of the present disclosure, the target object is an object that moves based on a target instrument; and the predetermined depth interval is determined based on the position of the target instrument.
[0101] According to an embodiment of the present disclosure, the depth map and the two-dimensional image are collected based on a 3D body sensing camera.
[0102] Based on the video processing method based on artificial intelligence provided by the present disclosure, the present disclosure also provides a video processing system based on artificial intelligence, which includes an image acquisition device and an electronic device. The image acquisition device is used to acquire a depth map and a two-dimensional image. The electronic device is connected to the image acquisition device in communication to receive the depth map and the two-dimensional image acquired by the image acquisition device. The electronic device is used to execute the video processing method based on artificial intelligence of the aforementioned embodiment.
[0103] In one embodiment, the acquisition device may be a 3D motion sensing camera.
[0104] In one embodiment, the electronic device may include a processor, and the processor may be integrated with a motion detection module, a signal decision module, and a video recording module. Among them, the motion detection module may be used to perform mask processing on the two-dimensional image received by the electronic device based on the depth map received by the electronic device, and detect the target object on the masked image. If the target object is detected, an instruction indicating that the target image is obtained is sent to the signal decision module, such as sending instruction 1. If the target object is not detected, an instruction indicating that a non-target image is obtained is sent to the signal decision module, such as sending instruction 0. The signal decision module may maintain the aforementioned start time, end time, etc. based on the received instruction, and determine in real time the duration of the target image or the duration of the non-target image collected. The signal decision module may determine whether the recording start time or the recording end time is reached based on the determined duration. If the signal decision module determines that the recording start time is reached, a recording instruction is sent to the video recording module, and the video recording module may store the two-dimensional image received in real time to a predetermined storage space to achieve video recording. If the signal decision module determines that the recording termination time has been reached, a termination instruction is sent to the video recording module, and the video recording module stops storing the two-dimensional image in the predetermined storage space.
[0105] For example, the processor may synchronously send the received depth map and two-dimensional image to the video recording module and the motion detection module. After receiving the depth map and the two-dimensional image, the video recording module may cache the two-dimensional image and the depth map. After receiving the recording instruction, the real-time cached two-dimensional image and depth map are stored in a predetermined storage space. After receiving the termination instruction, the real-time cached two-dimensional image and depth map are stopped from being stored in the predetermined storage space.
[0106] The video recorded by the disclosed embodiment may be a motion video of the target object. When it is necessary to call for playback, the electronic device may read the stored video from the predetermined storage space and send the video to the video player for playback. Alternatively, the electronic device may also read the stored video from the predetermined storage space in real time during the video recording process, and send the read video to the player for playback, so as to perform real-time recording and playback of the video during the motion of the target object.
[0107] The video processing method, device and system based on artificial intelligence provided by the present disclosure can realize the recognition of the target object's action in complex scenes by cropping the two-dimensional image based on the depth map and detecting the target object in combination with the target detection technology, which can ensure the high accuracy of data collection. Based on the video processing method, device and system based on artificial intelligence provided by the present disclosure, it is also possible to realize the automatic processing of videos, which can reduce the need for manual screening and editing of videos. In sports scenes, it is convenient for coaches and sports analysts to obtain and process the required sports videos more quickly, which is conducive to speeding up the training and feedback cycle process. Based on the video processing method, device and system based on artificial intelligence provided by the present disclosure, it is also possible to achieve the effect of processing only key sports content and clearly distinguishing the target object from other objects in the background.
[0108] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals. In the technical solution of this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.
[0109] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0110] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement an artificial intelligence-based video processing method of an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0111] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0112] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0113] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a video processing method based on artificial intelligence. For example, in some embodiments, the video processing method based on artificial intelligence may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the video processing method based on artificial intelligence described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a video processing method based on artificial intelligence in any other appropriate manner (e.g., by means of firmware).
[0114] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0115] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0116] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0117] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0118] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0119] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. Among them, the server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0121] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A video processing method based on artificial intelligence, comprising: Determine a target pixel in the acquired depth map whose depth value is within a predetermined depth range; Performing mask processing on the acquired two-dimensional image according to the target pixel to obtain a masked image; The two-dimensional image and the depth map are collected at the same time, and the two-dimensional image and the depth map are aligned pixel by pixel; as well as In response to detecting a target object in the masked image, a video processing start timing is determined to start video processing for the target object.
2. The method according to claim 1, wherein: In response to detecting the target object in the masked image, determining the timing to start video processing includes: In response to detecting a target object in the masked image, determining the masked image to be a target image; and In response to the duration of the target image being captured being greater than the first predetermined duration, it is determined that the timing for starting the video processing has been reached.
3. The method according to claim 2, further comprising: In response to obtaining the target image for the first time, determining the time when the current target image is obtained as the starting time; as well as In response to determining that the current masked image is the target image, a time difference between the moment when the current target image is obtained and the start moment is determined as a duration of acquiring the target image.
4. The method according to claim 3, further comprising: In response to the duration of the acquisition of the non-target image being longer than the second predetermined duration, the start time is determined based on the time when the target image is first obtained in the subsequent acquisition.
5. The method according to claim 4, further comprising: In response to determining that the current masked image is the target image, updating the termination time according to the time when the current target image is obtained; as well as In response to determining that the current masked image is a non-target image, a time difference between a time when the current non-target image is obtained and the termination time is used as a duration of acquiring the non-target image.
6. The method according to any one of claims 2 to 5, further comprising: After starting video processing for the target object: In response to the duration of the acquisition of the non-target image being longer than a third predetermined duration, determining that a timing for terminating the video processing has been reached; as well as The video processing for the target object is terminated.
7. The method according to claim 1, further comprising: Cache the acquired two-dimensional image into a first storage space; as well as In response to reaching the video processing start timing, the two-dimensional image buffered in real time is stored in a second storage space.
8. The method according to claim 1, wherein: The target object is an object that moves based on a target device; and the predetermined depth interval is determined based on a position of the target device.
9. The method according to claim 1, wherein: The depth map and the two-dimensional image are collected based on a 3D body sensing camera.
10. A video processing device based on artificial intelligence, comprising: A pixel determination module, used to determine a target pixel in the acquired depth map whose depth value is within a predetermined depth range; A mask processing module, used for performing mask processing on the collected two-dimensional image according to the target pixel to obtain a masked image; The two-dimensional image and the depth map are collected at the same time, and the two-dimensional image and the depth map are aligned pixel by pixel; as well as The processing determination module is used to determine a video processing start timing in response to detecting a target object in the masked image, so as to start video processing for the target object.
11. The device according to claim 10, wherein: The processing determination module comprises: a target image determination submodule, configured to determine that the masked image is a target image in response to detecting a target object in the masked image; and The start timing determination submodule is used to determine that the video processing start timing has been reached in response to the duration of the target image being captured being greater than a first predetermined duration.
12. The device according to claim 11, wherein The processing determination module also includes: a start time determination submodule, configured to determine, in response to obtaining the target image for the first time, a time when the current target image is obtained as the start time; and The first duration determination submodule is used to determine the time difference between the moment when the current target image is obtained and the starting moment in response to determining that the current masked image is the target image, as the duration of acquiring the target image.
13. The device according to claim 12, wherein: The starting time determination submodule is used for: In response to the duration of the acquisition of the non-target image being longer than the second predetermined duration, the start time is determined based on the time when the target image is first obtained in the subsequent acquisition.
14. The device according to claim 13, wherein: The processing determination module also includes: a termination time determination submodule, configured to update the termination time according to the time when the current target image is obtained in response to determining that the current masked image is the target image; and The second duration determination submodule is used for, in response to determining that the current masked image is a non-target image, using the time difference between the moment when the current non-target image is obtained and the termination moment as the duration of the non-target image being collected.
15. The device according to any one of claims 11 to 14, wherein: The processing determination module also includes: a termination timing determination submodule, configured to determine that a video processing termination timing has been reached in response to a duration of the non-target image being captured being longer than a third predetermined duration; and The processing termination submodule is used to terminate the video processing for the target object.
16. The apparatus according to claim 10, further comprising: A cache module, used for caching the acquired two-dimensional image into a first storage space; as well as The storage module is used for storing the two-dimensional image cached in real time into a second storage space in response to reaching the timing for starting the video processing.
17. The device according to claim 10, wherein: The target object is an object that moves based on a target device; and the predetermined depth interval is determined based on a position of the target device.
18. The device according to claim 10, wherein: The depth map and the two-dimensional image are collected based on a 3D body sensing camera.
19. A video processing system based on artificial intelligence, comprising: An image acquisition device for acquiring a depth map and a two-dimensional image; as well as an electronic device, communicatively connected to the image acquisition device to receive the depth map and the two-dimensional image acquired by the image acquisition device, Wherein, the electronic device is configured to: execute the artificial intelligence-based video processing method described in any one of claims 1 to 8.
20. The system of claim 19, wherein: The image acquisition device includes a 3D body sensing camera.
21. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any one of claims 1 to 9.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 9.
23. A computer program product, comprising a computer program / instruction, wherein the computer program / instruction is stored on at least one of a readable storage medium and an electronic device, and when the computer program / instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
