A chart image processing method and device, electronic equipment and readable storage medium
By converting nautical chart images into an HSV color model and utilizing a coordinate registration model to generate nautical chart masks and vector contours, the problem of unstable quality in traditional nautical chart digitization processing is solved, achieving end-to-end automation and high-quality nautical chart image processing.
Patent Information
- Application Number
- CN202611100968.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-08-25
AI Technical Summary
Traditional nautical chart digitization relies on manual and semi-automated tools, resulting in unstable processing quality and a lack of a fully automated architecture.
By converting the color model of the nautical chart image to the HSV color model, a nautical chart mask for the water depth area is generated. The latitude and longitude information of the water area outline is determined using the coordinate registration model, and the nautical chart vector outline is constructed, realizing full-link automated processing.
It has achieved fully automated processing of nautical chart images, improved image processing quality, and shortened the processing time for a single nautical chart image.
Smart Images

Figure CN122636686A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image technology, and in particular relates to a method, apparatus, electronic device and readable storage medium for processing nautical chart images. Background Technology
[0002] Currently, traditional nautical chart digitization processing relies heavily on manual labor and semi-automated tools in stages. Specifically, operators use semi-automated tools to manually delineate depth contours, channel boundaries, and other vector parameters on nautical chart images, then manually input the chart's attribute data and export the formatted files. This results in a lack of end-to-end automation in traditional nautical chart digitization solutions, leading to inconsistent processing quality. Summary of the Invention
[0003] This application provides a nautical chart image processing method, apparatus, electronic device, and readable storage medium, which can solve the problem of unstable processing quality caused by reliance on manual and semi-automatic tools.
[0004] In a first aspect, embodiments of this application provide a nautical chart image processing method, including: Acquire the nautical chart image to be processed; The color model of the nautical chart image to be processed is converted into the HSV color model to obtain the converted nautical chart image. Based on the HSV color of each pixel in the converted nautical chart image, a nautical chart mask for each water depth region is generated. Based on the nautical chart mask for each of the aforementioned water depth regions, extract the corresponding water area contours from the converted nautical chart image; Based on the coordinate registration model, the latitude and longitude information of the water area contour of each water depth region is determined; Based on the latitude and longitude information of each water area contour and the attribute information of the nautical chart image to be processed, a corresponding nautical chart vector contour is constructed.
[0005] In some embodiments, before determining the latitude and longitude information of the water area contour of each water depth region based on the coordinate registration model, the method further includes: Acquire a nautical chart marker image, wherein the nautical chart marker image includes an image region containing preset marker points; The nautical chart mark image is detected, and the preset mark points and corresponding pixel coordinates are extracted; Based on the quadratic polynomial model, the coordinate registration model is determined according to the pixel coordinates and latitude and longitude coordinates of the preset marker points.
[0006] In some embodiments, the coordinate registration model includes a forward registration model and a reverse registration model, wherein the forward registration model includes Lon = a0 + a1·x + a2·y + a3·x 2+a4·x·y+a5·y 2, Lat=b0+b1·x+b2·y+b3·x 2 +b4·x·y+b5·y 2 The reverse registration model includes x = c0 + c1·Lon + c2·Lat + c3·Lon 2 +c4·Lon·Lat+c5·Lat 2 ,y=d0+d1·Lon+d2·Lat+d3·Lon 2 +d4·Lon·Lat+d5·Lat 2 ; Where (x,y) are the pixel coordinates, (Lon,Lat) are the latitude and longitude coordinates, and a, b, c, d are the model fitting coefficients of the coordinate registration model.
[0007] In some embodiments, determining the coordinate registration model based on the pixel coordinates and latitude / longitude coordinates of the preset marker points, according to the quadratic polynomial model, includes: Establish a corresponding coordinate mapping relationship based on the pixel coordinates and latitude and longitude coordinates of the first marker point; Based on the quadratic polynomial model, the initial model is determined according to the coordinate mapping relationship of the first marked point; The initial model is verified using the pixel coordinates and latitude and longitude coordinates of the second marker point to determine the registration error of the second marker point, where the first marker point and the second marker point may be the same or different. If the registration error is less than or equal to a preset error threshold, then the initial model is determined as the coordinate registration model; If the registration error is greater than the preset error threshold, then return to the previous step: establish the corresponding coordinate mapping relationship and subsequent steps based on the pixel coordinates and latitude and longitude coordinates of the first marker point, until the registration error is less than or equal to the preset error threshold.
[0008] In some embodiments, generating a nautical chart mask for each depth region based on the HSV color of each pixel in the converted nautical chart image includes: Based on a preset water depth color scheme, at least one initial mask is generated according to the HSV color of each pixel in the converted nautical chart image. Morphological opening and closing operations are performed on each of the initial masks to eliminate noise and complete the fracture boundaries, thereby obtaining the nautical chart masks for each of the water depth regions.
[0009] In some embodiments, detecting the nautical chart marker image and extracting the preset marker points and their corresponding pixel coordinates includes: Extract the contour information of the nautical chart marker image; The circularity of the outline information of the nautical chart mark image is calculated to obtain a circular outline; Based on preset filtering conditions, the circular outline is filtered to obtain the preset marker points; The pixel coordinates of the preset marker point are determined based on the cross mark in the preset marker point, wherein the preset marker point is a circular control point with a cross mark.
[0010] In some embodiments, constructing the corresponding nautical chart vector contour based on the latitude and longitude information of each of the water area contours and the attribute information of the nautical chart image to be processed includes: Based on the latitude and longitude information of each water area outline, a vector geometric data file is generated; Generate a geographic attribute data file based on the attribute information of the nautical chart image to be processed; Generate a nautical chart data file based on the vector geometric data file and the geographic attribute data file; The nautical chart data file is parsed to construct the nautical chart vector outline.
[0011] Secondly, embodiments of this application provide a nautical chart image processing apparatus, comprising: The acquisition module is used to acquire the nautical chart image to be processed; The conversion module is used to convert the color model of the nautical chart image to be processed into the HSV color model to obtain the converted nautical chart image; The water area contour generation module is used to generate a nautical chart mask for each water depth region based on the HSV color of each pixel in the converted nautical chart image. It is also used to extract the corresponding water area contours in the converted nautical chart image based on the nautical chart mask of each of the water depth regions; The nautical chart vector contour construction module is used to determine the latitude and longitude information of the water area contour of each water depth region based on the coordinate registration model; It is also used to construct corresponding nautical chart vector contours based on the latitude and longitude information of each of the water area contours and the attribute information of the nautical chart image to be processed.
[0012] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method as described in any one of the first aspects above.
[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in any one of the first aspects above.
[0014] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any one of the first aspects above.
[0015] The beneficial effects of the embodiments in this application compared with the prior art are: This application embodiment converts the color model of the nautical chart image to be processed into an HSV color model to obtain a converted nautical chart image. Based on the HSV color of each pixel in the converted nautical chart image, a nautical chart mask for each water depth region is generated, enabling accurate identification of water depth regions based on the HSV color of each pixel. Based on the nautical chart mask for each water depth region, the corresponding water area contour is extracted from the converted nautical chart image, enabling accurate identification of the contour of each water depth region. Based on a coordinate registration model, the latitude and longitude information of the water area contour for each water depth region is determined, enabling accurate acquisition of the latitude and longitude information of the contour of each water depth region. Based on the latitude and longitude information of each water area contour and the attribute information of the nautical chart image to be processed, a corresponding nautical chart vector contour is constructed, realizing the construction of the nautical chart vector contour and achieving fully automated processing of nautical chart images, ensuring image processing quality.
[0016] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of the nautical chart image processing method provided in the embodiments of this application; Figure 2 This is an example diagram of the water area outline provided in the embodiments of this application; Figure 3 This is an example diagram of the nautical chart vector outline provided in the embodiments of this application; Figure 4 This is an example diagram of the preset marker points provided in the embodiments of this application; Figure 5a This is an example diagram showing the pixel coordinates of the first marker point provided in an embodiment of this application; Figure 5b This is an example diagram of the latitude and longitude coordinates of the first marker point provided in the embodiments of this application; Figure 6This is a schematic diagram of the structure of the nautical chart image processing device provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0020] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0021] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0023] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0025] In some embodiments, Figure 1 This is a schematic diagram of the first flowchart of the nautical chart image processing method provided in the embodiments of this application. For example... Figure 1 As shown, the method includes: S11: Obtain the nautical chart image to be processed.
[0026] In the application, after capturing the nautical chart video stream in real time using a camera device, the video stream is decoded and preprocessed. Then, key frames in the video stream are selected as the nautical charts to be processed.
[0027] In some implementations, features are extracted from each frame of the nautical chart video stream. When the similarity between the current frame and its adjacent frames is less than a similarity threshold, a scene transition is determined, and the current frame is identified as a keyframe.
[0028] S12: Convert the color model of the nautical chart image to be processed into the HSV color model to obtain the converted nautical chart image.
[0029] In the application, based on the brightness of the blue, green and red of each pixel in the nautical chart image to be processed, the blue, green and red of each pixel are decomposed into hue, saturation and lightness, thereby converting the color model of the nautical chart image to be processed into the HSV color model and obtaining the converted nautical chart image.
[0030] The HSV color model refers to a three-dimensional color space consisting of hue, saturation, and lightness.
[0031] S13: Generate a nautical chart mask for each water depth region based on the HSV color of each pixel in the converted nautical chart image.
[0032] In some implementations, step S13: generating a nautical chart mask for each depth region based on the HSV color of each pixel in the converted nautical chart image, including: S131: Based on the preset water depth color scheme, generate at least one initial mask according to the HSV color of each pixel in the converted nautical chart image.
[0033] In the application, for each pixel, the HSV color is analyzed to determine its corresponding water depth range. A mask corresponding to the water depth is then set at its location based on a preset water depth color scheme. When masks are generated at the locations of each pixel, initial masks for each water depth region are created. For example, the preset water depth color scheme can be: land color scheme: brown, light brown; intertidal zone color scheme: yellow, light green; shallow water area: 5-level water depth color scheme; blank area: 10-level brightness color scheme.
[0034] S132: Perform morphological opening and closing operations on each initial mask, eliminate noise, and complete the fracture boundary processing to obtain the nautical chart mask for each water depth region.
[0035] In the application, for each initial mask, a morphological opening operation (erosion followed by dilation) is performed to eliminate isolated noise points. Then, a closing operation (dilation followed by erosion) is performed to connect and fill broken boundaries, resulting in an optimized mask with smooth boundaries and internal coherence. After all initial masks have been processed, nautical chart masks for each water depth region are obtained.
[0036] S14: Extract the corresponding water area contours from the converted nautical chart image based on the nautical chart mask for each water depth region.
[0037] In the application, the water area contours of each water depth area are extracted based on the nautical chart mask of each water depth area.
[0038] Figure 2 This is an example diagram of the water area outline provided in an embodiment of this application. Figure 2 As shown, brown and light brown represent land, yellow and light green represent intertidal zones, different shades of blue represent shallow water areas, and different brightness levels of white represent blank areas.
[0039] S15: Based on the coordinate registration model, determine the latitude and longitude information of the water area contour in each water depth region.
[0040] In the application, the pixel coordinates of the water area contours for each water depth region are obtained. Based on the standard model, the pixel coordinates of the water area contours for each water depth region are converted into latitude and longitude coordinates, thereby obtaining the latitude and longitude information of the water area contours for each water depth region.
[0041] S16: Construct the corresponding nautical chart vector contour based on the latitude and longitude information of the water area outline and the attribute information of the nautical chart image to be processed.
[0042] In some embodiments, step S16: Constructing a corresponding nautical chart vector contour based on the latitude and longitude information of the water area contour and the attribute information of the nautical chart image to be processed, including: S161: Generate vector geometric data files based on the contour information of each water area.
[0043] In the application, the contour information of each water area is written into the corresponding standard file according to the required standard format specifications to generate vector geometric data files.
[0044] S162: Generate a geographic attribute data file based on the attribute information of the nautical chart image to be processed.
[0045] In the application, the attribute information of the nautical chart image to be processed is written into the corresponding standard file according to the required standard format specifications to generate a geographic attribute data file.
[0046] Among them, attribute information includes attribute information of local features.
[0047] S163: Generate nautical chart data files based on vector geometric data files and geographic attribute data files.
[0048] In the application, a nautical chart data file containing coordinate system, field definitions, geometric features, and attribute information is generated based on the vector geometric data file and the geographic attribute data file.
[0049] By generating files in various standard formats, it is possible to interface with existing software and achieve fully automated processing.
[0050] S164: Parse the nautical chart data file and construct the nautical chart vector outline.
[0051] In the application, the target software is used to parse the nautical chart data file and reconstruct the vector outline of the digital nautical chart. Figure 3 This is an example diagram of the nautical chart vector outline provided in an embodiment of this application. For example... Figure 3 As shown, different colored areas correspond to the outlines of different water depth areas.
[0052] For example, the program that generates the file is as follows: # MIF Template mif_content = f"""Version 300 Charset "WindowsSimpChinese" Delimiter "," CoordSys Earth Projection 1, 104 Columns {len(columns)} {column_definitions} Data Pline {point_count} {point_coordinates}""" # MID Attribute mid_content = f"{id},{name},{type},{point_count}\n" This application embodiment converts the color model of the nautical chart image to be processed into an HSV color model to obtain a converted nautical chart image. Based on the HSV color of each pixel in the converted nautical chart image, a nautical chart mask for each water depth region is generated, enabling accurate identification of water depth regions based on the HSV color of each pixel. Based on the nautical chart mask for each water depth region, the corresponding water area contour is extracted from the converted nautical chart image, enabling accurate identification of the contour of each water depth region. Based on the coordinate registration model, the latitude and longitude information of the water area contour for each water depth region is determined, enabling accurate acquisition of the latitude and longitude information of the contour of each water depth region. Based on the contour information of each water area contour and the attribute information of the nautical chart image to be processed, the corresponding nautical chart vector contour is constructed, realizing the construction of the nautical chart vector contour and achieving fully automated processing of nautical chart images, ensuring image processing quality.
[0053] It is understandable that achieving fully automated processing of nautical chart images, vectorizing nautical chart images, and shortening the processing time for a single nautical chart image are all possible. Furthermore, the high-quality processing results obtained by the methods described in the embodiments of this application can be applied to the fields of marine surveying, navigation, and digital chart production.
[0054] In some embodiments, before step S15: determining the latitude and longitude information of the water area contour for each water depth region based on the coordinate registration model, the method further includes: S21: Obtain nautical chart marker images.
[0055] The nautical chart marker image includes the image area of preset marker points.
[0056] In this application, preset marker points are set on the water surface, and the corresponding latitude and longitude information of these marker points is recorded. After capturing the nautical chart video stream in real time using a camera device, the video stream is decoded and preprocessed. Then, video frames containing the preset marker points are selected as the nautical chart marker images.
[0057] The nautical chart video stream used to acquire the nautical chart mark image and the nautical chart video stream used to acquire the nautical chart image to be processed may be the same or different.
[0058] S22: Detect the nautical chart marker image and extract the preset marker points and their corresponding pixel coordinates.
[0059] In some implementations, step S22: Detecting the nautical chart marker image and extracting preset marker points and their corresponding pixel coordinates includes: S221: Extract the contour information of the nautical chart marker image.
[0060] In the application, after grayscale and adaptive binarization processing of the nautical chart mark image, the contour extraction method is used to extract the full contour of the nautical chart mark image and obtain the corresponding contour information.
[0061] The contour information of the nautical chart marker image includes not only the contours of the preset marker points, but also the contours of other features besides the preset marker points.
[0062] S222: Calculate the circularity of the outline information of the nautical chart mark image to obtain a circular outline.
[0063] Among them, the preset marker point is a circular control point with a cross mark.
[0064] In application, the contour circularity calculation is used to process the contour information of the nautical chart mark image and calculate the circularity of each contour.
[0065] S223: Based on preset filtering conditions, filter the circular outline to obtain preset marker points.
[0066] In the application, preset filtering conditions are used to filter target circular contours that meet preset roundness. Among the target circular contours, valid circular contours with a radius greater than a preset radius threshold are then selected. These valid circular contours are then designated as preset marker points.
[0067] By using both circularity and radius of circle as filters, preset marker points can be accurately identified, thus improving the accuracy of their recognition.
[0068] Example of a program for detecting nautical chart marker images: # Grayscale + OTSU Binarization gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) binary = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV |cv2.THRESH_OTSU) # Contour Extraction contours, hierarchy = cv2.findContours(binary, cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE) # Circular Filter For contour in contours: area = cv2.contourArea(contour) perimeter = cv2.arcLength(contour, True) circularity = 4 * np.pi * area / (perimeter * perimeter) If 0.7 <= circularity <= 0.8: (x, y), radius = cv2.minEnclosingCircle(contour) circle_center = (int(x), int(y)) S224: Determine the pixel coordinates of the preset marker point based on the crosshair in the preset marker point.
[0069] Among them, the preset marker point is a circular control point with a cross mark. Figure 4 This is an example diagram of preset marker points provided in the embodiments of this application. For example... Figure 4 As shown, the blue circular icon with a cross inside is the preset marker point.
[0070] In application, contour analysis or line segment extraction methods can be used to process preset marker points and extract structures that satisfy the geometric feature of "two approximately equal-length line segments intersecting perpendicularly at the center point". This structure is identified as a cross marker, and then the intersection point of the cross marker is calculated to obtain the pixel coordinates of the cross's center point.
[0071] S23: Based on the quadratic polynomial model, determine the coordinate registration model according to the pixel coordinates and latitude and longitude coordinates of the preset marker points.
[0072] In some implementations, step S23: Based on a quadratic polynomial model, determine the coordinate registration model according to the pixel coordinates and latitude and longitude coordinates of the preset marker points, including: S231: Establish the corresponding coordinate mapping relationship based on the pixel coordinates and latitude and longitude coordinates of the first marker point.
[0073] In the application, preset marker points are automatically sorted according to preset sorting rules to obtain the sorted preset marker points. (Continue referring to...) Figure 4 ,like Figure 4 The numbers marked on the circular icons shown are the sorted results. For example, the default sorting rule is from left to right and from top to bottom.
[0074] For example, a program that automatically sorts according to preset sorting rules is as follows: def sort_circles(circles): """In the same row within 30 pixels of the Y coordinate, sorted in ascending order by X.""" return sorted(circles, key=lambda c: (c['center'][1] / / 30, c['center'][0])) Import the latitude and longitude file beforehand to obtain the latitude and longitude coordinates of the sorted preset marker points. Obtain the first marker point from the preset marker points, along with its pixel coordinates and latitude and longitude coordinates, and establish a coordinate mapping relationship. That is, the coordinate mapping relationship includes the pixel coordinates and latitude and longitude coordinates of points belonging to the same first marker point.
[0075] Figure 5a This is an example diagram showing the pixel coordinates of the first marker point provided in an embodiment of this application. For example... Figure 5a As shown in the figure, the red control points with serial numbers represent the first marker points, and the location information of the points represents the pixel coordinates. Figure 5b This is an example diagram of the latitude and longitude coordinates of the first marker point provided in an embodiment of this application. For example... Figure 5b As shown in the figure, the blue control points with serial numbers represent the first marker points, and the location information of the points represents their latitude and longitude coordinates.
[0076] S232: Based on the quadratic polynomial model, determine the initial model according to the coordinate mapping relationship of the first marked point.
[0077] In the application, based on the quadratic polynomial model, multiple quadratic polynomials are established according to the coordinate mapping relationship of the first marker point. The quadratic polynomial of the first marker point is solved and fitted to obtain an initial model for pixel coordinate and latitude / longitude coordinate transformation.
[0078] In some implementations, the first marker point is greater than a preset number. The preset number is set according to the fitting accuracy requirements of the actual scenario to ensure fitting accuracy.
[0079] In some implementations, the initial model includes a forward registration model and a backward registration model. The forward registration model is used to convert pixel coordinates into latitude and longitude coordinates. The backward registration model is used to restore the latitude and longitude coordinates back to pixel coordinates.
[0080] An example of a quadratic polynomial fitting model for pixel coordinate and latitude / longitude coordinate transformation is as follows: def fit_polynomial(pixel_points, geo_points, degree=2): def build_features(x, y, deg): features = [] for i in range(deg + 1): for j in range(deg + 1 - i): features.append((x ** i) * (y ** j)) return features A = np.array([build_features(x, y, degree) for x, y in pixel_points]) coeffs_lon = np.linalg.lstsq(A, geo_points[:, 0], rcond=None)[0] coeffs_lat = np.linalg.lstsq(A, geo_points[:, 1], rcond=None)[0] return coeffs_lon, coeffs_lat S233: Use the pixel coordinates and latitude and longitude coordinates of the second marker point to verify the initial model and determine the registration error of the second marker point.
[0081] The first marker point may be the same as or different from the second marker point.
[0082] In the application, to obtain an accurate model for pixel coordinate and latitude / longitude coordinate transformation, the accuracy of the initial model is verified. A second marker point is obtained from the preset marker points, along with its pixel and latitude / longitude coordinates. These coordinates are then used in the forward and reverse registration models to verify the initial model, and the registration error of the second marker point is calculated.
[0083] In some implementations, the root mean square error (RMSE) of the initial model is calculated based on the validation results. This RMSE is then used as the registration error.
[0084] S234: If the registration error is less than or equal to the preset error threshold, the initial model is determined as the coordinate registration model.
[0085] In application, when the registration error is less than or equal to the preset error threshold, it means that the current initial model meets the accuracy requirements of marine navigation, and the current model is determined as the coordinate registration model.
[0086] S235: If the registration error is greater than the preset error threshold, then establish the corresponding coordinate mapping relationship and subsequent steps based on the pixel coordinates and latitude and longitude coordinates of the first marker point until the registration error is less than or equal to the preset error threshold.
[0087] In application, when the registration error is greater than the preset error threshold, it means that the current initial model cannot meet the accuracy requirements of maritime navigation. It is necessary to reacquire the first marker point and its pixel coordinates and latitude and longitude coordinates, re-establish and verify the new initial model, until the registration error is less than or equal to the preset error threshold, and obtain a model that meets the accuracy requirements of maritime navigation.
[0088] In some implementations, the coordinate registration model includes a forward registration model and a backward registration model. The forward registration model includes Lon = a0 + a1·x + a2·y + a3·x 2 +a4·x·y+a5·y 2 Lat = b0 + b1·x + b2·y + b3·x 2 +b4·x·y+b5·y 2 The reverse registration model includes x = c0 + c1·Lon + c2·Lat + c3·Lon 2 +c4·Lon·Lat+c5·Lat 2 ,y=d0+d1·Lon+d2·Lat+d3·Lon 2 +d4·Lon·Lat+d5·Lat 2 ; Where (x,y) are pixel coordinates, (Lon,Lat) are latitude and longitude coordinates, and a, b, c, d are model fitting coefficients of the coordinate registration model.
[0089] In application, the coordinate registration model converts the pixel coordinates corresponding to the contour into latitude and longitude coordinates, and then converts those latitude and longitude coordinates back into pixel coordinates. Then, it calculates the registration error and performs cross-validation to reduce coordinate conversion anomalies.
[0090] By establishing a coordinate registration model using a second-order quadratic polynomial, the coordinate registration model can adapt to various nonlinear distortions, thereby improving the coordinate registration accuracy to the sub-meter level.
[0091] This application embodiment detects nautical chart marker images and extracts preset marker points and their corresponding pixel coordinates; based on a quadratic polynomial model, a coordinate registration model is determined according to the pixel coordinates and latitude and longitude coordinates of the preset marker points, thereby realizing the conversion between pixel coordinates and latitude and longitude coordinates of the nautical chart image, achieving automated coordinate conversion without manual operation.
[0092] In some embodiments, after step S13: generating a nautical chart mask for each depth region based on the HSV color of each pixel in the converted nautical chart image, the method further includes: Acquire satellite remote sensing data corresponding to the nautical chart image to be processed; generate remote sensing masks for each water depth region based on the multispectral information in the satellite remote sensing data.
[0093] Acquire the ship detection data corresponding to the nautical chart image to be processed; generate detection masks for each water depth region based on the water depth information of the ship detection data.
[0094] The water depth zones are determined based on nautical chart masks, remote sensing masks, and sounding masks.
[0095] The quality indicators for each water depth area are determined based on the nautical charts to be processed, satellite remote sensing data, and ship detection data.
[0096] Specifically, for each pixel, the water depth values corresponding to the nautical chart mask, remote sensing mask, and ship detection mask are weighted and fused to obtain the final water depth value. Water depth regions are then determined based on the final water depth values of each pixel. Finally, the quality indicators of the nautical chart, satellite remote sensing data, and ship detection data at each pixel are calculated.
[0097] The quality indicators are determined based on spatial consistency, time freshness, accuracy of data acquisition equipment, and deviation of historical data.
[0098] Spatial consistency characterizes the gradient between a pixel and its neighboring pixels. A sudden change in gradient indicates low spatial consistency, while a stable gradient indicates high spatial consistency. Time freshness characterizes the data acquisition time. Later acquisition time results in higher time freshness, while earlier acquisition time results in lower time freshness. Data acquisition equipment refers to devices that collect nautical charts, satellite remote sensing data, and ship survey data to be processed. Historical data bias is based on the accuracy deviation of historical data collected by each data acquisition device.
[0099] In some implementations, spatial consistency, temporal freshness, accuracy of data acquisition equipment, and historical data deviation are weighted and fused to obtain quality indicators.
[0100] Based on the quality indicators of each water depth region, the areas to be optimized are determined. The quality indicators of the areas to be optimized are lower than the preset quality threshold.
[0101] Obtain ship wake images of the area to be optimized; perform inversion based on ship wake images to obtain the target water depth value of the area to be optimized.
[0102] In some implementations, wake features are extracted from ship wake images, such as wake opening angle, wake length, and wake attenuation rate, and the target water depth of the area to be optimized is determined based on these wake features.
[0103] In some implementations, a correlation can be established between wake characteristics and water depth values, thereby determining the target water depth value for the area to be optimized based on the wake characteristics. Alternatively, a model can be trained based on wake characteristics and water depth values, and the model can then be used to predict the target water depth value based on the wake characteristics.
[0104] Based on the target water depth value of the area to be optimized, each water depth region is optimized to obtain the optimized water depth region. Then, the water body contour of the optimized water depth region is extracted. Based on the coordinate registration model, the latitude and longitude information of the water body contour of the optimized water depth region is determined.
[0105] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, the data collection in the above embodiments is compliant, and its use or implementation does not involve any infringement upon public interests.
[0106] For ease of explanation, only the parts related to the embodiments of this application are shown in the methods described in the above embodiments.
[0107] In some embodiments, Figure 6 This is a schematic diagram of the structure of the nautical chart image processing device provided in the embodiments of this application. Figure 6 As shown, the device includes: The acquisition module 10 is used to acquire the nautical chart image to be processed.
[0108] The conversion module 11 is used to convert the color model of the nautical chart image to be processed into the HSV color model to obtain the converted nautical chart image.
[0109] The water area contour generation module 12 is used to generate a nautical map mask for each water depth area based on the HSV color of each pixel in the converted nautical map image. It is also used to extract the corresponding water area contours from the converted nautical chart image based on the nautical chart mask for each water depth region.
[0110] The nautical chart vector contour construction module 13 is used to determine the latitude and longitude information of the water area contour in each water depth region based on the coordinate registration model; It is also used to construct the corresponding nautical chart vector contour based on the latitude and longitude information of the water area contour and the attribute information of the nautical chart image to be processed.
[0111] In some embodiments, the apparatus further includes: The model building module is used to acquire nautical chart marker images, which include image regions of preset marker points; to detect the nautical chart marker images and extract the preset marker points and their corresponding pixel coordinates; and to determine the coordinate registration model based on a quadratic polynomial model, according to the pixel coordinates and latitude and longitude coordinates of the preset marker points.
[0112] In some embodiments, the model building module is specifically used to establish a corresponding coordinate mapping relationship based on the pixel coordinates and latitude and longitude coordinates of the first marker point; determine an initial model based on the coordinate mapping relationship of the first marker point using a quadratic polynomial model; verify the initial model using the pixel coordinates and latitude and longitude coordinates of the second marker point to determine the registration error of the second marker point, whether the first marker point and the second marker point are the same or different; if the registration error is less than or equal to a preset error threshold, then the initial model is determined as a coordinate registration model; if the registration error is greater than the preset error threshold, then return to execute: establish a corresponding coordinate mapping relationship based on the pixel coordinates and latitude and longitude coordinates of the first marker point and subsequent steps, until the registration error is less than or equal to the preset error threshold.
[0113] In some embodiments, the model building module is specifically used to extract the contour information of the nautical chart mark image; calculate the circularity based on the contour information of the nautical chart mark image to obtain a circular contour; filter the circular contour based on preset filtering conditions to obtain preset marker points; and determine the pixel coordinates of the preset marker points based on the cross mark in the preset marker points, wherein the preset marker points are circular control points with cross marks.
[0114] In some embodiments, the water area contour generation module is specifically used to generate at least one initial mask based on a preset water depth color scheme and the HSV color of each pixel in the converted nautical chart image; perform morphological opening and closing operations on each initial mask, eliminate noise, and complete the fracture boundary processing to obtain the nautical chart mask for each water depth region.
[0115] In some embodiments, the nautical chart vector contour construction module is specifically used to generate vector geometric data files based on the latitude and longitude information of each water area contour; generate geographic attribute data files based on the attribute information of the nautical chart image to be processed; generate nautical chart data files based on the vector geometric data files and geographic attribute data files; and parse the nautical chart data files to construct the nautical chart vector contour.
[0116] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 2 of this embodiment includes: at least one processor 20 ( Figure 7 (Only one is shown in the diagram), memory 21, and computer program 22 stored in said memory 21 and executable on said at least one processor 20, wherein said processor 20 executes said computer program 22 to implement the steps in any of the above method embodiments.
[0117] The electronic device 2 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 2 may include, but is not limited to, a processor 20 and a memory 21. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 2 and does not constitute a limitation on electronic device 2. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0118] The processor 20 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0119] In some embodiments, the memory 21 may be an internal storage unit of the electronic device 2, such as a hard disk or memory of the electronic device 2. In other embodiments, the memory 21 may be an external storage device of the electronic device 2, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 2. Furthermore, the memory 21 may include both internal and external storage units of the electronic device 2. The memory 21 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 21 can also be used to temporarily store data that has been output or will be output.
[0120] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0122] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.
[0123] This application provides a computer program product that, when run on an electronic device, enables the electronic device to implement the steps described in the various method embodiments above.
[0124] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some cases, the computer-readable medium cannot be an electrical carrier signal or a telecommunication signal.
[0125] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0126] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0127] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0128] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0129] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for processing nautical chart images, characterized in that, include: Acquire the nautical chart image to be processed; The color model of the nautical chart image to be processed is converted into the HSV color model to obtain the converted nautical chart image. Based on the HSV color of each pixel in the converted nautical chart image, a nautical chart mask for each water depth region is generated. Based on the nautical chart mask for each of the aforementioned water depth regions, extract the corresponding water area contours from the converted nautical chart image; Based on the coordinate registration model, the latitude and longitude information of the water area contour of each water depth region is determined; Based on the latitude and longitude information of each water area contour and the attribute information of the nautical chart image to be processed, a corresponding nautical chart vector contour is constructed; Before determining the latitude and longitude information of the water area contour in each water depth region based on the coordinate registration model, the method further includes: Acquire a nautical chart marker image, wherein the nautical chart marker image includes an image region containing preset marker points; The nautical chart mark image is detected, and the preset mark points and corresponding pixel coordinates are extracted; Based on the quadratic polynomial model, the coordinate registration model is determined according to the pixel coordinates and latitude and longitude coordinates of the preset marker points.
2. The method according to claim 1, characterized in that, The coordinate registration model includes a forward registration model and a reverse registration model. The forward registration model includes Lon = a0 + a1·x + a2·y + a3·x 2 +a4·x·y+a5·y 2 Lat = b0 + b1·x + b2·y + b3·x 2 +b4·x·y+b5·y 2 The reverse registration model includes x = c0 + c1·Lon + c2·Lat + c3·Lon 2 +c4·Lon·Lat+c5·Lat 2 ,y=d0+d1·Lon+d2·Lat+d3·Lon 2 +d4·Lon·Lat+d5·Lat 2 ; Where (x,y) are the pixel coordinates, (Lon,Lat) are the latitude and longitude coordinates, and a, b, c, d are the model fitting coefficients of the coordinate registration model.
3. The method according to claim 1, characterized in that, The method of determining the coordinate registration model based on the quadratic polynomial model, according to the pixel coordinates and latitude and longitude coordinates of the preset marker points, includes: Establish a corresponding coordinate mapping relationship based on the pixel coordinates and latitude and longitude coordinates of the first marker point; Based on the quadratic polynomial model, the initial model is determined according to the coordinate mapping relationship of the first marked point; The initial model is verified using the pixel coordinates and latitude and longitude coordinates of the second marker point to determine the registration error of the second marker point, where the first marker point and the second marker point may be the same or different. If the registration error is less than or equal to a preset error threshold, then the initial model is determined as the coordinate registration model; If the registration error is greater than the preset error threshold, then return to the previous step: establish the corresponding coordinate mapping relationship and subsequent steps based on the pixel coordinates and latitude and longitude coordinates of the first marker point, until the registration error is less than or equal to the preset error threshold.
4. The method according to any one of claims 1 to 3, characterized in that, The step of generating a nautical chart mask for each depth region based on the HSV color of each pixel in the converted nautical chart image includes: Based on a preset water depth color scheme, at least one initial mask is generated according to the HSV color of each pixel in the converted nautical chart image. Morphological opening and closing operations are performed on each of the initial masks to eliminate noise and complete the fracture boundaries, thereby obtaining the nautical chart masks for each of the water depth regions.
5. The method according to claim 4, characterized in that, The step of detecting the nautical chart marker image and extracting the preset marker points and their corresponding pixel coordinates includes: Extract the contour information of the nautical chart marker image; The circularity of the outline information of the nautical chart mark image is calculated to obtain a circular outline; Based on preset filtering conditions, the circular outline is filtered to obtain the preset marker points; The pixel coordinates of the preset marker point are determined based on the cross mark in the preset marker point, wherein the preset marker point is a circular control point with a cross mark.
6. The method according to claim 5, characterized in that, The step of constructing corresponding nautical chart vector contours based on the latitude and longitude information of each of the water area contours and the attribute information of the nautical chart image to be processed includes: Based on the latitude and longitude information of each water area outline, a vector geometric data file is generated; Generate a geographic attribute data file based on the attribute information of the nautical chart image to be processed; Generate a nautical chart data file based on the vector geometric data file and the geographic attribute data file; The nautical chart data file is parsed to construct the nautical chart vector outline.
7. A nautical chart image processing device, characterized in that, include: The acquisition module is used to acquire the nautical chart image to be processed; The conversion module is used to convert the color model of the nautical chart image to be processed into the HSV color model to obtain the converted nautical chart image; The water area contour generation module is used to generate a nautical chart mask for each water depth region based on the HSV color of each pixel in the converted nautical chart image. It is also used to extract the corresponding water area contours in the converted nautical chart image based on the nautical chart mask of each of the water depth regions; The nautical chart vector contour construction module is used to determine the latitude and longitude information of the water area contour of each water depth region based on the coordinate registration model; It is also used to construct corresponding nautical chart vector contours based on the latitude and longitude information of each of the water area contours and the attribute information of the nautical chart image to be processed; The model building module is used to acquire nautical chart marker images, which include image regions of preset marker points; It is also used to detect the nautical chart mark image and extract the preset mark points and their corresponding pixel coordinates; It is also used to determine the coordinate registration model based on a quadratic polynomial model, according to the pixel coordinates and latitude and longitude coordinates of the preset marker points.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.