A ship navigation ocean environment modeling method and system based on a grid network
By using a grid network-based method to dynamically determine the grid granularity and perform binarization, the problem of complex chart processing in marine environment modeling for ship navigation is solved, and theoretical support for simplified marine environment division and ship path planning is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NAVAL UNIV OF ENG PLA
- Filing Date
- 2024-12-20
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies struggle to effectively divide the marine environment into navigable and non-navigable waters in ship navigation marine environment modeling, resulting in complex and inconvenient chart processing, which affects the accuracy and efficiency of ship path planning.
A raster network-based approach is adopted, using the imread function to acquire marine environment images, converting them to grayscale images using the rgb2gray function, dynamically determining the raster granularity based on the proportion of obstacles, and performing binarization using rectangular coordinates to divide the marine environment into a matrix representation of 0s and 1s, thus simplifying the image processing workflow.
It enables the easy division of the marine environment into navigable and non-navigable waters, provides a theoretical basis for ship navigation planning, simplifies the image processing process, and improves the efficiency and accuracy of path planning.
Smart Images

Figure CN119888072B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of marine environment modeling technology, specifically relating to a method and system for modeling the marine environment of ship navigation based on grid networks. Background Technology
[0002] Marine environmental modeling is a way of representing the real marine environment using mathematical language. Environmental models can recreate actual scenarios and quantitatively represent them on nautical charts. Environmental modeling is a crucial part of the maritime route planning process. Accurately extracting environmental information and describing the navigation environment of a route using appropriate methods are the prerequisites and foundations for conducting maritime ship route planning.
[0003] For ships, the primary task in environmental modeling and analysis of their navigation area is to determine the ship's starting point, destination, the exact location of obstacles, and radar coordinates, thereby identifying feasible routes. Various environmental modeling methods exist, among which free space methods, linked graph methods, topology methods, grid methods, and visualization methods are commonly used.
[0004] Quattrochi et al. used the free space method to conduct multi-scale analysis of multi-scale remote sensing data for the design and implementation of geographic information system software modules, and established various spatial analysis techniques. Li et al. used free space to establish an underwater environment model for the three-dimensional path planning problem of autonomous underwater vehicles (UUVs) in underwater environments. Hao et al. used the free space method to establish a 30x20 grid matrix for simplified environmental modeling calculations in the marine environment where UUVs operate. Liu et al. developed an environment modeling optimization technique based on linked graphs and nonlinear graphs, using ship maritime transportation as a research background. Lv et al. provided an innovative review of the application status of digital twin technology (DTT) in various fields of marine industries such as shipbuilding (SBI), offshore oil and gas, marine fisheries, and marine energy, innovatively mentioning the current research status of the practical application of linked graphs in marine environment modeling. Liu et al. focused on the time-dependent adaptive formation control problem of UUV systems under random noise and switching topologies, using topology... A robust adaptive time-defined adaptive formation control strategy was developed, and the established control algorithm can prove that all signals of the USV system maintain the mean square boundary within a specified time and ensure effective tracking of the leading vehicle. Liu et al. modeled the pirate zone environment by simulating the marine environment and dividing it into particles for route planning using a grid. The modeled environment is represented by a series of discrete grids. Similarly, Liu et al. also attempted to use gridded networks for network search to predict water quality indicators and the water quality certification process. Sun et al. used electronic navigation charts (ENC), automatic identification systems (AIS), and available information from marine radar to construct a grid map in platform-based marine radar target detection of unmanned surface vehicles (USVs), effectively solving the problems of identifying obstructions and maintaining the stability of sound tracking performance in marine environments with obstructed detection. Yang et al. used the visual map method to establish a marine monitoring model, creating a feature-based marine measurement and mapping network, and a three-dimensional (3D) model of the marine environment.
[0005] Among these methods, grid networks have attracted much attention due to their universality and wide range of applications. Originally designed to solve the robot path planning problem, with the continuous development of technology, the grid method has gradually been applied by many experts and scholars to ship path planning, achieving quite ideal results.
[0006] There are three main methods of raster representation: indexing, coordinate representation, and discretization. Phetprayoon et al. studied Upper Lam Phra, located in northeastern Thailand. The severe erosion problem in the Phloeng watershed was addressed using a grid-based curve number (CN) method. This method estimates the surface runoff depth of each grid cell within the watershed through GIS drainage analysis on a DEM, and can be applied to surface runoff estimation. Tarboton et al. proposed a novel method for representing flow direction and calculating upslope area using a rectangular grid digital elevation model. This process is based on representing the flow direction as a single angle and can be applied to the calculation of results from digital elevation datasets. Lei et al. introduced a novel singularity-free spherical (global) coordinate system. By decomposing the Earth into several identical triangular regions and constructing local coordinate combinations for each region, a new global grid system is formed. This system has a consistent hierarchical structure and a simple relationship with traditional coordinates, making it suitable for organizing, representing, and analyzing spatial data. Karimi-Fard et al. established a raster-based system for fine-grid discretization, upsampling, and coarse-grid discretization of maps, which can be shared without any additional processing. Asouti et al. proposed a Navier-Stokes solver for steady-state and unsteady-state turbulence on unstructured / hybrid grids, featuring triangular and quadrilateral elements. This solver can be applied in graphics processing.
[0007] Given that computers tend to process data in binary form, meaning they are better at handling discrete data, discretizing environmental data becomes a superior choice. For nautical charts used for ship navigation, discretization means dividing the chart into navigable and non-navigable waters. In the algorithm, the chart is gridded and represented as matrices of 0s and 1s, simplifying the image processing flow and performing binarization on the chart. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention provides a method and system for modeling the marine environment of ships based on grid networks. It utilizes the `imread` function to obtain RGB images, and then uses the `rgb2gray` function to convert the RGB images into grayscale images. The grid size of the grayscale image is dynamically determined based on the complexity of the marine environment. The marine environment is discretized using unit grids, and the nautical chart is binarized according to actual needs, presenting both black and white versions. This provides a theoretical basis for ship navigation route planning.
[0009] To achieve binarization of nautical charts, this invention provides the following technical solution:
[0010] This invention provides a first solution: a method for modeling the marine environment of ships based on grid networks, including...
[0011] Step 1: Obtain pixel values of the marine environment image during ship navigation;
[0012] Step 2: Convert the pixel values of the marine environment image of the ship's navigation to obtain a grayscale image;
[0013] Step 3: Determine the raster granularity of the grayscale image;
[0014] Step 4: Based on the grid granularity, the marine environment of the ship's navigation is rasterized, and a binarized nautical chart is generated using the rectangular coordinate method.
[0015] Preferably, in step 1, the imread function and the whos command are used to extract the marine environment image of the ship's navigation, and the imshow function is used to display the image.
[0016] Preferably, in step 2, the imread function in MATLAB is used to read the RGB value of each pixel in the marine environment image, resulting in an RGB image, and the rgb2gray function is used to convert the RGB image into a grayscale image.
[0017] Preferably, in step 3, the grid granularity needs to be dynamically determined based on the proportion of obstacles in the marine environment map. The specific process is as follows:
[0018] Step 301: Calculate the sum of the areas of all obstacles in the marine environment map, as shown in the following formula:
[0019] (1)
[0020] in, For the area of all obstacles, Let i be the area of the i-th obstacle;
[0021] Step 302: Determine the grid size based on the proportion of the area of all obstacles in the entire marine environment image. Calculate the estimated area of the obstacles by filling irregular obstacles with standard rectangles, and find the coordinates of all obstacles in the Cartesian coordinate system. , and then with and If a rectangle is drawn with its diagonal vertices as the basis, then the area of the rectangle is... The granularity of the raster is calculated as shown in the following formula:
[0022] (2)
[0023] in, It is the raster adjustment factor. It is the defined maximum side length of the grid, which is related to obstacle information. It is the minimum side length of the grid, which is generally determined based on the ship's movement step length.
[0024] Preferably, the specific steps of step 4 are as follows:
[0025] Step 401: Divide the two-dimensional navigation environment into a series of cell grids according to the grid granularity;
[0026] Step 402: Identify the cell grid using rectangular coordinates;
[0027] Step 403: Discretize the two-dimensional navigation environment identified by the rectangular coordinate method, and use a matrix to represent the two-dimensional navigation environment map. This matrix contains only 0 and 1, which represent vacant and occupied waters, respectively. In the two-dimensional navigation environment, it represents navigable waters and non-navigable waters, and generates a binary raster chart.
[0028] Preferably, the total number of cell grids in step 401 is expressed by the following formula:
[0029] (3)
[0030] In the formula, The number of columns in the cell grid. For the number of rows in the cell grid, This is a rounding up operation; then, each cell is assigned a value. If the i-th cell is an obstacle cell, then the obstacle cell is... Assign a value of 1; if the j-th cell is a free grid, then assign a value of 1 to the free grid. When the value is set to 0, 1 represents navigable waters and 0 represents navigable waters in the path algorithm implementation. Thus, the global navigation environment can be decomposed into many cell grids with binary information using the rectangular coordinate method.
[0031] Preferably, the specific process of step 402 is as follows:
[0032] (1) Create a rectangular coordinate system on the two-dimensional grid environment, with the lower left corner of the two-dimensional grid environment as the origin and the horizontal direction of the two-dimensional grid environment as the coordinate system. The axis is defined by the vertical direction of the two-dimensional grid environment. The axes are defined, and the cell lengths of both axes are integer multiples of the side length of the cell grid.
[0033] (2) In the created rectangular coordinate system, any first... The position of each cell grid All can be determined by the corresponding coordinates To determine, using To represent a two-dimensional grid environment model in a Cartesian coordinate system, the expression for the two-dimensional grid environment model is as follows:
[0034] (4)
[0035] in, This indicates that the current grid is a free grid. This indicates that the current grid cell is an obstacle grid cell;
[0036] (3) Obstacle grids are represented in black, while free grids are not colored.
[0037] This invention provides a second solution: a grid-based system for modeling the marine environment of ships during navigation, which includes:
[0038] The image acquisition module acquires pixel values of marine environment images during ship navigation;
[0039] The grayscale processing module converts the pixel values of marine environment images of ship navigation to obtain grayscale images;
[0040] The raster granularity calculation module calculates the raster granularity of grayscale images;
[0041] The binarized nautical chart generation module uses a raster granularity to rasterize the marine environment of ship navigation and employs the rectangular coordinate method to generate binarized nautical charts.
[0042] The present invention provides a third solution: an electronic device, wherein a memory stores computer instructions, and a processor is used to run the computer instructions stored in the memory to implement the steps of a method for modeling the marine environment of ship navigation based on a grid network.
[0043] The present invention provides a fourth solution: a computer-readable storage medium storing computer instructions, characterized in that the computer instructions are used to execute the steps of a method for modeling the marine environment of ship navigation based on a grid network.
[0044] Beneficial effects
[0045] Compared with existing technologies, this invention is based on a grid network model and uses a discretization method to represent the rasterized nautical chart in matrix form of 0 and 1 respectively, which simplifies the image processing process and performs binarization processing on the nautical chart, providing a theoretical basis for ship navigation route planning.
[0046] This invention uses a grid network combined with discretization processing to simplify the image processing workflow, directly dividing the marine environment map into navigable and non-navigable waters, making nautical chart processing direct and convenient. Attached Figure Description
[0047] Figure 1 It is a rectangular coordinate grid model;
[0048] Figure 2 Get the effect image for each pixel;
[0049] Figure 3Image showing the pixel value conversion effect;
[0050] Figure 4 The effect of modifying the pixel count;
[0051] Figure 5 These are the pixel value statistics.
[0052] Figure 6 grayscale Figure 2 The resulting image generated by the value conversion. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] Example
[0055] This embodiment specifically provides a method for modeling the marine environment of ships based on grid networks, including:
[0056] Step 1: Obtain pixel values of the marine environment image during ship navigation;
[0057] Step 2: Convert the pixel values of the marine environment image of the ship's navigation to obtain a grayscale image;
[0058] Step 3: Determine the raster granularity of the grayscale image;
[0059] Step 4: Based on the grid granularity, the marine environment of the ship's navigation is rasterized, and a binarized nautical chart is generated using the rectangular coordinate method.
[0060] The above steps involve the following:
[0061] 1. Model Assumptions and Model Initialization
[0062] 1.1 Basic Assumptions of the Model
[0063] When ships plan their navigation routes based on the maritime navigation environment, the global navigation environment needs to be converted into a two-dimensional environmental model that can be recognized by the computer system, i.e., a grid environment model. Due to the highly complex marine environment, the following assumptions are made regarding the grid environment model:
[0064] (1) The waters where the navigation takes place are relatively calm seas, and the effects of wind, waves and currents can be ignored.
[0065] (2) The navigation environment is two-dimensional, and the number, position, shape and size of obstacles are fixed and will not change relative to each other during the ship's navigation.
[0066] (3) Common obstacles in navigable waters include: lighthouses, reefs (including exposed reefs, dry reefs, submerged reefs, and hidden reefs), dangerous shipwrecks, navigation marks, islands, and shallow waters.
[0067] 1.2 Determination of grid granularity
[0068] The idea behind the grid method is to abstract the three-dimensional environment of ship navigation into a two-dimensional environment, and divide the navigation environment on the electronic chart into small grids. The granularity of the grid division should be determined according to the actual situation: if the grid is too small, the constructed environmental chart will be more accurate, but the program execution efficiency will be lower and the memory usage will be larger; if the grid is too large, although the program execution efficiency will be improved, the accuracy of the generated environmental chart will be insufficient. Therefore, determining the grid granularity is an important part of path planning. The grid size needs to be dynamically determined according to the environmental complexity, that is, the proportion of obstacles in the chart. First, the sum of the areas of all obstacles in the chart is calculated, as shown in the following formula (1).
[0069] (1)
[0070] in, For the area of all obstacles, Let be the area of the i-th obstacle.
[0071] The grid size is determined based on the proportion of the obstacle's area in the overall map environment. An estimated obstacle area is calculated by filling irregular obstacles with standard rectangles. The coordinates of all obstacle vertices in a Cartesian coordinate system are then determined. , and then with and If a rectangle is drawn with its diagonal vertices as the basis, then the area of the rectangle is... The granularity of the grid is calculated as shown in equation (2).
[0072] (2)
[0073] In the formula, It is the raster adjustment factor. It is the defined maximum side length of the grid, which is related to obstacle information. It is the minimum side length of the grid, which is generally determined based on the ship's movement step size. It can be seen that when the proportion of obstacles in the environment is low, the complexity of the planned path is low, and the computational load of choosing a smaller grid spacing is still within an acceptable range. When the proportion of obstacles is high and the environment is relatively complex, a relatively larger grid spacing is chosen to avoid excessive computational load in path planning, excessive occupation of system resources, and a decrease in the ship's reaction capability.
[0074] 2. Raster identification and discretization processing
[0075] The global navigation environment is rasterized using a grid method, and the specific process is as follows:
[0076] Assume the horizontal length of the global two-dimensional driving environment is The length in the vertical direction is The side length of each cell grid is If the number of cells is less than one cell, it is treated as one cell. Thus, the two-dimensional driving environment can be divided into a series of cell grids. The total number of cell grids is shown in the following formula (3), which can be expressed as:
[0077] (3)
[0078] In the formula, The number of columns in the cell grid. For the number of rows in the cell grid, This is a rounding up operation; then, each cell is assigned a value. If the i-th cell is an obstacle cell, then the obstacle cell is... Assign a value of 1; if the j-th cell is a free grid, then assign a value of 1 to the free grid. The value is assigned to 0. In the path algorithm implementation, 1 represents unnavigable waters and 0 represents navigable waters. This allows the global navigation environment to be decomposed into many binary cell grids, which are then labeled.
[0079] Grid Labeling: Rectangular Coordinate Method
[0080] Create a Cartesian coordinate system on the 2D grid model, with the lower left corner of the grid model as the origin and the horizontal direction of the grid model as the coordinate axis. The axis is defined by the vertical direction of the grid model. Define axes, and ensure that the cell lengths of both axes are integer multiples of the side lengths of the cell grid. In the created Cartesian coordinate system, any x-axis... The position of each cell grid All can be determined by the corresponding coordinates To determine, using To represent the grid environment model in the Cartesian coordinate system, the mathematical model of the grid environment is as shown in equation (4), which can be expressed as:
[0081] (4)
[0082] In the formula, This indicates that the current grid is a free grid. This indicates that the current grid cell is an obstacle grid cell.
[0083] Cartesian coordinate method grid model such as Figure 1 As shown, Figure 1 The coordinates in the graph are the coordinates of the unit grid. To facilitate the observation and analysis of the grid model, the unit grid with obstacles is represented in black, and the free grid is not colored.
[0084] Discretization
[0085] The processing of nautical charts uses a discretization method to represent them using a matrix. This matrix contains only two numbers: 0 (Free) and 1 (Occupied), representing vacant and occupied waters respectively. In the nautical chart, this represents navigable and non-navigable waters, resulting in a binary raster nautical chart. If... Figure 1 When discretizing nautical charts using Cartesian coordinates, it's important to note that the coordinate positions (x, y) correspond to the row and column coordinates of the discretized matrix. Since the matrix coordinate system originates from the top left corner, while the Cartesian coordinate system originates from the bottom left corner, this is equivalent to inverting the chart vertically.
[0086] The result after discretization is:
[0087] (7)
[0088] Case Analysis
[0089] A rasterized marine environment case study was conducted based on a portion of the nautical charts captured from the Bashi Channel.
[0090] (1) Pixel value acquisition
[0091] The `imread` function and the `whos` command can be used to extract basic information from the read image, and the `imshow` function can be used to display the image, as shown below. Figure 2 As shown.
[0092] (2) Pixel value conversion
[0093] In MATLAB, the `imread` function reads the RGB values of each pixel in an image, resulting in an RGB image. Each pixel value in an RGB image is typically composed of three variables: r, g, and b (0-255). To simplify calculations, we need to convert the RGB image to a grayscale image where each pixel has a single value (0-255). The `rgb2gray` function can be used to convert an RGB image to a grayscale image, as shown below. Figure 3 As shown.
[0094] (3) Determination of grid granularity
[0095] The `imresize` function can be used to change the number of pixels, such as... Change to The final selection is based on the determination of the raster granularity. Spatial resolution. The effect is as follows: Figure 4 As shown.
[0096] (4) Rectangular coordinate method: generation of binary nautical charts
[0097] There are many methods for generating binarized nautical charts. Here, we extract navigable sea area information from grayscale images and generate them through directional transformation.
[0098] Since the `imbinarize` function replaces all values above the global threshold with 1 and sets all other values to 0, it cannot specify a pixel value of 0 and all others as 1. Therefore, the `zeros` function is used to generate an all-zero matrix of the same size as the pixel matrix. The results are obtained by statistically analyzing all pixel values in the nautical chart, as shown below. Figure 5 As shown. Set the pixel value of the navigable sea area to 1, leaving the others unchanged. The generated result is as follows. Figure 6 As shown.
[0099] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0100] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for modeling the marine environment of ships based on grid networks, characterized in that, The modeling method includes the following steps: Step 1: Obtain pixel values of the marine environment image during ship navigation; Step 2: Convert the pixel values of the marine environment image of the ship's navigation to obtain a grayscale image; Step 3: Determine the raster granularity of the grayscale image; Step 4: Based on the grid granularity, the marine environment of the ship's navigation is rasterized, and a binarized nautical chart is generated using the rectangular coordinate method; In step 3, the grid granularity needs to be dynamically determined based on the proportion of obstacles in the marine environment map. The specific process is as follows: Step 301: Calculate the sum of the areas of all obstacles in the marine environment map, as shown in the following formula: (1) in, For the area of all obstacles, Let i be the area of the i-th obstacle; Step 302: Determine the grid size based on the proportion of the area of all obstacles in the entire marine environment image. Calculate the estimated area of the obstacles by filling irregular obstacles with standard rectangles, and find the coordinates of all obstacles in the Cartesian coordinate system. , and then with and If a rectangle is drawn with its diagonal vertices as the basis, then the area of the rectangle is... The granularity of the raster is calculated as shown in the following formula: (2) in, It is the raster adjustment factor. It is the defined maximum side length of the grid, which is related to obstacle information. It is the minimum side length of the grid, determined by the ship's movement step size; The specific steps of step 4 are as follows: Step 401: Divide the two-dimensional navigation environment into a series of cell grids according to the grid granularity; Step 402: Identify the cell grid using the rectangular coordinate method; Step 403: Discretize the two-dimensional navigation environment identified by the rectangular coordinate method, and use a matrix to represent the two-dimensional navigation environment map. The matrix contains only 0 and 1, which represent vacant and occupied waters respectively. In the two-dimensional navigation environment, it represents navigable waters and non-navigable waters, and generates a binary raster chart. The specific process of step 402 is as follows: (1) Create a rectangular coordinate system on the two-dimensional grid environment, with the lower left corner of the two-dimensional grid environment as the origin and the horizontal direction of the two-dimensional grid environment as the coordinate system. The axis is defined by the vertical direction of the two-dimensional grid environment. The axes are defined, and the cell lengths of both axes are integer multiples of the side length of the cell grid. (2) In the created rectangular coordinate system, any first... Position of each cell grid All can be determined by the corresponding coordinates To determine, using To represent a two-dimensional grid environment model in a Cartesian coordinate system, the expression for the two-dimensional grid environment model is as follows: (4) in, This indicates that the current grid is a free grid. This indicates that the current grid cell is an obstacle grid cell; (3) Obstacle grids are represented in black, while free grids are not colored.
2. The method for modeling the marine environment of ships based on grid networks according to claim 1, characterized in that, In step 1, the imread function and the whos command are used to extract the marine environment image of the ship's navigation, and the imshow function is used to display the image.
3. The method for modeling the marine environment of ships based on grid networks according to claim 1, characterized in that, In step 2, the imread function in MATLAB is used to read the RGB value of each pixel in the marine environment image, resulting in an RGB image. The rgb2gray function is then used to convert the RGB image into a grayscale image.
4. A grid-based system for modeling the marine environment of ships, characterized in that, This system is used to implement the ship navigation marine environment modeling method according to any one of claims 1-3, comprising: The image acquisition module acquires pixel values of marine environment images during ship navigation; The grayscale processing module converts the pixel values of marine environment images of ship navigation to obtain grayscale images; The raster granularity calculation module calculates the raster granularity of grayscale images; The binarized nautical chart generation module uses a raster granularity to rasterize the marine environment of ship navigation and employs the rectangular coordinate method to generate binarized nautical charts.
5. An electronic device comprising a processor and a memory, characterized in that, The memory stores computer instructions, and the processor executes the computer instructions stored in the memory to implement the steps of the method as described in any one of claims 1-3.
6. A computer-readable storage medium storing computer instructions, characterized in that, Computer instructions are used to perform the steps of the method as described in any one of claims 1-3.
Citation Information
Patent Citations
Ship path planning method and system based on A star algorithm, and storage medium
CN116360460A