Ship bollard identification method and system based on adaptive multi-scale multi-grid division

By adopting an adaptive multi-scale multi-grid partitioning method, combined with visual saliency analysis and gradient direction consistency features, the problem of insufficient positioning accuracy of ship mooring bollards in large ships and high-resolution images is solved, and high-precision recognition of complex scenes is achieved.

CN121330592APending Publication Date: 2026-01-13昆山市交通运输综合行政执法大队 +1

Patent Information

Application Number
CN202511561202.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies have a positioning accuracy of less than 60% when locating large ships and ship mooring bollards in high-resolution images. They cannot adapt to different ship sizes and distance variations, and are sensitive to image noise in complex scenes with poor threshold adaptability.

Method used

An adaptive multi-scale multi-grid partitioning method is adopted. The foreground and background regions are divided by visual saliency analysis to generate non-uniform candidate grids. The candidate grids are selected by combining gradient direction consistency and texture features. A three-scale image pyramid is constructed and multi-scale fusion is performed. Fine grid partitioning and support vector machine classifier are used for accurate localization.

Benefits of technology

It significantly improves positioning accuracy in complex scenarios, adapts to ships of different sizes and distances, reduces false detections and missed detections, and achieves accurate identification of large ships and high-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330592A_ABST
    Figure CN121330592A_ABST
Patent Text Reader

Abstract

The invention discloses a ship bollard identification method and system based on adaptive multi-scale multi-grid division, and belongs to the technical field of computer vision and image processing. The system divides an image foreground region and a background region through a visual saliency calculation module, carries out dense sampling in the foreground region and sparse sampling in the background region by adopting a non-uniform grid generation module, screens candidate grids in combination with gradient direction consistency and texture features, fuses candidate frames of different scales through a multi-scale image pyramid, and finally obtains a multi-scale image. And accurate positioning of the bollard is realized through the fine grid accurate positioning module. The method solves the problem that the prior art is insufficient in adaptability to ship size, shooting distance and resolution change, improves the precision and generalization ability of bollard positioning in a complex scene, and is suitable for bollard detection scenes of various ship images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and image processing technology, specifically a method and system for identifying ship mooring bollards based on adaptive multi-scale multi-grid partitioning. Background Technology

[0002] In the fields of computer vision, image processing, and target detection and recognition, accurate positioning of ship mooring bollards is crucial for ship safety supervision and overload detection. Existing technologies typically employ multi-grid partitioning techniques. This involves dividing the original ship image into fixed-size square grids as initial candidate regions, extracting edge features from the grids, setting a fixed discrimination threshold to filter candidate grids for mooring bollards, and then further subdividing these candidate grids into finer grids. A classifier is used to determine the category of each fine grid, and the mooring bollard position is obtained through connected component analysis. This method is suitable for inland waterway vessels (length less than 60 meters), images captured at distances less than 200 meters, and images with resolutions ranging from 1920×1080 to 2048×1600. However, it has significant limitations in practical applications: for large vessels such as riverboats and ocean-going vessels in Class III and above waterways, or for images captured at distances exceeding 200 meters and with resolutions of 4 million pixels (2560×1440) or higher, the positioning accuracy is less than 60%. The main reasons for the above problems include: First, the use of fixed grid size and sliding step size cannot adapt to the size differences and aspect ratio changes of different ships; second, grid division based solely on a single-scale image is difficult to cope with scale differences caused by changes in distance and resolution of the target; and third, the edge feature screening mechanism relying on a fixed threshold is sensitive to image noise in complex scenes and has poor threshold adaptability, making it unable to effectively distinguish between mooring bollards and background areas.

[0003] Patent CN110473255B discloses a method for locating ship bollards based on multi-grid division. The method includes steps S1: dividing the captured original ship image into 84×84 square grid images, using each grid image as a preliminary candidate region; Step S2: extracting edge features from the preliminary candidate regions, setting edge feature discrimination conditions, and using grid images that meet the conditions as candidate bollard grids; Step S3: further dividing each candidate bollard grid into 3×3 fine grids, and using a classifier to determine whether each fine grid image is a bollard; Step S4: combining the fine grids to obtain the precise location of the bollard. This invention employs multi-grid division technology, combining coarse and fine positioning to achieve precise bollard positioning. This method is applicable to ship images in various complex scenarios, such as ship images in rainy or snowy weather, and is of great significance for determining ship overloading. However, the aforementioned device uses a fixed 84×84 grid with a step size of 42. This fixed scale and step size cannot adapt to ships of different sizes and aspect ratios. Therefore, those skilled in the art urgently need to solve the above-mentioned technical problems. Summary of the Invention

[0004] The present invention aims to solve the above-mentioned prior art by positioning the frame closer to the edge of the mooring bollard, that is, by making the bounding box smaller, thereby improving the positioning accuracy. In addition to being applicable to the original scenarios, it is also applicable to the identification of mooring bollards of riverboats, seaboats and other vessels, as well as the identification of mooring bollards in scenarios with a capture distance of >200 meters, and the identification of mooring bollards in high-resolution images.

[0005] The technical solutions adopted in this invention are as follows:

[0006] A method for identifying ship mooring bollards based on adaptive multi-scale multi-grid partitioning includes the following steps:

[0007] S1. Input the ship image and divide it into regions;

[0008] S2. Generate non-uniform candidate grids through grid sampling;

[0009] S3. Extract the different features of non-uniform candidate meshes and filter the candidate meshes;

[0010] S4. Merge candidate meshes of different scales;

[0011] S5. Perform fine mesh division and classification on the candidate mesh, and output the final location box by combining connected component analysis.

[0012] By adopting the above technical solution, through region segmentation, non-uniform grid sampling, feature extraction and filtering, multi-scale fusion, and fine-grid precise localization, the problem of insufficient adaptability of existing technologies to changes in ship size, shooting distance, and resolution is comprehensively solved. The combination of adaptive region segmentation and non-uniform grid sampling ensures precise coverage of foreground targets and effective reduction of background redundancy; the synergy of multi-scale fusion and fine-grid precise localization achieves close alignment of the localization box with the edge of the mooring bollard, significantly improving the localization accuracy in complex scenes. At the same time, it expands the applicability of the method, effectively supporting the mooring bollard recognition needs of large vessels such as riverboats and ocean-going vessels, as well as long-distance (>200 meters) and high-resolution images.

[0013] Further, the visual saliency calculation in step S1 includes:

[0014] S11. Convert the input image to a grayscale image;

[0015] S12. Obtain the amplitude spectrum and phase spectrum through two-dimensional discrete Fourier transform, and calculate the spectral residual by convolving the logarithmic amplitude spectrum with the mean filter;

[0016] S13. After inverse Fourier transform and Gaussian smoothing, a saliency plot normalized to [0,1] is generated;

[0017] S14. Based on adaptive threshold T adap =μ+kσ divides the foreground region Ω fg and background area Ω bg , where μ is the mean of the significance plot, σ is the standard deviation, and k is an adjustable parameter.

[0018] By employing the above technical solution, visual saliency analysis is achieved through the spectral residual method. This includes grayscale image conversion, two-dimensional discrete Fourier transform, spectral residual calculation, and normalized saliency map generation, ensuring accurate segmentation of the foreground region (ship target) and background region (water surface, sky, etc.). An adaptive threshold T is then used. adap =μ+kσ dynamically distinguishes between salient and non-salient regions, effectively reducing the interference of complex backgrounds on subsequent mesh sampling, providing reliable region guidance for non-uniform mesh generation, and improving the targeting and efficiency of mesh generation.

[0019] Furthermore, the generation of non-uniform candidate grids through grid sampling in step S2 is specifically as follows:

[0020] In the foreground region Ω fg Dense grid is employed: a smaller grid size and smaller step size are used to ensure fine coverage of potential ship targets, where the foreground area Ω fg Use a 32×32 to 64×64 grid with a step size of 8 to 16.

[0021] In the background area Ω bg Employing a sparse mesh: Using a larger base size (e.g., Slarge = 128 or 84) and a larger step size (e.g., Steplarge = 64 or 48) to quickly eliminate background and significantly reduce the number of candidate regions, where the background region Ω bg Use a grid of 84×84 to 128×128 with a step size of 48 to 64.

[0022] When the non-uniform grid slides to the end of the current row or column on I0, and the next slide will exceed the image edge:

[0023] If the area exceeding the limit is greater than 0.5 * Size * Step, then the sliding will stop.

[0024] If the area exceeding the image's boundaries is ≤ 0.5 * Size * Step, continue sliding. After sliding, all portions of the non-uniform grid extending beyond the image will be filled with I. 0gray mean μ gray ;

[0025] When a non-uniform grid sliding window extends beyond the image edge, the extended portion is filled with the image's average grayscale value.

[0026] By adopting the above technical solution, a dense grid of 32×32 to 64×64 (step size 8 to 16) is used for the foreground region to ensure fine target coverage, while a sparse grid of 84×84 to 128×128 (step size 48 to 64) is used for the background region to reduce redundant computation. An edge-filling strategy (filling the excess portion with the average grayscale value) ensures that no boundary targets are missed. This differentiated grid sampling strategy enables the method to be content-adaptive, adapting to large-scale scenes such as riverboats and seagoing vessels over 60 meters in length, as well as handling ship images with complex aspect ratios, while balancing detection accuracy and computational efficiency.

[0027] Furthermore, the calculation of the gradient direction consistency feature C in step S3 includes:

[0028] S311. Calculate the gradient direction histogram:

[0029] Specifically,

[0030] For each grid image, first calculate the gradient magnitude and direction of each pixel, and then use the Sobel operator to calculate the horizontal gradient G. x and vertical gradient G y :

[0031] Horizontal gradient G xUse the Sobel horizontal edge detection operator to count the number of edge points in the vertical edge map, and use this number of edge points as the vertical edge value v;

[0032] Vertical gradient G y The Sobel vertical edge detection operator is used to count the number of edge points in the horizontal edge map, and this number of edge points is used as the horizontal edge value h.

[0033] Gradient magnitude:

[0034] Gradient direction: θ(x,y)=atan2(Gy(x,y),Gx(x,y)), range [-π,π];

[0035] S312. Gradient Direction Histogram: Divide 360 ​​degrees evenly into B intervals. For each pixel, map its gradient direction θ(x,y) to the corresponding interval, and accumulate the gradient magnitude M(x,y) of that pixel as a weight to obtain the gradient direction histogram H. Let the value of the k-th interval (k=0,1,...,B-1) of the histogram H be H[k], then:

[0036] H[k]=∑{x,y}where M(x,y)*δ(θ(x,y)∈kth interval)

[0037] Where δ(■) is an indicator function, which takes the value 1 when the condition is true and 0 otherwise;

[0038] S313. Calculate the directional consistency measure:

[0039] Calculate the normalized maximum value of the histogram:

[0040] C = max(H) / sum(H)

[0041] Where max(H) is the maximum value of histogram H, and sum(H) is the sum of all interval values ​​of histogram H;

[0042] Since the sum of the values ​​in each interval is actually the sum of the gradient magnitudes of the entire grid, that is, sum(H) = ∑{x,y}M(x,y);

[0043] The value of C ranges from [1 / B, 1]. When C = 1, it means that all gradient directions are concentrated in the same interval; when C = 1 / B, it means that the gradient directions are evenly distributed in each interval.

[0044] S321. Calculation of texture feature T:

[0045] Calculate the LBP texture response: LBP = ∑s(g) p -g c )·2p;

[0046] Statistical texture complexity: T = entropy(LBP_histogram);

[0047] S322. Basic LBP Calculation:

[0048] For each pixel, consider its 3x3 neighborhood. Using the grayscale value of the center pixel as a threshold, compare the grayscale values ​​of the 8 pixels in the neighborhood with the threshold. If the grayscale values ​​are greater than or equal to the threshold, record them as 1; otherwise, record them as 0. Concatenate the binary bits in a clockwise direction to form an 8-bit binary number, and then convert it to a decimal number. This is the LBP value of that point. The specific calculation formula is as follows:

[0049]

[0050] Among them, g c It is the grayscale value of the center pixel, g p s(z) is the gray value of the p-th pixel in the neighborhood, and s(z) is the sign function. s(z) = 1 if z >= 0; otherwise s(z) = 0.

[0051] S323. Rotation-invariant LBP improvement:

[0052] The obtained LBP binary string is cyclically shifted, and the pattern corresponding to the minimum value among all shift results is taken as the LBP value of that point.

[0053] LBP ri =min{ROR(LBP,i)|i=0,1,...,7}, where ROR represents a circular right shift of i bits;

[0054] S324. Texture complexity calculation:

[0055] Calculate a histogram of rotation-invariant LBP values ​​for the entire grid, with a histogram size of 10;

[0056] S325. Calculate the entropy of the histogram as a measure of texture complexity:

[0057]

[0058] Where pk is the frequency of the k-th interval in the histogram, which is the number of values ​​of the k-th interval divided by the total number of pixels. The larger the entropy T, the more complex the texture; the smaller the entropy T, the more uniform the texture.

[0059] S33. Candidate Grid Filtering:

[0060] Based on the above two characteristics, a dual-threshold joint screening mechanism is used to determine the candidate grid for mooring bollards, with the following specific conditions:

[0061] C≥0.5 and T≥2.0; where C≥0.5: ensures that the gradient direction within the mesh is highly concentrated, excluding background regions with scattered edges;

[0062] T≥2.0: Ensure that the mesh texture complexity meets the minimum requirements for the surface texture of the mooring bollard, and exclude backgrounds with uniform textures such as water surfaces and skies;

[0063] Screening results: (h≥α) h ·A)&(v≥α v ·A)&(C≥τ c )&(T≥τ t ), where A is the grid area, α h α v τ c τ t If the parameters are adaptive, then this mesh is determined to be a candidate mesh, where h is the horizontal edge value of the mesh, α is the horizontal edge value of the mesh, and α is the horizontal edge value of the mesh. h Adaptive threshold factor for horizontal edge values, vertical edge values ​​of v grid, α v Vertical edge value adaptive threshold factor, C-direction consistency measure, T-mesh texture complexity;

[0064] τ C The gradient direction consistency threshold, C, has a value range of [1 / B, 1], τ t Texture complexity threshold, the range of texture complexity T is [0, log(10)];

[0065] The background texture is set with a threshold by statistical analysis of positive and negative samples. Only meshes that simultaneously meet the above conditions are retained as "mooring post candidate meshes" and enter the subsequent multi-scale fusion and fine positioning steps.

[0066] By employing the above technical solution, and through dual-dimensional extraction of gradient direction consistency feature C and texture feature T, combined with an adaptive threshold screening mechanism (C≥0.5 and T≥2.0, supplemented by edge values ​​h and v), accurate screening of candidate meshes for mooring bollards was achieved. The gradient direction consistency feature captures the concentration of the mooring bollard edge direction, while the texture feature (rotation-invariant LBP entropy) distinguishes regular textures from background noise. The joint screening of these two features effectively eliminates background meshes with uniform textures, such as those on the water surface and in the sky, significantly reducing the false positive rate of candidate meshes and providing high-quality candidate regions for subsequent multi-scale fusion.

[0067] Further, in step S4, the candidate meshes are fused, specifically including:

[0068] S41. Construct a three-scale image pyramid, including the original image, a 1.5x magnified image, and a 0.75x reduced image. The candidate grids at each scale are mapped back to the original image coordinate system through coordinate scaling. The magnified image has a scaling factor of 1 / 1.5, and the reduced image has a scaling factor of 1 / 0.75.

[0069] S42. Remove redundant overlapping candidate boxes:

[0070] Specifically, the process involves: original image scale I0, 1.5x magnification scale I1, and 0.75x reduction scale I2. Steps S11-S13 are repeated for I1 and I2. A sliding window is divided using the same basic grid size Size and the same relative step size Step. The candidate grids generated in the two layers are mapped back to the original image coordinate system. Non-maximum suppression is used to fuse the overlapping candidate boxes generated at different scales and remove redundancy.

[0071] By employing the aforementioned technical solution, a three-scale image pyramid is constructed: the original image, a 1.5x magnified image, and a 0.75x reduced image. Candidate grids at different scales are scaled back to the original image coordinate system using a factor of 1 / 1.5 for the magnified image and 1 / 0.75 for the reduced image. Non-maximum suppression is then used to fuse redundant bounding boxes. This strategy addresses the issue of scale variation caused by differences in shooting distance at a single scale, ensuring stable capture of small targets at long distances and large targets at close range. It also improves the method's adaptability to images with different resolutions, such as 2560×1440 and above.

[0072] Furthermore, the fine mesh division described in step S5 specifically includes,

[0073] S51. Further divide each candidate mooring bollard grid into a 3×3 fine grid, and use a classifier to determine whether each fine grid image is a mooring bollard;

[0074] S52. Divide the candidate mesh of Size×Size into a fine mesh of 3×3, resulting in a total of n = Size×Size / 3 / 3 fine meshes;

[0075] S53. Perform convolution operations with the fine grid using n 3×3 operators to obtain n feature values. Feed the n-dimensional features into a pre-trained support vector machine classifier for binary classification. If the classifier determines that the probability of the fine grid being a mooring bollard is greater than 0.5, then the region is a mooring bollard region; otherwise, it is not. Use this method to determine whether each fine grid is a mooring bollard region.

[0076] By adopting the above technical solution, the candidate grid is divided into a 3×3 fine grid, and the feature vector of the fine grid is extracted by convolution with 256 3×3 operators, thus achieving a finer granularity of localization from the grid level to the fine grid level. The fine grid division allows feature extraction to focus more on the local details of the mooring bollard, providing more accurate input features for the subsequent classifier, effectively improving the precision of the mooring bollard edge localization, and making the final localization box closer to the actual outline of the mooring bollard.

[0077] Furthermore, the training process of the support vector machine classifier is as follows: the mooring bollard areas of the ship image are manually labeled, the non-mooring bollard areas of the image are divided into 5000 small 3×3 images as negative samples, and the mooring bollard areas are divided into 1000 small 3×3 images as positive samples. The positive and negative sample images are convolved with 256 3×3 operators to obtain feature vectors. The feature vectors are fed into the support vector machine classifier for training. The classifier uses a Gaussian kernel with parameters c=0.1 and gamma=0.5. The classifier is obtained after 2000 training iterations.

[0078] By employing the above technical solution, using 1000 positive samples of mooring bollards and 5000 negative background samples, feature vectors were extracted through convolution using 256 3×3 operators, and the system was trained iteratively 2000 times using a Gaussian kernel function (parameters c=0.1, gamma=0.5). This rigorous sample selection and parameter optimization strategy ensured the classifier's accurate judgment of whether fine grids represent mooring bollards, reduced the misclassification rate for fine grids, and provided reliable classification results for subsequent connected component analysis.

[0079] Furthermore, in steps S51-S53, the fine mesh of the mooring bollard is combined to obtain the precise location of the mooring bollard; the meshes in the fine mesh that are identified as mooring bollards by the classifier are combined, and the connected components are taken to obtain the location and region of the mooring bollard.

[0080] By employing the above technical solution, fine meshes identified as mooring bollards by the merging classifier are analyzed using an 8-neighborhood connectivity domain, and the bounding rectangle of the largest connectivity domain is extracted as the final location box. This process aggregates the scattered fine mesh mooring bollard areas into a complete target region, effectively eliminating isolated noise points in the fine mesh classification, ensuring the integrity and spatial accuracy of the location results, and ultimately outputting a location box that accurately covers the entire mooring bollard area.

[0081] The present invention further provides a ship mooring bollard identification system based on adaptive multi-scale multi-grid partitioning, which uses the ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning as the operating logic, including:

[0082] Visual saliency calculation module: used to generate saliency maps and divide foreground and background regions;

[0083] Non-uniform mesh generation module: used to generate dense meshes in the foreground region and sparse meshes in the background region;

[0084] Feature extraction and filtering module: used to calculate gradient direction consistency features and texture features, and to filter candidate meshes;

[0085] Multi-scale fusion module: used to construct an image pyramid and fuse candidate boxes across scales;

[0086] Fine-mesh localization module: used for fine-mesh generation, SVM classification and connected component analysis, and outputs the final localization result.

[0087] By adopting the above technical solution, and through the collaborative work of the visual saliency calculation module, non-uniform grid generation module, feature extraction and filtering module, multi-scale fusion module, and fine grid precise localization module, the engineering implementation of bollard recognition has been achieved. Each module has clearly defined responsibilities and interfaces, ensuring faithful reproduction of the method's logic while improving the system's maintainability and scalability, enabling the method to be stably applied to bollard detection tasks in actual ship supervision scenarios.

[0088] The present invention has the following beneficial effects:

[0089] 1. This invention achieves adaptive region segmentation of image content through visual saliency analysis. Combined with a non-uniform grid generation strategy, it adopts differentiated grid density in salient and background areas, which improves the targeting and efficiency of grid segmentation, makes the positioning box closer to the edge of the mooring bollard, and enhances the spatial accuracy of the positioning results.

[0090] 2. This invention constructs a three-scale image pyramid and fuses candidate grids of different scales. By combining coordinate scaling and non-maximum suppression to eliminate redundant boxes, it effectively improves the adaptability to targets of different scales. In addition to being applicable to the original scenarios, it can also adapt to the needs of mooring bollard recognition for large ships such as riverboats and ocean-going vessels, as well as long-distance, high-resolution images.

[0091] 3. This invention enhances the robustness of features to changes in target shape and texture by extracting gradient direction consistency features and rotation-invariant local binary pattern texture features, combined with an adaptive threshold filtering mechanism. This effectively distinguishes mooring bollards from background areas, reduces false detections and false negatives, and improves the quality of candidate meshes.

[0092] 4. This invention accurately captures the local detailed features of the mooring bollard by dividing the candidate mesh into fine meshes and combining a support vector machine classifier with connected component analysis. Through region merging and circumscribed rectangle extraction, it achieves precise positioning of the mooring bollard boundary, ensuring the integrity and reliability of the final positioning result. Attached Figure Description

[0093] Figure 1This is a flowchart of the control algorithm of the present invention;

[0094] Figure 2 This is a diagram illustrating the effect of the close-range daytime mooring bollard recognition method of the present invention.

[0095] Figure 3 This is a diagram illustrating the effect of the close-range nighttime mooring bollard recognition method of the present invention.

[0096] Figure 4 This is a diagram illustrating the effect of long-distance daytime mooring bollard recognition according to the present invention.

[0097] Figure 5 This is a diagram illustrating the effect of the long-distance nighttime mooring bollard recognition method of the present invention. Detailed Implementation

[0098] The present invention will now be described in further detail with reference to the accompanying drawings and specific preferred embodiments.

[0099] In the description of this invention, it should be understood that the terms "left side," "right side," "upper part," "lower part," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. "First," "second," etc., do not indicate the importance of the components, and therefore should not be construed as a limitation of this invention. The specific dimensions used in this embodiment are only for illustrating the technical solution and do not limit the scope of protection of this invention.

[0100] Reference Figure 1 , Figure 2 , Figure 3 , Figure 4 and Figure 5 As can be seen, this invention discloses a ship mooring bollard recognition system based on adaptive multi-scale multi-grid partitioning. The algorithm of this invention takes a ship image as input and achieves accurate positioning of the mooring bollard through multi-module collaboration. The specific steps are as follows: First, the saliency map S of the input image is calculated using the spectral residual method. After converting the image I0 into a grayscale image, the amplitude spectrum A and phase spectrum P are obtained through two-dimensional discrete Fourier transform. hs The spectral residual R is generated by convolving the logarithmic amplitude spectrum L with the mean filter. Then, the residual R is generated by inverse Fourier transform and Gaussian smoothing to generate a saliency map normalized to [0,1]. Based on an adaptive threshold, the image is divided into foreground regions Ω. fg and background area Ω bg ;

[0101] Next, non-uniform mesh generation is performed. A dense mesh of 32×32 to 64×64 (step size 8 to 16) is used in the foreground area, and a sparse mesh of 84×84 to 128×128 (step size 48 to 64) is used in the background area. When the mesh slides beyond the image edge, the gray value is filled to ensure effective coverage of the boundary area.

[0102] Subsequently, the feature extraction and filtering module calculates the gradient direction consistency feature C and rotation-invariant local binary pattern (LBP) texture feature T for each grid, and filters candidate grids for mooring bollards using adaptive thresholds C≥0.5 and T≥2.0. A three-scale image pyramid is constructed (original image, 1.5x magnified image, and 0.75x reduced image). Candidate grids at each scale are mapped back to the original image coordinate system after coordinate scaling, and redundant boxes are fused using non-maximum suppression.

[0103] Finally, the fine-mesh localization module divides the candidate mesh into 3×3 fine meshes. A Gaussian kernel support vector machine (SVM) classifier is used to determine the category of each fine mesh. For meshes identified as mooring bollards, an 8-neighborhood connectivity analysis is performed, and the bounding rectangle of the largest connected region is extracted as the final localization result. This process achieves high-precision localization of mooring bollards in complex scenes through visually saliency-guided non-uniform sampling, multi-scale feature fusion, and fine-grained classification.

[0104] In one embodiment, the ship mooring bollard recognition system based on adaptive multi-scale multi-grid partitioning disclosed in this invention achieves accurate positioning of mooring bollards in complex scenarios through the collaborative work of five core modules. The system architecture combines adaptive perception and fine classification capabilities, and can effectively cope with challenges such as differences in ship size, changes in shooting distance, and high-resolution images.

[0105] The visual saliency calculation module, as the system's perception front end, employs the spectral residual method to achieve intelligent region segmentation of image content. This module first converts the input ship image (a color image converted to grayscale) into a grayscale image. It then decomposes it into an amplitude spectrum A and a phase spectrum P using a two-dimensional discrete Fourier transform. The logarithmic amplitude spectrum L is convolved with a 3×3 or 5×5 mean filter to generate a spectral residual R. Finally, through inverse Fourier transform and Gaussian smoothing, a saliency map S normalized to the [0,1] interval is generated. Based on the adaptive threshold Tadap = μ + kσ, where μ is the mean of the saliency map S, σ is the standard deviation, and k is an adjustable parameter (e.g., k = 2), the image is dynamically divided into foreground regions Ω. fg (Significant target area) and background area Ω bgThis provides precise region guidance for subsequent mesh generation, solving the problem of insufficient adaptability of traditional fixed meshes to image content. The non-uniform mesh generation module achieves differentiated sampling based on region characteristics. A dense mesh of 32×32–64×64 (step size 8–16) is used in the foreground region Ωfg to ensure coverage of target details, while a sparse mesh of 84×84–128×128 (step size 48–64) is used in the background region Ωbg to reduce redundant computation. To optimize boundary processing, when the mesh sliding window exceeds the image edge, the excess portion is filled with the image grayscale mean μgray, ensuring the integrity of edge region features. In practical applications, the preferred combination is a 32×32 dense mesh (step size 8) and a 128×128 sparse mesh (step size 64), which satisfies the 16-fold density sampling requirement for the foreground region while reducing the computational load in the background region by more than 70%, significantly improving processing efficiency.

[0106] The feature extraction and filtering module constructs a multi-dimensional feature discrimination system, filtering candidate meshes through dual verification of gradient direction consistency and texture complexity. The gradient direction consistency feature C is achieved by constructing a gradient direction histogram H divided into 8 equal intervals (360 degrees), calculating the normalized maximum value (C = max(H) / sum(H)), with a value range of [1 / 8, 1]. A threshold of 0.5 is set to capture the directional concentration of the mooring bollard edges. The Local Binary Pattern (LBP) texture feature uses a rotation-invariant variant, generating a texture histogram by taking the minimum value LBPri = min{ROR(LBP,i)} through cyclic shifting. The entropy value T = -∑(pk·log(pk)) is calculated as a measure of texture complexity, with a threshold of 2.0 to distinguish regular textures of the mooring bollards from background noise. The dual features are jointly filtered using an adaptive threshold (C ≥ 0.5 and T ≥ 2.0) to reduce the false positive rate of candidate meshes.

[0107] The multi-scale fusion module constructs cross-scale detection capabilities through a three-scale image pyramid (original image, 1.5x magnified image, and 0.75x reduced image). Each scale uses the same method as the original. Figure 1 The system employs a unique grid partitioning strategy. The generated candidate grids are mapped back to the original coordinate system after coordinate scaling (scaling factor 1 / 1.5 for magnified images and 1 / 0.75 for magnified images). Then, overlapping candidate boxes are fused using non-maximum suppression (IoU>0.5) to eliminate redundant detection results. This module enables the system to maintain stable detection performance for ship images at different distances (beyond 200 meters) and resolutions (above 4 million pixels), solving the problem of poor adaptability of traditional single-scale methods to changes in target scale.

[0108] The fine-mesh localization module achieves precise localization through micro-classification and macro-aggregation. After dividing the candidate mesh into 3×3 fine meshes, feature vectors extracted through convolution with 256 3×3 operators are input into a Gaussian kernel support vector machine (SVM) classifier (parameters c=0.1, gamma=0.5) for binary classification. The classifier converges after 2000 training iterations with 1000 positive mooring bollard samples and 5000 negative background samples, effectively improving the classification accuracy for fine meshes. Finally, positive fine meshes are merged through 8-neighborhood connected component analysis, and the bounding rectangle of the largest connected component is extracted as the final localization box, improving the edge fit of the localization box by 30% and achieving precise capture of the mooring bollard boundaries.

[0109] The system's modules are seamlessly connected through data flow, from saliency perception to multi-scale fusion and then to fine-grained classification, significantly improving positioning accuracy. It can adapt to large ships such as riverboats and ocean-going vessels, as well as long-distance, high-resolution scenarios, providing reliable technical support for regulatory needs such as ship overload detection.

[0110] This invention further discloses a ship mooring bollard positioning method based on adaptive multi-scale multi-grid partitioning, which serves as the operating logic for a ship mooring bollard identification system based on adaptive multi-scale multi-grid partitioning, and specifically includes the following steps:

[0111] S1. Input a ship image, generate a saliency map S through visual saliency calculation, and segment the foreground region Ω based on an adaptive threshold. fg and background area Ω bg ;

[0112] S2. In Ω fg A dense grid is used, ranging from 32×32 to 64×64, with a step size of 8 to 16, in Ω. bg A sparse grid, 84×84~128×128, with a step size of 48~64, is used to generate a non-uniform candidate grid.

[0113] S3. Calculate the gradient direction consistency feature C and LBP texture feature T for each grid, and apply an adaptive threshold C≥τ. c , T≤τ t Screening candidate grids for mooring bollards;

[0114] S4. Construct a three-scale image pyramid, map candidate grids of different scales back to the original image, and use non-maximum suppression to fuse redundant boxes;

[0115] S5. Divide the candidate grid into 3×3 fine grids, determine the fine grid category using an SVM classifier, and obtain the precise positioning box of the mooring bollard by combining 8-neighborhood connected domain analysis.

[0116] In one embodiment, the visual saliency calculation in step S1 includes:

[0117] The saliency map S of the input image I0 is calculated using the spectral residual method: S(x,y)=f(I), where the value of each pixel S(x,y)∈[0,1] represents the visual saliency at that location. The calculation method is as follows:

[0118] S11. Input image I O Convert to grayscale;

[0119] S12. Obtain the amplitude spectrum and phase spectrum through two-dimensional discrete Fourier transform, and calculate the spectral residual by convolving the logarithmic amplitude spectrum with the mean filter;

[0120] S13. After inverse Fourier transform and Gaussian smoothing, a saliency plot normalized to [0,1] is generated;

[0121] S14. Based on adaptive threshold T adap =μ+kσ divides the foreground region Ω fg and background area Ω bg , where μ is the mean of the significance plot, σ is the standard deviation, and k is an adjustable parameter.

[0122] Specifically, this involves converting I0 to a grayscale image I. 0gray ;

[0123] S111: Calculate the two-dimensional discrete Fourier transform of the image to obtain its frequency domain representation:

[0124] F = DFT(I), then the amplitude spectrum A = |F| and the phase spectrum P are obtained. hs = angle(F);

[0125] S121: Calculate the logarithmic amplitude spectrum: L = log(A);

[0126] S131: Calculate the spectral residual: R = Lh avg *L, where h avg It is a mean filter, and * indicates convolution;

[0127] S141: Construct the frequency domain signal in exponential form: S0 = exp(R + i * P) hs ), where i is the imaginary unit;

[0128] S151: Perform inverse Fourier transform IDFT(S0) on S0 to obtain the saliency map: S = |IDFT(S0)|2;

[0129] S161: Apply Gaussian smoothing to the saliency plot to enhance visualization and reduce noise;

[0130] S171: Normalize the saliency plot to the range [0,1].

[0131] In one embodiment, in step S2, based on S and the set threshold T adap The input image is divided into binary regions: foreground (salient) region Ω. fg and background area Ω bg .

[0132] S21: Set an adaptive threshold T adap =μ+kσ, where μ is the mean of the significance plot S, σ is the standard deviation, and k is an adjustable parameter (e.g., k=2).

[0133] S22: Divide the image into binary regions: foreground (salient) region

[0134] Ω fg ={(x,y)|S(x,y)>Tadap}, and the background region Ω bg .

[0135] In one embodiment, in step S3, the gradient direction consistency feature C of each grid is calculated as follows:

[0136] S31. The directional consistency metric C reflects the degree of concentration of gradient directions. If the gradient directions are highly consistent, the value of a certain interval in the histogram will be much larger than that of other intervals, indicating high consistency. If the gradient directions are dispersed, the values ​​of each interval in the histogram will not differ much, indicating low consistency.

[0137] Calculate the normalized maximum value of the histogram:

[0138] C = max(H) / sum(H);

[0139] Where max(H) is the maximum value of histogram H, and sum(H) is the sum of all interval values ​​of histogram H;

[0140] sum(H) = ∑{x,y}M(x,y);

[0141] The value range of C is [1 / B, 1]. When C = 1, it means that all gradient directions are concentrated in the same interval. When C = 1 / B, it means that the gradient directions are evenly distributed in each interval.

[0142] Calculate the gradient direction histogram:

[0143] For each grid image, first calculate the gradient magnitude and direction for each pixel. Then, use the Sobel operator to calculate the horizontal gradient Gx and the vertical gradient Gy:

[0144] Horizontal gradient Gx: Uses the Sobel horizontal edge detection operator (counts the number of edge points in the vertical edge map and uses this number of edge points as the vertical edge value v; already calculated in the original patent, can be reused).

[0145] Vertical gradient Gy: Uses the Sobel vertical edge detection operator (counts the number of edge points in the horizontal edge map and uses this number of edge points as the horizontal edge value h, which has been calculated in the original patent and can be reused).

[0146] Gradient magnitude:

[0147] Gradient direction: θ(x,y)=atan2(Gy(x,y),Gx(x,y)), range [-π,π]

[0148] Histogram of gradient directions: Divide 360 ​​degrees (i.e., 2π radians) evenly into B intervals (e.g., B = 8, each interval is 45 degrees). For each pixel, map its gradient direction θ(x,y) to the corresponding interval, and accumulate the gradient magnitude M(x,y) of that pixel as a weight to obtain the histogram of gradient directions H.

[0149] Let the value of the k-th interval (k = 0, 1, ..., B-1) of histogram H be H[k], then:

[0150] H[k]=∑{x,y}where M(x,y)*δ(θ(x,y)∈kth interval)

[0151] Here, δ(■) is an indicator function, which takes the value 1 when the condition is true and 0 otherwise.

[0152] The directional consistency metric C reflects the degree of concentration of gradient directions. If the gradient directions are highly consistent, the value of a certain interval in the histogram will be much larger than that of other intervals, indicating high consistency; if the gradient directions are dispersed, the values ​​of each interval in the histogram will not differ much, indicating low consistency.

[0153] The normalized maximum value of the histogram is calculated.

[0154] C = max(H) / sum(H)

[0155] Where max(H) is the maximum value of histogram H, and sum(H) is the sum of all interval values ​​of histogram H.

[0156] Since the sum of the values ​​in each interval is actually the sum of the gradient magnitudes of the entire grid, that is, sum(H) = ∑{x,y}M(x,y).

[0157] Therefore, the range of C is [1 / B, 1]. When C = 1, it means that all gradient directions are concentrated in the same interval; when C = 1 / B, it means that the gradient directions are evenly distributed in each interval.

[0158] S32: Calculating local binary pattern texture features specifically involves:

[0159] Calculate the LBP texture response: LBP = ∑s(g) p -g c )·2p;

[0160] Statistical texture complexity: T = entropy(LBP_histogram);

[0161] First, perform basic LBP calculations. For each pixel, consider its 3x3 neighborhood. Using the grayscale value of the center pixel as a threshold, compare the grayscale values ​​of the 8 neighboring pixels with the threshold. If the grayscale values ​​are greater than or equal to the threshold, record them as 1; otherwise, record them as 0. Concatenate these binary bits in a clockwise direction to form an 8-bit binary number, and then convert it to a decimal number. This is the LBP value for that point. The specific calculation formula is as follows:

[0162]

[0163] Where gc is the grayscale value of the center pixel, g p s(z) is the gray value of the p-th pixel in the neighborhood, and s(z) is the sign function;

[0164] s(z) = 1 if z >= 0; otherwise s(z) = 0;

[0165] Since the mooring bollard may rotate, a rotation-invariant variant of LBP is used. Specifically, the obtained LBP binary string is cyclically shifted, and the pattern corresponding to the minimum value among all shift results is taken as the LBP value of that point.

[0166] LBPri=min{ROR(LBP,i)|i=0,1,...,7};

[0167] Where ROR represents a circular right shift of i bits;

[0168] Texture complexity is calculated by plotting a histogram of rotation-invariant LBP values ​​for the entire mesh, with a histogram size of 10.

[0169] S33. Calculate the entropy of the histogram as a measure of texture complexity:

[0170]

[0171] Where pk is the frequency of the k-th interval in the histogram, which is the number of values ​​of the k-th interval divided by the total number of pixels. The larger the entropy T, the more complex the texture; the smaller the entropy T, the more uniform the texture.

[0172] S34. Determine if the grid is a candidate grid for mooring bollards:

[0173] If the conditions are met:

[0174] (h≥αh ·A)&(v≥α v ·A)&(C≥τc)&(T≥τ t ), where A is the grid area,

[0175] α h α v τ c τ t If the parameters are adaptive, then this mesh is determined to be a candidate mesh;

[0176] Where, α h α v A value of 0.283 is acceptable.

[0177] τ c The gradient direction consistency threshold, C, has a value range of [1 / B, 1].

[0178] τ t The texture complexity threshold is set by considering the range of texture complexity T as [0, log(10)]. The background texture is set by statistically analyzing positive and negative samples.

[0179] α h α v A value of 0.283 is acceptable.

[0180] τ c The gradient direction consistency threshold, C, ranges from [1 / B, 1]. The bollard region exhibits a consistent direction, such as the vertical or horizontal edges of the bollard. Therefore, a higher consistency threshold can be set.

[0181] Through experiments, the C-value distributions of positive and negative samples of mooring bollards were statistically analyzed. It was assumed that the C-values ​​of the positive samples were mainly above 0.5, while the C-values ​​of the negative samples were below 0.5. Let τ be... c =0.5.

[0182] τ t The texture complexity threshold, the texture complexity T (entropy) ranges from [0, log(10)] (10 intervals were used). The mooring bollard area may have repetitive, regular textures, resulting in a low entropy value; while the texture of the background (such as the water surface) may be more complex or simple. The threshold can be set by statistical analysis of positive and negative samples.

[0183] The T-value distributions for positive and negative samples were calculated experimentally. It was assumed that the T-values ​​for positive samples were mainly distributed below 2.0 (based on the natural logarithm; the values ​​differ if base 2 is used), while the T-value distributions for negative samples were more widespread. Let τ be... t =2.0.

[0184] The above thresholds need to be adjusted based on the actual dataset. They can be set automatically using the following methods:

[0185] During the training phase, C and T are calculated for each sample using labeled candidate grids of mooring bollards (positive samples) and negative samples, and then the threshold is set based on the statistical distribution of the positive samples.

[0186] For example, τ can be c Set it to the 25th percentile of the positive sample C value (i.e., 25% of the positive samples are below this value, but we want to retain most of the positive samples, so we set it a little lower), and set τt to the 75th percentile of the positive sample T value (i.e., 75% of the positive samples are below this value, and we want to retain positive samples with less texture complexity).

[0187] Specific steps:

[0188] Collect the C and T values ​​of all positive samples (mooring bollard areas) in the training set.

[0189] For τ c Take the 10th percentile of the positive sample C value (to be conservative and to avoid missing positive samples, we set it a little low, such as the 10th percentile).

[0190] For τ t Take the 90th percentile of the T value of the positive samples (again, to avoid missing positive samples, set it higher so that 90% of the positive samples have a T value below this threshold).

[0191] An adaptive threshold was set so that 90% of the positive samples simultaneously satisfy C≥τ. c and T≤τ t .

[0192] In one embodiment, in step S4, a three-scale image pyramid is constructed: the original image scale I0, the 1.5x magnification scale I1, and the 0.75x reduction scale I2. The same processing is performed on I1 and I2, using the same basic grid size Size and the same relative step size to divide the sliding window. The candidate grids generated by these two layers are mapped back to the original image coordinate system. Non-maximum suppression and other techniques are used to fuse the overlapping candidate boxes generated at different scales and remove redundancy.

[0193] In one embodiment, in step S5, each candidate mooring bollard grid is further divided into 3×3 fine grids, and a classifier is used to determine whether each fine grid image is a mooring bollard.

[0194] Each candidate grid is further divided into 3×3 fine grids. A classifier is used to determine whether each fine grid image is a mooring post. The Size×Size mooring post candidate grids are all divided into 3×3 fine grids, resulting in n = Size×Size / 3 / 3 fine grids. n 3×3 operators are used to perform convolution operations with each fine grid to obtain n feature values. The n-dimensional features are fed into a pre-trained support vector machine classifier for binary classification. If the classifier determines that the probability of a fine grid is a mooring post is greater than 0.5, then the region is a mooring post region; otherwise, it is not. This method is used to determine whether each fine grid is a mooring post region.

[0195] The training process of the Support Vector Machine (SVM) classifier is as follows: The mooring bollard areas of the ship image are manually labeled. The non-mooring bollard areas are divided into 5000 3×3 images as negative samples, and the mooring bollard areas are divided into 1000 3×3 images as positive samples. The positive and negative sample images are convolved with 256 3×3 operators to obtain feature vectors. These feature vectors are then fed into the SVM classifier for training. The classifier uses a Gaussian kernel with parameters c=0.1 and gamma=0.5. After 2000 training iterations, the classifier is obtained. The classifier determines the location of the mooring bollards through connected component analysis. The fine mesh of the mooring bollards is combined to obtain the precise location of the mooring bollards. The meshes identified as mooring bollards by the classifier are combined, and connected components are extracted to obtain the location and region of the mooring bollards.

[0196] In one embodiment, refer to Figure 2 , Figure 3 and Figure 4 As can be seen, the present invention realizes the identification of ships at night and during the day by image acquisition, and at the same time, by magnifying the ship images, it realizes the detection of ship items, including whether there are dangerous objects, whether the flags are not being flown as required, and issues warnings.

[0197] Working principle: Using ship images as input, an end-to-end positioning link is constructed through five core modules: First, the visual saliency calculation module uses the spectral residual method to convert the image into a grayscale image, which is then decomposed into amplitude spectrum A and phase spectrum P by two-dimensional discrete Fourier transform. hsThe system generates a spectral residual by convolving the logarithmic amplitude spectrum with a mean filter, then performs inverse Fourier transform and Gaussian smoothing to generate a normalized saliency map. Based on an adaptive threshold, it dynamically divides the foreground region (salient target region) and background region, providing a content-aware basis for subsequent grid division. Next, the non-uniform grid generation module uses a dense grid of 32×32–64×64 (stride 8–16) for the foreground region to ensure target detail coverage, and a sparse grid of 84×84–128×128 (stride 48–64) for the background region to reduce redundant computation. Edges exceeding the grid's boundaries are filled with grayscale mean to ensure feature integrity. The feature extraction and filtering module captures edge direction concentration through gradient direction consistency features, combines rotation-invariant local binary patterns to generate a texture histogram and calculate entropy, and jointly filters candidate grids using an adaptive threshold. The multi-scale fusion module constructs a three-scale image pyramid. After mapping the candidate grids at each scale back to the original image through coordinate scaling, redundant boxes are fused using non-maximum suppression. Finally, the fine-grid localization module divides the candidate grid into 3×3 fine grids, uses 256 3×3 operators for convolution to extract features, inputs them into a Gaussian kernel SVM classifier trained with 1000 positive samples / 5000 negative samples to determine the fine grid category, merges positive grids through 8-neighbor connected component analysis, and extracts the bounding rectangle of the largest connected component as the final localization result.

[0198] By dynamically dividing the foreground / background regions through visual saliency analysis, a 32×32 dense grid (step size 8) is used in the foreground (such as the main body of a ship) to achieve 16 times the density sampling, while a 128×128 sparse grid (step size 64) is used in the background (such as the water surface) to reduce redundant calculations. Combined with the edge filling strategy, the boundary target coverage is ensured, so that the grid division has the ability to adapt to content and can be adapted to river ships and sea ships over 60 meters long and complex aspect ratio scenes.

[0199] A three-scale image pyramid was constructed (original image, 1.5x magnification, 0.75x reduction). The same grid division strategy was used for each scale, and candidate grids were scaled according to coordinates (scaling factor of 1 / 1.5 for magnified image, and scaling factor of 0.75 for reduced image). Figure 1 By mapping the coordinates of the image back to the original coordinate system ( / 0.75), and using non-maximum suppression to fuse cross-scale redundant boxes, stable detection of long-distance (>200 meters) and high-resolution (2560×1440 and above) images is achieved, improving the localization accuracy.

[0200] Multi-dimensional adaptive screening mechanism: Gradient direction consistency feature C captures the concentration of the mooring bollard edge direction by normalizing the maximum value of the histogram (threshold 0.5), while rotation-invariant LBP texture feature T distinguishes regular textures from background noise by using entropy value (threshold 2.0). The joint screening of the two features reduces the false positive rate; at the same time, the threshold is dynamically adjusted by the statistical distribution of positive samples to enhance robustness to complex scenes.

[0201] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.

Claims

1. A method for identifying ship mooring bollards based on adaptive multi-scale multi-grid partitioning, characterized in that, Includes the following steps: S1. Input the ship image and divide it into regions; S2. Generate non-uniform candidate grids through grid sampling; S3. Extract the different features of non-uniform candidate meshes and filter the candidate meshes; S4. Merge candidate meshes of different scales; S5. Perform fine mesh division and classification on the candidate mesh, and output the final location box by combining connected component analysis.

2. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 1, characterized in that, The visual saliency calculation in step S1 includes: S11. Input image I O Convert to grayscale image I 0gray ; S12. Obtain the amplitude spectrum and phase spectrum through two-dimensional discrete Fourier transform, and calculate the spectral residual by convolving the logarithmic amplitude spectrum with the mean filter; S13. After inverse Fourier transform and Gaussian smoothing, a saliency plot normalized to [0,1] is generated; S14. Based on adaptive threshold T adap =μ+kσ divides the foreground region Ω fg and background area Ω bg , where μ is the mean of the significance plot, σ is the standard deviation, and k is an adjustable parameter.

3. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 2, characterized in that, In step S2, generating a non-uniform candidate grid through grid sampling specifically involves: In the foreground region Ω fg Dense grid is employed: a smaller grid size and smaller step size are used to ensure fine coverage of potential ship targets, where the foreground area Ω fg Use a 32×32 to 64×64 grid with a step size of 8 to 16. In the background area Ω bg Employing a sparse mesh: Using a larger base size and a larger step size (Step) to quickly eliminate background and significantly reduce the number of candidate regions, where the background region Ω... bg Use a grid of 84×84 to 128×128 with a step size of 48 to 64. When the non-uniform grid slides to the end of the current row or column on I0, and the next slide will exceed the image edge: If the area exceeding the limit is greater than 0.5 * Size * Step, then the sliding will stop. If the area exceeding the image's boundaries is ≤ 0.5 * Size * Step, continue sliding. After sliding, all portions of the non-uniform grid extending beyond the image will be filled with I. 0gray mean μ gray ; When a non-uniform grid sliding window extends beyond the image edge, the extended portion is filled with the image's average grayscale value.

4. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 2, characterized in that, The calculation of the gradient direction consistency feature C in step S3 includes: S311. Calculate the gradient direction histogram: Specifically, For each grid image, first calculate the gradient magnitude and direction for each pixel, and then use the Sobel operator to calculate the horizontal gradient G. x and vertical gradient G y : Horizontal gradient G x Use the Sobel horizontal edge detection operator to count the number of edge points in the vertical edge map, and use this number of edge points as the vertical edge value v; Vertical gradient G y The Sobel vertical edge detection operator is used to count the number of edge points in the horizontal edge map, and this number of edge points is used as the horizontal edge value h. Gradient magnitude: Gradient direction: θ(x,y)=atan2(Gy(x,y),Gx(x,y)), range [-π,π]; S312. Gradient Direction Histogram: Divide 360 ​​degrees evenly into B intervals. For each pixel, map its gradient direction θ(x,y) to the corresponding interval, and accumulate the gradient magnitude M(x,y) of that pixel as a weight to obtain the gradient direction histogram H. Let the value of the k-th interval (k=0,1,...,B-1) of the histogram H be H[k], then: H[k]=∑{x,y}where M(x,y)*δ(θ(x,y)∈kth interval) Where δ(·) is an indicator function, which takes the value 1 when the condition is true and 0 otherwise; S313. Calculate the directional consistency measure: Calculate the normalized maximum value of the histogram: C = max(H) / sum(H) Where max(H) is the maximum value of histogram H, and sum(H) is the sum of all interval values ​​of histogram H; Since the sum of the values ​​in each interval is actually the sum of the gradient magnitudes of the entire grid, that is, sum(H) = ∑{x,y}M(x,y); The value of C ranges from [1 / B, 1]. When C = 1, it means that all gradient directions are concentrated in the same interval; when C = 1 / B, it means that the gradient directions are evenly distributed in each interval. S321. Calculation of texture feature T: Calculate the LBP texture response: LBP = ∑s(g) p -g c )·2p; Statistical texture complexity: T = entropy(LBP_histogram); S322. Basic LBP Calculation: For each pixel, consider its 3x3 neighborhood. Using the grayscale value of the center pixel as a threshold, compare the grayscale values ​​of the 8 pixels in the neighborhood with the threshold. If the grayscale values ​​are greater than or equal to the threshold, record them as 1; otherwise, record them as 0. Concatenate the binary bits in a clockwise direction to form an 8-bit binary number, and then convert it to a decimal number. This is the LBP value of that point. The specific calculation formula is as follows: Among them, g c It is the grayscale value of the center pixel, g p s(z) is the gray value of the p-th pixel in the neighborhood, and s(z) is the sign function. s(z) = 1 if z >= 0; otherwise s(z) = 0. S323. Rotation-invariant LBP improvement: The obtained LBP binary string is cyclically shifted, and the pattern corresponding to the minimum value among all shift results is taken as the LBP value of that point. LBP ri =min{ROR(LBP,i)|i=0,1,...,7}, where ROR represents a circular right shift of i bits; S324. Texture complexity calculation: Calculate a histogram of rotation-invariant LBP values ​​for the entire grid, with a histogram size of 10; S325. Calculate the entropy of the histogram as a measure of texture complexity: Where pk is the frequency of the k-th interval in the histogram, which is the number of values ​​in the k-th interval divided by the total number of pixels. The larger the entropy T, the more complex the texture; the smaller the entropy T, the more uniform the texture. S33. Candidate Grid Filtering: Based on the above two characteristics, a dual-threshold joint screening mechanism is used to determine the candidate grid for mooring bollards, with the following specific conditions: C≥0.5 and T≥2.0; where C≥0.5: ensures that the gradient direction within the mesh is highly concentrated, excluding background regions with scattered edges; T≥2.0: Ensure that the mesh texture complexity meets the minimum requirements for the surface texture of the mooring bollard, and exclude backgrounds with uniform textures such as water surfaces and skies; Screening results: (h≥α) h ·A)&(v≥α v ·A)&(C≥τ c )&(T≥τ t ), where A is the grid area, α h α v τ c τ t If the parameters are adaptive, then this mesh is determined to be a candidate mesh, where h is the horizontal edge value of the mesh, α is the horizontal edge value of the mesh, and α is the horizontal edge value of the mesh. h Adaptive threshold factor for horizontal edge values, vertical edge values ​​of v grid, α v Vertical edge value adaptive threshold factor, C-direction consistency measure, T-mesh texture complexity; τ C The gradient direction consistency threshold, C, has a value range of [1 / B, 1], τ t Texture complexity threshold, the range of texture complexity T is [0, log(10)]; The background texture is set with a threshold by statistical analysis of positive and negative samples. Only meshes that simultaneously meet the above conditions are retained as "mooring post candidate meshes" and enter the subsequent multi-scale fusion and fine positioning steps.

5. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 2, characterized in that, In step S4, the candidate meshes are fused, specifically including: S41. Construct a three-scale image pyramid, including the original image, a 1.5x magnified image, and a 0.75x reduced image. The candidate grids at each scale are mapped back to the original image coordinate system through coordinate scaling. The magnified image has a scaling factor of 1 / 1.5, and the reduced image has a scaling factor of 1 / 0.

75. S42. Remove redundant overlapping candidate boxes: Specifically, the process involves: original image scale I0, 1.5x magnification scale I1, and 0.75x reduction scale I2. Steps S11-S13 are repeated for I1 and I2. A sliding window is divided using the same basic grid size Size and the same relative step size Step. The candidate grids generated in the two layers are mapped back to the original image coordinate system. Non-maximum suppression is used to fuse the overlapping candidate boxes generated at different scales and remove redundancy.

6. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 1, characterized in that, The fine mesh division described in step S5 specifically includes, S51. Further divide each candidate mooring bollard grid into a 3×3 fine grid, and use a classifier to determine whether each fine grid image is a mooring bollard; S52. Divide the candidate mesh of Size×Size into a fine mesh of 3×3, resulting in a total of n = Size×Size / 3 / 3 fine meshes; S53. Perform convolution operations with the fine grid using n 3×3 operators to obtain n feature values. Feed the n-dimensional features into a pre-trained support vector machine classifier for binary classification. If the classifier determines that the probability of the fine grid being a mooring bollard is greater than 0.5, then the region is a mooring bollard region; otherwise, it is not. Use this method to determine whether each fine grid is a mooring bollard region.

7. The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning according to claim 6, characterized in that, The training process of the support vector machine classifier is as follows: The mooring bollard areas of the ship image are manually labeled. The non-mooring bollard areas of the image are divided into 5000 small 3×3 images as negative samples, and the mooring bollard areas are divided into 1000 small 3×3 images as positive samples. The positive and negative sample images are convolved with 256 3×3 operators to obtain feature vectors. The feature vectors are fed into the support vector machine classifier for training. The classifier uses a Gaussian kernel with parameters c=0.1 and gamma=0.

5. The classifier is obtained after 2000 training iterations.

8. The method according to claim 1, characterized in that, In steps S51-S53, the fine mesh of the mooring bollard is combined to obtain the precise location of the mooring bollard; the meshes in the fine mesh that are identified as mooring bollards by the classifier are combined, and the connected components are taken to obtain the location and region of the mooring bollard.

9. A ship mooring bollard identification system based on adaptive multi-scale multi-grid partitioning, characterized in that, The ship mooring bollard identification method based on adaptive multi-scale multi-grid partitioning as described in any one of claims 1-8 is used as the operating logic, including: Visual saliency calculation module: used to generate saliency maps and divide foreground and background regions; Non-uniform mesh generation module: used to generate dense meshes in the foreground region and sparse meshes in the background region; Feature extraction and filtering module: used to calculate gradient direction consistency features and texture features, and to filter candidate meshes; Multi-scale fusion module: used to construct an image pyramid and fuse candidate boxes across scales; Fine-mesh localization module: used for fine-mesh generation, SVM classification and connected component analysis, and outputs the final localization result.

Citation Information

Patent Citations

  • A method for positioning ship mooring bollards based on multi-grid partitioning

    CN110473255B

Cited By

  • Egg surface crack identification method and system based on machine vision

    CN122223459A

  • A Machine Vision-Based Method and System for Recognizing Cracks on Egg Surface

    CN122223459B