Moving target detection method and device based on machine vision and electronic equipment

By using multi-scale edge detection and shape models in machine vision, the existing mobile object detection methods are solved, and the problem of insufficient robustness and high computational complexity in complex environments is achieved, and the rapid and high-precision object detection is achieved, which satisfies the Requirements for real-time applications.

CN119295720APending Publication Date: 2025-01-10CHINA UNIV OF PETROLEUM (BEIJING)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411198097.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing mobile object detection methods are not robust enough in complex environments, have high computational complexity, cannot meet the needs of real-time applications, and require a large amount of labeled data for training, resulting in low detection accuracy and slow speed.

Method used

Using a machine vision-based method, multi-scale edge information is extracted through a pre-trained edge detection model and combined with a shape model for object detection, reducing dependence on the target appearance and improving robustness and accuracy.

Benefits of technology

It realizes fast and high-precision mobile object detection in complex environments, improves the accuracy and stability of edge detection, reduces dependence on labeled data, and meets the needs of real-time applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295720A_ABST
    Figure CN119295720A_ABST
Patent Text Reader

Abstract

The invention provides a machine vision-based moving target detection method and apparatus, and an electronic device. The method comprises the steps of obtaining an original image by using an installed camera; based on a pre-trained edge detection model, extracting edge information of the original image under different scales to obtain a multi-scale edge image; and based on a pre-trained shape model, obtaining a moving target detection result according to the multi-scale edge image. According to the method, the target object is positioned through the shape model, the dependence on the appearance of the target can be reduced, the robustness of target positioning can be improved, meanwhile, the accuracy and stability of edge detection can be effectively improved by improving a traditional edge detection algorithm and extracting the edge information of the original image under different scales, and the accuracy and stability of target positioning can be improved. Therefore, the position of the target can be captured more quickly and accurately, and the category of the target can be predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target detection, and in particular to a moving target detection method, device and electronic equipment based on machine vision. Background Art

[0002] In the existing technology, Moving Object Detection (MOD) is an important part of the field of computer vision and image processing, and is widely used in various scenarios such as security monitoring, autonomous driving, drone reconnaissance, sports analysis, etc.

[0003] However, the mobile target detection method provided by the prior art has the following limitations (1-)-(5).

[0004] (1) Under complex environmental conditions, such as illumination changes, occlusion, background interference, etc., the existing mobile target detection methods are not robust enough, which may lead to target detection errors or tracking loss, affecting the accuracy and stability of the system.

[0005] (2) For complex dynamic scenes with a large number of moving targets or targets interfering with each other, existing mobile target detection methods have difficulty in accurately capturing and predicting moving targets, which may lead to problems such as target overlap, occlusion, or incorrect trajectory prediction.

[0006] (3) In real-time applications, such as video surveillance and autonomous driving, mobile target detection needs to be completed within a limited time. However, existing mobile target detection methods have high computational complexity, resulting in slow processing speed and unable to meet real-time requirements.

[0007] (4) Existing mobile target detection methods usually require a large amount of well-labeled training data for model training, but obtaining accurate labeled data is a time-consuming and laborious task, especially for complex mobile targets and scenes.

[0008] (5) For long-term target prediction, that is, the prediction of the target's future position, existing mobile target detection methods are often subject to factors such as changes in the target's motion pattern and environmental uncertainty, resulting in inaccurate prediction results.

[0009] Therefore, how to solve the problem of low detection accuracy and slow speed of existing mobile target detection methods is an important issue that needs to be solved urgently in the field of target detection. Summary of the invention

[0010] The present invention provides a moving target detection method, device and electronic equipment based on machine vision, which are used to overcome the defects of low detection accuracy and slow speed of existing moving target detection methods and realize fast and high-precision detection of moving targets.

[0011] On the one hand, the present invention provides a method for detecting a moving target based on machine vision, comprising: acquiring an original image using an installed camera; extracting edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; and obtaining a moving target detection result based on the multi-scale edge image based on a pre-trained shape model.

[0012] Furthermore, the method of extracting edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image includes: decomposing the original image into multiple images of different scales, each scale of the image representing image details at different resolutions; for images of different scales, using different edge detection models to perform edge detection to obtain edge information of different scales; and obtaining the multi-scale edge image based on the edge information of different scales.

[0013] Furthermore, the edge detection model includes a high-scale edge detection model and a low-scale edge detection model, and images of different scales include high-resolution images and low-resolution images; accordingly, the edge detection model based on pre-training extracts edge information of the original image at different scales to obtain a multi-scale edge image, including: extracting subtle edge information in the high-resolution image based on the high-scale edge detection model; extracting coarse edge information in the low-resolution image based on the low-scale edge detection model; and fusing the subtle edge information and the coarse edge information to obtain the multi-scale edge image.

[0014] Further, the extracting of subtle edge information from the high-resolution image includes: eliminating, shifting and merging the subtle edge information to obtain optimized subtle edge information; correspondingly, fusing the subtle edge information and the coarse edge information to obtain the multi-scale edge image includes: fusing the optimized subtle edge information and the coarse edge information to obtain the multi-scale edge image.

[0015] Furthermore, the edge information of different scales includes edge positions at the pixel level; accordingly, obtaining the multi-scale edge image based on the edge information of different scales includes: selecting a local window based on the initially obtained edge position at the pixel level; the local window contains neighborhood information; interpolating the edge position at the pixel level at each scale in the local window to obtain the edge position at the sub-pixel level; performing fitting analysis on the edge position at the pixel level at each scale in the local window to obtain the edge direction at the sub-pixel level; and drawing edge images at multiple different scales based on the edge position and edge direction at the sub-pixel level to obtain the multi-scale edge image.

[0016] Furthermore, the method of obtaining a multi-scale edge image includes: obtaining an eroded image of the original image; associating the multi-scale edge image with the eroded image, and quantitatively interpreting the multi-scale edge image and the eroded image to obtain a target multi-scale edge image; accordingly, the method of obtaining a moving target detection result based on the multi-scale edge image based on a pre-trained shape model includes: inputting the target multi-scale edge image into a pre-trained shape model to obtain the output moving target detection result; wherein, the moving target detection result includes the position and category of the target in the original image.

[0017] In a second aspect, a mobile target detection device based on machine vision includes: an original image acquisition module, used to acquire an original image using an installed camera; a multi-scale edge image acquisition module, used to extract edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; a mobile target detection result acquisition module, used to obtain a mobile target detection result according to the multi-scale edge image based on a pre-trained shape model.

[0018] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a mobile target detection method based on machine vision as described above is implemented.

[0019] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the machine vision-based mobile target detection methods described above.

[0020] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described methods for detecting moving targets based on machine vision.

[0021] The mobile target detection method based on machine vision provided by the present invention obtains the original image by using the installed camera, and extracts the edge information of the original image at different scales based on the pre-trained edge detection model to obtain a multi-scale edge image, and then obtains the mobile target detection result based on the multi-scale edge image based on the pre-trained shape model. The method locates the target object through the shape model, which can help reduce the dependence on the target appearance and improve the robustness of target positioning. At the same time, by improving the traditional edge detection algorithm and extracting the edge information of the original image at different scales, the accuracy and stability of edge detection can be effectively improved, thereby capturing the position of the target and predicting the category of the target more quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0023] Figure 1 It is a flow chart of a method for detecting a moving target based on machine vision provided by an embodiment of the present invention.

[0024] Figure 2 It is a structural schematic diagram of a moving target detection device based on machine vision provided in an embodiment of the present invention.

[0025] Figure 3 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] It should be noted that the mobile target detection method provided by the prior art has the defects of low detection accuracy and slow detection speed, and cannot meet the actual application requirements.

[0028] In view of this, the present invention proposes a moving target detection method based on machine vision, specifically, Figure 1 A schematic flow chart of a method for detecting a moving target based on machine vision provided in an embodiment of the present invention is shown.

[0029] like Figure 1 As shown, the method includes steps S110-S130, and steps S110-S130 and related steps will be described in detail below.

[0030] S110, obtaining an original image using the installed camera.

[0031] It is understandable that a set number of cameras are installed in the target area and the parameters of the cameras are pre-configured, and then in actual application, the original image in the target area can be directly collected through the installed cameras, and the original image may contain the detected target.

[0032] The target area is an area where the target may be located, and the detected target can be any person or object that needs to be detected, which is not specifically limited here.

[0033] The specific number of cameras installed can be set according to actual needs and is not specifically limited here.

[0034] The pre-configured camera parameters include but are not limited to resolution, frame rate, exposure, gain, and white balance to adapt to different lighting conditions and scene requirements.

[0035] In a specific embodiment, the original image is an image including other vehicles and / or pedestrians other than the vehicle, and the detection target is other vehicles or pedestrians other than the vehicle.

[0036] In yet another specific embodiment, the original image is an image including a plurality of machine components, and the detection target is a faulty machine component.

[0037] Of course, in addition to using a camera to obtain the original image, a camera or an image sensor may also be used to capture the original image, which is not specifically limited here.

[0038] S120, extracting edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image.

[0039] It can be understood that, based on obtaining the original image that may contain the target using the installed camera in step S110, further, step S120 will extract edge information of the original image at different scales to obtain a multi-scale edge image.

[0040] Specifically, at different scales, the improved Canny edge detection algorithm (i.e., the pre-trained edge detection model) is used to extract the edge information of the target. By applying different edge models at low scales and high scales, and eliminating, shifting, and merging the edges at higher scales, the edges of the detected targets can be effectively extracted and noise and unnecessary edges can be reduced.

[0041] Among them, the Canny edge detection algorithm is an edge detection technology widely used in image processing and computer vision. The algorithm was proposed by John F. Canny in 1986. Its goal is to find an optimal edge detection solution, that is, to capture as many real edge points as possible while suppressing noise and ensuring edge continuity.

[0042] The Canny edge detection algorithm mainly includes the following steps S121-S124.

[0043] S121, Gaussian filtering.

[0044] First, the input original image is smoothed using a Gaussian filter to reduce the noise in the original image. Gaussian filtering can suppress high-frequency noise, which is critical for subsequent edge detection.

[0045] S122, calculate the gradient strength and direction.

[0046] The gradient strength and direction of each pixel in the original image can be calculated using a difference operator such as the Sobel operator or the Prewitt operator, where the gradient strength indicates the strength of the edge and the direction indicates the direction of the edge.

[0047] S123, Non-Maximum Suppression (NMS).

[0048] After obtaining the gradient strength and direction, non-maximum suppression is performed. This process checks the relationship between each pixel and its two neighboring pixels (along the gradient direction). If the gradient value of the current pixel is not the local maximum, it is set to 0, thereby suppressing non-edge pixels.

[0049] S124, dual threshold detection and edge connection.

[0050] Two thresholds (upper threshold and lower threshold) are used to determine which edges are real. Edges above the upper threshold are considered strong edges and are directly marked as edges; edges below the lower threshold are directly suppressed; edges between the upper and lower thresholds are considered real edges only when they are connected to strong edges.

[0051] After the above steps S121-S124, an image containing only edges will be obtained, which is the result of Canny edge detection. The Canny edge detection algorithm has been applied in many fields due to its good performance and robustness, such as image segmentation, feature extraction, target recognition, etc.

[0052] The above steps S121-S124 describe the execution process of the traditional Canny edge detection algorithm. It can be seen that the traditional Canny edge detection algorithm only extracts edge information from the original image of a single scale.

[0053] In order to further improve the accuracy and robustness of edge detection, the Canny edge detection algorithm is improved in this embodiment. The improvement is that a series of images of different scales are generated based on the original image, and then the above-mentioned Canny edge detection algorithm (edge ​​detection model) is applied to the image at each scale respectively. Then, from low scale to high scale, the edge information at different scales is fused. The edge information at the lower scale provides finer details, while the information at the higher scale helps to capture the overall shape of larger objects, thereby obtaining a multi-scale edge image.

[0054] It should be noted that when fusing edge information at different scales, the edge at a higher scale can be eliminated, shifted, and merged to reduce noise and unnecessary edges, thereby more accurately capturing the location of the target.

[0055] The improved multi-scale Canny edge detection algorithm can significantly improve the edge detection effect in complex scenes, especially when dealing with objects of various sizes, shapes and textures. The algorithm is particularly suitable for automatic image analysis, robot navigation, medical image analysis and other fields, where high-precision edge detection is crucial for subsequent image understanding and analysis.

[0056] It should also be noted that the improved multi-scale Canny edge detection algorithm adopted in this embodiment solves the limitation of the traditional / conventional Canny edge detection algorithm requiring interpolation when estimating the intensity along the normal, can overcome the problem that the edge normal direction cannot pass through the center of adjacent pixels, and improves the accuracy and stability of edge detection.

[0057] S130, obtaining a moving target detection result based on the pre-trained shape model and the multi-scale edge image.

[0058] It can be understood that, based on extracting edge information of the original image at different scales to obtain a multi-scale edge image in step S120, further, step S130 will obtain a moving target detection result according to the multi-scale edge image.

[0059] Specifically, this embodiment uses a shape model to locate a moving target. The shape model can describe the geometric shape and structural information of the target, thereby providing more accurate target positioning. By using the shape model, the reliance on the target appearance can be reduced, thereby enhancing the robustness of the target.

[0060] Among them, shape models are a mathematical framework used to describe and analyze the geometric shape of objects in the field of computer vision and pattern recognition. They can help computers understand, recognize and classify various shapes, which is very important for image analysis, target recognition, medical image analysis, robotics, virtual reality and many other fields.

[0061] In a specific embodiment, the shape model is any one of a contour model, a point distribution model, a graph model, and a deep learning model.

[0062] Among them, the contour model is constructed based on the edge or contour of the target object. The point distribution model is a statistical model that models the variability of shape by performing principal component analysis on a set of shape points of a set of training samples. The graph model uses the concepts of graph theory to describe shapes and solve shape segmentation problems. Deep learning models, in particular, refer to models built based on convolutional neural networks or generative adversarial networks, which can automatically learn complex shape features from large amounts of data.

[0063] To establish a shape model of an object, feature points, contours or other geometric features may be used to describe the shape and structural information of the object. The shape model may be a predefined template or may be obtained through learning and training, which is not specifically limited here.

[0064] For example, in one specific embodiment, the process of creating a shape model includes collecting and annotating training data (image samples annotated with target locations and categories and corresponding multi-scale edge image samples), and then using these data to train the model to capture the statistical characteristics of the shape. Once the model is trained, it can be used for analysis and prediction of new data.

[0065] In the actual application stage, the extracted multi-scale edge model is input into the trained shape model to obtain the output moving object detection result. The moving object detection result includes but is not limited to the position of the object in the original image and the category of the object.

[0066] In this embodiment, the original image is obtained by using the installed camera, and the edge information of the original image at different scales is extracted based on the pre-trained edge detection model to obtain a multi-scale edge image, and then the mobile target detection result is obtained based on the multi-scale edge image based on the pre-trained shape model. This method locates the target object through the shape model, which can help reduce the dependence on the target appearance and improve the robustness of target positioning. At the same time, by improving the traditional edge detection algorithm and extracting the edge information of the original image at different scales, it can effectively improve the accuracy and stability of edge detection, thereby more quickly and accurately capturing the position of the target and predicting the category of the target.

[0067] On the basis of the above embodiments, the process of acquiring a multi-scale edge image will be described in detail below.

[0068] Based on a pre-trained edge detection model, edge information of an original image at different scales is extracted to obtain a multi-scale edge image, including: decomposing the original image into multiple images of different scales, each scale of the image represents image details at different resolutions; for images of different scales, different edge detection models are used to perform edge detection to obtain edge information of different scales; and a multi-scale edge image is obtained based on edge information of different scales.

[0069] It can be understood that, first, an image pyramid is constructed for the original image, which can be achieved by continuously downsampling the original image (for example, using bilinear interpolation or Gaussian blur followed by downsampling). Each downsampling will generate an image of a smaller scale, thereby obtaining a series of images of different resolutions / scales, each of which represents image details at different scales.

[0070] Then, for each scale of the image in the pyramid, the pre-trained edge detection model is applied. Since the resolution of each scale of the image is different, the corresponding applicable edge detection model is also different. In other words, for each scale of the image, an edge detection model specific to that scale is used to optimize the edge detection effect.

[0071] In this embodiment, a larger scale image will detect coarser edges, while a smaller scale image will detect finer details.

[0072] For example, in a specific embodiment, the edge detection model includes a high-scale edge detection model and a low-scale edge detection model, and the images of different scales include high-resolution images and low-resolution images; Accordingly, based on the pre-trained edge detection model, edge information of the original image at different scales is extracted to obtain a multi-scale edge image, including: extracting subtle edge information in a high-resolution image based on a high-scale edge detection model; extracting coarse edge information in a low-resolution image based on a low-scale edge detection model; and fusing the subtle edge information and the coarse edge information to obtain a multi-scale edge image.

[0073] It is easy to understand that this embodiment decomposes the original image into a high-scale image (high-resolution image) and a low-scale image (low-resolution image). The high-resolution image retains more details and textures, while the low-resolution image simplifies these details and focuses more on large shapes and contours.

[0074] Of course, in other embodiments, the original image may be decomposed into more images of different scales, which is not specifically limited here.

[0075] For high-resolution images and low-resolution images, this embodiment applies corresponding high-scale edge detection models and low-scale edge detection models to extract subtle edge information and coarse edge information, respectively.

[0076] Specifically, by inputting a high-resolution image into a pre-trained high-scale edge detection model, the subtle edge information of the output can be obtained; by inputting a low-resolution image into a pre-trained low-scale edge detection model, the rough edge information of the output can be obtained.

[0077] The high-scale edge detection model is obtained by training and optimization based on a constructed first training sample data set, and the first training sample data set includes high-resolution image samples and their corresponding edge annotation samples.

[0078] The low-scale edge detection model is obtained by training and optimization based on the constructed second training sample data set, and the second training sample data set includes low-resolution image samples and their corresponding edge annotation samples.

[0079] The high-resolution image sample refers to an image with a higher resolution than the first resolution, and the low-resolution image sample refers to an image with a lower resolution than the second resolution. The first resolution is higher than the second resolution, and under this premise, the first resolution and the second resolution can be set according to actual conditions.

[0080] It should also be noted that after the subtle edge information in the high-resolution image is extracted, the subtle edge information may be eliminated, shifted and merged to obtain optimized subtle edge information.

[0081] Subtle edge information is eliminated, specifically, isolated edge points or short edge fragments are removed, which are often noise or pseudo edges.

[0082] The subtle edge information is shifted. Specifically, the position of the edge is adjusted to more accurately reflect the real boundary of the target, which may involve fine-tuning or repositioning the edge.

[0083] Subtle edge information is merged and broken edge fragments are connected to restore the complete edge chain, which helps to improve the overall continuity and integrity of the edge.

[0084] Then, a multi-scale edge image is obtained by fusion based on the optimized subtle edge information and coarse edge information. Specifically, weighted averaging, maximum value selection or other fusion strategies can be used to integrate low-scale structural information and high-scale detail information.

[0085] In this embodiment, the original image is decomposed into multiple images of different scales, each scale image represents the image details at different resolutions, and different edge detection models are used to perform edge detection for images of different scales to obtain edge information of different scales, and then, a multi-scale edge image is obtained based on the edge information of different scales, so that, based on the pre-trained shape model, a moving target detection result is obtained based on the multi-scale edge image. This method locates the target object through the shape model, which can help reduce the dependence on the target appearance and improve the robustness of target positioning. At the same time, by improving the traditional edge detection algorithm and extracting the edge information of the original image at different scales, the accuracy and stability of edge detection can be effectively improved, thereby capturing the position of the target and predicting the category of the target more quickly and accurately.

[0086] On the basis of the above embodiments, an optimization method for obtaining a multi-scale edge image is further described in detail.

[0087] Edge information at different scales includes edge positions at the pixel level; accordingly, a multi-scale edge image is obtained based on the edge information at different scales, including: selecting a local window based on the initially obtained edge position at the pixel level; the local window contains neighborhood information; interpolating the edge position at the pixel level at each scale within the local window to obtain the edge position at the sub-pixel level; performing fitting analysis on the edge position at the pixel level at each scale within the local window to obtain the edge direction at the sub-pixel level; drawing edge images at multiple different scales based on the edge position and edge direction at the sub-pixel level to obtain a multi-scale edge image.

[0088] It is understandable that the resolution of digital images usually limits the accuracy of edge or feature point positioning to the single pixel level, however, in many applications, such as robot navigation, 3D reconstruction, motion analysis, etc., higher positioning accuracy is necessary.

[0089] Taking this into consideration, the present embodiment adopts a sub-pixel positioning method (sub-pixel positioning and orientation) to improve the accuracy of edge positioning. Specifically, interpolation and other techniques can be used to achieve sub-pixel positioning, and the edge can be oriented to a certain degree to indicate its directionality, which can improve the accuracy and precision of the target position, thereby better capturing and predicting the motion trajectory of the moving target.

[0090] Sub-pixel accuracy positioning refers to locating the coordinates of feature points or edges to an accuracy less than one pixel, such as sub-pixel accuracy. This is usually achieved by interpolating around edge features detected at the pixel level, using information from neighboring pixels to estimate the actual edge position of the feature.

[0091] Specifically, first, for each initially obtained pixel-level edge position, a local window is selected, which contains neighborhood information, namely, the surrounding pixels of the edge point.

[0092] Then, within the local window, an interpolation operation is performed on the pixel-level edge position at each scale, such as bilinear interpolation, Gaussian interpolation and other algorithms to estimate the actual position of the edge, thereby obtaining a sub-pixel edge position with higher precision than pixel accuracy.

[0093] At the same time, within the local window, the edge position at the pixel level is used for fitting analysis, such as the least squares method for fitting a straight line or curve, to calculate the edge direction at the sub-pixel level. This step is crucial for understanding the direction of the edge.

[0094] Next, the obtained sub-pixel edge position and edge direction are used to draw edges on the image at each scale, interpolate between edge points to form continuous lines, or use specific algorithms to enhance the coherence and clarity of the edges to obtain edge images at different scales.

[0095] Finally, all edge images at different scales are fused to obtain a multi-scale edge image.

[0096] Through the above process, more accurate and detailed edge information can be extracted from images of different scales, which is very important for subsequent computer vision tasks such as target recognition.

[0097] In this embodiment, a local window is selected based on the initially obtained pixel-level edge position, the local window contains neighborhood information, and the pixel-level edge position at each scale is interpolated in the local window to obtain the sub-pixel level edge position, and then the pixel-level edge position at each scale is fitted and analyzed in the local window to obtain the sub-pixel level edge direction, and according to the sub-pixel level edge position and edge direction, edge images are drawn at multiple different scales to obtain multi-scale edge images, thereby, based on the pre-trained shape model, the mobile target detection result is obtained according to the multi-scale edge image. This method can extract more accurate and detailed edge information from images of different scales, so as to help capture the position of the target and predict the category of the target more quickly and accurately in the future.

[0098] On the basis of the above embodiment, further, after obtaining the multi-scale edge image, the erosion image of the original image is obtained, the multi-scale edge image is associated with the erosion image, and the multi-scale edge image and the erosion image are quantitatively interpreted to obtain the target multi-scale edge image.

[0099] Accordingly, based on the pre-trained shape model, a moving target detection result is obtained according to the multi-scale edge image, including: inputting the target multi-scale edge image into the pre-trained shape model to obtain an output moving target detection result; wherein the moving target detection result includes the position and category of the target in the original image.

[0100] It can be understood that by drawing edge images at multiple scales and associating the drawn multi-scale edge images with the erosion images corresponding to the original images, more comprehensive target information can be provided by quantitatively interpreting the edge images and the erosion images.

[0101] Specifically, first, an erosion operation is performed on the original image to obtain an eroded image of the original image. Erosion is a morphological operation used to eliminate small objects in the original image and reduce noise on the boundary. It scans the original image and removes those foreground pixels that do not completely overlap with the structural elements, thereby shrinking the object boundary in the original image inward.

[0102] Then, the multi-scale edge image is associated with the erosion image, and the multi-scale edge image and the erosion image are compared to find common features between them, such as edges and contours. This association helps to more accurately determine the boundaries and shapes of the target.

[0103] At the same time, the multi-scale edge image and the erosion image are quantitatively interpreted to extract quantifiable features, such as edge strength, edge direction, connected area, region area, perimeter, shape factor, position information and texture features, and data analysis and comparison are performed on the quantifiable features to obtain the target multi-scale edge image.

[0104] Next, the target multi-scale edge image is input into the pre-trained shape model to obtain the output moving target detection result, which includes the position (coordinates) and category of the target in the original image.

[0105] In this embodiment, by drawing edge images at multiple scales and associating the multi-scale edge images with the erosion images, more comprehensive and integrated moving target information can be provided, which helps to better understand the shape, structure and motion characteristics of the target, thereby improving the effect of target capture and prediction.

[0106] In addition, in some embodiments, a detailed description is also provided for the process of acquiring the original image using a camera.

[0107] Specifically, an innovatively designed vehicle safety monitoring system was used when collecting the original images.

[0108] The vehicle-mounted safety monitoring system includes the first layer, the second layer and the third layer; the first layer is arranged with magnetic sensors for detecting moving targets; the second layer is equipped with a control unit for coordinating the operation of the entire system, including data collection, processing and transmission; the third layer is equipped with a mobile camera for capturing original images; the vehicle-mounted safety monitoring system moves by driving the wheels through motors to dynamically capture moving targets.

[0109] It is understandable that the vehicle-mounted safety monitoring system used when obtaining the original image with the camera is innovatively designed. It is a multi-level detection vehicle system that integrates multiple sensors and technologies for the detection of moving targets. The vehicle-mounted safety monitoring system integrates multiple components such as magnetic sensors, control units, signal acquisition and transmission modules, battery modules, Wi-Fi modules, cameras and alarm modules. These modules will be described in detail below.

[0110] The vehicle-mounted safety monitoring system comprises a first layer, a second layer and a third layer, wherein the first layer is the lowest layer and is provided with magnetic sensors for detecting moving targets.

[0111] The second layer is the middle layer, which is equipped with a control unit. The control unit is responsible for coordinating the operation of the entire monitoring system, including data collection, processing and transmission.

[0112] In addition to the control unit, the second layer is also equipped with a signal acquisition and transmission module, a battery module and a WIFI module. The signal acquisition and transmission module is used to collect sensor data and send it to a remote server or monitoring center through a WIFI module or other wireless technologies. The battery module is used to power the entire monitoring system, and the WIFI module is used for wireless data transmission.

[0113] The third layer is the top layer, which is equipped with a mobile camera and an alarm module. The mobile camera is used to capture raw images that may contain moving targets, and the alarm module is used to send out a warning signal when an abnormal situation is detected.

[0114] The vehicle-mounted safety monitoring system of this embodiment moves by driving the wheels with a motor, so that it can flexibly approach different positions of the moving target.

[0115] The wheels here include a driving wheel, and the driving wheel is equipped with a pulse sensor connected to the control unit; wherein, when the driving wheel rotates one circle, the pulse sensor will correspondingly generate a pulse signal.

[0116] Correspondingly, the moving target detection method also includes: obtaining the number of pulse signals generated by the pulse sensor; and calculating the distance between the moving target and the starting point according to the number of pulse signals to achieve the positioning of the moving target.

[0117] It is also worth mentioning that the motion trajectory of the on-board safety monitoring system has artificial intelligence, which can realize autonomous route optimization and trajectory planning. When capturing moving targets, it dynamically analyzes the interference introduced by the detection vehicle's own movement, and can accurately capture and predict the safety status of the object being measured (moving target).

[0118] In this embodiment, the mobile camera installed on the innovatively designed vehicle-mounted safety monitoring system is used to obtain the original image containing the moving target, and the number of pulse signals generated by the pulse sensor in the vehicle-mounted safety monitoring system is obtained. Then, based on the number of pulse signals, the distance between the detected moving target and the starting point is calculated to locate the position of the moving target, thereby achieving accurate detection of the moving target and improving the accuracy and efficiency of detection. Corresponding to the mobile target detection method based on machine vision described in the above embodiments, this embodiment provides a mobile target detection device based on machine vision. Specifically, Figure 2 A schematic structural diagram of a moving target detection device based on machine vision provided by an embodiment of the present invention is shown.

[0119] like Figure 2 As shown, the device includes: an original image acquisition module 210, which is used to acquire the original image using an installed camera; a multi-scale edge image acquisition module 220, which is used to extract edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; a moving target detection result acquisition module 230, which is used to obtain a moving target detection result based on the multi-scale edge image based on a pre-trained shape model.

[0120] In this embodiment, the original image is acquired by the original image acquisition module 210 using the installed camera; the edge information of the original image at different scales is extracted by the multi-scale edge image acquisition module 220 based on the pre-trained edge detection model to obtain a multi-scale edge image; the moving target detection result acquisition module 230 is based on the pre-trained shape model and the multi-scale edge image to obtain the moving target detection result. The device locates the target object through the shape model, which can help reduce the dependence on the target appearance and improve the robustness of target positioning. At the same time, by improving the traditional edge detection algorithm and extracting the edge information of the original image at different scales, the accuracy and stability of edge detection can be effectively improved, thereby capturing the position of the target and predicting the category of the target more quickly and accurately.

[0121] It should be noted that the moving target detection device based on machine vision provided in this embodiment and the moving target detection method based on machine vision described in the above embodiments can be referred to each other, and will not be described in detail here.

[0122] Figure 3An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a moving target detection method based on machine vision, the method comprising: obtaining an original image using an installed camera; extracting edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; obtaining a moving target detection result based on the multi-scale edge image based on a pre-trained shape model.

[0123] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0124] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mobile target detection method based on machine vision provided by the above methods, and the method includes: using an installed camera to obtain an original image; based on a pre-trained edge detection model, extracting edge information of the original image at different scales to obtain a multi-scale edge image; based on a pre-trained shape model, obtaining a mobile target detection result according to the multi-scale edge image.

[0125] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the mobile target detection method based on machine vision provided by the above-mentioned methods, the method comprising: acquiring an original image using an installed camera; extracting edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; and obtaining a mobile target detection result based on the multi-scale edge image based on a pre-trained shape model.

[0126] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A moving target detection method based on machine vision, characterized in that: include: Use the installed camera to obtain the original image; Based on a pre-trained edge detection model, edge information of the original image at different scales is extracted to obtain a multi-scale edge image; Based on the pre-trained shape model, a moving object detection result is obtained according to the multi-scale edge image.

2. The method for detecting a moving target based on machine vision according to claim 1, characterized in that: The edge detection model based on the pre-trained edge detection model extracts edge information of the original image at different scales to obtain a multi-scale edge image, including: Decomposing the original image into multiple images of different scales, each scale of the image representing image details at different resolutions; For images of different scales, different edge detection models are used to perform edge detection to obtain edge information of different scales; The multi-scale edge image is obtained according to edge information of different scales.

3. The method for detecting a moving target based on machine vision according to claim 2, characterized in that: The edge detection model includes a high-scale edge detection model and a low-scale edge detection model, and the images of different scales include high-resolution images and low-resolution images; Accordingly, the edge detection model based on the pre-trained edge detection model extracts edge information of the original image at different scales to obtain a multi-scale edge image, including: Extracting subtle edge information in the high-resolution image based on the high-scale edge detection model; Extracting rough edge information in the low-resolution image based on the low-scale edge detection model; The multi-scale edge image is obtained by fusing the subtle edge information and the rough edge information.

4. The method for detecting a moving target based on machine vision according to claim 3, characterized in that: The step of extracting subtle edge information from the high-resolution image comprises: Eliminating, shifting and merging the subtle edge information to obtain optimized subtle edge information; Correspondingly, the fusing of the subtle edge information and the rough edge information to obtain the multi-scale edge image includes: The multi-scale edge image is obtained by fusing the optimized subtle edge information and the rough edge information.

5. The method for detecting a moving target based on machine vision according to claim 2, characterized in that: The edge information of different scales includes edge positions at pixel level; Accordingly, obtaining the multi-scale edge image according to edge information of different scales includes: Selecting a local window according to the pixel-level edge position initially obtained; the local window contains neighborhood information; Interpolating the edge position at the pixel level at each scale in the local window to obtain the edge position at the sub-pixel level; Performing fitting analysis on the edge position at the pixel level at each scale in the local window to obtain the edge direction at the sub-pixel level; According to the edge position and edge direction at the sub-pixel level, edge images are drawn at multiple different scales to obtain the multi-scale edge image.

6. The method for detecting a moving target based on machine vision according to any one of claims 1 to 5, characterized in that: The multi-scale edge image is obtained, and then the following steps are included: Acquire a corroded image of the original image; Associating the multiscale edge image with the erosion image, and performing quantitative interpretation on the multiscale edge image and the erosion image to obtain a target multiscale edge image; Accordingly, the moving target detection result is obtained based on the pre-trained shape model and the multi-scale edge image, including: Inputting the target multi-scale edge image into a pre-trained shape model to obtain the output of the moving target detection result; The moving target detection result includes the position and category of the target in the original image.

7. A mobile target detection device based on machine vision, characterized in that: include: The original image acquisition module is used to acquire the original image using the installed camera; A multi-scale edge image acquisition module is used to extract edge information of the original image at different scales based on a pre-trained edge detection model to obtain a multi-scale edge image; The moving target detection result acquisition module is used to obtain the moving target detection result according to the multi-scale edge image based on the pre-trained shape model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for detecting a moving target based on machine vision as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting a moving target based on machine vision as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for detecting a moving target based on machine vision as claimed in any one of claims 1 to 6 is implemented.