A method and system for positioning a pipe product
By analyzing particle regions in pipeline product videos, segmenting sub-regions, and combining occlusion probability and motion patterns, the matching weights were adjusted to solve the problem of inaccurate positioning caused by occlusion interference, thus achieving higher-precision pipeline product positioning.
Patent Information
- Application Number
- CN202510985018.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Existing technologies cannot effectively eliminate occlusion interference in pipeline product positioning, leading to inaccurate positioning. In particular, when using particle filtering algorithms, occlusion reduces similarity and affects positioning accuracy.
By acquiring particle regions from pipeline product videos, segmenting them into sub-regions, analyzing the possibility of occlusion, and combining motion patterns and lighting differences, the matching weights are adjusted, and particle filtering algorithms are used for localization to eliminate occlusion interference.
It improves the accuracy and precision of pipeline product positioning. By analyzing the movement patterns and light differences in obstructed areas, it accurately determines the probability of obstructed areas and reduces the impact of obstruction on positioning.
Smart Images

Figure CN120495706B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing, in particular to a pipeline product positioning method and system. BACKGROUND
[0002] At present, the manufacturing workshop of pipeline products often pastes RIFD or UWB tags as unique identifiers on the surface of materials, uses radio frequency identification (RIFD) and ultra-wideband technology (UWB) to detect and identify the tags to obtain position information, and then transmits the obtained position information to the material system to realize the positioning of the pipeline product materials. The radio frequency identification (RIFD) and ultra-wideband technology are relatively expensive, and the cost of using this technology for pipeline product positioning is high.
[0003] Visual positioning locates the position of the material by analyzing the material image, and this positioning method requires a lower cost, so visual positioning can be used to realize pipeline product positioning. Particle filtering algorithm is a commonly used visual positioning method, which analyzes the similarity of each particle and the matching template to determine the probability of each particle being a pipeline product in the positioning process. The pipeline product may be blocked by other objects during movement, resulting in a decrease in the similarity of the pipeline product and the matching template, and thus positioning errors may occur. Therefore, how to exclude the interference of the blockage on the pipeline product positioning and realize accurate pipeline product positioning has become the research focus of the present application.
[0004] The patent document with the authorization announcement number CN114972421B discloses a workshop material identification tracking and positioning method and system. The method in the patent document only uses the existing target tracking algorithm for tracking processing, and does not involve how to exclude the interference of the blockage on the material positioning. Therefore, the method in the patent document cannot solve the problem of the present application. SUMMARY
[0005] In order to solve the problem of how to exclude the interference of the blockage on the pipeline product positioning and realize accurate pipeline product positioning, the present application provides a pipeline product positioning method and system.
[0006] In the first aspect, the present application provides a pipeline product positioning method, which adopts the following technical solution:
[0007] A pipeline product positioning method, comprising the steps of:
[0008] obtaining a pipeline product video, the pipeline product video containing a plurality of pipeline product images;
[0009] obtaining a pre-set matching template, using a target tracking algorithm to obtain a plurality of particle regions in the current frame of the pipeline product image based on the matching template, dividing the particle regions into a plurality of sub-regions, and calculating the possibility of any sub-region being a blocked region , the pipeline product region in the preset number of frames of pipeline product images before acquisition is recorded as a reference region, a suspected occlusion region in the reference region is acquired, a moving law fluctuation distribution diagram of the suspected occlusion region is constructed, the possibility that the sub-region belongs to the suspected occlusion region in the current frame is obtained according to the distribution position of the distance between the sub-region and the predicted region of the suspected occlusion region in the moving law fluctuation histogram, S represents the similarity of the sub-region and the best matching region in the matching template, G represents the light difference degree of the sub-region and the best matching region in the matching template, K represents the possibility that the sub-region belongs to the suspected occlusion region in the current frame, and norm() represents a linear normalization function;
[0010] The matching weights of the sub-regions are set according to the possibilities that the sub-regions are occluded, the matching degree of the particle region and the matching template is calculated according to the matching weights, and the particle filtering algorithm is used to locate the pipeline product region in the current frame of pipeline product images based on the matching degree.
[0011] The present application controls the contribution of each sub-region in matching according to the occlusion of each sub-region in the particle region, so that the matching value is more accurately calculated, and data basis is provided for improving the positioning accuracy; further, since the similarity of the occlusion region and the matching template is low, and the light difference also leads to low similarity with the matching template, the occlusion of each sub-region is relatively accurately reflected by excluding the interference of the light difference in the similarity calculation; further, since the occlusion region has the motion law feature, the probability that each sub-region belongs to the occlusion region is more accurately and comprehensively judged in combination with the motion prediction; further, since the motion prediction may have a prediction deviation, when the probability that each sub-region belongs to the occlusion region is analyzed by the motion prediction, the probability that each sub-region belongs to the occlusion region is more accurately obtained by analyzing the distribution of the prediction deviation.
[0012] Preferably, the pipeline product region in the preset number of frames of pipeline product images before acquisition is recorded as a reference region, comprising:
[0013] The pipeline product region in the preset number of frames of pipeline product images before acquisition is tracked by using a target tracking algorithm to obtain the pipeline product region in the preset number of frames of pipeline product images, which is recorded as a reference region.
[0014] Preferably, the suspected occlusion region in the reference region is acquired, comprising:
[0015] The reference region is divided into several sub-regions, the possibility of each sub-region of the reference region being an occluded region is calculated, all sub-regions of the reference region are clustered into two categories according to the possibility of being an occluded region, the mean value of the possibility of being an occluded region of all sub-regions in each category is calculated, and the sub-region in the category with a larger mean value of the possibility of being an occluded region is recorded as a suspected occluded region.
[0016] The suspected occluded region is divided by simple cluster analysis, and the implementation is simpler and more efficient.
[0017] Preferably, the moving rule fluctuation distribution map of the suspected occluded region comprises:
[0018] The previous preset number of frame pipeline product images are recorded as reference pipeline product images, and a motion region in the reference pipeline product images is obtained.
[0019] If the suspected occluded region belongs to the motion region, the motion region to which the suspected occluded region belongs is taken as a research region, a prediction region of the research region in the next frame of reference pipeline product images and a prediction region of the pipeline product in the next frame of reference pipeline product images are obtained, and the intersection of the prediction region of the pipeline product in the next frame of reference pipeline product images and the prediction region of the research region in the next frame of reference pipeline product images is taken as a prediction region of the suspected occluded region in the next frame of reference pipeline images.
[0020] If the suspected occluded region does not belong to the motion region, the intersection of the suspected occluded region and the prediction region of the pipeline product in the next frame of reference management image is taken as the prediction region of the suspected occluded region in the next frame.
[0021] The distance between the suspected occluded region and the geometric center of the prediction region in a frame of reference pipeline product images is taken as the moving rule fluctuation of the suspected occluded region obtained based on the frame of reference pipeline product images, the moving rule fluctuation of the suspected occluded region is counted, and the statistical histogram obtained by counting is recorded as a moving rule fluctuation distribution map.
[0022] The present application accurately predicts the suspected occluded region by analyzing the stillness and motion of the object occluding the pipeline product.
[0023] Preferably, the obtaining of the prediction region of the research region in the next frame of reference pipeline product images and the prediction region of the pipeline product in the next frame of reference pipeline product images comprises:
[0024] A vector formed by a geometric center of the reference region in the current frame and a geometric center of the reference region in the previous frame is referred to as a translation index of the pipeline product; and an angle of rotation of a line connecting any key point of the reference region in the current frame and the geometric center, and a line connecting a corresponding key point of the reference region in the previous frame and the geometric center is referred to as a rotation index of the pipeline product.
[0025] After the pipeline product is translated according to the translation index, the pipeline product is rotated around the geometric center according to the rotation index to obtain a predicted region of the pipeline product in the next frame of the reference pipeline product image.
[0026] The predicted region of the pipeline product in the next frame of the reference pipeline product image is obtained.
[0027] The present application simultaneously considers the rotation and translation indexes, and more accurately predicts the region position.
[0028] Preferably, the possibility that the sub-region belongs to the suspected occlusion region in the current frame is obtained according to a distribution position of a distance between the sub-region and a predicted region of the suspected occlusion region in the current frame in a moving law fluctuation histogram, and the possibility that the sub-region belongs to the suspected occlusion region in the current frame includes:
[0029] If the sub-region belongs to the predicted region of the suspected occlusion region in the current frame, a distance between the sub-region and the predicted region of the suspected occlusion region in the current frame is set to 0; if the sub-region does not belong to the predicted region of the suspected occlusion region in the current frame, a geometric center of the predicted region of the suspected occlusion region in the current frame is connected with the sub-region, and a distance from an intersection of the connection line and the predicted region to a geometric center of the sub-region is taken as the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame, and is referred to as a deviation distance.
[0030] A probability value at a position corresponding to the deviation distance in the moving law fluctuation distribution diagram is obtained, and is referred to as the possibility that the sub-region belongs to the suspected occlusion region in the current frame.
[0031] The present application reflects the possibility that the sub-region belongs to the suspected occlusion region in the current frame by positioning the probability at the corresponding position in the moving law fluctuation distribution diagram according to the distance between the sub-region and the predicted region of the suspected occlusion region, effectively eliminates the interference of the prediction deviation, and improves the accuracy of the occlusion determination.
[0032] Preferably, the method for obtaining the light difference degree between the sub-region and the best matching region in the matching template includes:
[0033] The light difference degree between the sub-region and the best matching region in the matching template is obtained by subtracting the average luminance of the best matching region in the matching template from the average luminance of the sub-region.
[0034] The second aspect of the present application provides a pipeline product positioning system, which adopts the following technical scheme:
[0035] The pipeline product positioning system comprises a processor and a memory, and the memory stores computer program instructions, which, when executed by the processor, implement the pipeline product positioning method.
[0036] By adopting the above technical scheme, the pipeline product positioning method is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor, and use is facilitated.
[0037] The present application has the following technical effects:
[0038] The present application controls the contribution of each sub-region in the matching according to the occlusion of each sub-region in the particle region, so as to more accurately calculate the matching value and provide a data basis for improving the positioning accuracy.
[0039] Further, since the occlusion region has a low similarity with the matching template, and the light difference also leads to a low similarity with the matching template, the occlusion of each sub-region is relatively accurately reflected by excluding the interference of the light difference in the similarity calculation.
[0040] Further, since the occlusion region has a motion law feature, the probability that each sub-region belongs to the occlusion region is more accurately and comprehensively judged in combination with motion prediction.
[0041] Further, since the motion prediction has a prediction deviation, when the probability that each sub-region belongs to the occlusion region is analyzed by the motion prediction, the probability that each sub-region belongs to the occlusion region is more accurately obtained by analyzing the distribution of the prediction deviation. BRIEF DESCRIPTION OF DRAWINGS
[0042] The above and other objects, features and advantages of the exemplary embodiments of the present application will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0043] Figure 1 is a flowchart of a pipeline product positioning method in an embodiment of the present application. DETAILED DESCRIPTION
[0044] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described, obviously, the described embodiments are a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.
[0045] It should be understood that when the claims, the specification and the drawings of the present application use the terms "first", "second" and the like, they are only used to distinguish different objects, rather than to describe a specific sequence. The terms "include" and "contain" used in the specification and claims of the present application indicate the presence of the described features, whole, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, whole, steps, operations, elements, components and / or sets thereof.
[0046] The embodiments of the present application disclose a pipeline product positioning method, referring to Figure 1 , comprising steps S1-S3:
[0047] S1: acquiring a pipeline product video, the pipeline product video containing a plurality of frames of pipeline product images.
[0048] Specifically, the pipeline product video is collected, and each frame of image in the pipeline product video is recorded as a pipeline product image.
[0049] S2: acquiring a pre-set matching template, and using a target tracking algorithm to acquire a plurality of particle regions in the current frame of pipeline product image based on the matching template, dividing the particle regions into a plurality of sub-regions, and calculating the possibility of any sub-region being an occlusion region.
[0050] It should be noted that the particle filtering algorithm searches for the positioning product by generating particles in the region where the positioning product may exist, and then judges the accurate position of the positioning product according to the similarity between the particles and the matching template. If the position of the pipeline product is partially occluded, the image information at the occluded position will be different from the matching template, and the similarity between the particles and the matching template cannot accurately locate the accurate position of the product. In order to reduce the influence of occlusion on similarity analysis, the weight of the occlusion region in the particle in the calculation of similarity needs to be reduced. In order to adjust the weight, the possibility of each region in the particle region being an occlusion region needs to be analyzed.
[0051] S20: acquiring a pre-set matching template, and using a target tracking algorithm to acquire a plurality of particle regions in the current frame of pipeline product image based on the matching template.
[0052] Preferably, as an example, the pre-set matching template is acquired, and a plurality of particle regions in the current frame of pipeline product image are acquired based on the matching template using a target tracking algorithm, comprising:
[0053] An image of each pipeline product is collected, the name of the pipeline product to be located and tracked is input, and a corresponding pipeline product image is retrieved based on the name of the pipeline product as a matching template of the pipeline product to be located and tracked.
[0054] Based on the matching template, a particle filter algorithm is used to sequentially locate and analyze each frame of the pipeline product image, and in the process of locating and analyzing, a plurality of particle regions in the current frame of the pipeline product image are obtained.
[0055] S21: The particle region is divided into a plurality of sub-regions.
[0056] Preferably, as an example, the particle region is divided into a plurality of sub-regions, including:
[0057] The particle region is uniformly divided into a preset number of sub-regions, and in this embodiment, the preset number is taken as 25 for description, and other embodiments can take other values, and this embodiment does not make specific limitations.
[0058] S22: The possibility of any sub-region being an occlusion region is calculated.
[0059] It should be noted that the similarity of the occlusion region to the corresponding region of the matching template will be lower than that of the non-occlusion region to the corresponding region of the matching template; at the same time, the change of the occlusion region will have a certain motion regularity, so the possibility of each sub-region being an occlusion region can be analyzed in combination with this feature.
[0060] Preferably, as an example, the possibility of any sub-region being an occlusion region is calculated, including:
[0061]
[0062] Wherein, the pipeline product region in the preset number of frames of pipeline product images obtained before is recorded as a reference region, a suspected occlusion region in the reference region is obtained, a moving regularity fluctuation distribution diagram of the suspected occlusion region is constructed, the possibility of the sub-region belonging to the suspected occlusion region in the current frame is obtained according to the distribution position of the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame in the moving regularity fluctuation histogram, S represents the similarity of the sub-region to the best matching region in the matching template, G represents the light difference degree of the sub-region to the best matching region in the matching template, K represents the possibility of the sub-region belonging to the suspected occlusion region in the current frame, norm() represents a linear normalization function, and X represents the possibility of the sub-region being an occlusion region.
[0063] It can be understood that the occlusion region predicted by the motion law can be inaccurate, so that other regions outside the predicted occlusion region can also be occlusion regions, and therefore the deviation of the occlusion region prediction needs to be analyzed to obtain a distribution histogram of the deviation, and then the possibility of the sub-region being an occlusion region is determined according to the position of the deviation of the sub-region and the predicted occlusion region in the distribution histogram. The possibility of the sub-region belonging to the suspected occlusion region in the current frame reflects the case of the sub-region belonging to the occlusion region based on the motion law. Since the change of light can also cause the similarity to decrease, when the similarity is used to determine the case of the sub-region being an occlusion region, the influence of light needs to be excluded, reflects the case of the sub-region belonging to the occlusion region based on the similarity.
[0064] It should be noted that the pipeline product region in the preset number of frames of pipeline product images before is recorded as a reference region, including:
[0065] The particle filtering algorithm is used to track each frame of pipeline product image in sequence, and the pipeline product region positioned in the preset number of frames of pipeline product images before the current frame of pipeline product image is obtained, which is recorded as a reference region.
[0066] The above embodiments relate to the suspected occlusion region, the motion law fluctuation distribution of the suspected occlusion region, and the possibility of the sub-region belonging to the suspected occlusion region in the current frame, the light difference degree, and the best matching region. The determination method of the suspected occlusion region, the motion law fluctuation distribution of the suspected occlusion region, and the possibility of the sub-region belonging to the suspected occlusion region in the current frame, the light difference degree, and the best matching region needs to be described below.
[0067] S220: Obtain the suspected occlusion region in the reference region.
[0068] Preferably, as an example, the suspected occlusion region in the reference region is obtained, including:
[0069] The reference region is divided into a plurality of sub-regions, the possibility of each sub-region of the reference region being an occluded region is calculated, all sub-regions of the reference region are clustered into two categories according to the possibility of being an occluded region, the mean value of the possibility of being an occluded region of all sub-regions in each category is calculated, and the sub-regions in the category with a larger mean value of the possibility of being an occluded region constitute a region, which is recorded as a suspected occlusion region.
[0070] In particular, if the pipe product image does not have a preset number of pipe product images before, the possibility of each sub-region being an occluded region cannot be determined, and the suspected occluded region cannot be segmented based on the possibility. For such pipe product images, only the similarity between each sub-region of the reference region and the best matching region of the matching template is calculated, and all sub-regions of the reference region are clustered into two categories according to the similarity. The region composed of the sub-regions in the category with a low average similarity is regarded as the suspected occluded region.
[0071] S221: Construct a moving regular fluctuation distribution map of the suspected occluded region.
[0072] It should be noted that the movement prediction of the suspected occluded region includes two cases: one is that the object of the pipe product does not move, so the movement of the pipe product can be used to predict the change of the occluded region; the other is that the object of the pipe product moves, and the object of the pipe product and the object of the pipe product need to be combined to predict the occluded region.
[0073] Preferably, as an example, the construction of the moving regular fluctuation distribution map of the suspected occluded region includes:
[0074] The previous preset number of pipe product images is denoted as reference pipe product images, and the moving region in the reference pipe product image is obtained;
[0075] If the suspected occluded region belongs to the moving region, the moving region to which the suspected occluded region belongs is regarded as a research region, a vector formed by the geometric center of the reference region in one frame and the geometric center of the reference region in the previous frame is denoted as the translation index of the pipe product; the rotation angle of the line connecting any key point of the reference region in one frame and the geometric center, and the line connecting the corresponding key point of the reference region in the previous frame and the geometric center is denoted as the rotation index of the pipe product; the pipe product is translated according to the translation index, and then rotated around the geometric center according to the rotation index to obtain the predicted region of the pipe product in the next frame of the reference pipe product image; the predicted region of the research region in the next frame of the reference pipe product image is obtained; the intersection of the predicted region of the pipe product in the next frame of the reference pipe product image and the predicted region of the research region in the next frame of the reference pipe product image is regarded as the predicted region of the suspected occluded region in the next frame of the reference pipe product image;
[0076] If the suspected occluded region does not belong to the moving region, the intersection of the suspected occluded region and the predicted region of the pipe product in the next frame of the reference management image is regarded as the predicted region of the suspected occluded region in the next frame;
[0077] The distance between the suspected occlusion region in a frame of reference pipeline product image and the geometric center of the predicted region is taken as the movement law fluctuation of the suspected occlusion region obtained based on the frame of reference pipeline product image; the movement law fluctuation of the suspected occlusion region is counted, and the statistical histogram obtained by counting is recorded as a movement law fluctuation distribution.
[0078] It can be understood that when the suspected occlusion region belongs to the motion region, it indicates that the object occluding the pipeline product is a moving object, and the occlusion region is predicted by the movement law of the moving object and the pipeline product. If the suspected occlusion region does not belong to the motion region, it indicates that the object occluding the pipeline product is a stationary object, and the position of the stationary object in the next frame is unchanged. At the same time, since the stationary object cannot be detected, the suspected occlusion region can be used to represent the stationary object, so the suspected occlusion region is taken as the predicted region of the stationary object in the next frame, and the intersection of the suspected occlusion region and the predicted region and the occlusion region of the pipeline product in the next frame is taken as the predicted region of the suspected occlusion region in the next frame.
[0079] It should be noted that the method for obtaining the motion region comprises: processing the pipeline product video by using the frame difference method to obtain a frame difference image, and taking the region surrounded by the pixels with a value of 255 in the frame difference image as the motion region.
[0080] It should be further noted that the method for obtaining the rotation index comprises: obtaining the angle between the line connecting a key point and the geometric center in the reference region of a frame of reference pipeline product image and the line connecting the corresponding key point and the geometric center in the reference region of the previous frame of reference pipeline product image, and if the line connecting the key point and the geometric center in the reference region of the frame of reference pipeline product image is in the clockwise direction of the line connecting the corresponding key point and the geometric center in the reference region of the previous frame of reference pipeline product image, the angle is taken as the rotation index; if the line connecting the key point and the geometric center in the reference region of the frame of reference pipeline product image is in the counterclockwise direction of the line connecting the corresponding key point and the geometric center in the reference region of the previous frame of reference pipeline product image, the negative value of the angle is taken as the rotation index.
[0081] S222: Obtain the possibility that the sub-region belongs to the suspected occlusion region in the current frame according to the distribution position of the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame in the movement law fluctuation histogram.
[0082] Preferably, as an example, obtaining the possibility that the sub-region belongs to the suspected occlusion region in the current frame according to the distribution position of the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame in the movement law fluctuation histogram comprises:
[0083] If the sub-region belongs to the predicted region of the suspected occlusion region in the current frame, the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame is set to 0, and if the sub-region does not belong to the predicted region of the suspected occlusion region in the current frame, a line is drawn between the sub-region and the geometric center of the predicted region of the suspected occlusion region in the current frame, and the distance from the intersection of the line and the predicted region to the geometric center of the sub-region is taken as the distance between the sub-region and the predicted region of the suspected occlusion region in the current frame, denoted as a deviation distance.
[0084] The probability value of the deviation distance in the moving regular fluctuation distribution map is obtained, denoted as the possibility of the sub-region belonging to the suspected occlusion region in the current frame.
[0085] It can be understood that due to the prediction deviation, some regions may belong to the suspected occlusion region although they deviate from the predicted region of the suspected occlusion region, so the probability distribution of each prediction deviation is analyzed, and the probability of the sub-region belonging to the suspected occlusion region is determined according to the deviation distance between the sub-region and the predicted region of the suspected occlusion region.
[0086] S223: Obtain the best matching region of the sub-region in the matching template.
[0087] Preferably, as an example, obtaining the best matching region of the sub-region in the matching template comprises:
[0088] The region with the largest similarity to the sub-region in the matching template is taken as the best matching region.
[0089] S224: Obtain the light difference degree of the sub-region and the best matching region in the matching template.
[0090] It should be noted that the brightness difference of the same object at different positions is mainly affected by the light interference, so the light difference can be used to reflect the light difference.
[0091] Preferably, as an example, obtaining the light difference degree of the sub-region and the best matching region in the matching template comprises:
[0092] The brightness values of each pixel in the sub-region and the brightness values of each pixel in the best matching region of the sub-region in the matching template are obtained, and the light difference degree of the sub-region and the best matching region in the matching template is obtained by subtracting the average brightness of the best matching region of the sub-region in the matching template from the average brightness of the sub-region.
[0093] S3: setting a matching weight of each sub-region according to the possibility of being occluded, calculating the matching degree of the particle region and the matching template according to the matching weight, and locating the pipeline product region in the current frame pipeline product image based on the particle filtering algorithm.
[0094] S30: setting a matching weight of each sub-region according to the possibility of being occluded, and calculating the matching degree of the particle region and the matching template according to the matching weight.
[0095] Preferably, as an example, setting a matching weight of each sub-region according to the possibility of being occluded, and calculating the matching degree of the particle region and the matching template according to the matching weight, comprises:
[0096] Taking the proportion of the reciprocal of the possibility of each sub-region being occluded in the reciprocal of the possibility of all sub-regions in the particle region being occluded as the matching weight of each sub-region, and taking the similarity between each sub-region and the corresponding region in the matching template as the matching degree of the sub-region.
[0097] Taking the matching weight as the weight, and performing weighted summation on the matching degrees of all sub-regions in the particle region to obtain the matching degree of the particle region and the matching template.
[0098] It can be understood that by setting the weight of the sub-region with large occlusion possibility to be lower, more information without occlusion is relied on to obtain the matching degree, so that a more accurate matching value can be reflected.
[0099] S31: locating the pipeline product region in the current frame pipeline product image based on the particle filtering algorithm.
[0100] The embodiment of the present application also discloses a pipeline product positioning system, comprising a processor and a memory, and the memory stores computer program instructions.
[0101] The above system also comprises a communication bus and a communication interface and other components well known to those skilled in the art, the settings and functions of which are known in the art, and thus will not be described here.
[0102] In this disclosure, a "storage medium" can be any available medium that can be accessed by a general purpose or special purpose computer system, apparatus, or device to store, retrieve, or store and retrieve information. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store or
[0103] While the present application has been illustrated and described in detail in the drawings and foregoing description, such illustration and description is to be considered illustrative or exemplary and not restrictive; the present application is not limited to the disclosed embodiments. Numerous alternative modifications of the methods, apparatuses, and embodiments of the present application described herein will be apparent in light of this disclosure to one skilled in the art and may be employed without departing from the broad spirit and scope of the present application. Accordingly, the specification and drawings are to be regarded as illustrative only and the scope of the application to be determined from the claims.
[0104] The above are only preferred embodiments of the present application, not to limit the protection scope of the present application, therefore: all equivalent changes made on the structure, shape, principle of the present application should be covered in the protection scope of the present application.
Claims
1. A method of positioning a pipe product, characterized by, The method comprises the steps of: acquiring a pipeline product video, wherein the pipeline product video comprises a plurality of pipeline product images; Obtain a preset matching template, obtain a plurality of particle regions in a current frame pipeline product image based on the matching template using a target tracking algorithm, divide the particle regions into a plurality of sub-regions, and calculate a possibility of any sub-region being an occluded region Obtain a pipeline product region in a preset number of previous frames of pipeline product images, denoted as a reference region, obtain a suspected occluded region in the reference region, including: dividing the reference region into a plurality of sub-regions, calculating a possibility of each sub-region of the reference region being an occluded region, grouping all sub-regions of the reference region into two categories according to the possibility of the occluded region, calculating a mean value of the possibility of the occluded region of all sub-regions in each category, and constructing a moving law fluctuation distribution map of the suspected occluded region, obtaining a possibility of the sub-region belonging to the suspected occluded region in the current frame according to a distribution position of the distance between the sub-region and a predicted region of the suspected occluded region in the current frame in the moving law fluctuation histogram, including: if the sub-region belongs to the predicted region of the suspected occluded region in the current frame, setting the distance between the sub-region and the predicted region of the suspected occluded region in the current frame as 0, if the sub-region does not belong to the predicted region of the suspected occluded region in the current frame, connecting the sub-region and the geometric center of the predicted region of the suspected occluded region in the current frame, and taking a distance from the intersection of the connecting line and the predicted region to the geometric center of the sub-region as the distance between the sub-region and the predicted region of the suspected occluded region in the current frame, denoted as a deviation distance; obtaining a probability value at a value equal to the deviation distance in the moving law fluctuation distribution map, denoted as the possibility of the sub-region belonging to the suspected occluded region in the current frame, S represents the similarity of the sub-region and a best matching region in the matching template, G represents the light difference degree of the sub-region and the best matching region in the matching template, K represents the possibility of the sub-region belonging to the suspected occluded region in the current frame, and norm() represents a linear normalization function. The method for obtaining the light difference degree of the sub-region and the best matching region in the matching template comprises: subtracting the average brightness of the best matching region in the matching template from the average brightness of the sub-region to obtain the light difference degree of the sub-region and the best matching region in the matching template; According to the possibility of each sub-region being blocked, the matching weight of each sub-region is set, the matching degree of the particle region and the matching template is calculated according to the matching weight, and the particle filtering algorithm is used to locate the pipeline product region in the current frame pipeline product image based on the matching degree.
2. A method of positioning a pipe product according to claim 1, characterized in that The pipeline product region in the previous preset number of frames of pipeline product images is recorded as a reference region, and the method comprises the steps of: The pipeline product region in the previous preset number of frames of pipeline product images is obtained by tracking the previous preset number of frames of pipeline product images by using a target tracking algorithm, and the pipeline product region is recorded as a reference region.
3. A method of positioning a pipe product according to claim 1, wherein, The method for constructing the moving law fluctuation distribution of the suspected blocked region comprises the steps of: The previous preset number of frames of pipeline product images are recorded as reference pipeline product images, and the moving region in the reference pipeline product images is obtained. If the suspected blocked region belongs to the moving region, the moving region to which the suspected blocked region belongs is taken as a research region, the predicted region of the research region in the next frame of reference pipeline product image and the predicted region of the pipeline product in the next frame of reference pipeline product image are obtained, and the intersection of the predicted region of the pipeline product in the next frame of reference pipeline product image and the predicted region of the research region in the next frame of reference pipeline product image is taken as the predicted region of the suspected blocked region in the next frame of reference pipeline image. If the suspected blocked region does not belong to the moving region, the intersection of the suspected blocked region and the predicted region of the pipeline product in the next frame of reference management image is taken as the predicted region of the suspected blocked region in the next frame. The distance between the geometric center of the suspected blocked region and the predicted region in a frame of reference pipeline product image is taken as the moving law fluctuation of the suspected blocked region obtained based on the frame of reference pipeline product image, the moving law fluctuation of the suspected blocked region is counted, and the statistical histogram obtained by counting is recorded as a moving law fluctuation distribution.
4. A method of positioning a pipe product according to claim 3, wherein, The method for obtaining the predicted region of the research region in the next frame of reference pipeline product image and the predicted region of the pipeline product in the next frame of reference pipeline product image comprises the steps of: A vector formed by the geometric center of the reference region in a frame of reference pipeline product image and the geometric center of the reference region in the previous frame of reference pipeline product image is taken as a translation index of the pipeline product, and the rotation angle of the line connecting any key point of the reference region in a frame of reference pipeline product image and the geometric center and the line connecting the corresponding key point of the reference region in the previous frame of reference pipeline product image and the geometric center is taken as a rotation index of the pipeline product. After the pipeline product is translated according to the translation index, the pipeline product is rotated around the geometric center according to the rotation index to obtain the predicted region of the pipeline product in the next frame of reference pipeline product image. The predicted region of the research region in the next frame of reference pipeline product image is obtained.
5. A pipe product positioning system characterized by, The method comprises the steps of: a processor and a memory, said memory storing computer program instructions which, when executed by the processor, implement a method of positioning a pipe product according to any one of claims 1-4.
Citation Information
Patent Citations
Workshop material identification, tracking and positioning method and system
CN114972421B
Anti-shielding particle filtering target tracking method based on integral histogram
CN107507222A