CN113486895B - Ship board identification method and device and computer readable storage medium - Google Patents

Ship board identification method and device and computer readable storage medium Download PDF

Info

Publication number
CN113486895B
CN113486895B CN202110805684.2A CN202110805684A CN113486895B CN 113486895 B CN113486895 B CN 113486895B CN 202110805684 A CN202110805684 A CN 202110805684A CN 113486895 B CN113486895 B CN 113486895B
Authority
CN
China
Prior art keywords
connected region
color
ship
target color
coordinate
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.)
Active
Application number
CN202110805684.2A
Other languages
Chinese (zh)
Other versions
CN113486895A (en
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.)
Zhejiang Whyis Technology Co ltd
Original Assignee
Zhejiang Whyis Technology 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 Zhejiang Whyis Technology Co ltd filed Critical Zhejiang Whyis Technology Co ltd
Priority to CN202110805684.2A priority Critical patent/CN113486895B/en
Publication of CN113486895A publication Critical patent/CN113486895A/en
Application granted granted Critical
Publication of CN113486895B publication Critical patent/CN113486895B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Character Input (AREA)

Abstract

The embodiment of the invention discloses a ship board identification method, a ship board identification device and a computer readable storage medium, wherein the method comprises the following steps: acquiring a color image of a ship, and converting the color image into a binary image; combining continuous white pixel points in the binary image into at least one first connected region; determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region; screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region; and sorting the target color communication areas according to the size conformity, and selecting the target color communication area with the highest size conformity as the ship plate of the ship. The ship plate recognition speed of the ship is improved, and therefore a foundation is laid for quick recognition of ship plate characters.

Description

Ship board identification method and device and computer readable storage medium
Technical Field
The invention relates to the field of ship monitoring, in particular to a ship plate identification method and device and a computer readable storage medium.
Background
The existing ship nameplate positioning technology is realized by utilizing a deep learning algorithm and a neural network algorithm on the basis of mature license plate identification.
Because the ships in the inland waterway are all longer, and the ratio of the ship nameplates occupied in the whole ship is smaller, the general image acquisition snapshot uses high-resolution images, so that all information of the whole ship can be included in the picture, and in addition, 4096 x 2160 or higher 7680 x 4320 resolution pictures are generally adopted in the industry.
If the deep learning and neural network algorithm is adopted to be used as a ship nameplate positioning technology, the problem of identification speed is inevitably brought. In the industry, a deep learning target positioning algorithm is used for identifying 4096 × 2160 pictures, the ship nameplate number can be positioned only within 1 second, and the processing speed is low.
Aiming at the problem that the speed of identifying the ship plate of the ship is low in the prior art, an effective solution is not available at present.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method and an apparatus for identifying a ship plate, and a computer-readable storage medium, in which a connected region is determined after a snapshot ship image is binarized, and the optimal connected region is used as a ship plate of a ship, so as to solve the problem that the ship plate identification is slow in the prior art.
In order to achieve the above object, in one aspect, the present invention provides a ship board identification method, including: acquiring a color image of a ship, and converting the color image into a binary image; combining continuous white pixel points in the binary image into at least one first connected region; determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region; screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region; and sorting the target color communication areas according to the size conformity, and selecting the target color communication area with the highest size conformity as the ship plate of the ship.
Further optionally, the sorting the target color connected regions by size conformity, and the selecting the target color connected region with the highest size conformity as the ship plate of the ship includes: identifying the leftmost coordinate, the rightmost coordinate, the uppermost coordinate and the lowermost coordinate of the target color connected region; calculating the length of the target color connected region according to the leftmost coordinate and the rightmost coordinate, and calculating the width of the target color connected region according to the uppermost coordinate and the lowermost coordinate; recording the target color communication area with the length within a preset length range and the width within a preset width range as a mark communication area; calculating the ratio of the width to the length of the mark communication area; calculating the ratio difference between the ratio and a preset ratio; and arranging the mark communication areas in an ascending order or a descending order according to the ratio difference, and selecting the mark communication area corresponding to the smallest ratio difference as the ship plate of the ship.
Further optionally, the screening the at least one first corresponding connected region according to the target color threshold to obtain at least one target color connected region includes: acquiring a color characteristic value of each pixel in the first corresponding communication area; taking the average value of the color characteristic values of all the pixels in the first corresponding connected region as the color characteristic value of the first corresponding connected region; calculating a color difference value between the color characteristic value of the first corresponding connected region and a standard color characteristic value; and selecting the first corresponding connected region corresponding to the color difference value smaller than the target color threshold value as the target color connected region.
Further optionally, after the selecting the target color connected region with the highest size conformity as the ship plate of the ship, the method includes: performing character cutting on the ship board to obtain a plurality of single characters; and identifying the single characters to obtain the character strings in the ship board.
Further optionally, the merging the continuous white pixel points in the binarized image into at least one first connected region includes: merging the continuous white pixels in each row into at least one blob; merging a plurality of the blobs in succession in adjacent rows into at least one of the first connected regions.
On the other hand, the embodiment of the invention also provides a ship plate recognition device, which comprises: the image conversion module is used for acquiring a color image of a ship and converting the color image into a binary image; a binarization image connected region determining module, configured to merge continuous white pixel points in the binarization image into at least one first connected region; the color image connected region determining module is used for determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region; the screening module is used for screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region; and the selecting module is used for sorting the target color communication areas according to the size conformity, and selecting the target color communication area with the highest size conformity as the ship plate of the ship.
Further optionally, the selecting module includes: the identification submodule is used for identifying the leftmost coordinate, the rightmost coordinate, the uppermost coordinate and the lowermost coordinate of the target color connected region; the length and width calculation submodule is used for calculating the length of the target color communication region according to the leftmost coordinate and the rightmost coordinate, and calculating the width of the target color communication region according to the uppermost coordinate and the lowermost coordinate; the mark connected region determining submodule is used for recording the target color connected region with the length within a preset length range and the width within a preset width range as a mark connected region; the ratio calculation submodule is used for calculating the ratio of the width to the length of the mark communication area; the ratio difference calculation submodule is used for calculating the ratio difference between the ratio and a preset ratio; and the first selection submodule is used for arranging the mark communication areas in an ascending order or a descending order according to the ratio difference, and selecting the mark communication area corresponding to the smallest ratio difference as the ship plate of the ship.
Further optionally, the screening module comprises: a pixel color characteristic value obtaining module, configured to obtain a color characteristic value of each pixel in the first corresponding communication area; a connected region color characteristic value determining module, configured to use an average value of color characteristic values of all pixels in the first corresponding connected region as a color characteristic value of the first corresponding connected region; the color difference value calculation submodule is used for calculating the color difference value between the color characteristic value and the standard color characteristic value; and the second selection submodule is used for selecting the first corresponding connected region corresponding to the color difference value smaller than the target color threshold value as the target color connected region.
Further optionally, the apparatus comprises: the character cutting module is used for performing character cutting on the ship board to obtain a plurality of single characters; and the character string determining module is used for identifying the single characters to obtain the character string in the ship board.
In another aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when processed by a processor performs the boat deck identification method as described above.
The technical scheme has the following beneficial effects: the method comprises the steps of converting a color image of a ship into a binary image, dividing a plurality of connected regions, mapping the connected regions into the color image, and selecting the optimal connected region as a ship plate of the ship after color screening and size screening.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a ship plate identification method provided by an embodiment of the invention;
FIG. 2 is a flowchart of a method for selecting an optimal connected region according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for determining a target color connected region according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method for identifying a ship plate character string according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for acquiring a first communication area according to an embodiment of the present invention;
fig. 6 is a block diagram of a ship board recognition device according to an embodiment of the present invention;
FIG. 7 is a block diagram of a selection module according to an embodiment of the present invention;
FIG. 8 is a block diagram of a screening module according to an embodiment of the present invention;
fig. 9 is a block diagram of a structure of a binarized image connected region determining module according to an embodiment of the present invention.
Reference numerals: 100-image conversion module 200-binary image connected region determination module 300-color image connected region determination module 400-screening module 4001-pixel color characteristic value acquisition module 4002-connected region color characteristic value determination module 4003-color difference value calculation sub-module 4004-second selection sub-module 500-selection module 5001-recognition sub-module 5002-length and width calculation sub-module 5003-mark connected region determination sub-module 5004-ratio calculation sub-module 5005-ratio difference calculation sub-module 5006-first selection sub-module 600-character cutting module 700-character string determination module
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, a deep learning algorithm or a neural network algorithm is usually adopted for identifying and positioning the ship nameplate, generally 4096 × 2160 or higher 7680 × 4320 resolution pictures are identified, and as the size of the image is large, at least 1 second is required for successful identification, so that the identification speed is slow and the identification efficiency is low.
In order to solve the problem of slow speed of positioning and identifying the ship plate, an embodiment of the present invention provides a ship plate identification method, and fig. 1 is a flowchart of the ship plate identification method provided by the embodiment of the present invention, as shown in fig. 1, including:
s101, acquiring a color image of a ship, and converting the color image into a binary image;
at port navigation section bayonet socket department, often can be equipped with the camera equipment of taking a candid photograph of being exclusively used in, when boats and ships passed through the bayonet socket, camera equipment takes a candid photograph boats and ships, obtains the initial color image that this boats and ships correspond.
The resolution of the initial color image is 4096 × 2160, and the format of the picture is JPEG.
And converting the initial color image from a JPEG format into an RGB format, wherein the RGB format color image is the color image, and performing binarization operation on the color image to obtain a binarized image.
S102, combining continuous white pixel points in the binary image into at least one first connected region;
the pixel matrix after binarization only contains 0 or 1, the pixel of 0 is black, and the pixel of 1 is white. In this embodiment, the character is binarized to 0 and the background is binarized to 1. After the binary image is obtained, combining the continuous 1 pixel points into a first connected region, and obtaining all the first connected regions in the binary image according to the principle.
S103, determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region;
and acquiring the coordinates of each first connected region in the binary image, and correspondingly delimiting a first corresponding connected region in the color image according to the coordinates.
S104, screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region;
in this embodiment, the color of the standard boat plate is blue, and therefore, a connected region having a color of blue, that is, a target color connected region, needs to be screened out from the plurality of first connected regions.
S105, sorting the target color communication areas according to size conformity, and selecting the target color communication area with the highest size conformity as the ship plate of the ship.
Regarding the size of the standard ship plate as the standard size, the closer the sizes of the target color communication regions are to the standard size, the higher the size conformity of the target color communication regions is, and the target color communication region with the highest size conformity is determined as the ship plate of the ship.
And after binarization is carried out on the color picture, a connected region is determined, and an optimal connected region is screened out according to the color and the size, so that the processing speed of ship plate identification is increased.
Based on the foregoing solution, as an optional implementation manner, fig. 2 is a flowchart of a method for selecting an optimal connected region according to an embodiment of the present invention, and as shown in fig. 2, the step S105 of sorting the target color connected regions according to size conformity, where selecting the target color connected region with the highest size conformity as the ship plate of the ship includes:
s1051, identifying the leftmost coordinate, the rightmost coordinate, the uppermost coordinate and the lowermost coordinate of the target color connected region;
and taking a leftmost coordinate X _ LEFT, a rightmost coordinate X _ RIGHT, a topmost coordinate Y _ TOP and a bottommost coordinate Y _ BOTTOM for each target color connected region.
S1052, calculating the length of the target color connected region according to the leftmost coordinate and the rightmost coordinate, and calculating the width of the target color connected region according to the uppermost coordinate and the lowermost coordinate;
the length calculation formula of each target color region is X _ RIGHT-X _ LEFT, and the width calculation formula is Y _ TOP-Y _ BOTTOM.
S1053, marking the target color connected region with the length within a preset length range and the width within a preset width range as a mark connected region;
in a preferred embodiment, if the width of the target color connected component satisfies 80< (X _ RIGHT-X _ LEFT) <300 and the length satisfies 60< (Y _ TOP-Y _ BOTTOM) <200, it is determined that the target color connected component is the mark connected component.
S1054, calculating the ratio of the width to the length of the mark communication area;
the ratio of width to length, ratio, | X _ RIGHT-X _ LEFT |/| Y _ TOP-Y _ BOTTOM |.
S1055, calculating the ratio difference between the ratio and a preset ratio;
the ratio difference L ═ ratio-1.5 |, where 1.5 is the width to height ratio of the standard boat deck.
S1056, arranging the mark communication areas in an ascending order or a descending order according to the ratio difference, and selecting the mark communication area corresponding to the minimum ratio difference as the ship plate of the ship.
The smaller the ratio difference is, the closer the mark communication area corresponding to the ratio difference is to the standard ship plate. After arranging the mark communication areas in ascending or descending order of the ratio difference, the mark communication area with the smallest ratio difference is the mark communication area closest to the standard ship plate, in other words, the ship plate of the ship has the highest possibility in the mark communication area.
As an optional implementation manner, fig. 3 is a flowchart of a method for determining a target color connected component according to an embodiment of the present invention, and as shown in fig. 3, the S104, performing screening on the at least one first corresponding connected component according to a target color threshold to obtain at least one target color connected component includes:
s1041, acquiring a color characteristic value of each pixel in the first corresponding communication area;
in this embodiment, the picture to which the first corresponding connected region belongs is a color picture in RGB format, and the R component intensity value, the G component intensity value, and the B component intensity value of each pixel in the first corresponding connected region are used as the color feature values thereof.
S1042, taking the average value of the color characteristic values of all the pixels in the first corresponding connected region as the color characteristic value of the first corresponding connected region;
the R component intensity value of the first corresponding connected region is the mean value of the R component intensity values of all pixels and is recorded as R1; the G component intensity value of the first corresponding connected region is the mean value of the G component intensity values of all the pixels and is marked as G1; the B component intensity value of the first corresponding connected component is the mean of the B component intensity values of all pixels, denoted as B1. The R1, G1 and B1 of the first corresponding connected region are the color feature values of the first corresponding connected region.
S1043, calculating a color difference value between the color characteristic value of the first corresponding connected region and a standard color characteristic value;
specifically, the color difference value is calculated by the following formula:
Figure BDA0003166443720000061
wherein, R, G, B are color characteristic values of the standard boat brand (R ═ 0xB0, G ═ 0x27, B ═ 0xF0), and R1, G1, B1 are color characteristic values of the first corresponding connected region.
S1044, selecting the first corresponding connected region corresponding to the color difference value smaller than the target color threshold value as the target color connected region.
In this embodiment, the color of the standard ship plate is blue, the target color threshold is 15, and if ρ is less than 15, it is determined that the first corresponding connected region is the target color connected region; on the other hand, if ρ is equal to or greater than 15, it is determined that the first corresponding connected component is not the target color connected component.
As an optional implementation manner, fig. 4 is a flowchart of a method for recognizing a ship plate character string according to an embodiment of the present invention, and as shown in fig. 4, after the step S105 of selecting a target color connected region with the highest size conformity as a ship plate of the ship, the method includes:
s106, performing character cutting on the ship board to obtain a plurality of single characters;
after the ship plate is identified and positioned, specific character data of the ship plate needs to be acquired. And cutting out the whole picture according to the coordinate data of the ship plate, and then cutting out a single character from the ship plate.
S107, identifying the single characters to obtain the character strings in the ship board.
And identifying each single character in the ship plate to obtain a character string in the ship plate, namely the ship plate number. The ship license plate and the corresponding ship image can be uploaded to a monitoring platform to be used as a record of ship passing, and therefore maritime personnel can manage and monitor the ship conveniently.
As a possible implementation manner, fig. 5 is a flowchart of a method for acquiring a first connected region according to an embodiment of the present invention, and as shown in fig. 5, the S102 merging continuous white pixel points in the binarized image into at least one first connected region includes:
s1021, combining continuous white pixels in each line into at least one cluster;
a search is made for each pixel in the binarized image and if there are pixels that are continuously white in a row, i.e. pixels that are continuously 1, these pixels are merged into one blob.
S1022, combining a plurality of continuous clusters in adjacent rows into at least one first connected region.
The consecutive cliques in adjacent rows are merged into one large clique, the first connected region.
The embodiment of the present invention further provides a ship plate recognition apparatus, and fig. 6 is a block diagram of a structure of the ship plate recognition apparatus provided in the embodiment of the present invention, as shown in fig. 6, including:
the image conversion module 100 is used for acquiring a color image of a ship and converting the color image into a binary image;
at port navigation section bayonet socket department, often can be equipped with the camera equipment of taking a candid photograph of being exclusively used in, when boats and ships passed through the bayonet socket, camera equipment takes a candid photograph boats and ships, obtains the initial color image that this boats and ships correspond.
The resolution of the initial color image is 4096 × 2160, and the format of the picture is JPEG.
And converting the initial color image from a JPEG format into an RGB format, wherein the RGB format color image is the color image, and performing binarization operation on the color image to obtain a binarized image.
A binarized image connected region determining module 200, configured to merge continuous white pixel points in the binarized image into at least one first connected region;
the pixel matrix after binarization only contains 0 or 1, the pixel of 0 is black, and the pixel of 1 is white. In this embodiment, the character is binarized to 0 and the background is binarized to 1. After the binary image is obtained, combining the continuous 1 pixel points into a first connected region, and obtaining all the first connected regions in the binary image according to the principle.
A color image connected region determining module 300, configured to determine at least one first corresponding connected region in the color image according to coordinates of the first connected region;
and acquiring the coordinates of each first connected region in the binary image, and correspondingly delimiting a first corresponding connected region in the color image according to the coordinates.
A screening module 400, configured to screen the at least one first corresponding connected region according to a target color threshold to obtain at least one target color connected region;
in this embodiment, the color of the standard boat plate is blue, and therefore, a connected region having a color of blue, that is, a target color connected region, needs to be screened out from the plurality of first connected regions.
And the selecting module 500 is used for sorting the target color connected regions according to the size conformity, and selecting the target color connected region with the highest size conformity as the ship plate of the ship.
Regarding the size of the standard ship plate as the standard size, the closer the sizes of the target color communication regions are to the standard size, the higher the size conformity of the target color communication regions is, and the target color communication region with the highest size conformity is determined as the ship plate of the ship.
And after binarization is carried out on the color picture, a connected region is determined, and an optimal connected region is screened out according to the color and the size, so that the processing speed of ship plate identification is increased.
As an alternative implementation manner, fig. 7 is a block diagram of a selecting module according to an embodiment of the present invention, and as shown in fig. 7, the selecting module 500 includes:
the identifying sub-module 5001 is configured to identify a leftmost coordinate, a rightmost coordinate, a topmost coordinate, and a bottommost coordinate of the target color connected region;
and taking a leftmost coordinate X _ LEFT, a rightmost coordinate X _ RIGHT, a topmost coordinate Y _ TOP and a bottommost coordinate Y _ BOTTOM for each target color connected region.
A length and width calculation submodule 5002 configured to calculate the length of the target color connected region according to the leftmost coordinate and the rightmost coordinate, and calculate the width of the target color connected region according to the uppermost coordinate and the lowermost coordinate;
the length calculation formula of each target color region is X _ RIGHT-X _ LEFT, and the width calculation formula is Y _ TOP-Y _ BOTTOM.
A mark connected region determining sub-module 5003, configured to mark the target color connected region whose length is within a preset length range and whose width is within a preset width range as a mark connected region;
in a preferred embodiment, if the width of the target color connected component satisfies 80< (X _ RIGHT-X _ LEFT) <300 and the length satisfies 60< (Y _ TOP-Y _ BOTTOM) <200, it is determined that the target color connected component is the mark connected component.
A ratio operator module 5004 for calculating the ratio of the width to the length of the mark connected region;
the ratio of width to length, ratio, | X _ RIGHT-X _ LEFT |/| Y _ TOP-Y _ BOTTOM |.
A ratio difference calculation submodule 5005 for calculating a ratio difference between the ratio and a preset ratio;
the ratio difference L ═ ratio-1.5 |, where 1.5 is the width to height ratio of the standard boat deck.
The first selection submodule 5006 is configured to arrange the mark connected regions in an ascending order or a descending order according to the ratio difference, and select the mark connected region corresponding to the smallest ratio difference as the ship plate of the ship.
The smaller the ratio difference is, the closer the mark communication area corresponding to the ratio difference is to the standard ship plate. After arranging the mark communication areas in ascending or descending order of the ratio difference, the mark communication area with the smallest ratio difference is the mark communication area closest to the standard ship plate, in other words, the ship plate of the ship has the highest possibility in the mark communication area.
As an alternative implementation manner, fig. 8 is a block diagram of a screening module provided in an embodiment of the present invention, and as shown in the drawing, the screening module 400 includes:
a pixel color characteristic value obtaining module 4001, configured to obtain a color characteristic value of each pixel in the first corresponding communication area;
in this embodiment, the picture to which the first corresponding connected region belongs is a color picture in RGB format, and the R component intensity value, the G component intensity value, and the B component intensity value of each pixel in the first corresponding connected region are used as the color feature values thereof.
A connected region color feature value determining module 4002, configured to use an average value of color feature values of all pixels in the first corresponding connected region as a color feature value of the first corresponding connected region;
the R component intensity value of the first corresponding connected region is the mean value of the R component intensity values of all pixels and is recorded as R1; the G component intensity value of the first corresponding connected region is the mean value of the G component intensity values of all the pixels and is marked as G1; the B component intensity value of the first corresponding connected component is the mean of the B component intensity values of all pixels, denoted as B1. The R1, G1 and B1 of the first corresponding connected region are the color feature values of the first corresponding connected region.
A color difference value calculating sub-module 4003, configured to calculate a color difference value between the color feature value and a standard color feature value; specifically, the color difference value is calculated by the following formula:
Figure BDA0003166443720000091
wherein, R, G, B are color characteristic values of the standard boat brand (R ═ 0xB0, G ═ 0x27, B ═ 0xF0), and R1, G1, B1 are color characteristic values of the first corresponding connected region.
A second selection submodule 4004, configured to select the first corresponding connected region corresponding to the color difference value smaller than the target color threshold as the target color connected region.
In this embodiment, the color of the standard ship plate is blue, the target color threshold is 15, and if ρ is less than 15, it is determined that the first corresponding connected region is the target color connected region; on the other hand, if ρ is equal to or greater than 15, it is determined that the first corresponding connected component is not the target color connected component.
As an alternative implementation, fig. 9 is a block diagram of a structure of a binarized image connected region determining module according to an embodiment of the present invention, and as shown in fig. 9, the apparatus includes:
the character cutting module 600 is configured to perform character cutting on the ship board to obtain a plurality of single characters;
after the ship plate is identified and positioned, specific character data of the ship plate needs to be acquired. And cutting out the whole picture according to the coordinate data of the ship plate, and then cutting out a single character from the ship plate.
A character string determining module 700, configured to identify the single characters to obtain a character string in the ship board.
And identifying each single character in the ship plate to obtain a character string in the ship plate, namely the ship plate number. The ship license plate and the corresponding ship image can be uploaded to a monitoring platform to be used as a record of ship passing, and therefore maritime personnel can manage and monitor the ship conveniently.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which, when processed by a processor, performs the boat deck identification method as described above.
The storage medium stores the software, and the storage medium includes but is not limited to: optical disks, floppy disks, hard disks, erasable memory, etc.
The technical scheme has the following beneficial effects: the method comprises the steps of converting a color image of a ship into a binary image, dividing a plurality of connected regions, mapping the connected regions into the color image, and selecting the optimal connected region as a ship plate of the ship after color screening and size screening.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (8)

1. A boat brand recognition method, comprising:
acquiring a color image of a ship, and converting the color image into a binary image;
combining continuous white pixel points in the binary image into at least one first connected region;
determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region;
screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region;
sorting the target color communication areas according to size conformity, and selecting the target color communication area with the highest size conformity as a ship plate of the ship;
the target color connected regions are sorted according to size conformity, and the target color connected region with the highest size conformity is selected as the ship plate of the ship, and the method comprises the following steps:
identifying the leftmost coordinate, the rightmost coordinate, the uppermost coordinate and the lowermost coordinate of the target color connected region;
calculating the length of the target color connected region according to the leftmost coordinate and the rightmost coordinate, and calculating the width of the target color connected region according to the uppermost coordinate and the lowermost coordinate;
recording the target color communication area with the length within a preset length range and the width within a preset width range as a mark communication area;
calculating the ratio of the width to the length of the mark communication area;
calculating the ratio difference between the ratio and a preset ratio;
and arranging the mark communication areas in an ascending order or a descending order according to the ratio difference, and selecting the mark communication area corresponding to the smallest ratio difference as the ship plate of the ship.
2. The boat deck identification method of claim 1, wherein the screening the at least one first corresponding connected region according to a target color threshold to obtain at least one target color connected region comprises:
acquiring a color characteristic value of each pixel in the first corresponding communication area;
taking the average value of the color characteristic values of all the pixels in the first corresponding connected region as the color characteristic value of the first corresponding connected region;
calculating a color difference value between the color characteristic value of the first corresponding connected region and a standard color characteristic value;
and selecting the first corresponding connected region corresponding to the color difference value smaller than the target color threshold value as the target color connected region.
3. The ship board identification method according to claim 1, wherein after the step of selecting the target color connected region with the highest size conformity as the ship board of the ship, the method comprises the following steps:
performing character cutting on the ship board to obtain a plurality of single characters;
and identifying the single characters to obtain the character strings in the ship board.
4. The ship plate identification method according to claim 1, wherein the merging of continuous white pixel points in the binarized image into at least one first connected region comprises:
merging the continuous white pixels in each row into at least one blob;
merging a plurality of the blobs in succession in adjacent rows into at least one of the first connected regions.
5. A boat identification device, comprising:
the image conversion module is used for acquiring a color image of a ship and converting the color image into a binary image;
a binarization image connected region determining module, configured to merge continuous white pixel points in the binarization image into at least one first connected region;
the color image connected region determining module is used for determining at least one first corresponding connected region in the color image according to the coordinates of the first connected region;
the screening module is used for screening the at least one first corresponding connected region according to a target color threshold value to obtain at least one target color connected region;
the selecting module is used for sorting the target color connected regions according to the size conformity, and selecting the target color connected region with the highest size conformity as the ship plate of the ship;
the selecting module comprises:
the identification submodule is used for identifying the leftmost coordinate, the rightmost coordinate, the uppermost coordinate and the lowermost coordinate of the target color connected region;
the length and width calculation submodule is used for calculating the length of the target color communication region according to the leftmost coordinate and the rightmost coordinate, and calculating the width of the target color communication region according to the uppermost coordinate and the lowermost coordinate;
the mark connected region determining submodule is used for recording the target color connected region with the length within a preset length range and the width within a preset width range as a mark connected region;
the ratio calculation submodule is used for calculating the ratio of the width to the length of the mark communication area;
the ratio difference calculation submodule is used for calculating the ratio difference between the ratio and a preset ratio;
and the first selection submodule is used for arranging the mark communication areas in an ascending order or a descending order according to the ratio difference, and selecting the mark communication area corresponding to the smallest ratio difference as the ship plate of the ship.
6. The boat deck identification device of claim 5, wherein the screening module comprises:
a pixel color characteristic value obtaining module, configured to obtain a color characteristic value of each pixel in the first corresponding communication area;
a connected region color characteristic value determining module, configured to use an average value of color characteristic values of all pixels in the first corresponding connected region as a color characteristic value of the first corresponding connected region;
the color difference value calculation submodule is used for calculating the color difference value between the color characteristic value and the standard color characteristic value;
and the second selection submodule is used for selecting the first corresponding connected region corresponding to the color difference value smaller than the target color threshold value as the target color connected region.
7. The boat deck identification device according to claim 5, comprising:
the character cutting module is used for performing character cutting on the ship board to obtain a plurality of single characters;
and the character string determining module is used for identifying the single characters to obtain the character string in the ship board.
8. A computer-readable storage medium, on which a computer program is stored, which program, when being processed by a processor, is adapted to carry out the boat identification method according to any one of claims 1 to 4.
CN202110805684.2A 2021-07-16 2021-07-16 Ship board identification method and device and computer readable storage medium Active CN113486895B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110805684.2A CN113486895B (en) 2021-07-16 2021-07-16 Ship board identification method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110805684.2A CN113486895B (en) 2021-07-16 2021-07-16 Ship board identification method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113486895A CN113486895A (en) 2021-10-08
CN113486895B true CN113486895B (en) 2022-04-19

Family

ID=77939859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110805684.2A Active CN113486895B (en) 2021-07-16 2021-07-16 Ship board identification method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113486895B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117557785B (en) * 2024-01-11 2024-04-02 宁波海上鲜信息技术股份有限公司 Image processing-based long-distance fishing boat plate recognition method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102226907A (en) * 2011-05-24 2011-10-26 武汉嘉业恒科技有限公司 License plate positioning method and apparatus based on multiple characteristics
CN104732227A (en) * 2015-03-23 2015-06-24 中山大学 Rapid license-plate positioning method based on definition and luminance evaluation
CN110245613A (en) * 2019-06-17 2019-09-17 珠海华园信息技术有限公司 Ship board recognition methods based on deep learning Characteristic Contrast
CN111985475A (en) * 2020-08-26 2020-11-24 苏州工图智能科技有限公司 Ship board identification method, computing device and storage medium
CN113095281A (en) * 2021-04-29 2021-07-09 平安国际智慧城市科技股份有限公司 Fake-licensed vehicle identification method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6487255B2 (en) * 2015-03-31 2019-03-20 日本電産サンキョー株式会社 Character cutout device, character recognition device, and character cutout method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102226907A (en) * 2011-05-24 2011-10-26 武汉嘉业恒科技有限公司 License plate positioning method and apparatus based on multiple characteristics
CN104732227A (en) * 2015-03-23 2015-06-24 中山大学 Rapid license-plate positioning method based on definition and luminance evaluation
CN110245613A (en) * 2019-06-17 2019-09-17 珠海华园信息技术有限公司 Ship board recognition methods based on deep learning Characteristic Contrast
CN111985475A (en) * 2020-08-26 2020-11-24 苏州工图智能科技有限公司 Ship board identification method, computing device and storage medium
CN113095281A (en) * 2021-04-29 2021-07-09 平安国际智慧城市科技股份有限公司 Fake-licensed vehicle identification method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于计算机视觉的内河船舶身份识别研究;王益全;《中国优秀硕博士学位论文全文数据库(硕士) 信息科技辑》;20090615;第40,53-55页 *

Also Published As

Publication number Publication date
CN113486895A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
JP4071701B2 (en) Color image compression method and color image compression apparatus
US7062099B2 (en) Image processing method and apparatus using self-adaptive binarization
CN103488978B (en) License plate positioning method based on gray level jump and character projection interval mode
US8768052B2 (en) Image processing apparatus, image processing method, and non-transitory computer readable medium
CA2650180C (en) Image binarization using dynamic sub-image division
CN107066972B (en) Natural scene Method for text detection based on multichannel extremal region
CN104182722B (en) Method for text detection and device and text message extracting method and system
JP2008524728A (en) Method for segmenting digital images and generating compact representations
JP2003228712A (en) Method for identifying text-like pixel from image
JP2013211750A (en) Image processing device and image processing program
CN113486895B (en) Ship board identification method and device and computer readable storage medium
US10438376B2 (en) Image processing apparatus replacing color of portion in image into single color, image processing method, and storage medium
WO2018103226A1 (en) Method and device for generating handwriting format document on the basis of picture
CN112419260A (en) PCB character area defect detection method
JP2011248702A (en) Image processing device, image processing method, image processing program, and program storage medium
JP5796392B2 (en) Image processing apparatus and computer program
CN115272350A (en) Method for detecting production quality of computer PCB mainboard
CN111666811A (en) Method and system for extracting traffic sign area in traffic scene image
JP4915678B2 (en) Feature extraction apparatus and feature extraction method
US20140205200A1 (en) Image binarization using dynamic sub-image division
CN111914847B (en) OCR (optical character recognition) method and system based on template matching
CN108388898A (en) Character identifying method based on connector and template
CN116363654A (en) Text image arbitrary inclination angle detection and correction algorithm
CN113610940B (en) Ocean vector file and image channel threshold based coastal area color homogenizing method
CN106295642B (en) License plate positioning method based on fault tolerance rate and texture features

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
GR01 Patent grant
GR01 Patent grant