CN116485842A - Method, device and storage medium for automatic target recognition - Google Patents
Method, device and storage medium for automatic target recognition Download PDFInfo
- Publication number
- CN116485842A CN116485842A CN202310510954.6A CN202310510954A CN116485842A CN 116485842 A CN116485842 A CN 116485842A CN 202310510954 A CN202310510954 A CN 202310510954A CN 116485842 A CN116485842 A CN 116485842A
- Authority
- CN
- China
- Prior art keywords
- target
- pixel
- calculating
- coordinates
- bulls
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 241001522301 Apogonichthyoides nigripinnis Species 0.000 claims abstract description 37
- 238000003708 edge detection Methods 0.000 claims abstract description 30
- 238000012549 training Methods 0.000 claims abstract description 27
- 238000012545 processing Methods 0.000 claims abstract description 21
- 238000003706 image smoothing Methods 0.000 claims abstract description 8
- 238000001914 filtration Methods 0.000 claims description 10
- 238000004422 calculation algorithm Methods 0.000 claims description 9
- 238000005259 measurement Methods 0.000 claims description 6
- 238000001514 detection method Methods 0.000 abstract description 5
- 239000011159 matrix material Substances 0.000 description 24
- 230000006870 function Effects 0.000 description 11
- 238000012937 correction Methods 0.000 description 9
- 230000000694 effects Effects 0.000 description 7
- 230000008685 targeting Effects 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 101150064138 MAP1 gene Proteins 0.000 description 1
- 101100075995 Schizosaccharomyces pombe (strain 972 / ATCC 24843) fma2 gene Proteins 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 230000005764 inhibitory process Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/246—Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/20—Analysis of motion
- G06T7/277—Analysis of motion involving stochastic approaches, e.g. using Kalman filters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
- G06T7/55—Depth or shape recovery from multiple images
- G06T7/593—Depth or shape recovery from multiple images from stereo images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
- G06T2207/10012—Stereo images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The application discloses an automatic target identification method, an automatic target identification device and a storage medium, relates to the technical field of sensor data processing, and solves the problem that in the prior art, the target is not fully identified, so that the target model is failed to update. The method comprises the following steps: acquiring a data set according to the target picture, training the data set, and determining a training result; carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude and direction of the gradient, and determining an edge detection binary image; calculating neighborhood gradient values of all pixel points; traversing non-0 pixel points of the edge in the edge detection binary image, and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values; and calculating the target coordinates in the three-dimensional space according to the parallaxes of the target pixel coordinates. The method improves the target detection and identification performance, so that the target tracking is faster and more accurate, the anti-interference capability of the system is improved, and the system can not cause tracking failure due to other factors such as environment.
Description
Technical Field
The present disclosure relates to the field of sensor data processing technologies, and in particular, to a method, an apparatus, and a storage medium for automatic target identification.
Background
Currently, intelligent weapon systems based on informatization and unmanned mobile platform technology are getting attention of more and more major military countries in the world as important components in future warfare, and are being studied intensively as technological high points in novel combat forces in all countries in the world.
Today, the development of intelligent unmanned systems is rapid, and unmanned mobile platform technology aiming systems are still to be improved. Currently, a popular targeting system is video manual targeting and target tracking targeting based on correlation filtering. The video manual aiming is greatly influenced by people, firstly, the requirements on personnel quality are high, the hidden cost is certainly increased, and secondly, the stability exerted by personnel is poor and the error is large. In addition, the target tracking aiming based on the correlation filtering has the limitation that the gesture change of the moving target is a common interference problem in target tracking. When the target scale is reduced, a tracking frame cannot adaptively track, so that a lot of background information is included, and update errors of the target model are caused: when the target scale is increased, the target information in the tracking frame is not complete, so that the updating error of the target model is caused.
Disclosure of Invention
According to the method, the device and the storage medium for automatically identifying the target, the problem that in the prior art, the target model is failed to update due to incomplete target identification is solved, the target detection and identification performance is improved, the target tracking is enabled to be faster and more accurate, the anti-interference capability of the system is improved, and the system cannot cause tracking failure due to other factors such as environment.
In a first aspect, an embodiment of the present invention provides a method for automatic target identification, where the method includes:
acquiring a data set according to the target picture, training the data set, and determining a training result;
carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude and the direction of the gradient, and detecting and connecting edges by using a double-threshold algorithm according to the gray level value of the pixel point to obtain an edge detection binary image;
calculating neighborhood gradient values of all pixel points by using operators on the edge detection binary image;
traversing non-0 pixel points of the edge in the edge detection binary image, and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values;
and calculating the three-dimensional coordinates of the bulls-eye relative to the left camera according to the parallax of the pixel coordinates of the bulls-eye, calculating the horizontal rotation angle and the vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculating the bulls-eye coordinates in the three-dimensional space.
With reference to the first aspect, in one possible implementation manner, the detecting and connecting edges according to the gray value of the pixel point using a dual-threshold algorithm to obtain an edge detection binary image includes: judging the gradient value of the pixel point and the size of the double threshold value, and if the gradient value is higher than the high threshold value, marking the pixel point as a strong edge pixel point; if the pixel point is lower than the high threshold value and higher than the low threshold value, marking the pixel point as a weak boundary pixel point; if the pixel is lower than the low threshold, the pixel is marked as a suppressed pixel.
With reference to the first aspect, in one possible implementation manner, before the method is executed, internal parameters of the cameras of the camera are acquired, and correction is performed according to calibration measurement of a relative position between the two cameras.
With reference to the first aspect, in a possible implementation manner, the calculating the coordinates of the target center in the three-dimensional space includes: and carrying out Kalman filtering on the holder angle.
With reference to the first aspect, in one possible implementation manner, the method further includes: and (3) taking a plurality of groups of the target coordinates and corresponding target three-dimensional coordinate information, fitting out weapon outgoing lines by using a least square method, and enabling corresponding target pixels to coincide with points on the fitted lines according to distance information only during aiming to finish aiming.
In a second aspect, an embodiment of the present invention provides an apparatus for automatic target recognition, the apparatus including:
the training module is used for acquiring a data set according to the target picture, training the data set and determining a training result;
the edge detection binary image acquisition module is used for carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude value and the direction of the gradient, and detecting and connecting edges by using a double-threshold algorithm according to the gray level value of the pixel point to obtain an edge detection binary image;
the computing module is used for computing neighborhood gradient values of all pixel points for the edge detection binary image by using operators;
the coordinate determining module is used for traversing non-0 pixel points of the edge in the edge detection binary image and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values;
and the three-dimensional coordinate determining module is used for calculating the three-dimensional coordinates of the bulls-eye relative to the left camera according to the parallaxes of the pixel coordinates of the bulls-eye, calculating the horizontal rotation angle and the vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculating the bulls-eye coordinates in the three-dimensional space.
With reference to the second aspect, in one possible implementation manner, the edge detection binary image obtaining module is configured to include: judging the gradient value of the pixel point and the size of the double threshold value, and if the gradient value is higher than the high threshold value, marking the pixel point as a strong edge pixel point; if the pixel point is lower than the high threshold value and higher than the low threshold value, marking the pixel point as a weak boundary pixel point; if the pixel is lower than the low threshold, the pixel is marked as a suppressed pixel.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes a camera correction module, configured to obtain an internal parameter of the camera, and perform correction according to calibration measurement of a relative position between the two cameras.
With reference to the second aspect, in one possible implementation manner, the three-dimensional coordinate determining module is configured to perform kalman filtering on a pan/tilt angle.
With reference to the second aspect, in a possible implementation manner, the device further includes a targeting module, configured to take multiple sets of the target coordinates and corresponding target three-dimensional coordinate information, and fit a weapon ejection line by using a least square method, where the targeting is completed by overlapping corresponding target pixels with points on the fitted line according to the distance information.
In a third aspect, embodiments of the present invention provide a server for automatic target recognition, the server comprising a memory and a processor;
the memory is used for storing computer executable instructions;
the processor is configured to execute the computer-executable instructions to implement a method of automatic identification and a method of any of the methods of automatic identification.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing executable instructions that when executed by a computer enable a method of automatic identification and a method of automatic identification.
One or more technical solutions provided in the embodiments of the present invention at least have the following technical effects or advantages:
the embodiment of the invention adopts a method, a device and a storage medium for automatic target identification, wherein the method comprises the following steps: acquiring a data set according to the target picture, training the data set, and determining a training result; carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude and the direction of the gradient, and detecting and connecting edges by using a double-threshold algorithm according to the gray level value of the pixel point to obtain an edge detection binary image; calculating neighborhood gradient values of all pixel points by using an operator to detect the binary image; traversing non-0 pixel points of the edge in the edge detection binary image, and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values; according to the parallax of the pixel coordinates of the target centers, the three-dimensional coordinates of the target centers relative to the left camera are calculated, the horizontal rotation angle and the vertical rotation angle are calculated according to the three-dimensional coordinates of the left camera, and the target center coordinates in the three-dimensional space are calculated, so that the target center positions which need subjective judgment can be calculated, the calculation of the target center coordinates is carried out by calculating photos shot at different positions for many times, the edges of the target images are also remembered, the actual edges are determined, the problems that the manual sighting efficiency is low and targets are lost when the shielding occurs are effectively solved, the sighting efficiency is high, the stability is high, the targets appearing in the field of view are continuously tracked, and even if the shielding occurs, the targets are locked again after the shielding occurs again, and the target sighting is carried out.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the embodiments of the present invention or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating steps of a method for automatic target recognition according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a correction map according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an apparatus for automatic target recognition according to an embodiment of the present application;
fig. 4 is a schematic diagram of a server for automatic target recognition according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The existing aiming system is still to be improved, the existing and popular aiming system comprises manual aiming and target tracking aiming based on relevant filtering, the video manual aiming is greatly influenced by people, firstly, the quality requirement on users is high, the invisible cost is undoubtedly increased, and secondly, people are doubtful in exerting stability and have large errors. Furthermore, target tracking targeting based on correlation filtering also has its limitations. The common interference problem in the gesture change mouse tracking is that the appearance model is changed based on the common interference problem, so that tracking failure is easy to cause. The method of the present application is presented based on this.
The embodiment of the invention provides a method for automatically identifying a target, which is shown in fig. 1 and comprises S101 to S105.
S101, acquiring a data set according to the target picture, training the data set, and determining a training result.
Before executing S101, the internal parameters of the camera cameras are acquired, and the relative position between the two cameras is measured according to calibration, so as to perform correction. Camera calibration is not only needed to derive the internal parameters of each camera, but also the relative position between the two cameras (i.e. the translation vector t and rotation matrix R of the right camera relative to the left camera) needs to be measured by calibration. The binocular correction has the effect that two images after distortion removal are strictly corresponding to each other, so that the epipolar lines of the two images are exactly on the same horizontal line, any point on one image and the corresponding point on the other image have the same line number, and the corresponding points can be matched by one-dimensional search on the line. In one specific embodiment provided herein, a Matlab camera calibration kit is used for binocular calibration. Firstly, preparing a checkerboard with proper size according to the distance measurement, wherein the width of the checkerboard in a short-focus binocular camera (the distance measurement range is within 20 m) is up to 20 mm; for a long-focus binocular camera (the ranging range is about 40 m), the width of the square in the chessboard needs to be as large as possible, otherwise, the calibration accuracy is affected, and the range is at least 60mm. Then, shooting pictures, and shooting a plurality of groups of pictures as much as possible, so that the calibration effect can be improved, and the accuracy of ranging is directly influenced by the quality of the calibration effect. For a short-focus camera, 40 groups of photos are usually taken; a tele camera will typically require more groups of pictures. After the photo is taken, the picture enters a matlab calibration tool box, and the Stereo Camera Calibrator double-target calibration tool box is used for importing the picture to obtain calibration data.
Or calibrating a binocular camera using OpenCV. First, detecting chessboard angular points by using findCHessBoard Corders, optimizing sub-pixel angular points by using corerSubPix, storing angular point coordinates, and then generating object point coordinates according to chessboard size, wherein the Z coordinate of the object point is zero, and the abscissa and the ordinate are all from 0. And then, monocular camera calibration is carried out on the left camera and the right camera respectively by using calibretecamera, and internal parameters, distortion coefficients and the like of the two cameras are calculated. The stereo calibration is performed using the stereoCalibrate function, and since the two cameras have been calibrated separately before, default parameters are used for the stereo calibration here, i.e. the two-camera parameters are not changed any more, and equal amounts of R, T, E, F are optimized, R represents the rotation matrix, T represents the translation matrix, E represents the eigen matrix, and F represents the basis matrix.
Then, correction mapping is performed on the calibration data obtained by the two methods, as shown in fig. 2, and the actual calibration process extends backward from the image (C) in fig. 2 to the image (a) in fig. 2, and the process is called reverse mapping. For each integer pixel on the calibration image (C), its coordinates are found in the undistorted image (B) and used to find the actual (floating point) coordinates in the original image (a). The pixel values on the floating point coordinates are interpolated from adjacent integer pixel locations on the original image, which are assigned to calibrated integer pixel locations on the destination image (C). After the calibration images are assigned, they are sheared to increase the overlapping area between the left and right images.
This is achieved here by using the initunderstatorectifymap function for the left and right camera parameters, respectively. The function initunderstatorectifigmap returns as output the look-up map tables map1 and map2, and then corrects the left and right perspective using the mapping of the left and right cameras by the remap function.
After camera correction, the dataset is annotated. Training the obtained data using a neural network, a neural network provided herein may be divided into: and an input terminal, a backup, a pre. The input end is mainly responsible for Mosaic data enhancement, adaptive anchor frame calculation and adaptive picture scaling. Backsheen is largely divided into a Focus structure and a CSP structure, in which the slicing operation is critical. The Neck part adopts a PANet structure, and the Neck is mainly used for generating the feature pyramid. Feature pyramids enhance the detection of objects of different scales by the model, thereby enabling the identification of the same object of different sizes and scales. And adopting GIOU_Loss as a Loss function of the binding box at the output end. In the post-processing of object detection, a nms operation is usually required for screening of many object boxes, where a weighted nms approach is used.
S102, gray processing and image smoothing processing are carried out on the identified targets according to training results, and the amplitude and the direction of the gradient are calculated. In step S101, finally, when the target is identified, capturing the target picture according to the marking box, firstly, performing gray processing, and normalizing the three channel RGB values of each pixel point according to the following formula:wherein R represents the RGB value of red, G represents the RGB value of green, and B represents the RGB value of blue, thereby obtaining the gray scale of the target.
In order to reduce the influence of noise on the edge detection result as much as possible, gaussian filtering is performed on the obtained gray level diagram:wherein, the method comprises the steps of, wherein,representing variance, x represents the coordinate value of the one-dimensional gaussian distribution.
And determining parameters to obtain a one-dimensional kernel vector. The choice of gaussian convolution kernel size will affect the performance of the detector. The larger the magnetic village, the lower the sensitivity of the detector to noise.
Secondly, calculating the amplitude and the direction of the gradient of each pixel point in the image by using a Sobel operator,,,the three matrices are G of the operator respectively x Representing the x-direction convolution template, G y Representing a y-direction convolution template, K representing a neighborhood point marking matrix of a point to be processed, wherein [ i, j ]]As the point to be treated is the point to be treated,to the point ofRepresenting the neighborhood of points to be processed.
The gradient amplitude of each point can be expressed by a mathematical formula according to the method:wherein, the method comprises the steps of, wherein,,。
detecting and connecting edges by using a double-threshold algorithm according to the gray value of the pixel point to obtain an edge detection binary image; comprising the following steps: judging the gradient value of the pixel point and the size of the double threshold value, and if the gradient value is higher than the high threshold value, marking the pixel point as a strong edge pixel point; if the threshold value is lower than the high threshold value and higher than the low threshold value, the mark is markedMarking as weak boundary pixel points; if the pixel is lower than the low threshold, the pixel is marked as a suppressed pixel. The gradient is divided into 8 directions, namely E, NE, N, NW, W, SW, S, SE, wherein 0 represents 0-45 degrees, 1 represents 45-90 degrees, 2 represents-90 to-45 degrees, and 3 represents-45-0 degrees. The gradient direction of the pixel point P is theta, and then the linear interpolation of the gradients of the pixel points P1 and P2 is:,representation ofTo the point ofThe pixel points respectively form an included angle value with the horizontal, and the non-maximum value inhibition can help to inhibit all gradient values except the local maximum value to be 0. With the dual threshold detection again, the remaining pixels can more accurately represent the actual edges in the image after non-maximum suppression is applied. However, there are still some edge pixels due to noise and color variations. To address these spurious responses, it is necessary to filter edge pixels with weak gradient values and preserve edge pixels with high gradient values, which can be achieved by selecting a high and low threshold (the threshold being determined by manually adjusting the observed edge detection binary image effect). If the gradient value of the edge pixel is higher than the high threshold value, marking it as a strong edge pixel; if the gradient value of the edge pixel is less than the high threshold and greater than the low threshold, it is marked as a weak edge pixel; if the gradient value of the edge pixel is less than the low threshold, it is suppressed. And finally, communicating all the strong edges and the weak edges connected with the strong edges.
S103, calculating neighborhood gradient values of all pixel points by using an operator-to-edge detection binary image. Initializing the circle center space N (a, b), and making all N (a, b) =0.
S104, traversing non-0 pixel points of the edge in the edge detection binary image, calculating a plurality of target pixel coordinates, drawing lines along the gradient direction (the vertical direction of the tangent line), and enabling the N (a, b) +=1 of the points (a, b) in all accumulators through which the line segments pass.
The statistical ordering N (a, b) is that the larger the possible circle center N (a, b) is, the more possible circle centers are, and a plurality of circle centers can be arranged in one graph, but because the targets are a plurality of concentric circles, the largest N (a, b) is the circle center which is the coordinate of the target center pixel point. If the circle center is not detected, the length and width of the original image are x and y, and the position (0.5 x and 0.4 y) is taken as the target bulls-eye coordinate (the actual position of the target bulls-eye, and errors exist when the target is not coplanar with the camera).
And obtaining pixel point coordinates of the left and right view bulls-eye centers in the steps, and obtaining three-dimensional coordinates of the bulls-eye centers in a physical space through the pixel point coordinates of the images and camera parameters so as to realize the following aiming. First, the depth information of the bulls-eye is calculated according to the principle of triangulation (after depth information is obtained). Assuming that the corrected image errors are negligible, it can be considered to be taken by a perfect undistorted, aligned, measured system. The image planes of the two cameras are perfectly coplanar, with parallel optical axes (the optical axis is a ray that emanates from the projection center O, also called the "chief ray", passing through the principal point c), at a known distance and with equal focal length. In addition, the corrected left and right views are aligned for each pixel row. At this time, the center of gravity isImaging points on left and right viewsAndcorresponding abscissaAnd。
in this case, the depth is inversely proportional to the parallax. The depth Z is easily found by a similar triangle. Expressed by the formula:where f denotes the camera focal length and T denotes the two-camera distance. Imaging point of bulls-eye on left viewCorresponding abscissa isAnd. The coordinates of the center point of the left view areAnd. Coordinates of the bulls-eye relative to the left camera X and Y directions are calculated from the bulls-eye distance Z:,three-dimensional coordinates X, Y, Z of the bulls-eye with respect to the left camera are thus obtained.
Since depth is inversely proportional to parallax, it is apparent that there is a nonlinear relationship between the two. When the parallax approaches zero, a small parallax change causes a large depth change. When the parallax is large, the tiny parallax does not cause the depth to change too much, and it can be concluded that the stereoscopic vision system has higher depth resolution only when the object is closer to the camera.
S105, calculating the target coordinates in the three-dimensional space according to the target pixel coordinates. According to the parallax of the pixel coordinates of the target cores, calculating the three-dimensional coordinates of the target cores relative to the left camera; and calculating a horizontal rotation angle and a vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculating the target coordinates in the three-dimensional space. In the case of obtaining the three-dimensional coordinates of the bulls-eye, the left camera coordinates areThe coordinates of the bulls-eye areThe formula is:the horizontal rotation angle w and the vertical rotation angle h are obtained. The pan/tilt head is rotated so that the center of the left camera view is aimed at the bulls-eye.
And (3) taking a plurality of groups of target coordinates and corresponding target three-dimensional coordinate information, fitting out a weapon ejection line by using a least square method, and enabling corresponding target pixels to coincide with points on the fitted line according to distance information during aiming to finish aiming. In a specific embodiment provided in the application, the weapon is aimed at the targets by rotating the cradle head at 10m,20m,30m,40m and 50m, and the left image pixel positions and the corresponding distance information of the five groups of targets are taken, and because the weapon is ejected in an approximate straight line, the five points are also in a straight line in the field of view. The pixel position is taken asTaking distance information in three-dimensional coordinates of the bulls-eye as. A straight line can be fitted in the visual field by using a least square method through 5 pixel points, and the straight line is a weapon ejection line. Expressed as:
,
wherein the method comprises the steps ofTo the point ofIs thatAnd a deviation value from the fitted line at the coordinates.
I.e., to find the R minimum in the following formula:
,
wherein the method comprises the steps ofRepresentation ofA point(s),Dots and method for producing the sameThe distance of the point to the y-direction of the fitted line.
,
,
Solving a and b to obtain a fitting straight line, and calculating the distance from the target to the cameraA relation to this straight line. When aiming is needed, only the bulls-eye is needed to be identified, the pixel position and the distance information are acquired, the pixel coordinates of the corresponding fitting line are acquired according to the distance information, and the three-dimensional coordinates and the horizontal and vertical angle difference value with the current gesture are calculated.
Processing the horizontal and vertical angle differences according to the kalman filter, comprising: assuming that the system state at time k is related to time k-1 and that there is noise inside, the state equation:whereinIs a system state matrix, A is a state transition matrix,is the system state matrix at time k-1,is process noise.
Observation equation:whereinIn the form of a system state matrix,is the observed quantity of the state matrix, H is the state observation matrix,to measure noise.
Predicting without noise, prediction state:and (3) predicting and observing:observation information (observation-predictive observation):whereinAnd (3) withIs the observed quantity of the system state matrix and the state matrix under the noise-free condition,represented as the optimal predicted state at time k-1.
Observing the innovation reflects the predicted noiseAnd observation noiseThe comprehensive effect on the state will process noiseSeen as a new ratio.
Then the predicted state is optimized:
,
error covariance matrix:
,
whereas kalman gainShould the error covariance matrix be madeMinimum state innovation (state-predicted state):
,
wherein H represents an observation matrix, and I represents an identity matrix.
Assume that in the absence of noise, the state innovation:
,
at this time, the error covariance matrix is expanded:
。
if T is used to represent the diagonal of the error covariance matrix, then:
,
for a pair ofDeriving to find the minimum mean square error to makeThe Kalman gain can be obtained by minimum。
According toLet it be 0, the kalman gain is:
,
wherein the observation matrix H and the observation noise covariance matrix R are constant, so the Kalman gainCovariance matrix of prediction errorRelated to the following.
Solving an error covariance matrix:
,
when the external effect on the system is added, five formulas of Kalman filtering can be arranged:
and (3) predicting:,the method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is process noiseCovariance of (2)
And (3) correction:,,;
the filtered signal is smoother, and the prediction function is realized.
An embodiment of the present invention provides an apparatus 300 for automatic target recognition, where as shown in fig. 3, the apparatus 300 includes:
the training module 301 is configured to obtain a data set according to the target picture, train the data set, and determine a training result.
The edge detection binary image obtaining module 302 is configured to perform gray level processing and image smoothing processing on the identified target according to the training result, calculate the magnitude and direction of the gradient, and detect and connect edges according to the gray level value of the pixel point by using a dual-threshold algorithm to obtain an edge detection binary image; further comprises: judging the gradient value of the pixel point and the size of the double threshold value, and if the gradient value is higher than the high threshold value, marking the pixel point as a strong edge pixel point; if the pixel point is lower than the high threshold value and higher than the low threshold value, marking the pixel point as a weak boundary pixel point; if the pixel is lower than the low threshold, the pixel is marked as a suppressed pixel.
The calculating module 303 is configured to calculate neighborhood gradient values of all pixel points using the operator-edge detection binary image;
the coordinate determining module 304 is configured to traverse non-0 pixel points of the edge in the edge detection binary image, and calculate a plurality of bulls-eye pixel coordinates in combination with the neighborhood gradient value;
the three-dimensional coordinate determining module 305 is configured to calculate the three-dimensional coordinates of the bulls-eye relative to the left camera according to the parallaxes of the pixel coordinates of the multiple bulls-eye, calculate the horizontal rotation angle and the vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculate the bulls-eye coordinates in the three-dimensional space. And the method is also used for carrying out Kalman filtering on the holder angle.
The device 300 further includes a camera calibration module for obtaining internal parameters of the cameras and calibrating the relative positions between the two cameras according to calibration measurements.
The device 300 further comprises an aiming module for taking a plurality of groups of target coordinates and corresponding target three-dimensional coordinate information, and fitting out a weapon ejection line by using a least square method, wherein the aiming is completed by only overlapping corresponding target pixels with points on the fitted line according to the distance information.
The apparatus or module set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. For convenience of description, the above devices are described as being functionally divided into various modules, respectively. The functions of the various modules may be implemented in the same piece or pieces of software and/or hardware when implementing the present application. Of course, a module that implements a certain function may be implemented by a plurality of sub-modules or a combination of sub-units.
The methods, apparatus or modules described herein may be implemented in computer readable program code means and in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (english: application Specific Integrated Circuit; abbreviated: ASIC), programmable logic controllers and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller can be regarded as a hardware component, and means for implementing various functions included therein can also be regarded as a structure within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
Some of the modules of the apparatus described herein may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
An embodiment of the present invention provides a server 400 for automatic target recognition, which includes a memory 401 and a processor 402 as shown in fig. 4; memory 401 is used to store computer-executable instructions; the processor 402 is configured to execute computer-executable instructions to implement a method of automatic identification and a method of any of the automatic identification methods.
The embodiment of the invention provides a computer readable storage medium, wherein executable instructions are stored in the computer readable storage medium, and when the computer executes the executable instructions, the method for automatically identifying and the method for automatically identifying can be realized.
The storage medium includes, but is not limited to, a random access Memory (English: random Access Memory; RAM), a Read-Only Memory (ROM), a Cache Memory (English: cache), a Hard Disk (English: hard Disk Drive; HDD), or a Memory Card (English: memory Card). The memory may be used to store computer program instructions.
Although the present application provides method operational steps as described in the examples or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the present embodiment is only one way of performing the steps in a plurality of steps, and does not represent a unique order of execution. When implemented by an actual device or client product, the method of the present embodiment or the accompanying drawings may be performed sequentially or in parallel (e.g., in a parallel processor or a multithreaded environment).
From the description of the embodiments above, it will be apparent to those skilled in the art that the present application may be implemented in software plus necessary hardware. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, or may be embodied in the implementation of data migration. The computer software product may be stored on a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., comprising instructions for causing a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to perform the methods described in various embodiments or portions of embodiments herein.
In this specification, each embodiment is described in a progressive manner, and the same or similar parts of each embodiment are referred to each other, and each embodiment is mainly described as a difference from other embodiments. All or portions of the present application can be used in a number of general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the present application; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced with equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions.
Claims (8)
1. A method of automatic target recognition, comprising:
acquiring a data set according to the target picture, training the data set, and determining a training result;
carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude and the direction of the gradient, and detecting and connecting edges by using a double-threshold algorithm according to the gray level value of the pixel point to obtain an edge detection binary image;
calculating neighborhood gradient values of all pixel points by using operators on the edge detection binary image;
traversing non-0 pixel points of the edge in the edge detection binary image, and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values;
and calculating the three-dimensional coordinates of the bulls-eye relative to the left camera according to the parallax of the pixel coordinates of the bulls-eye, calculating the horizontal rotation angle and the vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculating the bulls-eye coordinates in the three-dimensional space.
2. The method according to claim 1, wherein the detecting and connecting edges according to gray values of pixels using a dual-threshold algorithm to obtain an edge detection binary image comprises: judging the gradient value of the pixel point and the size of the double threshold value, and if the gradient value is higher than the high threshold value, marking the pixel point as a strong edge pixel point; if the pixel point is lower than the high threshold value and higher than the low threshold value, marking the pixel point as a weak boundary pixel point; if the pixel is lower than the low threshold, the pixel is marked as a suppressed pixel.
3. A method according to claim 1, characterized in that, before the method is performed, the internal parameters of the cameras of the camera are obtained and the relative position between the two cameras is corrected on the basis of calibration measurements.
4. The method of claim 1, wherein the calculating the coordinates of the bulls-eye in three-dimensional space comprises: and carrying out Kalman filtering on the holder angle.
5. The method as recited in claim 1, further comprising: and (3) taking a plurality of groups of the target coordinates and corresponding target three-dimensional coordinate information, fitting out weapon outgoing lines by using a least square method, and enabling corresponding target pixels to coincide with points on the fitted lines according to distance information only during aiming to finish aiming.
6. An apparatus for automatic target recognition, comprising:
the training module is used for acquiring a data set according to the target picture, training the data set and determining a training result;
the edge detection binary image acquisition module is used for carrying out gray level processing and image smoothing processing on the identified target according to the training result, calculating the amplitude value and the direction of the gradient, and detecting and connecting edges by using a double-threshold algorithm according to the gray level value of the pixel point to obtain an edge detection binary image;
the computing module is used for computing neighborhood gradient values of all pixel points for the edge detection binary image by using operators;
the coordinate determining module is used for traversing non-0 pixel points of the edge in the edge detection binary image and calculating a plurality of bulls-eye pixel coordinates by combining the neighborhood gradient values;
and the three-dimensional coordinate determining module is used for calculating the three-dimensional coordinates of the bulls-eye relative to the left camera according to the parallaxes of the pixel coordinates of the bulls-eye, calculating the horizontal rotation angle and the vertical rotation angle according to the three-dimensional coordinates of the left camera, and calculating the bulls-eye coordinates in the three-dimensional space.
7. A server for automatic target recognition, comprising a memory and a processor;
the memory is used for storing computer executable instructions;
the processor is configured to execute the computer-executable instructions to implement the method of any of claims 1-5.
8. A computer readable storage medium storing executable instructions which when executed by a computer enable the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310510954.6A CN116485842A (en) | 2023-05-09 | 2023-05-09 | Method, device and storage medium for automatic target recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310510954.6A CN116485842A (en) | 2023-05-09 | 2023-05-09 | Method, device and storage medium for automatic target recognition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116485842A true CN116485842A (en) | 2023-07-25 |
Family
ID=87217747
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310510954.6A Pending CN116485842A (en) | 2023-05-09 | 2023-05-09 | Method, device and storage medium for automatic target recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116485842A (en) |
-
2023
- 2023-05-09 CN CN202310510954.6A patent/CN116485842A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110717942B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
CN108876749A (en) | A kind of lens distortion calibration method of robust | |
CN109961417B (en) | Image processing method, image processing apparatus, and mobile apparatus control method | |
CN107844750A (en) | A kind of water surface panoramic picture target detection recognition methods | |
CN106815869B (en) | Optical center determining method and device of fisheye camera | |
CN110689581A (en) | Structured light module calibration method, electronic device and computer readable storage medium | |
CN110992263B (en) | Image stitching method and system | |
CN106530358A (en) | Method for calibrating PTZ camera by using only two scene images | |
CN112288826B (en) | Calibration method and device of binocular camera and terminal | |
CN111028205B (en) | Eye pupil positioning method and device based on binocular distance measurement | |
JP5672112B2 (en) | Stereo image calibration method, stereo image calibration apparatus, and computer program for stereo image calibration | |
CN106408551A (en) | Monitoring device controlling method and device | |
CN108734738B (en) | Camera calibration method and device | |
WO2019232793A1 (en) | Two-camera calibration method, electronic device and computer-readable storage medium | |
CN110619660A (en) | Object positioning method and device, computer readable storage medium and robot | |
Cvišić et al. | Recalibrating the KITTI dataset camera setup for improved odometry accuracy | |
CN110087049A (en) | Automatic focusing system, method and projector | |
CN106558038B (en) | A kind of detection of sea-level and device | |
JP7156624B2 (en) | Depth map filtering device, depth map filtering method and program | |
CN111383264A (en) | Positioning method, positioning device, terminal and computer storage medium | |
CN114494013A (en) | Image splicing method, device, equipment and medium | |
CN113793266A (en) | Multi-view machine vision image splicing method, system and storage medium | |
CN105335959B (en) | Imaging device quick focusing method and its equipment | |
Kruger et al. | In-factory calibration of multiocular camera systems | |
CN117848234A (en) | Object scanning mechanism, method and related equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |