A target feature recognition method and system based on machine vision
By combining stereo matching and depth map weighted fusion methods from machine vision with Siamese networks and 3D convolutional networks, the problems of low efficiency and poor accuracy in traditional track slab detection are solved, achieving high-precision track slab feature recognition and defect detection.
Patent Information
- Application Number
- CN202511549522.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-10-28
AI Technical Summary
Traditional track slab detection methods rely on manual visual inspection, which is inefficient and easily affected by subjective factors. Existing cross-modal feature fusion algorithms are complex and difficult to guarantee recognition accuracy.
A machine vision-based approach is adopted, which constructs an attention mask by weighted fusion of depth map generated by stereo matching and texture color anomaly map, extracts feature maps using Siamese network and performs gated dynamic fusion, and combines 3D convolutional network to learn geometric relationships between viewpoints to generate enhanced features.
It enables accurate identification of track slab features under visible light image conditions, reducing labor costs and false detection rates, and achieving identification accuracy close to that of multi-sensor fusion, thus guiding track construction and defect detection.
Smart Images

Figure CN121033613B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of track slab measurement technology, and more specifically, to a target feature recognition method and system based on machine vision. Background Technology
[0002] Track slabs are a crucial component of railway track structures, and their quality and performance directly affect the safe operation and service life of the railway. Characteristic identification of track slabs is of paramount importance during railway construction and maintenance. Traditional track slab inspection methods primarily rely on manual visual inspection, which is not only inefficient but also susceptible to subjective factors, making it difficult to guarantee the accuracy and consistency of inspection results.
[0003] With the rapid development of technologies such as computer vision, image processing, and artificial intelligence, new technical means have been provided for track slab feature recognition. Existing technologies have proposed methods for feature recognition by fusing visible light images with other data (such as infrared and lidar). However, the development of such cross-modal feature fusion algorithms is challenging. Not only is data processing complex, but precise spatial alignment and temporal synchronization are also required. Inaccurate alignment can affect the accuracy of feature recognition. Features from different data sources may conflict or be redundant, interfering with feature recognition. Summary of the Invention
[0004] The purpose of this invention is to provide a target feature recognition method and system based on machine vision to improve the aforementioned problems. To achieve the above objective, the technical solution adopted by this invention is as follows:
[0005] In a first aspect, the present invention provides a target feature recognition method based on machine vision, comprising:
[0006] Acquire target images from at least two perspectives and preprocess the target images from different perspectives;
[0007] Depth maps are generated by stereo matching of images from different perspectives, and anomaly maps are generated by texture and color recognition. An attention mask is constructed by weighted fusion of depth maps and anomaly maps.
[0008] A set of matching images from different perspectives are input into the Siamese network to extract feature maps. The attention mask is downsampled to the same size and then dynamically fused with the feature maps under gating to obtain weighted feature maps from different perspectives.
[0009] Weighted feature maps from different perspectives are input into a 3D convolutional network, and enhanced features are obtained by learning the geometric relationships between perspectives. These enhanced features are used to guide track construction or defect detection.
[0010] Secondly, the present invention also provides a target feature recognition system based on machine vision, comprising:
[0011] The first acquisition module is used to acquire target images from at least two perspectives and to preprocess the target images from different perspectives.
[0012] The first building module is used to generate depth maps by stereo matching of images from different perspectives, generate anomaly maps by texture and color recognition, and construct an attention mask by weighted fusion of depth maps and anomaly maps.
[0013] The first fusion module is used to input a set of matching images from different perspectives into the Siamese network to extract feature maps, downsample the attention mask to the same size, and perform gated dynamic fusion with the feature maps to obtain weighted feature maps from different perspectives.
[0014] The second fusion module is used to input weighted feature maps from different perspectives into a 3D convolutional network, and obtain enhanced features by learning the geometric relationships between perspectives. These enhanced features are used to guide track construction or defect detection.
[0015] The beneficial effects of this invention are as follows:
[0016] This invention constructs an attention mask by weighted fusion of depth maps generated through stereo matching and texture / color anomaly maps. This mask is then dynamically fused with feature maps extracted by a Siamese network, precisely enhancing effective features, weakening noise, and reducing interference from irrelevant information. The Siamese network, through shared weights and contrastive learning, ensures consistent feature distribution across different viewpoints. 3D convolution further leverages this consistency, fusing effective local information from multiple perspectives into a globally complete feature set. This approach considers both multi-view information and spatial geometric relationships, resulting in more accurate and comprehensive track slab feature recognition. Thus, using only visible light images, it achieves recognition accuracy approaching that of multi-sensor fusion, eliminating the need for complex multi-source data fusion. This provides guidance for track construction and defect detection, reducing labor costs and false detection rates.
[0017] Other features and advantages of the invention will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of the invention. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the target feature recognition method based on machine vision according to an embodiment of the present invention;
[0020] Figure 2 This is a structural diagram of a target feature recognition device based on machine vision, according to an embodiment of the present invention.
[0021] The diagram is labeled as follows: 800 - Machine vision-based target feature recognition device; 801 - Processor; 802 - Memory; 803 - Multimedia component; 804 - I / O interface; 805 - Communication component. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0023] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0024] Example 1:
[0025] See Figure 1 A target feature recognition method based on machine vision includes steps S100, S200, S300 and S400.
[0026] S100: Acquire target images from at least two perspectives, and preprocess the target images from different perspectives; the target described in this application is a track slab.
[0027] The imaging device used in this application has at least two cameras facing different directions, which acquire target images from different angles, and the imaging device moves along a track axis; image preprocessing includes:
[0028] The image undergoes distortion correction and preliminary denoising, and is converted into a grayscale image. This application employs Contrast Limiting Adaptive Histogram Equalization (CLAHE) to make the grayscale distribution of the image more uniform, thereby enhancing the image contrast, improving the visual quality of the image, and avoiding excessive amplification of noise.
[0029] The image is divided into multiple sub-regions (tiles), each typically a small rectangular block, such as 8x8 or 16x16 pixels. Histogram processing is then applied to each sub-region separately.
[0030] Count the number of pixels for each gray level. If the number of pixels for a single gray level exceeds the threshold, the excess pixel values are redistributed to other gray levels.
[0031] Calculate the histogram of each sub-region, traverse all pixels within the sub-block, and record the number of pixels corresponding to each gray level (e.g., 128); calculate the average number of pixels in the sub-region (i.e., the number of pixels at each gray level in the ideal uniform histogram), and then determine the number threshold.
[0032] If the number of pixels at a single gray level exceeds the number threshold, the excess pixel values are redistributed to other gray levels; this preserves the effective gray level contrast while avoiding excessive stretching of noise peaks.
[0033] For each sub-region that has been contrast-limited, histogram equalization is performed separately, and the gray-level mapping relationship of that sub-region is calculated.
[0034] Bilinear interpolation is used to smooth the sub-regions after histogram equalization, eliminating boundary faults between regions and obtaining the preprocessed target image.
[0035] S200: Generate depth maps by stereo matching of images from different perspectives, generate anomaly maps by texture and color recognition, and construct an attention mask by weighted fusion of depth maps and anomaly maps;
[0036] Stereo matching utilizes images from two or more viewpoints to calculate disparity by matching the positions of the same scene point in different images, thereby inferring depth information. This application employs a semi-global matching (SGBM) method, which improves matching accuracy by considering the neighborhood information of pixels, building upon block matching.
[0037] Depth maps can reflect defects such as cracks and delamination in track slabs. To quantify the reliability of the depth value of each pixel, a confidence matrix of the same size as the depth map is constructed. Since feature point matching is performed in stereo matching, the number of effective matching feature points in the 3×3 neighborhood around each pixel can be counted and normalized to [0,1] as the confidence level (the more matching feature points in the neighborhood, the higher the confidence level).
[0038] Texture analysis can use the Gray-Level Co-occurrence Matrix (GLCM) extraction method to calculate contrast, correlation, and energy indices (reflecting the coarseness and regularity of the texture) in multiple directions. The extracted GLCM features are compared with the texture template of a statistically normal track slab to calculate the Euclidean distance. Regions with excessive differences are selected and marked as texture anomalies. The degree to which the Euclidean distance exceeds a preset threshold is mapped to confidence level.
[0039] Color analysis can use color histograms or other color feature extraction methods; compare the differences between the color features and the color features of normal track plate samples, mark the areas of color aberration, and map the magnitude of the difference to confidence level.
[0040] In another embodiment, color features that account for a higher proportion can be identified from the current frame image and adjacent frame images as normal color features, and areas that do not conform to normal color features are marked as abnormal areas.
[0041] Perform an OR operation on the candidate regions for texture anomalies and color anomalies (if either anomaly is satisfied, it is determined to be an anomaly) to obtain a binarized initial anomaly map (1=abnormal, 0=normal); and weight the confidence scores of texture anomalies and color anomalies to obtain the confidence score of the anomaly map.
[0042] Identifying depth anomaly regions from the depth map—that is, regions where the depth value deviates significantly from its neighborhood or where depth values show discontinuities—is crucial. The depth map is then binarized (1 = depth anomaly, 0 = normal). Weighted fusion of the binarized depth map and the anomaly map combines the advantages of both to generate a more comprehensive attention mask. The depth map provides 3D information about the scene, while the anomaly map provides information about texture and color anomalies.
[0043] S300: Input a set of matching images from different perspectives into the Siamese network to extract feature maps, downsample the attention mask to the same size, and perform gated dynamic fusion with the feature maps to obtain weighted feature maps from different perspectives;
[0044] A Siamese network consists of two or more sub-networks sharing weights, each processing one of two input samples. The network continuously adjusts the weights through contrastive learning, making the feature representations of similar samples more similar and the feature representations of dissimilar samples more dissimilar. This process essentially learns the common features of the input samples, specifically including:
[0045] S310, Obtain the pre-built cause-effect graph;
[0046] Cause-effect graphs are constructed using domain knowledge and prior data-driven methods. Different cause-effect graphs need to be built for different identification purposes to enhance the identification of different features. Taking track slab defect identification as an example, the cause-effect graph includes:
[0047] Target variable (Y): presence or absence of defects (binary or continuous);
[0048] Relevant variables (C): Features that are causally related to the defect (such as crack length and depth);
[0049] Confounding variables (S): Features that are not causally related but are statistically relevant (such as changes in lighting, dirt texture, and image noise).
[0050] S320. Construct a decoupled network with two parallel branches based on the causal graph as a feature extractor for the Siamese network to separate relevant and interfering features in the image;
[0051] The purpose of the decoupling network is to separate the relevant variables (C) and the interference variables (S). The decoupling network with two parallel branches includes a causal branch and an interference branch. The causal branch uses a convolutional neural network (CNN) to extract relevant features.
[0052] The interference branch captures interference features through an attention mechanism or a graph neural network (GNN);
[0053] During training, counterfactual samples can be generated by decoupling relevant and interfering features (e.g., replacing the interfering features of a sample with the interfering features of other samples), thus eliminating the false correlation between relevant and interfering features.
[0054] I(C;S) is estimated using the CLUB (Contrastive Log-Ratio Upper Bound) method, and a regularization term is added as the optimization objective to force the mutual information to be minimized, making C and S independent of each other.
[0055] For constructing the loss function of the decoupled network, on the one hand, a classification loss term is constructed based on the causal graph to evaluate the correctness of the classification; on the other hand, a reconstruction loss term is constructed to ensure that the relevant features and interference features after decoupling can reconstruct the original input.
[0056] S330. Eliminate interfering features and generate a decoupled feature map.
[0057] Using the aforementioned causal decoupling network as the feature extraction part of the Siamese network, that is, constructing at least two causal decoupling networks with shared parameters to process images from different angles, not only can structural adaptation be achieved, but also the problem of interference features reducing recognition accuracy in traditional Siamese network feature extraction can be solved, significantly improving the feature alignment and similarity measurement capabilities of Siamese networks in cross-scene and strong interference scenarios.
[0058] S340. Stride convolution is used to downsample the attention mask to obtain a single-channel mask;
[0059] Let the feature map output by the Siamese network have a size of H×W×C, where C is the number of feature channels, H is the height, and W is the width. Stride convolution is used to downsample the attention mask (initially H0×W0×1, where H0 is the initial height and W0 is the initial width) to H×W×1 to ensure that the spatial dimensions are completely matched with the feature map.
[0060] S350. Expand the single-channel mask to match the number of channels in the feature map through convolution, and then combine it with the confidence of the attention mask to generate a gated weight mask through Sigmoid activation function mapping.
[0061] The downsampled single-channel mask is expanded to H×W×C (consistent with the number of channels in the feature map) through a 1×1 convolution, and then mapped to the [0,1] interval using a Sigmoid activation function; the expanded attention mask is then used... The Sigmoid activation function, incorporating confidence, is:
[0062] ;
[0063] in, Here, α is the activation function, and α is the mask confidence level (α∈[0,1]). For gating weights, It is a natural constant;
[0064] S360. Multiply the feature map point-by-point with the gated weight mask to obtain a weighted feature map. This enhances features in high-interest regions (such as deep anomaly regions) and suppresses features in irrelevant regions.
[0065] S400. Input the weighted feature maps from different perspectives into a 3D convolutional network, and obtain enhanced features by learning the geometric relationships between perspectives. The enhanced features are used to guide track construction or defect detection.
[0066] Weighted feature maps from different perspectives are stacked along a new dimension, and 3D convolutional kernels slide simultaneously in both the perspective and spatial dimensions to achieve cross-perspective feature interaction and output enhanced features from multiple perspectives.
[0067] Feature maps from different viewpoints often exhibit information complementarity (e.g., an area occluded in viewpoint 1 may be fully displayed in viewpoint 2) and spatial consistency (the structural features of the same object have a fixed geometric mapping across different viewpoints). Siamese networks have already ensured the consistency of feature distribution across feature maps from different viewpoints (i.e., the features of the same object have similar semantic dimensions across different viewpoints) through shared weights and contrastive learning; 3D convolution further utilizes this consistency to fuse effective local information from multiple viewpoints into a globally complete feature map.
[0068] This step utilizes the spatiotemporal awareness of 3D convolution to explicitly model the geometric relationships between multi-view images. It can automatically focus on these cross-view stable geometric features, and even if the input is a 2D image, it can construct a 3D structural representation in the feature space.
[0069] The horizontal state of the track slab is difficult to observe visually through images; that is, the model struggles to learn and identify subtle anomalies in the horizontal state of the track slab using only visible light images. To address this issue, the present invention further includes the following steps:
[0070] S500: Acquire a target image, on which there are projection lines projected by a projection device;
[0071] The projection device and the shooting device are designed as an integrated unit, meaning that their relative positions remain unchanged. The projection device generates light that is projected onto the track plate. The projection lines can be cross-shaped or other shapes, preferably composed of straight lines, and the width of each straight line should not be too small.
[0072] The projection lines are projected onto the track plate at a fixed angle. Under the normal state where the track plate is completely horizontal, the projection line image is obtained to obtain the standard projection lines.
[0073] When the track slab has an abnormal horizontal state, such as arching or sinking, the projection lines at the abnormal point will be distorted, for example, the length and width of the projection lines will change slightly. Therefore, the difficult-to-identify horizontal state can be transformed into geometric features that are easy for machine vision to recognize through the projection lines, so as to quickly and accurately obtain the horizontal information of the track slab.
[0074] S600: Segment the projection line region from the target image;
[0075] S700. Perform feature recognition on the projection line region, extract projection line distortion features, and identify the horizontal state of the target based on the projection line distortion features. Specifically, this includes:
[0076] The projection line features of consecutive frame images are obtained in time sequence; the track slabs corresponding to consecutive frame images are also connected in actual spatial position.
[0077] The projection lines of each frame image are compared with the pre-established standard projection lines to obtain the first projection line distortion features.
[0078] The projection lines of each frame image are compared with the projection lines of its two adjacent frames to obtain the second projection line distortion features.
[0079] The first projection line distortion feature and the second projection line distortion feature are input into the pre-established horizontal state recognition model, and the horizontal state heat map of the target is output.
[0080] The identification of the horizontal state takes into account the differences with both the standard track slab and adjacent track slabs. If the projection line features of the two adjacent frames before and after the current frame are highly similar, the weight of the second projection line distortion feature is increased (not exceeding 0.5), indicating that the current track slab is abnormal compared to the areas before and after it. If the projection line features of the two adjacent frames are not highly similar, the weight of the second projection line distortion feature is decreased, with the standard projection line as the main reference.
[0081] The method for constructing the horizontal state recognition model is as follows:
[0082] Collect sample images of the track slab projection lines, and simultaneously perform precise measurements of the track slab's horizontal state. Divide the track slab plane into several points, obtain the height data of each point, and map the height data into pixel values to obtain a heat map of the track slab's horizontal state.
[0083] The first projection line distortion feature and the second projection line distortion are extracted from the projection line sample image as input, and the corresponding horizontal state heatmap is used as output to train the model and obtain the horizontal state recognition model.
[0084] Example 2:
[0085] This application also provides a target feature recognition system based on machine vision, including:
[0086] The first acquisition module is used to acquire target images from at least two perspectives and to preprocess the target images from different perspectives.
[0087] The first building module is used to generate depth maps by stereo matching of images from different perspectives, generate anomaly maps by texture and color recognition, and construct an attention mask by weighted fusion of depth maps and anomaly maps.
[0088] The first fusion module is used to input a set of matching images from different perspectives into the Siamese network to extract feature maps, downsample the attention mask to the same size, and perform gated dynamic fusion with the feature maps to obtain weighted feature maps from different perspectives.
[0089] The second fusion module is used to input weighted feature maps from different perspectives into a 3D convolutional network, and obtain enhanced features by learning the geometric relationships between perspectives. These enhanced features are used to guide track construction or defect detection.
[0090] As an optional implementation, the system further includes:
[0091] The second acquisition module is used to acquire the target image, on which there are projection lines projected by a projection device;
[0092] The segmentation module is used to segment the projection line region from the target image;
[0093] The recognition module is used to perform feature recognition on the projection line area, extract projection line distortion features, and identify the horizontal state of the target based on the projection line distortion features.
[0094] As an optional implementation, the identification module includes:
[0095] The first acquisition unit is used to acquire the projection line features of consecutive frame images in a time sequence;
[0096] The first comparison unit is used to compare the projection lines of each frame image with the pre-established standard projection lines to obtain the first projection line distortion features.
[0097] The second comparison unit is used to compare the projection lines of each frame image with the projection lines of its two adjacent frames to obtain the second projection line distortion features.
[0098] The recognition unit is used to input the first projection line distortion feature and the second projection line distortion feature into the pre-established horizontal state recognition model and output the horizontal state heat map of the target.
[0099] As an optional implementation, the first fusion module includes:
[0100] The second acquisition unit is used to acquire the pre-constructed causal graph;
[0101] The building unit is used to construct a decoupled network with two parallel branches based on the causal graph as a feature extractor for the Siamese network, separating relevant and interfering features in the image;
[0102] The generation unit is used to remove interfering features and generate a decoupled feature map.
[0103] Example 3:
[0104] Corresponding to the above method embodiments, this embodiment also provides a target feature recognition device based on machine vision. The target feature recognition device based on machine vision described below can be referred to in correspondence with the target feature recognition method based on machine vision described above.
[0105] Figure 2 This is a block diagram illustrating a machine vision-based target feature recognition device 800 according to an exemplary embodiment. Figure 2As shown, the machine vision-based target feature recognition device 800 includes a processor 801 and a memory 802. The machine vision-based target feature recognition device 800 may also include one or more of the following: a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805. The processor 801 controls the overall operation of the machine vision-based target feature recognition device 800 to complete all or part of the steps in the machine vision-based target feature recognition method described above. The memory 802 stores various types of data to support the operation of the machine vision-based target feature recognition device 800. This data may include, for example, commands for any application or method operating on the machine vision-based target feature recognition device 800, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0106] Multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals.
[0107] The received audio signal can be further stored in memory 802 or transmitted via communication component 805. The audio component also includes at least one speaker for outputting audio signals. I / O interface 804 provides an interface between processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons can be virtual or physical. Communication component 805 is used for wired or wireless communication between the machine vision-based target feature recognition device 800 and other devices. Wireless communication includes, for example, Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof; therefore, the corresponding communication component 805 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0108] Example 4:
[0109] Corresponding to the above embodiment of the target feature recognition method based on machine vision, this embodiment also provides a readable storage medium. The readable storage medium described below can be referred to in relation to the target feature recognition method based on machine vision described above.
[0110] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described embodiment of the target feature recognition method based on machine vision.
[0111] Specifically, the readable storage medium can be a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or any other readable storage medium capable of storing program code.
[0112] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0113] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for recognizing a feature of a target based on machine vision, characterized by, The method comprises the following steps: obtaining target images under at least two perspectives, and preprocessing the target images under different perspectives; generating a depth map through stereo matching of the images under different perspectives, generating an anomaly map through texture and color recognition, and constructing an attention mask by weighted fusion of the depth map and the anomaly map, comprising: using a gray level co-occurrence matrix extraction method to calculate contrast, correlation and energy indicators in multiple directions, comparing the extracted gray level co-occurrence matrix features with the texture templates of the normal track plates, calculating the Euclidean distance, and marking the texture abnormal area; using a color histogram feature extraction method to compare the color features with the color features of the normal track plate samples, and marking the color abnormal area; performing an OR operation on the texture abnormal candidate area and the color abnormal candidate area to obtain a binary anomaly map; and performing weighted fusion on the binary depth map and the anomaly map to generate an attention mask; inputting a set of matched images under different perspectives into a twin network to extract a feature map, downsampling the attention mask to the same size, and performing gated dynamic fusion on the feature map to obtain weighted feature maps under different perspectives, comprising: obtaining a pre-constructed causal graph; constructing a decoupling network with two parallel branches as a feature extractor of the twin network based on the causal graph to separate relevant features and interference features in the image; eliminating the interference features to generate a decoupled feature map; downsampling the attention mask using a step convolution to obtain a single-channel mask; expanding the single-channel mask to the same number of channels as the feature map through convolution, combining the confidence of the attention mask, and mapping a gate weight mask through a Sigmoid activation function; multiplying the feature map and the gate weight mask point by point to obtain a weighted feature map; inputting the weighted feature maps under different perspectives into a 3D convolution network to obtain enhanced features by learning the geometric relationship between the perspectives, wherein the enhanced features are used to guide track construction or defect detection.
2. The method of claim 1, wherein, The method further comprises: obtaining a target image having a projection line projected by a projection device on the target; segmenting the projection line region from the target image; performing feature recognition on the projection line region, extracting projection line distortion features, and identifying the horizontal state of the target based on the projection line distortion features. 3.The method of claim 2, wherein, performing feature recognition on the projection line region, extracting projection line distortion features, and identifying the horizontal state of the target based on the projection line distortion features, comprising: obtaining the projection line features of the continuous frame images in sequence; comparing the projection line of each frame image with a pre-established standard projection line to obtain first projection line distortion features; comparing the projection lines of each frame image with its adjacent two frame images to obtain second projection line distortion features; inputting the first projection line distortion features and the second projection line distortion features into a pre-established horizontal state recognition model to output a target horizontal state heat map.
4. The method of claim 1, wherein, The preprocessing of the target images under different perspectives comprises: dividing the image into multiple sub-regions, and performing histogram processing on each sub-region respectively; counting the number of pixels of each gray level, and if the number of pixels of a single gray level exceeds a threshold, reassigning the excess pixel values to other gray levels; performing histogram equalization on each sub-region after contrast limitation. The pre-processed target image is obtained by using bilinear interpolation to smooth the sub-regions after histogram equalization.
5. A machine vision-based target feature identification system, characterized by, Comprise: The first acquisition module is used for acquiring target images under at least two viewing angles, and pre-processing the target images under different viewing angles; The first construction module is used for generating a depth map through stereo matching of the images under different viewing angles, generating an anomaly map through texture and color recognition, and constructing an attention mask by weighted fusion of the depth map and the anomaly map; comprising: Using a gray level co-occurrence matrix extraction method, the contrast, correlation and energy indicators are calculated in multiple directions, the extracted gray level co-occurrence matrix features are compared with the texture templates of the normal track plates, the Euclidean distance is calculated, and the texture abnormal area is marked; Using a color histogram feature extraction method, the difference between the color features and the color features of the normal track plate samples is compared, and the color abnormal area is marked; The texture abnormal candidate area and the color abnormal candidate area are OR operated to obtain a binary anomaly map; the depth map is binarized, and the binarized depth map and the anomaly map are weighted and fused to generate an attention mask; The first fusion module is used for inputting a set of matched images under different viewing angles into a twin network to extract a feature map, downsampling the attention mask to the same size, and performing dynamic gating fusion with the feature map to obtain weighted feature maps under different viewing angles; The first fusion module comprises: The second acquisition unit is configured to acquire a pre-constructed causal graph. The construction unit is configured to construct a decoupling network with two parallel branches as a feature extractor of the twin network based on the causal graph, to separate relevant features and interference features in the image. The generation unit is configured to remove the interference features and generate a decoupled feature map. The convolution unit is configured to downsample the attention mask using a stride convolution to obtain a single-channel mask. The mapping unit is configured to expand the single-channel mask to the same number of channels as the feature map through convolution, and then combine the confidence of the attention mask to generate a gating weight mask through a Sigmoid activation function. The processing unit is configured to multiply the feature map point by point with the gating weight mask to obtain a weighted feature map. The second fusion module is configured to input the weighted feature maps under different viewing angles into a 3D convolution network to obtain enhanced features by learning the geometric relationship between the viewing angles, and the enhanced features are used to guide track construction or defect detection.
6. The machine vision-based target feature identification system of claim 5, wherein, Further comprising: The second acquisition module is configured to acquire a target image having a projection line projected by a projection device on the target; The segmentation module is configured to segment the projection line region from the target image; The identification module is configured to identify the feature of the projection line region, extract the projection line distortion feature, and identify the horizontal state of the target based on the projection line distortion feature.
7. The machine vision-based target feature identification system of claim 6, wherein, The identification module comprises: The first acquisition unit is configured to acquire the projection line feature of the continuous frame image in time sequence; The first comparison unit is configured to compare the projection line of each frame image with a pre-established standard projection line to obtain a first projection line distortion feature; The second comparison unit is configured to compare the projection line of each frame image with the projection lines of its adjacent two frame images to obtain a second projection line distortion feature; The recognition unit is configured to input the first projection line distortion feature and the second projection line distortion feature into a pre-established horizontal state recognition model, and output a horizontal state heat map of the target.
Citation Information
Patent Citations
High-precision multi-view image recognition and detection method based on CCD (Charge Coupled Device) camera
CN120279228A
Multi-source unsupervised track anomaly detection method and system
CN120411893A