CN108510636B - Image segmentation method, image segmentation device and terminal equipment - Google Patents
Image segmentation method, image segmentation device and terminal equipment Download PDFInfo
- Publication number
- CN108510636B CN108510636B CN201810257260.5A CN201810257260A CN108510636B CN 108510636 B CN108510636 B CN 108510636B CN 201810257260 A CN201810257260 A CN 201810257260A CN 108510636 B CN108510636 B CN 108510636B
- Authority
- CN
- China
- Prior art keywords
- segmentation
- image
- character
- pixel points
- preset
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07D—HANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
- G07D7/00—Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency
- G07D7/004—Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency using digital security elements, e.g. information coded on a magnetic thread or strip
- G07D7/0047—Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency using digital security elements, e.g. information coded on a magnetic thread or strip using checkcodes, e.g. coded numbers derived from serial number and denomination
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07D—HANDLING OF COINS OR VALUABLE PAPERS, e.g. TESTING, SORTING BY DENOMINATIONS, COUNTING, DISPENSING, CHANGING OR DEPOSITING
- G07D7/00—Testing specially adapted to determine the identity or genuineness of valuable papers or for segregating those which are unacceptable, e.g. banknotes that are alien to a currency
- G07D7/20—Testing patterns thereon
- G07D7/2016—Testing patterns thereon using feature extraction, e.g. segmentation, edge detection or Hough-transformation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Character Input (AREA)
Abstract
The invention is suitable for the technical field of image processing, and provides an image segmentation method, an image segmentation device, terminal equipment and a computer-readable storage medium; the image segmentation method comprises the following steps: acquiring a first image; carrying out binarization processing on the first image to obtain a second image; scanning the second image according to a preset sliding window to obtain more than two window images; selecting window images meeting preset conditions from the window images as the crown word number character images; and performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas. The invention can improve the accuracy of segmenting the serial number characters on the paper money.
Description
Technical Field
The present invention belongs to the field of image processing technologies, and in particular, to an image segmentation method, an image segmentation apparatus, a terminal device, and a computer-readable storage medium.
Background
At present, when paper money is identified, the serial number on the paper money often needs to be identified, and the premise of identifying the serial number is to divide each serial number character.
However, the background of the crown word size region on the paper currency of some countries or regions is complex, and the boundary characteristics of the crown word size characters are not obvious, so that the position of the crown word size characters of the paper currency is positioned wrongly, and the accuracy of segmenting the crown word size characters is reduced.
Disclosure of Invention
In view of the above, the present invention provides an image segmentation method, an image segmentation apparatus, a terminal device and a computer-readable storage medium, which can improve the accuracy of segmenting the serial number characters on the paper money.
A first aspect of the present invention provides an image segmentation method, including:
acquiring a first image, wherein the first image is an image corresponding to a crown word number area of the paper money;
performing binarization processing on the first image to obtain a second image, wherein pixel points on the second image comprise character pixel points and background pixel points;
scanning the second image according to a preset sliding window to obtain more than two window images;
selecting window images meeting preset conditions from the window images as crown word number character images, wherein the preset conditions are that the number of character pixel points is greater than a preset first threshold value, and the number of background pixel points is greater than a preset second threshold value;
and performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a crown word number character.
A second aspect of the present invention provides an image segmentation apparatus comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a first image, and the first image is an image corresponding to a crown word number area of the paper money;
a binarization processing unit, configured to perform binarization processing on the first image acquired by the acquisition unit to obtain a second image, where pixel points on the second image include character pixel points and background pixel points;
a scanning unit, configured to scan the second image obtained by the binarization processing unit according to a preset sliding window, so as to obtain more than two window images;
the selecting unit is used for selecting window images meeting preset conditions from the window images obtained by the scanning unit as the crown word number character images, wherein the preset conditions are that the number of character pixel points is greater than a preset first threshold value, and the number of background pixel points is greater than a preset second threshold value;
and the segmentation unit is used for performing column segmentation on the crown word number character image selected by the selection unit based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a crown word number character.
A third aspect of the invention provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the image segmentation method according to any one of the preceding claims when executing the computer program.
A fourth aspect of the invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the image segmentation method according to any one of the preceding claims.
Compared with the prior art, the invention has the following beneficial effects:
the invention obtains a first image; carrying out binarization processing on the first image to obtain a second image; scanning the second image according to a preset sliding window to obtain more than two window images; selecting window images meeting preset conditions from the window images as the crown word number character images; performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas; the method and the device achieve the purpose of positioning the crown word number characters based on the number of the character pixel points and the number of the background pixel points of the crown word number character region, and avoid the problem that character boundaries are not easy to determine under a complex background, and character positioning errors are caused. The area of the serial number characters can be accurately positioned, so that the accuracy of segmenting the serial number characters on the paper money is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart of an implementation of an image segmentation method provided by an embodiment of the present invention;
FIG. 2-a is an effect diagram of an image corresponding to a crown-mark region of a banknote;
FIG. 2-b is an effect diagram of an image corresponding to a crown-mark region of another banknote;
FIG. 2-c is a diagram of the effect of the image shown in FIG. 2-b after binarization processing;
FIG. 3 is a schematic structural diagram of an image segmentation apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following description is made by way of specific embodiments with reference to the accompanying drawings.
Referring to fig. 1, it shows a flowchart of an implementation of the image segmentation method provided by the embodiment of the present invention, which is detailed as follows:
in the embodiment of the invention, the first image is an image corresponding to a crown word number area of the paper money;
before the crown characters of the bill are divided, an image corresponding to the crown region of the bill needs to be acquired.
In practical application, firstly, a banknote image is acquired, for example, a gray image of a banknote is acquired, and because the coordinate position of the crown word number area of the same banknote is fixed and unchanged, the image corresponding to the crown word number area of the banknote can be intercepted based on the preset coordinate position of the crown word number area of the corresponding banknote.
Preferably, the image corresponding to the intercepted crown word size region is larger than the character region of the crown word size, i.e. the intercepted first image includes all the crown word size characters.
For further description of the crown-mark area of the banknote, reference is made to fig. 2-a, which shows an effect diagram of an image corresponding to the crown-mark area of a banknote of the type having a simpler and single background and being easily segmented and recognized.
In addition, referring to fig. 2-b, which shows an effect diagram of an image corresponding to a crown word number region of another banknote, it can be seen that the background of the crown word number region of the banknote is complex, and for the banknote, because the background of the banknote is complex, the positioning and character segmentation in a conventional manner through a character outline can easily cause wrong positioning, and the accuracy of segmenting the crown word number characters is reduced.
102, performing binarization processing on the first image to obtain a second image, wherein pixel points on the second image comprise character pixel points and background pixel points;
in the embodiment of the present invention, the binarization processing is performed on the first image obtained in step 101, so as to obtain a second image, that is, a binarized image of a prefix region, where the image includes two types of pixel points, one of which is a character pixel point and the other of which is a background pixel point, and the two types of pixel points respectively correspond to pixel points with different gray levels. For example, the character pixel is a pixel with a gray value of 0, and the background pixel is a pixel with a gray value of 255. Referring to fig. 2-c, a diagram of the effect of the image shown in fig. 2-b after being subjected to the binarization processing is shown.
In practical applications, the binarization processing process may be calculated according to the tsu method, and multiplied by a preset coefficient as the binarization threshold, for example, the preset coefficient is 0.8.
In addition, in the embodiment of the present invention, the binarization processing is performed on the first image, so that the background noise of the first image can be removed, and the image quality of the first image is correspondingly improved, thereby correspondingly improving the accuracy of segmenting and positioning the crown-word number characters.
103, scanning the second image according to a preset sliding window to obtain more than two window images;
in the embodiment of the present invention, based on the second image obtained in step 102, the second image is scanned by moving the second image from left to right and from top to bottom in a preset sliding window in a specified step length, one window image can be obtained at the position of each moving step length, and more than two window images can be obtained after scanning the second image.
It should be noted that the preset sliding window may correspond to the size of the area of the serial number character, the sliding window is used to frame the serial number character from the second image more accurately, and the size of the sliding window may be slightly larger than the serial number character; for example, if the size of the crown characters of a certain type of banknote is 600 × 60 pixels, then a sliding window of 605 × 65 pixels may be selected for this type of banknote.
It should be noted that the specified step length may be 1 pixel point, in this case, the search is more accurate, but the search speed is slower, and the search speed may be increased by specifying the larger step length value.
104, selecting window images meeting preset conditions from the window images as crown word number character images;
in the embodiment of the present invention, a crown-number character image is selected from the window image obtained in step 103 based on preset conditions that the number of character pixel points is greater than a preset first threshold, and the number of background pixel points is greater than a preset second threshold.
In the embodiment of the present invention, the first threshold and the second threshold may be set according to actual conditions, for example, in the characters of the crown word size of a certain banknote, the number of the character pixels included in the character 1 is the minimum, when all the crown word sizes of the banknote are 1, the number of the character pixels is M, and then, the number of the pixels of the crown word number characters of any banknote should not be less than M; another exemplary method is that in the characters of the crown word size of a certain banknote, the number of character pixels included in the character 8 is the largest, and when the crown word size of the banknote is all 8, the number of corresponding character pixels is the largest, that is, the number of corresponding background pixels is the smallest, so that the number of background pixels of the crown word size character binary image of any banknote should be not less than N; based on the values of M and N described above, respective first and second thresholds may be set.
And 105, performing column segmentation on the serial number character image based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a serial number character.
In the embodiment of the present invention, the crown character image selected in step 104 is segmented by a preset segmentation column template, so as to obtain character regions with the number equal to that of crown characters of the banknote.
It should be noted that the preset column division template can be flexibly set according to the number of the characters and the character gaps of the crown word numbers on the corresponding paper money. For example, if the number of the serial number characters of a certain type of banknote is 6, the number of the split columns of the split column template corresponding to the banknote is 7, that is, the number of the serial number characters of the banknote is increased by 1, and the position range of the split columns should be changed in the character gap of the banknote.
Optionally, the column template includes more than two columns; the above step 105 can be implemented by the following method:
step A, controlling the segmentation column to transversely move on the crown word number character image by a specified step length to obtain at least two detection positions;
b, counting the number of character pixel points corresponding to the segmentation columns at each detection position to obtain a first numerical value;
and step C, dividing the row of the crown word number character image by taking the detection position where the corresponding division row is located when the first numerical value is minimum as the position for dividing the row of the crown word number character image.
In the embodiment of the invention, at least two detection positions can be obtained by controlling the segmentation columns to move transversely on the crown word number character image in a specified step length, and whether the detection positions are proper segmentation positions can be judged by counting the number of character pixel points on the segmentation columns at each detection position. For example, when the segmentation column happens to be in the gap of the prefix character, the number of character pixels on the segmentation column should be 0 without considering the complex background, and the number of character pixels on the segmentation column should be the minimum if considering the effect of the complex background. Therefore, based on the number of character pixel points on the column to be segmented at different positions, a proper segmentation position is determined, and the column segmentation of the crown word number characters is realized.
Optionally, after the step a, the method may further include:
step D, counting the number of character pixel points in the region between every two adjacent segmentation columns when the segmentation columns are at each detection position;
the step B is specifically as follows: and when the counted number of the character pixel points in the region between any two adjacent segmentation columns is greater than a preset third threshold value, counting the number of the character pixel points corresponding to the segmentation columns at each detection position to obtain a first numerical value.
In the embodiment of the invention, because the crown word number characters need to be segmented one by one, a character region is formed between adjacent segmentation columns, correspondingly, character pixel points between the adjacent segmentation columns are larger than a certain numerical value, and whether the position of the segmentation column is a proper segmentation position or not can be judged by counting the number of the character pixel points in the region between the adjacent segmentation columns when the segmentation column is at each detection position.
Optionally, after the step D, the method further includes:
step E, when the number of the counted character pixel points in the region between any two adjacent segmentation columns is larger than a preset third threshold value, counting the number of non-zero segmentation columns corresponding to the segmentation columns at each detection position to obtain a second numerical value;
the step C is specifically as follows: calculating the product of the first value and the second value; and dividing the row of the serial number character image by taking the detection position where the corresponding division row is positioned when the product is minimum as the position for dividing the row of the serial number character image.
In the embodiment of the present invention, the number of non-zero split columns corresponding to the split columns at each detection position may also be counted to obtain a second numerical value, where the non-zero split columns indicate split columns whose number of character pixels is not 0, that is, the non-zero split columns refer to split columns that pass through the character pixels. Illustratively, a non-zero segmented column refers to a segmented column that is not in the space of a prefix character, but rather passes through the character, without regard to a complex background; the smaller the number of non-zero division lines, the more suitable the division position of the prefix character.
It should be noted that, based on the size of the product, a suitable segmentation position may be selected, and when the product is greater than a certain threshold, the corresponding position may not be used as the segmentation position of the prefix character; therefore, the detection position corresponding to the minimum product can be selected as the division position of the crown character of the banknote.
Optionally, in the step a, controlling the segmentation column to move laterally on the crown word number character image by a specified step size includes:
acquiring a preset gap range corresponding to each adjacent character on the crown word number character image;
controlling the split columns to move laterally within the gap range by a specified step size.
In the embodiment of the invention, because the gap range between the serial number characters of the paper currency of a fixed type is determined, the gap range corresponding to each adjacent character on the serial number character image of the corresponding paper currency can be determined based on the prior knowledge. The split columns are controlled to move transversely within the gap range in a specified step size, so that the movable area of the split columns can be reduced, and the detection speed can be increased.
From the above, the present invention obtains the first image; carrying out binarization processing on the first image to obtain a second image; scanning the second image according to a preset sliding window to obtain more than two window images; selecting window images meeting preset conditions from the window images as the crown word number character images; performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas; the method and the device achieve the purpose of positioning the crown word number characters based on the number of the character pixel points and the number of the background pixel points of the crown word number character region, and avoid the problem that character boundaries are not easy to determine under a complex background, and character positioning errors are caused. The area of the serial number characters can be accurately positioned, so that the accuracy of segmenting the serial number characters on the paper money is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The following are embodiments of the apparatus of the invention, reference being made to the corresponding method embodiments described above for details which are not described in detail therein.
Fig. 3 is a schematic structural diagram of an image segmentation apparatus according to an embodiment of the present invention, and for convenience of description, only the portions related to the embodiment of the present invention are shown, which is detailed as follows:
as shown in fig. 3, the image segmentation apparatus 3 includes: an acquisition unit 31, a binarization processing unit 32, a scanning unit 33, a selection unit 34, and a segmentation unit 35.
The acquiring unit 31 is configured to acquire a first image, where the first image is an image corresponding to a crown word number region of a banknote;
a binarization processing unit 32, configured to perform binarization processing on the first image acquired by the acquisition unit 31 to obtain a second image, where pixel points on the second image include character pixel points and background pixel points;
a scanning unit 33, configured to scan the second image obtained by the binarization processing unit 32 according to a preset sliding window, so as to obtain more than two window images;
a selecting unit 34, configured to select, from the window images obtained by the scanning unit 33, a window image that meets a preset condition as a crown word character image, where the preset condition is that the number of character pixel points is greater than a preset first threshold, and the number of background pixel points is greater than a preset second threshold;
the segmentation unit 35 is configured to perform column segmentation on the serial number character image selected by the selection unit 34 based on a preset segmentation column template to obtain more than two character regions, where each character region includes a serial number character.
Optionally, the column template includes more than two columns; the image segmentation apparatus 3 further includes:
a movement control unit for controlling the division column to move transversely on the crown word number character image selected by the selection unit 34 by a designated step length to obtain at least two detection positions;
the first statistical unit is used for counting the number of character pixel points corresponding to each detection position obtained by the segmentation row in the mobile control subunit to obtain a first numerical value;
the segmentation unit 35 is further configured to:
and performing row-column segmentation on the serial number character image by taking the detection position where the segmentation column corresponding to the minimum first numerical value obtained by the first statistical unit is positioned as the position for performing the column segmentation on the serial number character image.
Optionally, the image segmentation apparatus 3 further includes a second statistics unit, configured to count the number of character pixel points in an area between each adjacent segmentation row when the segmentation row is at each detection position obtained by the motion control subunit;
the first statistical unit is further configured to:
and when the number of the character pixel points in the region between any two adjacent segmentation rows counted by the second counting unit is greater than a preset third threshold, counting the number of the character pixel points corresponding to the segmentation rows at each detection position.
From the above, the present invention obtains the first image; carrying out binarization processing on the first image to obtain a second image; scanning the second image according to a preset sliding window to obtain more than two window images; selecting window images meeting preset conditions from the window images as the crown word number character images; performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas; the method and the device achieve the purpose of positioning the crown word number characters based on the number of the character pixel points and the number of the background pixel points of the crown word number character region, and avoid the problem that character boundaries are not easy to determine under a complex background, and character positioning errors are caused. The area of the serial number characters can be accurately positioned, so that the accuracy of segmenting the serial number characters on the paper money is improved.
Fig. 4 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in said memory 41 and executable on said processor 40. The processor 40, when executing the computer program 42, implements the steps in the various image segmentation method embodiments described above, such as the steps 101 to 105 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the units 31 to 35 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 42 in the terminal device 4. For example, the computer program 42 may be divided into an acquisition unit, a binarization processing unit, a scanning unit, an extraction unit, and a division unit. The specific functions of each unit are as follows:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a first image, and the first image is an image corresponding to a crown word number area of the paper money;
a binarization processing unit, configured to perform binarization processing on the first image acquired by the acquisition unit to obtain a second image, where pixel points on the second image include character pixel points and background pixel points;
a scanning unit, configured to scan the second image obtained by the binarization processing unit according to a preset sliding window, so as to obtain more than two window images;
the selecting unit is used for selecting window images meeting preset conditions from the window images obtained by the scanning unit as the crown word number character images, wherein the preset conditions are that the number of character pixel points is greater than a preset first threshold value, and the number of background pixel points is greater than a preset second threshold value;
and the segmentation unit is used for performing column segmentation on the crown word number character image selected by the selection unit based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a crown word number character.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 4 and does not constitute a limitation of terminal device 4 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program and other programs and data required by the terminal device. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.
Claims (8)
1. An image segmentation method, characterized in that the image segmentation method comprises:
acquiring a first image, wherein the first image is an image corresponding to a crown word number area of the paper money;
performing binarization processing on the first image to obtain a second image, wherein pixel points on the second image comprise character pixel points and background pixel points;
scanning the second image according to a preset sliding window to obtain more than two window images;
selecting window images meeting preset conditions from the window images as crown word number character images, wherein the preset conditions are that the number of character pixel points is greater than a preset first threshold value, and the number of background pixel points is greater than a preset second threshold value;
performing column segmentation on the crown word number character image based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a crown word number character;
wherein the segmentation column template comprises more than two segmentation columns;
the column segmentation of the crown word number character image based on a preset segmentation column template comprises the following steps:
controlling the segmentation column to move transversely on the crown word number character image in a specified step length to obtain at least two detection positions;
counting the number of character pixel points corresponding to the segmentation columns at each detection position to obtain a first numerical value;
and performing row-column segmentation on the serial number character image by taking the detection position where the corresponding segmentation row is located when the first numerical value is minimum as a position for performing row segmentation on the serial number character image.
2. The image segmentation method of claim 1, wherein the controlling the segmentation columns to move laterally on the crown-size character image in a specified step size further comprises:
counting the number of character pixel points in the region between every two adjacent segmentation columns when the segmentation columns are at each detection position;
the counting of the number of character pixel points corresponding to the segmentation columns at each detection position comprises:
and when the counted number of the character pixel points in the region between any two adjacent segmentation columns is greater than a preset third threshold value, counting the number of the character pixel points corresponding to the segmentation columns at each detection position.
3. The image segmentation method according to claim 2, wherein the step of counting the number of character pixels in the region between adjacent segmentation columns at each detection position further comprises:
when the number of the counted character pixel points in the region between any two adjacent segmentation columns is larger than a preset third threshold value, counting the number of non-zero segmentation columns corresponding to the segmentation columns at each detection position to obtain a second numerical value, wherein the non-zero segmentation columns represent the segmentation columns with the number of the character pixel points not being 0;
the column division is performed on the serial number character image by taking the detection position where the corresponding division column is located when the first numerical value is the minimum as the position for performing the column division on the serial number character image, and the column division includes:
calculating the product of the first value and the second value;
and dividing the row of the serial number character image by taking the detection position where the corresponding division row is positioned when the product is minimum as the position for dividing the row of the serial number character image.
4. The image segmentation method according to any one of claims 1 to 3, wherein the controlling the segmentation columns to move laterally on the crown-number character image in a specified step size includes:
acquiring a preset gap range corresponding to each adjacent character on the crown word number character image;
controlling the split columns to move laterally within the gap range by a specified step size.
5. An image segmentation apparatus, characterized in that the image segmentation apparatus comprises:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a first image, and the first image is an image corresponding to a crown word number area of the paper money;
a binarization processing unit, configured to perform binarization processing on the first image acquired by the acquisition unit to obtain a second image, where pixel points on the second image include character pixel points and background pixel points;
a scanning unit, configured to scan the second image obtained by the binarization processing unit according to a preset sliding window, so as to obtain more than two window images;
the selecting unit is used for selecting window images meeting preset conditions from the window images obtained by the scanning unit as the crown word number character images, wherein the preset conditions are that the number of character pixel points is greater than a preset first threshold value, and the number of background pixel points is greater than a preset second threshold value;
the segmentation unit is used for performing column segmentation on the crown word number character image selected by the selection unit based on a preset segmentation column template to obtain more than two character areas, wherein each character area comprises a crown word number character;
wherein the segmentation column template comprises more than two segmentation columns;
the image segmentation apparatus further includes:
the mobile control unit is used for controlling the segmentation columns to transversely move on the crown word number character image selected by the selection unit by a specified step length to obtain at least two detection positions;
the first statistical unit is used for counting the number of character pixel points corresponding to each detection position obtained by the segmentation row in the mobile control subunit to obtain a first numerical value;
the segmentation unit is further configured to:
and performing row-column segmentation on the serial number character image by taking the detection position where the segmentation column corresponding to the minimum first numerical value obtained by the first statistical unit is positioned as the position for performing the column segmentation on the serial number character image.
6. The image segmentation apparatus according to claim 5, further comprising a second counting unit configured to count the number of character pixels in a region between adjacent segmented columns at each detection position obtained by the motion control subunit;
the first statistical unit is further configured to:
and when the number of the character pixel points in the region between any two adjacent segmentation rows counted by the second counting unit is greater than a preset third threshold, counting the number of the character pixel points corresponding to the segmentation rows at each detection position.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810257260.5A CN108510636B (en) | 2018-03-27 | 2018-03-27 | Image segmentation method, image segmentation device and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810257260.5A CN108510636B (en) | 2018-03-27 | 2018-03-27 | Image segmentation method, image segmentation device and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108510636A CN108510636A (en) | 2018-09-07 |
CN108510636B true CN108510636B (en) | 2020-01-14 |
Family
ID=63378741
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810257260.5A Active CN108510636B (en) | 2018-03-27 | 2018-03-27 | Image segmentation method, image segmentation device and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108510636B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110895849A (en) * | 2018-09-13 | 2020-03-20 | 深圳怡化电脑股份有限公司 | Method and device for cutting and positioning crown word number, computer equipment and storage medium |
CN112766249B (en) * | 2019-11-04 | 2024-06-14 | 深圳怡化电脑股份有限公司 | Bill boundary positioning method and device and terminal equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4136257B2 (en) * | 2000-03-17 | 2008-08-20 | 株式会社リコー | Character recognition device, character recognition method, and storage medium |
CN104899588B (en) * | 2015-06-26 | 2018-12-11 | 小米科技有限责任公司 | Identify the method and device of the character in image |
CN106022346B (en) * | 2016-05-24 | 2019-06-07 | 深圳怡化电脑股份有限公司 | A kind of cutting method and device of crown word number |
CN107437294B (en) * | 2017-08-01 | 2020-05-01 | 深圳怡化电脑股份有限公司 | Character segmentation method, device, equipment and storage medium |
CN107622562A (en) * | 2017-09-11 | 2018-01-23 | 深圳怡化电脑股份有限公司 | Extracting method, device, equipment and the storage medium of banknote image |
-
2018
- 2018-03-27 CN CN201810257260.5A patent/CN108510636B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108510636A (en) | 2018-09-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10896349B2 (en) | Text detection method and apparatus, and storage medium | |
CN107833238B (en) | Maximum connected domain marking method, target tracking method and augmented reality/virtual reality device | |
CN111079772B (en) | Image edge extraction processing method, device and storage medium | |
CN109598271B (en) | Character segmentation method and device | |
CN110619333A (en) | Text line segmentation method, text line segmentation device and electronic equipment | |
CN109214229B (en) | Bar code scanning method and device and electronic equipment | |
CN108334879B (en) | Region extraction method, system and terminal equipment | |
CN108229232B (en) | Method and device for scanning two-dimensional codes in batch | |
US9792507B2 (en) | Method and system for ground truth determination in lane departure warning | |
CN110475078B (en) | Camera exposure time adjusting method and terminal equipment | |
CN110570442A (en) | Contour detection method under complex background, terminal device and storage medium | |
CN109389110B (en) | Region determination method and device | |
CN108510636B (en) | Image segmentation method, image segmentation device and terminal equipment | |
CN109461133A (en) | Bridge bolt dropping detection method and terminal device | |
CN111882565B (en) | Image binarization method, device, equipment and storage medium | |
CN111091572A (en) | Image processing method and device, electronic equipment and storage medium | |
CN112801111A (en) | Image straight line edge point classification method and device based on gradient direction | |
CN111369489B (en) | Image identification method and device and terminal equipment | |
CN109308710B (en) | Monitoring method, computing device and computer readable storage medium | |
CN111242051B (en) | Vehicle identification optimization method, device and storage medium | |
CN112530079B (en) | Method, device, terminal equipment and storage medium for detecting bill factors | |
CN107945186A (en) | Method, apparatus, computer-readable recording medium and the terminal device of segmentation figure picture | |
CN108564571B (en) | Image area selection method and terminal equipment | |
CN109726722B (en) | Character segmentation method and device | |
CN110874814B (en) | Image processing method, image processing device and terminal equipment |
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 |