CN110717924A - Ship water gauge marking recognition method and device, computer equipment and storage medium - Google Patents

Ship water gauge marking recognition method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110717924A
CN110717924A CN201910926459.7A CN201910926459A CN110717924A CN 110717924 A CN110717924 A CN 110717924A CN 201910926459 A CN201910926459 A CN 201910926459A CN 110717924 A CN110717924 A CN 110717924A
Authority
CN
China
Prior art keywords
water gauge
image
ship
water
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910926459.7A
Other languages
Chinese (zh)
Inventor
张程程
卢浩
杜彬
黄峰
薛勇新
杨宝军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huanghua Port Branch Of China Inspection And Certification Group Hebei Co Ltd
Original Assignee
Huanghua Port Branch Of China Inspection And Certification Group Hebei Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huanghua Port Branch Of China Inspection And Certification Group Hebei Co Ltd filed Critical Huanghua Port Branch Of China Inspection And Certification Group Hebei Co Ltd
Priority to CN201910926459.7A priority Critical patent/CN110717924A/en
Publication of CN110717924A publication Critical patent/CN110717924A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words

Abstract

The application provides a ship water gauge marking identification method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a ship water gauge image of a target ship; according to a pre-trained font recognition library, recognizing water gauge scale data in a ship water gauge image; carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines; determining a water level line according to the plurality of straight lines and the water gauge scale data; and determining the reading of the water gauge marking according to the water gauge scale data and the water level line. The method realizes the automatic identification of the water gauge marking of the ship, can greatly improve the identification efficiency of the water gauge marking, and saves the labor cost.

Description

Ship water gauge marking recognition method and device, computer equipment and storage medium
Technical Field
The application relates to the technical field of water gauge measurement, in particular to a method and a device for identifying a marking of a ship water gauge, computer equipment and a storage medium.
Background
Along with the continuous development of coastal city coastline resources and the continuous increase of the external dependence of domestic resource bulk cargo, the bulk cargo import quantity is increased rapidly, and the water gauge weighing is used as a measuring mode for weighing the quantity and the weight of bulk cargo, and the function of the water gauge weighing is increasingly prominent. An important factor influencing the metering accuracy in the water gauge weighing is the reading of the values of the six-side draught of the ship.
At present, draft values of ships are mostly obtained by depending on inspection personnel to stand on a bank to observe a water gauge, take a boat to observe the water gauge and climb a hanging ladder to observe the water gauge; or recording a video of the water gauge by using the DV, and observing the water gauge by the video to obtain the video; or the water gauge is observed by using a remote control unmanned ship or an unmanned aerial vehicle. However, the above observation methods all need to rely on the inspection personnel to manually read the reading of the water gauge. The influence of subjective factors of inspectors is easily caused when the draft value is obtained, meanwhile, the obtaining efficiency is relatively poor, and the obtaining cost is relatively high.
Therefore, a method for automatically identifying the water gauge mark is needed.
Disclosure of Invention
The embodiment of the application provides a ship water gauge marking identification method, a ship water gauge marking identification device, computer equipment and a storage medium, and aims to solve the problem that the identification method in the prior art is high in labor cost.
The embodiment of the application provides a method for identifying a water gauge marking of a ship, which comprises the following steps: acquiring a ship water gauge image of a target ship; according to a pre-trained font recognition library, recognizing water gauge scale data in a ship water gauge image; carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines; determining a water level line according to the plurality of straight lines and the water gauge scale data; and determining the reading of the water gauge marking according to the water gauge scale data and the water level line.
In one embodiment, the method for recognizing the water gauge scale data in the ship water gauge image according to the pre-trained font recognition library comprises the following steps: processing the ship water gauge image to obtain a binary image containing water gauge scales; carrying out image segmentation on the binary image to obtain a plurality of digital images; and determining the water scale data corresponding to each digital image in the plurality of digital images according to a pre-trained font recognition library.
In one embodiment, processing the ship water gauge image to obtain a binary image containing water gauge scales comprises: carrying out graying processing on the ship water gauge image to obtain a grayscale image; performing median filtering processing on the gray level image to obtain a filtered gray level image; carrying out corrosion and expansion operations on the filtered gray-scale image to obtain a gray-scale image subjected to corrosion expansion; and carrying out binarization processing on the corroded and expanded gray scale image to obtain a binarized image, wherein the binarized image comprises water gauge scales.
In one embodiment, performing edge detection on the ship water gauge image to obtain a plurality of straight lines includes: carrying out graying processing on the ship water gauge image to obtain a grayscale image; and carrying out edge detection on the gray-scale image to obtain a plurality of straight lines, wherein the straight lines comprise water lines.
In one embodiment, determining the water line from the plurality of lines and the water gauge scale data comprises: determining a horizontal included angle of each straight line in the plurality of straight lines; screening at least one target straight line of which the horizontal included angle meets a preset condition from the plurality of straight lines; determining the position of the central line of the water gauge scale data; determining the position of an intersection point of each target straight line and the central line in at least one target straight line; and determining the water level line from at least one target straight line according to the position of the intersection point of each target straight line and the central line.
In one embodiment, determining a reading of a water gauge mark from the water gauge scale data and the water level line comprises: determining the font size and font position of each number on the water gauge according to the water gauge scale data; and determining the reading of the water gauge marking according to the position of the intersection point of the water line and the central line and the font size and the font position of each number.
In one embodiment, the vessel water gauge image comprises vessel water gauge images at a plurality of moments in time; correspondingly, according to a pre-trained font recognition library, recognizing ship water gauge images at multiple moments to obtain the readings of multiple water gauge marked lines; after obtaining readings for the plurality of water gauge markings, the method further comprises: and calculating the average value of the readings of the plurality of water gauge marked lines, and determining the average value as the water gauge marked line reading of the target ship.
In one embodiment, acquiring a vessel water gauge image of a target vessel comprises: receiving a ship water gauge video of a target ship sent by a client; and (4) screenshot is carried out on the ship water gauge video according to a preset frame number interval, so that ship water gauge images of the target ship at a plurality of moments are obtained.
In one embodiment, after calculating an average of the readings of the plurality of water gage lines and determining the average as the water gage line reading for the target vessel, further comprising: and sending the water gauge marking reading of the target ship to the client.
The embodiment of the application also provides a boats and ships water gauge marking recognition device, includes: the acquisition module is used for acquiring a ship water gauge image of a target ship; the recognition module is used for recognizing the water gauge scale data in the ship water gauge image according to a pre-trained font recognition library; the detection module is used for carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines; the first determining module is used for determining a water level line according to the straight lines and the water gauge scale data; and the second determination module is used for determining the reading of the water gauge marking according to the water gauge scale data and the water level line.
The embodiment of the present application further provides a computer device, which includes a processor and a memory for storing processor-executable instructions, where the processor executes the instructions to implement the steps of the ship water gauge line identification method in any of the above embodiments.
Embodiments of the present application also provide a computer-readable storage medium, on which computer instructions are stored, and when executed, the instructions implement the steps of the ship water gauge marking identification method in any of the above embodiments.
In the embodiment of the application, the method for identifying the water gauge mark line of the ship is provided, after the ship water gauge image is obtained, the water gauge scale data in the ship water gauge image is identified according to a pre-trained font identification library, then the edge of the ship water gauge image is detected to obtain a plurality of straight lines, the water level line is determined according to the plurality of straight lines and the water gauge scale data, and the reading of the water gauge mark line is determined according to the water gauge scale data and the water level line. In the above scheme, according to the font discernment storehouse of training in advance can discern water gauge scale data, need not artifical discernment, moreover through edge detection, obtain many straight lines, then determine the water level line according to many straight lines and water gauge scale data, can confirm the reading of water gauge marking according to water level line and water gauge scale data, realized the automatic identification of water gauge marking, can improve the recognition efficiency of water gauge marking greatly, practice thrift the human cost.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, are incorporated in and constitute a part of this application, and are not intended to limit the application. In the drawings:
fig. 1 is a schematic diagram illustrating an application scenario of a ship water gauge line identification method in an embodiment of the present application.
FIG. 2 illustrates a flow chart of a method for identifying a water gage mark line of a ship in an embodiment of the present application;
fig. 3 is a schematic view showing a gray scale of a ship water gauge image in the ship water gauge marking line identification method according to an embodiment of the present application;
fig. 4 is a schematic view showing a gray scale of a ship water gauge graph in the ship water gauge marking line identification method according to the embodiment of the present application;
FIG. 5 is a schematic diagram illustrating a plurality of straight lines obtained by edge detection in the ship water gauge line identification method according to an embodiment of the present application;
FIG. 6 shows a schematic view of a vessel water gage line identification apparatus in an embodiment of the present application;
fig. 7 shows a schematic diagram of a computer device in an embodiment of the application.
Detailed Description
The principles and spirit of the present application will be described with reference to a number of exemplary embodiments. It should be understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the present application, and are not intended to limit the scope of the present application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present application may be embodied as a system, apparatus, device, method or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
The embodiment of the application provides a method for identifying water gauge marking of a ship. Fig. 1 is a schematic diagram illustrating an application scenario of a ship water gauge line identification method in an embodiment of the present application. As shown in fig. 1, the client may send the ship water gauge image/video to the server. And if the server receives the ship water gauge video, screenshot is carried out on the video to obtain one or more ship water gauge images. The server can identify the water gauge scale data in the ship water gauge image according to a pre-trained font identification library. The server can carry out edge detection to boats and ships water gauge image, obtains many straight lines to confirm the water level line according to many straight lines and water gauge scale data. And the server determines the reading of the water gauge marking according to the water level line and the water gauge scale data. The ship water gauge image is an image including a water level line and a water gauge on the ship, which is shot when the ship sails on water. Wherein, the water level line refers to the boundary line between the water surface and the ship. The scale data of the water gauge refers to numbers or letters corresponding to scales on the water gauge. In some embodiments, the ship water gauge image/video may be taken directly by the client (e.g., cell phone, IPAD, etc.). In other embodiments, the ship water gauge image/video may be captured by a camera device (e.g., camera, drone, etc.) before being sent to the client.
The server may be a single server, a server cluster, or a cloud server, and the specific composition forms the present application without limitation. The client may be a desktop computer, a notebook, a mobile phone terminal, a PDA, etc., as long as the client is a device capable of displaying content to a user or a service person, sending an image to the server, and receiving an identification result returned by the server, and the present formation of the client is not limited in this application.
Fig. 2 shows a flowchart of a ship water gauge line identification method in an embodiment of the present application. Although the present application provides method operational steps or apparatus configurations as illustrated in the following examples or figures, more or fewer operational steps or modular units may be included in the methods or apparatus based on conventional or non-inventive efforts. In the case of steps or structures which do not logically have the necessary cause and effect relationship, the execution sequence of the steps or the module structure of the apparatus is not limited to the execution sequence or the module structure described in the embodiments and shown in the drawings of the present application. When the described method or module structure is applied in an actual device or end product, the method or module structure according to the embodiments or shown in the drawings can be executed sequentially or executed in parallel (for example, in a parallel processor or multi-thread processing environment, or even in a distributed processing environment).
Specifically, as shown in fig. 2, a method for identifying a water gauge mark of a ship according to an embodiment of the present application may include the following steps:
step S201, a ship water gauge image of the target ship is obtained.
The server can obtain a ship water gauge image of the target ship. For example, the server may send a get request to the client, which returns a ship water gauge image of the target ship in response to the get request. Or the server can receive the ship water gauge image of the target ship actively sent by the client.
And step S202, according to a pre-trained font recognition library, recognizing water gauge scale data in the ship water gauge image.
Specifically, the pre-trained font recognition library may be a pre-trained font recognition library for recognizing hull fonts 0-9 and M (representing: meters). For example, a font recognition library may be pre-trained using TensorFlow. TensorFlow is a symbolic mathematical system based on data flow programming. It is to be appreciated that other tools can be used to pre-train the font recognition library, and the present application is not limited in this respect.
And step S203, carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines.
And step S204, determining the water level line according to the plurality of straight lines and the water gauge scale data.
Specifically, considering that the water level line is the boundary line between the water surface and the ship, the edge detection can be performed on the ship water gauge image to obtain a plurality of straight lines. The plurality of lines includes a water line. The lowest line seen in the ship water gauge image is the water line. The water level line can be determined from a plurality of straight lines according to the water gauge scale data. For example, the lowermost straight line of the plurality of straight lines may be determined as the water line.
And S205, determining the reading of the water gauge mark line according to the water gauge scale data and the water level line.
After the water gauge scale data and the water level line are identified, the reading of the water gauge mark line can be determined according to the water level line and the water gauge scale data.
In the above scheme, according to the font discernment storehouse of training in advance can discern water gauge scale data, need not artifical discernment, moreover through edge detection, obtain many straight lines, then determine the water level line according to many straight lines and water gauge scale data, can confirm the reading of water gauge marking according to water level line and water gauge scale data, realized the automatic identification of water gauge marking, can improve the recognition efficiency of water gauge marking greatly, practice thrift the human cost.
In some embodiments of the present application, identifying water gauge scale data in a ship water gauge image according to a pre-trained font identification library includes: processing the ship water gauge image to obtain a binary image containing water gauge scales; carrying out image segmentation on the binary image to obtain a plurality of digital images; and determining the water scale data corresponding to each digital image in the plurality of digital images according to a pre-trained font recognition library.
Specifically, the ship water gauge image needs to be processed to obtain a binary image containing water gauge scales. The gray value of the pixel point on the binary image is set to 0 or 255, that is, the whole image has an obvious black and white effect. In general, the water gauge scale is bright white or yellow, and the color of the ship is relatively dark. Therefore, the final binary image may be a water gauge scale white, with the rest being a black background. After the binarized image is obtained, the binarized image may be subjected to image segmentation processing to obtain a plurality of digital images. Wherein each digital image comprises a number (0-9) or the letter M (representing a unit of meter). And then, according to a pre-trained font recognition library, determining water scale calibration data corresponding to each digital image in the plurality of digital images. By the mode, the ship water gauge image can be processed to obtain the binary image, then the binary image is segmented to obtain a plurality of digital images, and the water gauge scale data corresponding to the digital images can be conveniently determined according to the pre-trained font recognition library.
In some embodiments of the present application, processing the ship water gauge image to obtain a binarized image containing water gauge scales may include: carrying out graying processing on the ship water gauge image to obtain a grayscale image; performing median filtering processing on the gray level image to obtain a filtered gray level image; carrying out corrosion and expansion operations on the filtered gray-scale image to obtain a gray-scale image subjected to corrosion expansion; and carrying out binarization processing on the corroded and expanded gray scale image to obtain a binarized image, wherein the binarized image comprises water gauge scales.
Specifically, after the ship water gauge image is acquired, the ship water gauge image may be grayed to obtain a corresponding grayscale image. For example, the ship water gauge image may be grayed by an OpenCV library. The OpenCV library is a cross-platform computer vision library issued based on BSD licensing (open source), and can implement many common algorithms in image processing and computer vision. As shown in fig. 3, a gray scale of a ship water gauge image in an embodiment of the present application is shown. After obtaining the gray scale map, median filtering processing may be performed on the gray scale map to obtain a filtered gray scale map. For example, the picture can be median filtered by medianburr method in OpenCV library. The median filtering is to replace the value of one point in the digital image or digital sequence with the median of each point value in a neighborhood of the point, and to make the surrounding pixel values close to the true value, thereby eliminating the isolated noise point. And then, carrying out corrosion and expansion operation on the filtered gray-scale image to obtain a corrosion-expanded gray-scale image. For example, the filtered gray-scale image may be corroded by a morphologyEx function in an OpenCV library, and then expanded to facilitate obtaining contour extraction (for example, the OpenCV library FindContours may be used to extract a contour of the image), and finally processed into a binarized image. For example, fig. 4 shows a binarized image obtained in the embodiment of the present application. Through the mode, the ship water gauge image can be processed into a binary image. After the binary image is obtained, the water gauge scale data can be identified according to a pre-trained font identification library, and the position and the size of each water gauge scale data, namely the position and the number of pixels forming each water gauge scale data, can be obtained according to the binary image.
In some embodiments of the present application, edge detection is performed on a ship water gauge image to obtain a plurality of straight lines, which may include: carrying out graying processing on the ship water gauge image to obtain a grayscale image; and carrying out edge detection on the gray-scale image to obtain a plurality of straight lines, wherein the straight lines comprise water lines. For example, fig. 5 shows a schematic diagram of a plurality of straight lines detected in an embodiment of the present application. In the scheme, the ship water gauge image is converted into the gray scale image, and then the edge detection is carried out, so that the edge detection precision can be improved, and the water gauge marking identification precision is improved.
In some embodiments of the present application, determining the water level line from the plurality of lines and the water gauge scale data may include: determining a horizontal included angle of each straight line in the plurality of straight lines; screening at least one target straight line of which the horizontal included angle meets a preset condition from the plurality of straight lines; determining the position of the central line of the water gauge scale data; determining the position of an intersection point of each target straight line and the central line in at least one target straight line; and determining the water level line from at least one target straight line according to the position of the intersection point of each target straight line and the central line.
Since the water line is located at the lowermost end, the water line can be determined according to the positions of the plurality of straight lines. Wherein the plurality of identified straight lines includes: water lines, score lines on ships, and the like. The water line is generally horizontal, but the horizontal angle of the water line is not zero in consideration of the shooting angle and the influence of waves. Therefore, the horizontal included angle of each straight line in the plurality of straight lines, namely the included angle between the straight line and the horizontal direction, can be determined, and then at least one target straight line with the horizontal included angle meeting the preset condition is screened out from the plurality of straight lines. The preset condition can be set to be between-45 degrees and +45 degrees, or can be set to be between-60 degrees and +60 degrees, and can be set according to actual requirements. For example, a HoughLinesP function in an OpenCV library can be used to screen out a target straight line with a horizontal included angle meeting a preset condition. After the target straight lines satisfying the preset condition are screened out, the position where each target straight line passes through the middle point of the width of the water gauge scale is determined, for example, the position where the intersection point of each target straight line and the center line of the water gauge scale is determined. Thus, the position of the centre line of the water gauge scale data may be determined first, as shown in figure 5. Then, the position of the intersection of each target straight line and the central line is determined. And determining the water level line from at least one target straight line according to the position of the intersection point of each target straight line and the central line. Among them, the target straight line positioned the lowest may be determined as the water line. Wherein, the direction from top to bottom is the direction along the digit diminishing gradually. By the mode, the water level line can be conveniently and simply identified.
In some embodiments of the present application, determining a reading of a water gauge mark from the water gauge scale data and the water line may include: determining the font size and font position of each number on the water gauge according to the water gauge scale data; and determining the reading of the water gauge marking according to the position of the intersection point of the water line and the central line and the font size and the font position of each number.
Specifically, after the water gauge scale data is identified, the font size and font position of each number on the water gauge can be determined from the water gauge scale data. And then, determining the reading of the water gauge marking according to the position of the intersection point of the water level line and the central line of the water gauge scale data and the font size and the font position of each number on the water gauge.
For example, as shown in FIG. 5, the font size and position on the scale and the font combination (e.g., 1, 2, M font combination at the same horizontal position is 12M, and whether the combination result has M is determined, and M is determined as meter number) are obtained from the recognized font result. After the number of meters (for example, 12M in fig. 5) on the side of the ship is obtained, the font height of M is positioned to the standard 10cm (since the font vertical height of the number of the water gauge line and the distance between the upper font and the lower font are both 10cm in general, this is standard fixed, except for the number of meters, which may be 10cm in height or 20cm in height, M in fig. 5 is also 10cm in height). The distance from meter to the water line (e.g. 12M from the water line in fig. 5) is calculated, and the number of fonts below M is multiplied by 20cm, and the obtained length and the number of meters are subtracted to obtain the reading of the number nearest to the water line above the water line (e.g. 12M minus 4 × 20cm in fig. 5, equal to 11.2M). Since the font size varies from top to bottom due to deck and photography, the actual distance from the font to the water line is calculated by the ratio of the font M to the font number (number 2 in FIG. 5) (e.g., the distance from the font number 2 to the water line in FIG. 5 is 14cm, and the final reading is 11.2M minus 14cm, which is equal to 11.06M).
In some embodiments of the present application, the vessel water gauge image comprises vessel water gauge images at a plurality of moments in time; correspondingly, according to a pre-trained font recognition library, recognizing ship water gauge images at multiple moments to obtain the readings of multiple water gauge marked lines; after obtaining readings for the plurality of water gauge markings, the method may further comprise: and calculating the average value of the readings of the plurality of water gauge marked lines, and determining the average value as the water gauge marked line reading of the target ship.
Specifically, the obtained ship water gauge images may include ship water gauge images at a plurality of times. In this way, the processing in the above embodiment is performed for each ship water gauge image to obtain the readings of a plurality of water gauge lines. After the readings of the plurality of water gage lines are obtained, an average value may be taken and determined as the water gage line reading for the target vessel. Through the mode, the accuracy of water gauge marking identification can be improved.
It will be appreciated that other means may be employed to determine the water gage line reading for the target vessel from the readings of the plurality of water gage lines. For example, the readings with a large deviation from the average value among the readings of the plurality of marked lines can be deleted, and then the average value is obtained and used as the final reading of the water gauge marked line, so that the identification accuracy can be further improved.
In some embodiments of the present application, obtaining a ship water gauge image of a target ship may include: receiving a ship water gauge video of a target ship sent by a client; and (4) screenshot is carried out on the ship water gauge video according to a preset frame number interval, so that ship water gauge images of the target ship at a plurality of moments are obtained.
Specifically, a client such as a mobile phone or a tablet computer may send a ship water gauge video of the target ship to the server. The server can capture the ship water gauge video according to the preset frame number intervals to obtain ship water gauge images of the target ship at multiple moments. The preset frame number interval can be set according to actual requirements.
In some embodiments of the present application, after calculating an average of the readings of the plurality of water gauge lines and determining the average as the water gauge line reading of the target vessel, it may further include: and sending the water gauge marking reading of the target ship to the client.
After obtaining the water gauge line reading of the target ship, the server may send the water gauge line reading of the target ship to the client. Therefore, the client can obtain the identification result in time, and the timeliness is improved. For example, a tester takes a video with a mobile phone, and then sends the video to a server through software, and the server can process and return a recognition result, so that the user experience can be improved.
The above method is described below with reference to a specific example, however, it should be noted that the specific example is only for better describing the present application and is not to be construed as limiting the present application.
In this embodiment, the method for identifying the water gauge mark of the ship may include the following steps:
step 1, a mobile phone client records a water gauge mark line through a head terminal, and then uploads a recorded video to a server through a network;
step 2, the server firstly captures a video according to a certain number of frames, then processes each captured image, calculates each captured image to obtain a reading, and finally calculates the average value of all readings to obtain the final water gauge reading; wherein, each screenshot is processed, and the processing method comprises the following substeps:
step 2.1, the server firstly converts the screenshot into a gray image through an OpenCV (open content library) and then adjusts a threshold;
step 2.2, performing OpenCV morphological transformation on the gray-scale image, performing median filtering on the image by using an OpenCV library media method, performing corrosion expansion operation on the image, segmenting independent noise image elements on the image by using morpholinoEx for corrosion, and performing expansion and expansion on the image elements to obtain the gray-scale image after morphological transformation;
step 2.3, carrying out binarization processing on the gray scale image after the form transformation to obtain a binarized image containing water gauge scales;
step 2.4, carrying out image segmentation on the binary image to obtain a plurality of digital images, identifying water gauge scale data corresponding to each digital image in the plurality of digital images according to a pre-trained font identification library, and storing the water gauge scale data;
step 2.5, carrying out graying processing on the screenshot again to obtain a grayscale image;
step 2.6, carrying out edge detection on the gray-scale image to obtain a plurality of straight lines;
step 2.7, screening out a target straight line with a horizontal included angle meeting a preset condition by using a HoughLinesP method of OpenCV;
step 2.7, determining a straight line with the lowest position in the target straight lines according to the recognized water gauge scale data, and determining the straight line as a water level line;
step 2.8, determining the reading of the water gauge mark according to the water level line and the water gauge mark data;
and 3, sending the final water gauge reading to the mobile phone client.
According to the method in the embodiment, after the ship water gauge video is obtained, screenshot is carried out according to the preset frame number to obtain a plurality of ship water gauge images, then each ship water gauge image is processed to obtain the reading of the water gauge marking in each ship water gauge image, the average value is finally obtained, and the average value is used as the final water gauge marking reading, so that the automatic identification of the ship water gauge marking is realized, manual intervention is not needed, the identification efficiency can be effectively improved, the identification accuracy can be improved and the labor cost can be reduced by means of multiple averaging. Furthermore, after shooting, the videos are uploaded to the server, so that the identification result returned by the server can be obtained, the timeliness is high, and the user experience is good.
Based on the same inventive concept, the embodiment of the present application further provides a device for identifying a water gauge mark of a ship, as described in the following embodiments. The principle of solving the problems of the ship water gauge marking recognition device is similar to that of the ship water gauge marking recognition method, so the implementation of the ship water gauge marking recognition device can refer to the implementation of the ship water gauge marking recognition method, and repeated parts are not repeated. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated. Fig. 6 is a block diagram of a structure of a ship water gauge line recognition device according to an embodiment of the present application, as shown in fig. 6, including: the following describes the structure of the device, including an acquisition module 601, an identification module 602, a detection module 603, a first determination module 604, and a second determination module 605.
The obtaining module 601 is used for obtaining a ship water gauge image of a target ship.
The recognition module 602 is configured to recognize water gauge scale data in the ship water gauge image according to a pre-trained font recognition library.
The detection module 603 is configured to perform edge detection on the ship water gauge image to obtain a plurality of straight lines.
The first determining module 604 is configured to determine a water level line based on the plurality of lines and the water gauge scale data.
The second determination module 605 is used to determine the reading of the water gauge mark line based on the water gauge scale data and the water line.
In some embodiments of the present application, the identification module may be specifically configured to: processing the ship water gauge image to obtain a binary image containing water gauge scales; carrying out image segmentation on the binary image to obtain a plurality of digital images; and determining the water scale data corresponding to each digital image in the plurality of digital images according to a pre-trained font recognition library.
In some embodiments of the present application, processing a ship water gauge image to obtain a binarized image containing water gauge scales includes: carrying out graying processing on the ship water gauge image to obtain a grayscale image; performing median filtering processing on the gray level image to obtain a filtered gray level image; carrying out corrosion and expansion operations on the filtered gray-scale image to obtain a gray-scale image subjected to corrosion expansion; and carrying out binarization processing on the corroded and expanded gray scale image to obtain a binarized image, wherein the binarized image comprises water gauge scales.
In some embodiments of the present application, the detection module may be specifically configured to: carrying out graying processing on the ship water gauge image to obtain a grayscale image; and carrying out edge detection on the gray-scale image to obtain a plurality of straight lines, wherein the straight lines comprise water lines.
In some embodiments of the present application, the first determining module may be specifically configured to: determining a horizontal included angle of each straight line in the plurality of straight lines; screening at least one target straight line of which the horizontal included angle meets a preset condition from the plurality of straight lines; determining the position of the central line of the water gauge scale data; determining the position of an intersection point of each target straight line and the central line in at least one target straight line; and determining the water level line from at least one target straight line according to the position of the intersection point of each target straight line and the central line.
In some embodiments of the present application, the second determining module may be specifically configured to: determining the font size and font position of each number on the water gauge according to the water gauge scale data; and determining the reading of the water gauge marking according to the position of the intersection point of the water line and the central line and the font size and the font position of each number.
In some embodiments of the present application, the vessel water gauge image comprises vessel water gauge images at a plurality of moments in time; correspondingly, according to a pre-trained font recognition library, recognizing ship water gauge images at multiple moments to obtain the readings of multiple water gauge marked lines; the apparatus further comprises a computing module operable to: after the readings of the plurality of water gauge lines are obtained, an average of the readings of the plurality of water gauge lines is calculated, and the average is determined as the water gauge line reading of the target ship.
In some embodiments of the present application, the obtaining module may be specifically configured to: receiving a ship water gauge video of a target ship sent by a client; and (4) screenshot is carried out on the ship water gauge video according to a preset frame number interval, so that ship water gauge images of the target ship at a plurality of moments are obtained.
In some embodiments of the present application, the apparatus further includes a sending module, and the sending module may be configured to: and after the average value of the readings of the plurality of water gauge marked lines is calculated and determined as the water gauge marked line reading of the target ship, the water gauge marked line reading of the target ship is sent to the client.
From the above description, it can be seen that the embodiments of the present application achieve the following technical effects: in the above scheme, according to the font discernment storehouse of training in advance can discern water gauge scale data, need not artifical discernment, moreover through edge detection, obtain many straight lines, then determine the water level line according to many straight lines and water gauge scale data, can confirm the reading of water gauge marking according to water level line and water gauge scale data, realized the automatic identification of water gauge marking, can improve the recognition efficiency of water gauge marking greatly, practice thrift the human cost.
The embodiment of the present application further provides a computer device, which may specifically refer to a schematic structural diagram of a computer device based on the ship water gauge line identification method provided in the embodiment of the present application shown in fig. 7, where the computer device may specifically include an input device 71, a processor 72, and a memory 73. Wherein the memory 73 is configured to store processor-executable instructions. The processor 71, when executing the instructions, implements the steps of the ship water gauge line identification method described in any of the above embodiments.
In this embodiment, the input device may be one of the main apparatuses for information exchange between a user and a computer system. The input device may include a keyboard, a mouse, a camera, a scanner, a light pen, a handwriting input board, a voice input device, etc.; the input device is used to input raw data and a program for processing the data into the computer. The input device can also acquire and receive data transmitted by other modules, units and devices. The processor may be implemented in any suitable way. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The memory may in particular be a memory device used in modern information technology for storing information. The memory may include multiple levels, and in a digital system, the memory may be any memory as long as it can store binary data; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as a RAM, a FIFO and the like; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card and the like.
In this embodiment, the functions and effects of the specific implementation of the computer device can be explained in comparison with other embodiments, and are not described herein again.
The present application further provides a computer storage medium based on the ship water gauge marking identification method, where the computer storage medium stores computer program instructions, and the computer program instructions, when executed, implement the steps of the ship water gauge marking identification method in any of the above embodiments.
In the present embodiment, the storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard disk (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects specifically realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and are not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different from that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
It is to be understood that the above description is intended to be illustrative, and not restrictive. Many embodiments and many applications other than the examples provided will be apparent to those of skill in the art upon reading the above description. The scope of the application should, therefore, be determined not with reference to the above description, but instead should be determined with reference to the pending claims along with the full scope of equivalents to which such claims are entitled.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and it will be apparent to those skilled in the art that various modifications and variations can be made in the embodiment of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A ship water gauge marking identification method is characterized by comprising the following steps:
acquiring a ship water gauge image of a target ship;
according to a pre-trained font recognition library, recognizing water gauge scale data in the ship water gauge image;
carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines;
determining a water level line according to the straight lines and the water gauge scale data;
and determining the reading of the water gauge marking according to the water gauge scale data and the water level line.
2. The method of claim 1, wherein identifying water gauge scale data in the ship water gauge image according to a pre-trained font recognition library comprises:
processing the ship water gauge image to obtain a binary image containing water gauge scales;
carrying out image segmentation on the binary image to obtain a plurality of digital images;
and determining the water gauge scale data corresponding to each digital image in the plurality of digital images according to a pre-trained font recognition library.
3. The method of claim 2, wherein processing the ship water gauge image to obtain a binarized image containing water gauge scales comprises:
carrying out graying processing on the ship water gauge image to obtain a grayscale image;
performing median filtering processing on the gray level image to obtain a filtered gray level image;
carrying out corrosion and expansion operations on the filtered gray-scale image to obtain a gray-scale image subjected to corrosion expansion;
and carrying out binarization processing on the corroded and expanded gray scale image to obtain a binarized image, wherein the binarized image comprises water gauge scales.
4. The method of claim 1, wherein performing edge detection on the ship water gauge image to obtain a plurality of straight lines comprises:
carrying out graying processing on the ship water gauge image to obtain a grayscale image;
and carrying out edge detection on the gray-scale image to obtain a plurality of straight lines, wherein the straight lines comprise water lines.
5. The method of claim 1, wherein determining a water line from the plurality of lines and the water gauge scale data comprises:
determining a horizontal included angle of each straight line in the plurality of straight lines;
screening out at least one target straight line of which the horizontal included angle meets a preset condition from the plurality of straight lines;
determining the position of the center line of the water gauge scale data;
determining the position of an intersection point of each target straight line in the at least one target straight line and the central line;
and determining a water level line from the at least one target straight line according to the position of the intersection point of each target straight line and the central line.
6. The method of claim 5, wherein determining a reading of a water gauge mark from the water gauge scale data and the water line comprises:
determining the font size and the font position of each number on the water gauge according to the water gauge scale data;
and determining the reading of the water gauge marking according to the position of the intersection point of the water level line and the central line and the font size and the font position of each number.
7. The method of claim 1, wherein the vessel water gauge images comprise vessel water gauge images at a plurality of moments in time;
correspondingly, according to a pre-trained font recognition library, recognizing ship water gauge images at multiple moments to obtain the readings of multiple water gauge marked lines;
after obtaining readings for the plurality of water gauge markings, the method further comprises:
calculating an average of the readings of the plurality of water gage markings and determining the average as the water gage marking reading for the target vessel.
8. The method of claim 7, wherein obtaining a vessel water gauge image of the target vessel comprises:
receiving a ship water gauge video of a target ship sent by a client;
and screenshot is carried out on the ship water gauge video according to preset frame number intervals to obtain ship water gauge images of the target ship at multiple moments.
9. The method of claim 8, after calculating an average of the readings of the plurality of water gage markings and determining the average as the water gage marking reading for the target vessel, further comprising:
and sending the water gauge marking reading of the target ship to the client.
10. A ship water gauge marking recognition device is characterized by comprising:
the acquisition module is used for acquiring a ship water gauge image of a target ship;
the recognition module is used for recognizing the water gauge scale data in the ship water gauge image according to a pre-trained font recognition library;
the detection module is used for carrying out edge detection on the ship water gauge image to obtain a plurality of straight lines;
the first determining module is used for determining a water level line according to the straight lines and the water gauge scale data;
and the second determination module is used for determining the reading of the water gauge marking according to the water gauge scale data and the water level line.
11. A computer device comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 9.
12. A computer-readable storage medium having computer instructions stored thereon which, when executed, implement the steps of the method of any one of claims 1 to 9.
CN201910926459.7A 2019-09-27 2019-09-27 Ship water gauge marking recognition method and device, computer equipment and storage medium Pending CN110717924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910926459.7A CN110717924A (en) 2019-09-27 2019-09-27 Ship water gauge marking recognition method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910926459.7A CN110717924A (en) 2019-09-27 2019-09-27 Ship water gauge marking recognition method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110717924A true CN110717924A (en) 2020-01-21

Family

ID=69211067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910926459.7A Pending CN110717924A (en) 2019-09-27 2019-09-27 Ship water gauge marking recognition method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110717924A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752286A (en) * 2020-03-09 2020-10-09 西南科技大学 Automatic mooring method for small unmanned ship
CN112183470A (en) * 2020-10-28 2021-01-05 长江大学 Ship water gauge identification method and equipment and storage medium
CN114973261A (en) * 2022-08-02 2022-08-30 中国科学院合肥物质科学研究院 Method for calculating operation amount of water surface cleaning ship
CN115620557A (en) * 2022-12-20 2023-01-17 深之蓝海洋科技股份有限公司 Intelligent operation system and intelligent operation method of intelligent port

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102975826A (en) * 2012-12-03 2013-03-20 上海海事大学 Portable ship water gauge automatic detection and identification method based on machine vision
CN105741276A (en) * 2016-01-27 2016-07-06 燕山大学 Ship waterline extraction method
CN106557764A (en) * 2016-11-02 2017-04-05 江西理工大学 A kind of water level recognition methodss based on binary-coded character water gauge and image procossing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102975826A (en) * 2012-12-03 2013-03-20 上海海事大学 Portable ship water gauge automatic detection and identification method based on machine vision
CN105741276A (en) * 2016-01-27 2016-07-06 燕山大学 Ship waterline extraction method
CN106557764A (en) * 2016-11-02 2017-04-05 江西理工大学 A kind of water level recognition methodss based on binary-coded character water gauge and image procossing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭方: "基于视频的船舶吃水线检测方法的研究", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752286A (en) * 2020-03-09 2020-10-09 西南科技大学 Automatic mooring method for small unmanned ship
CN112183470A (en) * 2020-10-28 2021-01-05 长江大学 Ship water gauge identification method and equipment and storage medium
CN112183470B (en) * 2020-10-28 2022-07-19 长江大学 Ship water gauge identification method and equipment and storage medium
CN114973261A (en) * 2022-08-02 2022-08-30 中国科学院合肥物质科学研究院 Method for calculating operation amount of water surface cleaning ship
CN114973261B (en) * 2022-08-02 2022-11-11 中国科学院合肥物质科学研究院 Method for calculating operation amount of water surface cleaning ship
CN115620557A (en) * 2022-12-20 2023-01-17 深之蓝海洋科技股份有限公司 Intelligent operation system and intelligent operation method of intelligent port
CN115620557B (en) * 2022-12-20 2023-05-26 深之蓝海洋科技股份有限公司 Intelligent operation system and intelligent operation method for intelligent port

Similar Documents

Publication Publication Date Title
CN110717924A (en) Ship water gauge marking recognition method and device, computer equipment and storage medium
CN108759973B (en) Water level measuring method
CN110781885A (en) Text detection method, device, medium and electronic equipment based on image processing
CN110909640A (en) Method and device for determining water level line, storage medium and electronic device
CN111652213A (en) Ship water gauge reading identification method based on deep learning
CN111598889B (en) Identification method and device for inclination fault of equalizing ring and computer equipment
CN110619328A (en) Intelligent ship water gauge reading identification method based on image processing and deep learning
US20200402385A1 (en) Region determining device, monitoring system, region determining method, and recording medium
CN111145120A (en) Visibility detection method and device, computer equipment and storage medium
CN115471476A (en) Method, device, equipment and medium for detecting component defects
CN114627461A (en) Method and system for high-precision identification of water gauge data based on artificial intelligence
KR101842535B1 (en) Method for the optical detection of symbols
JP7410323B2 (en) Abnormality detection device, abnormality detection method and abnormality detection system
CN113065454A (en) High-altitude parabolic target identification and comparison method and device
CN110824451A (en) Processing method and device of radar echo map, computer equipment and storage medium
CN112991342B (en) Water level line detection method, device and system based on water level gauge image
Ferreira et al. Character recognition for automatic draught survey
CN112183463B (en) Ship identification model verification method and device based on radar image
CN114998194A (en) Product defect detection method, system and storage medium
CN114782822A (en) Method and device for detecting state of power equipment, electronic equipment and storage medium
CN116563591A (en) Optical smoke detection method based on feature extraction under sea-sky background
CN113326749A (en) Target detection method and device, storage medium and electronic equipment
CN111950527A (en) Target detection method and device based on YOLO V2 neural network
CN113506315A (en) Method and device for detecting moving object and storage medium
US10019772B1 (en) Document image orientation, assessment and correction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination