CN108802062B - Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device - Google Patents
Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device Download PDFInfo
- Publication number
- CN108802062B CN108802062B CN201710288745.6A CN201710288745A CN108802062B CN 108802062 B CN108802062 B CN 108802062B CN 201710288745 A CN201710288745 A CN 201710288745A CN 108802062 B CN108802062 B CN 108802062B
- Authority
- CN
- China
- Prior art keywords
- stamp
- image
- gradient
- detected
- block
- 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
- 238000001514 detection method Methods 0.000 title claims abstract description 11
- 238000000034 method Methods 0.000 claims abstract description 17
- 239000003086 colorant Substances 0.000 claims description 9
- 238000012163 sequencing technique Methods 0.000 claims description 6
- 238000009966 trimming Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/84—Systems specially adapted for particular applications
- G01N21/88—Investigating the presence of flaws or contamination
- G01N21/95—Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
- G01N21/956—Inspecting patterns on the surface of objects
- G01N21/95607—Inspecting patterns on the surface of objects using a comparative method
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B41—PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
- B41K—STAMPS; STAMPING OR NUMBERING APPARATUS OR DEVICES
- B41K3/00—Apparatus for stamping articles having integral means for supporting the articles to be stamped
- B41K3/62—Details or accessories
Landscapes
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a detection method for detecting stamp-pad ink condition of a stamped image, which comprises the following steps: the terminal acquires an image covered with a seal; determining the gradient T of a block to be detected according to the image; determining the seal ink definition value K of the seal according to the gradient T of the block to be detected; comparing the stamp-pad ink definition K with a preset value T0, and when the stamp-pad ink definition K is larger than a preset value T0, determining that the stamp-pad ink is sufficient, otherwise, determining that the stamp-pad ink is insufficient; the method can detect the condition of the stamp-pad ink of the stamping image in real time, and can add the stamp-pad ink in time when the insufficient stamp-pad ink of the stamping image is found, thereby preventing the loss caused by the pollution to the file due to the poor stamp-pad ink during stamping.
Description
Technical Field
The invention relates to the technical field of stamping, in particular to a detection method for detecting stamp-pad ink condition of a stamped image and stamping equipment.
Background
The self-service stamping equipment can not automatically add the stamp-pad ink in the stamping process, at present, a good method for detecting the state of the stamp-pad ink in real time does not exist, and the situation that the stamp with insufficient stamp-pad ink covers the document (bill) and pollutes the document (bill) frequently occurs.
Disclosure of Invention
In order to overcome the technical problems in the prior art, the invention mainly aims to provide a method for detecting the stamp-pad ink condition of a stamped image in real time.
In order to achieve the purpose, the invention specifically adopts the following technical scheme:
the invention provides a detection method for detecting stamp-pad ink condition of a stamped image, which comprises the following steps:
acquiring an image covered with a seal;
determining the gradient T of a block to be detected according to the image;
determining the seal ink definition value K of the seal according to the gradient T of the block to be detected;
and comparing the stamp-pad ink definition value K with a preset value T0, and determining the stamp-pad ink condition according to the comparison result.
Determining the gradient T of the block to be detected according to the image specifically comprises the following steps:
generating a block to be detected in the image;
determining the gradient sum of each block to be detected according to the image gradient in each block to be detected, and sequencing the gradient sum of each block to be detected from large to small;
determining the gray sum of the seal colors in each block to be detected according to the gray value of the seal color in each block to be detected, and sequencing the gray sums of the seal colors in each block to be detected from large to small;
and determining the gradient T of the block to be detected according to the gradient of the block to be detected and the gray scale of the color of the seal in the block to be detected, and sequencing the gradient T of each block to be detected from large to small.
Determining the gradient sum of each block to be detected according to the image gradient in the block to be detected, specifically:
determining the gradient of the image in the x direction, namely:
dx(i,j)=l(i+1,j)-l(i,j);
determining the gradient of the image in the y direction, namely:
dy(i,j)=l(i,j+1)-l(i,j);
determining the image gradient G (x, y) according to the gradient of the image in the x direction and the gradient of the image in the y direction, namely:
G(x,y)=dx(i,j)+dy(i,j);
where l is the value of an image pixel and (i, j) is the pixel coordinate;
and determining the gradient sum of each block to be detected according to the image gradient G (x, y) in each block to be detected.
Determining the gray sum of the seal colors in each block to be detected according to the gray value of the seal colors in the block to be detected, specifically comprising the following steps:
converting the image from the current color space to an HSV color space;
extracting a color which is the same as the seal color from the HSV color space of the image;
and determining the gray sum of each block to be detected according to the gray value of the seal color in each block to be detected.
Determining the stamp-pad ink definition value K of the stamp according to the gradient T of the block to be detected, which specifically comprises the following steps:
determining the outer annular area S of the seal according to the preset seal size;
adding the gradients T of the blocks to be detected, wherein the gradient T of the blocks to be detected is greater than a gradient threshold value T1 to obtain a seal gradient N;
determining the seal ink definition value K of the seal according to the outer annular area S and the seal gradient N of the seal, namely:
K=N/S;
wherein K is the definition value of the stamp-pad ink, N is the gradient of the stamp, and S is the area of the outer ring of the stamp.
Comparing the stamp-pad ink definition K with a preset value T0, and determining the stamp-pad ink condition according to the comparison result, wherein the method specifically comprises the following steps:
and when the stamp-pad ink definition value K is larger than a preset value T0, determining that the stamp-pad ink is sufficient, otherwise, determining that the stamp-pad ink is insufficient.
And after the image covered with the seal is obtained, cutting the periphery of the image.
Correspondingly, the invention also provides stamping equipment which adopts the detection method to detect the stamp-pad ink condition of the stamped image on the stamped file. I.e. the device automatically identifies documents that are detected as being underprinted after stamping.
Compared with the prior art, the method can detect the condition of the stamp-pad ink of the stamped image in real time, and can add the stamp-pad ink in time when the insufficient stamp-pad ink of the stamped image is found, so that the loss caused by the fact that the stamp-pad ink is not enough to cause the stamp to be not stamped well and the document (bill) is polluted during stamping is prevented.
Drawings
FIG. 1 is a flow chart of a method for detecting the situation of stamping stamp-pad ink according to the present invention;
FIG. 2 is a flow chart of a method of determining a gradient T of a block to be detected according to the present invention;
FIG. 3 is a flowchart of a method for determining the stamp-pad ink definition K of a stamp according to the present invention;
FIG. 4 is a flow chart of a method of determining a gradient sum for each block to be detected according to the present invention;
FIG. 5 is a flowchart of a method for determining the gray-scale sum of the colors of the stamps in each block to be detected according to the present invention;
FIG. 6 is a schematic diagram of a stamp according to embodiment 1 of the present invention;
fig. 7 is a schematic diagram of a stamp in embodiment 2 of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, the present invention provides a method for detecting stamp-pad ink condition of a stamp-pad image, comprising:
step S10, the terminal acquires the image stamped with the seal;
step S20, clipping the periphery of the image;
after the image stamped with the stamp is obtained, in order to improve the efficiency of positioning the stamp, that is, to improve the detection efficiency, because dark dots such as black edges may exist around the image, after the image stamped with the stamp is obtained, the periphery of the image is cut. In the present embodiment, the image stamped with the stamp is acquired through the terminal, but in other embodiments, the image stamped with the stamp may be acquired through other devices.
Step S30, determining the block gradient T to be detected according to the image;
as shown in fig. 2, the determining the gradient T of the block to be detected according to the image includes step S301, generating the block to be detected in the image; step S302, determining the gradient sum of each block to be detected according to the image gradient in the block to be detected; step S303, the gradient sum of each block to be detected is sorted from big to small; step S304, determining the gray sum of the seal color in each block to be detected according to the gray value of the seal color in the block to be detected; s305, sorting the gray sum of each block to be detected from large to small; step S306, determining the gradient T of the block to be detected according to the gradient sum of the block to be detected and the gray sum of the color of the seal in the block to be detected, namely adding the gradient sum and the gray sum in the same block to be detected to obtain the gradient T of the block to be detected; and S307, sorting the gradients T of each block to be detected from large to small.
Specifically, if the pixel of the region covered with the stamp is 80X80, the initial position point (0, 0) of the image is moved by 80 pixels respectively along the X-axis and y-axis directions of the image to generate a first block to be detected (0, 0, 80), and a point is moved continuously along the X-axis direction to generate a second block to be detected (1, 0, 80) in the X-axis direction, and similarly, a point is moved continuously along the y-axis direction to generate a second block to be detected (0, 1, 80) in the y-axis direction. Thus, all the blocks to be detected of the image can be generated.
The order of the gradient sum of each block to be detected, the gray scale sum of each block to be detected and the gradient T of the block to be detected is from large to small so as to improve the detection efficiency. The place where the value of the gradient sum, the value of the gray sum or the value of the gradient T of the block to be detected is the largest is probably the position where the stamp is located.
As shown in fig. 4, the determining the gradient of each block to be detected according to the image gradient in the block to be detected and the step S3021, determining the gradient of the image in the x direction; step S3022, determining the gradient of the image in the y direction; step S3023, determining an image gradient G (x, y) according to the gradient of the image in the x direction and the gradient of the image in the y direction; step S3024, determining the gradient sum of each block to be detected according to the image gradient G (x, y) in each block to be detected, that is, adding the image gradients G (x, y) in each block to be detected to obtain the gradient sum of each block to be detected.
Specifically, the gradient in the image x direction is dx (i, j) ═ l (i +1, j) -l (i, j);
the gradient in the y direction of the image is dy (i, j) ═ l (i, j +1) -l (i, j);
the image gradient G (x, y) is, G (x, y) ═ dx (i, j) + dy (i, j);
where l is the value of an image pixel (e.g., RGB value) and i, j is the pixel coordinate.
As shown in fig. 5, determining the gray level of the seal color in each block to be detected according to the gray level of the seal color in the block to be detected and including step S3041, converting the image from the current color space to HSV color space; step S3042, extracting a color identical to the seal color from the HSV color space of the image (if the current seal color is red, extracting red); step S3043, determining the gray sum of each block to be detected according to the gray value of the seal color in each block to be detected, that is, adding the gray values of the seal colors in each block to be detected to obtain the gray sum of each block to be detected.
Step S40, determining the stamp-pad ink definition value K of the stamp according to the gradient T of the block to be detected;
as shown in fig. 3, the determining the stamp-pad ink definition value K of the stamp according to the gradient T of the block to be detected includes step S401, determining an outer annular area S of the stamp according to a preset stamp size; step S402, adding the gradients T of the blocks to be detected with the gradient threshold value T1 to obtain a seal gradient N; step S403, determining the stamp-pad ink definition K of the stamp according to the outer annular area S of the stamp and the stamp gradient N, namely:
K=N/S;
wherein, K is stamp-pad ink definition value, N is stamp gradient, S is stamp outer ring area, and gradient threshold value T1 is 2/3S.
Step S50, judging whether the stamp-pad ink definition value K is larger than a preset value T0; if yes, the step S60 is performed, and the output result is that the ink is sufficient; if the determination result is no, the process proceeds to step S70, and the output result is that the ink is insufficient.
T0 is the definition of seal definition, and can be set according to the needs of the user.
Correspondingly, the embodiment also provides a stamping device which adopts the detection method to detect the stamp-pad ink condition of the stamped image on the stamped file; that is, after stamping, the stamping apparatus automatically recognizes the document detected as being insufficient in stamp-pad ink.
Example 1
As shown in fig. 6, the stamp in this embodiment is a circular stamp, R1 is the radius of the inner ring, R2 is the radius of the outer ring, and the outer ring area S is:
s (ring) ═ pi × R2 × R2-pi × R1 × R1;
the stamp gradient N is as follows:
n is the sum of the block gradients T to be detected greater than the gradient valve T1;
the stamp-pad ink definition value K is:
k ═ N/S (ring);
when K is more than T0, the output stamp-pad ink is sufficient; otherwise, the output printing ink is insufficient.
Example 2
As shown in fig. 7, the stamp in this embodiment is an equilateral triangle stamp, a1 is the side length of the triangle, b1 is the height of the triangle; a2 is the side length of the inner triangle, b2 is the height of the inner triangle, the outer annular area S is:
the stamp gradient N is as follows:
n is the sum of the gradients T of the blocks to be detected which are greater than the gradient threshold value T1;
the stamp-pad ink definition value K is:
k ═ N/S (ring);
when K is more than T0, the output stamp-pad ink is sufficient; otherwise, the output printing ink is insufficient.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (7)
1. A detection method for detecting stamp-pad ink condition of a stamped image is characterized by comprising the following steps:
acquiring an image covered with a seal;
determining the gradient T of a block to be detected according to the image;
determining the seal ink definition value K of the seal according to the gradient T of the block to be detected;
comparing the stamp-pad ink definition value K with a preset value T0, and determining the stamp-pad ink condition according to the comparison result;
determining the gradient T of the block to be detected according to the image specifically comprises the following steps:
generating a block to be detected in the image;
determining the gradient sum of each block to be detected according to the image gradient in each block to be detected, and sequencing the gradient sum of each block to be detected from large to small;
determining the gray sum of the seal colors in each block to be detected according to the gray value of the seal color in each block to be detected, and sequencing the gray sums of the seal colors in each block to be detected from large to small;
determining the gradient T of the block to be detected according to the gradient sum of the block to be detected and the gray sum of the colors of the seals in the block to be detected, and sequencing the gradient T of each block to be detected from large to small;
determining the stamp-pad ink definition value K of the stamp according to the gradient T of the block to be detected, which specifically comprises the following steps:
determining the outer annular area S of the seal according to the preset seal size;
adding the gradients T of the blocks to be detected, wherein the gradient T of the blocks to be detected is greater than a gradient threshold value T1 to obtain a seal gradient N;
determining the seal ink definition value K of the seal according to the outer annular area S and the seal gradient N of the seal, namely:
K=N/S;
wherein K is the definition value of the stamp-pad ink, N is the gradient of the stamp, and S is the area of the outer ring of the stamp.
2. The method for detecting the stamp-pad ink condition of a stamp-pad image according to claim 1, wherein the step of determining the gradient sum of each block to be detected according to the image gradient in the block to be detected is specifically as follows:
determining the gradient of the image in the x direction, namely:
dx(i,j)=l(i+1,j)-l(i,j);
determining the gradient of the image in the y direction, namely:
dy(i,j)=l(i,j+1)-l(i,j);
determining the image gradient G (x, y) according to the gradient of the image in the x direction and the gradient of the image in the y direction, namely:
G(x,y)=dx(i,j)+dy(i,j);
where l is the value of an image pixel and (i, j) is the pixel coordinate;
and determining the gradient sum of each block to be detected according to the image gradient G (x, y) in each block to be detected.
3. The method for detecting the stamp-pad ink condition of a stamp image according to claim 1, wherein the step of determining the gray-scale sum of the stamp color in each block to be detected according to the gray-scale value of the stamp color in the block to be detected comprises:
converting the image from the current color space to an HSV color space;
extracting a color which is the same as the seal color from the HSV color space of the image;
and determining the gray sum of each block to be detected according to the gray value of the seal color in each block to be detected.
4. The method for detecting the stamp-pad ink condition of a stamped image according to claim 1, wherein the stamp-pad ink definition K is compared with a preset value T0, and the stamp-pad ink condition is determined according to the comparison result, specifically:
and when the stamp-pad ink definition value K is larger than a preset value T0, determining that the stamp-pad ink is sufficient, otherwise, determining that the stamp-pad ink is insufficient.
5. The method for detecting the ink-applying condition of a stamped image according to claim 1, further comprising, after the step of obtaining the image stamped with the stamp, trimming the periphery of the image.
6. A stamping device, characterized in that the detection method of any one of claims 1 to 5 is adopted to detect the stamp-pad ink condition of a stamped image on a stamped file.
7. The stamping apparatus of claim 6, wherein after stamping, the stamping apparatus automatically identifies documents detected as being underprinted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710288745.6A CN108802062B (en) | 2017-04-27 | 2017-04-27 | Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710288745.6A CN108802062B (en) | 2017-04-27 | 2017-04-27 | Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108802062A CN108802062A (en) | 2018-11-13 |
CN108802062B true CN108802062B (en) | 2020-12-18 |
Family
ID=64069392
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710288745.6A Active CN108802062B (en) | 2017-04-27 | 2017-04-27 | Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108802062B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110514675B (en) * | 2019-08-29 | 2020-12-11 | 珠海格力电器股份有限公司 | Intelligent detection method and system for label |
CN113478992B (en) * | 2021-05-31 | 2023-03-14 | 深圳市银之杰科技股份有限公司 | Full-automatic high-speed batch stamping machine |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102800085A (en) * | 2012-06-21 | 2012-11-28 | 西南交通大学 | Method for detecting and extracting main target image in complicated image |
CN103440671A (en) * | 2013-08-23 | 2013-12-11 | 方正国际软件有限公司 | Seal detecting method and system |
CN105513080A (en) * | 2015-12-21 | 2016-04-20 | 南京邮电大学 | Infrared image target salience evaluating method |
EP3050705A4 (en) * | 2013-09-24 | 2017-04-05 | I. Mer Co., Ltd. | Can-printing apparatus and can inspection device |
-
2017
- 2017-04-27 CN CN201710288745.6A patent/CN108802062B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102800085A (en) * | 2012-06-21 | 2012-11-28 | 西南交通大学 | Method for detecting and extracting main target image in complicated image |
CN103440671A (en) * | 2013-08-23 | 2013-12-11 | 方正国际软件有限公司 | Seal detecting method and system |
EP3050705A4 (en) * | 2013-09-24 | 2017-04-05 | I. Mer Co., Ltd. | Can-printing apparatus and can inspection device |
CN105513080A (en) * | 2015-12-21 | 2016-04-20 | 南京邮电大学 | Infrared image target salience evaluating method |
Non-Patent Citations (2)
Title |
---|
支票印章图像配准和检测算法研究;韩劲涛;《中国优秀硕士学位论文全文数据库》;20120515(第05期);正文第3-4章 * |
韩劲涛.支票印章图像配准和检测算法研究.《中国优秀硕士学位论文全文数据库》.2012,(第05期), * |
Also Published As
Publication number | Publication date |
---|---|
CN108802062A (en) | 2018-11-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100339691B1 (en) | Apparatus for recognizing code and method therefor | |
JP5701182B2 (en) | Image processing apparatus, image processing method, and computer program | |
US10699110B2 (en) | Image processing apparatus, image processing method, and non-transitory recording medium storing program for causing computer to execute image processing method | |
JP6970835B2 (en) | Image processing device, control method and control program | |
CN108802062B (en) | Detection method for detecting stamp-pad ink condition of stamp-pad image and stamp-pad device | |
CN107659799B (en) | Image pickup apparatus, image processing method, and storage medium | |
Li et al. | A color cast detection algorithm of robust performance | |
US20060221410A1 (en) | Image processing apparatus | |
EP2735998A1 (en) | Image processing apparatus | |
KR20160029164A (en) | Method and System for filtering image spam massage in mobile network | |
CN103530625A (en) | Optical character recognition method based on digital image processing | |
US9665770B2 (en) | Image processing apparatus with an improved table image detecting unit | |
CN102982331A (en) | Method for identifying character in image | |
US10104269B2 (en) | Image processing apparatus configured for binarizing image data and methods for binarizing image data | |
JP2017118433A (en) | Image processing device, image processing method and program | |
US20210127032A1 (en) | Image processing device, control method and control program | |
CN110263708A (en) | Image sources recognition methods, equipment and computer readable storage medium | |
JP2015012491A (en) | Image processor | |
CN115100625A (en) | Method and system for identifying state of signal lamp | |
EP1729497B1 (en) | Method and apparatus for detecting image area, and computer product | |
CN114023249A (en) | LED display screen image light point extraction method and device and LED display screen correction method | |
KR20020059531A (en) | Method and apparatus for improving printing quality of document in which a text and an image exist together | |
US20210192694A1 (en) | Image processing device, control method, and control program | |
JP5156794B2 (en) | Video processing method and video processing apparatus | |
US9756200B2 (en) | Image processing apparatus with an improved table image detecting unit |
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 |