CN115689943A - Micro graph code motion blur detection method based on gradient symmetry - Google Patents

Micro graph code motion blur detection method based on gradient symmetry Download PDF

Info

Publication number
CN115689943A
CN115689943A CN202211446212.3A CN202211446212A CN115689943A CN 115689943 A CN115689943 A CN 115689943A CN 202211446212 A CN202211446212 A CN 202211446212A CN 115689943 A CN115689943 A CN 115689943A
Authority
CN
China
Prior art keywords
image
code
gradient
symmetry
counterfeiting
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.)
Granted
Application number
CN202211446212.3A
Other languages
Chinese (zh)
Other versions
CN115689943B (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.)
Wuhan Baochengxin Technology Co ltd
Original Assignee
Wuhan Baochengxin 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 Wuhan Baochengxin Technology Co ltd filed Critical Wuhan Baochengxin Technology Co ltd
Priority to CN202211446212.3A priority Critical patent/CN115689943B/en
Publication of CN115689943A publication Critical patent/CN115689943A/en
Application granted granted Critical
Publication of CN115689943B publication Critical patent/CN115689943B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Image Analysis (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The invention discloses a microimage code motion blur detection method based on gradient symmetry, which comprises the following steps: step 1), photographing to obtain a micro image code sample picture; the micro-graph code comprises a two-dimensional code area and an anti-counterfeiting area; the anti-counterfeiting area comprises a microimage anti-counterfeiting code, wherein the microimage anti-counterfeiting code is a pattern formed by dense lattices; step 2), positioning and deducting the regional image of the microimage anti-counterfeiting code as a target image; step 3) calculating gradient images of 0 degrees, 90 degrees, 45 degrees and 135 degrees of the target image area; and 4) calculating the symmetry of the 0-degree and 90-degree gradient images and the symmetry of the 45-degree and 135-degree gradient images according to the gradient images, and judging whether the images are in motion blur or not according to the symmetry. When the method of the invention is used, the image can be effectively and accurately detected when the motion blur appears.

Description

Micro graph code motion blur detection method based on gradient symmetry
Technical Field
The invention relates to an image processing technology, in particular to a microimage code motion blur detection method based on gradient symmetry.
Background
In recent years, with the rapid development of domestic production, the problem of counterfeit goods is more and more rampant, legal rights and interests of enterprises and consumers are endangered, and the national economic development is seriously influenced. Along with the popularization of the intelligent equipment, the image anti-counterfeiting technology is more and more popularized. A novel micro-graph code is designed and provided, the micro-graph code is formed by combining a two-dimensional code and a micro-graph anti-counterfeiting code, and has the functions of pre-sale anti-counterfeiting, product tracing, goods fleeing prevention, intelligent marketing and the like, wherein the micro-graph anti-counterfeiting code is a dense dot matrix pattern which is specially designed, and is more beneficial to random diffusion of printing ink in printing. The micro-image anti-counterfeiting technology compares a clear and stable image photographed by a mobile phone with a server template image, and compares the diffusion effect of ink at a fine place.
In the practical application process, the smartphone is inevitably shaken in the using process, the shake can influence the final photographed picture to have smear, the quality is poor, the final result of the micro-image anti-counterfeiting is influenced, and the genuine products can be changed into fake products, which cannot be tolerated by the market. Based on the background, a microimage code motion blur detection method based on gradient symmetry is provided, when an image is detected to be a motion blur image, the result is judged to be unreliable, and a user can take a picture again for verification.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a microimage code motion blur detection method based on gradient symmetry aiming at the defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a microimage code motion blur detection method based on gradient symmetry comprises the following steps:
step 1), photographing to obtain a micro image code sample picture; the micro-graph code comprises a two-dimensional code area and an anti-counterfeiting area; the anti-counterfeiting area comprises a microimage anti-counterfeiting code, wherein the microimage anti-counterfeiting code is a pattern formed by dense lattices;
step 2), positioning and deducting the regional image of the microimage anti-counterfeiting code as a target image;
step 3) calculating gradient images of 0 degrees, 90 degrees, 45 degrees and 135 degrees of the target image area;
and 4) calculating the symmetry of the 0-degree and 90-degree gradient images and the symmetry of the 45-degree and 135-degree gradient images according to the gradient images, and judging whether the images are in motion blur or not according to the symmetry.
According to the scheme, the positioning and deducting of the regional image of the microimage anti-counterfeiting code in the step 2) is as follows:
the method comprises the steps of conducting smooth filtering and binarization processing on anti-counterfeiting area patterns of micro image code sample pictures, searching contours, screening rectangles conforming to squares in the contours as target contours, extracting the contours, and extracting target images by means of image affine transformation.
According to the scheme, in the step 3), the target image and the Sobel operators in 4 directions are adopted to carry out convolution operation, and gradient images in 4 directions are obtained.
According to the scheme, in the step 4), the judgment process is as follows:
solving the gray level mean values of the four images, calculating the ratio of the gradient mean values in the directions of 0 degree and 90 degrees to the gradient mean values in the directions of 45 degrees and 135 degrees, and judging the images as fuzzy images when the sum of the ratios exceeds a threshold value; the concrete formula is as follows:
Figure 997238DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 290816DEST_PATH_IMAGE002
the average gray value of the image after the convolution of the image and a horizontal Sobel operator,
Figure 675661DEST_PATH_IMAGE003
is the average gray value of the image after the convolution of the image and a vertical Sobel operator,
Figure 130913DEST_PATH_IMAGE004
the average gray value of the image after the convolution of the image and the Sobel operator in the 45-degree direction is obtained,
Figure 233998DEST_PATH_IMAGE005
the average gray value of the image after the convolution of the image and a Sobel operator in the 135-degree direction is obtained;
Figure 65688DEST_PATH_IMAGE006
is a proportionality coefficient of the two ratios,
Figure 570618DEST_PATH_IMAGE007
representing a difference threshold.
The invention has the following beneficial effects:
when the method of the invention is used, the image can be effectively and accurately detected when motion blur occurs, the phenomenon that the quality goods are changed into counterfeit goods due to the motion blur is reduced, the stability of an anti-counterfeiting detection algorithm is improved, and the robustness of identification is greatly improved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flow chart of a method of an embodiment of the present invention;
FIG. 2 is a schematic diagram of an anti-counterfeit code positioning and extracting target image according to an embodiment of the present invention;
FIG. 3 is a four-way edge feature extraction of an embodiment of the present invention;
FIG. 4 is a sample feature data distribution plot of an embodiment 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 further described in detail with reference to the following 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 method for detecting motion blur of microimage code based on gradient symmetry provided by the present invention includes the following steps:
step 1, photographing by mobile terminal equipment to obtain a micro image code sample picture;
step 2: positioning, deducting the micro image code anti-counterfeiting area image, and correcting and normalizing;
and step 3: calculating gradient images of the anti-counterfeiting codes of 0 degree, 90 degrees, 45 degrees and 135 degrees;
and 4, step 4: and calculating the horizontal and vertical gradient symmetry and the 45-degree and 135-degree gradient image symmetry according to the gradient images, and judging whether the images are blurred in motion or not according to the symmetry.
Referring to fig. 2, the microimage code anti-counterfeiting area is a target area. The micro-graph code is formed by combining a two-dimensional code and a micro-graph anti-counterfeiting code, and has the functions of pre-sale anti-counterfeiting, product tracing, anti-channel conflict, intelligent marketing and the like, wherein the micro-graph anti-counterfeiting code is a specially designed dense dot matrix pattern, is more favorable for random diffusion of ink in printing, and has the characteristic of gray level distribution two-stage, and the micro-graph anti-counterfeiting code in the embodiment is also designed with 3 white circles for positioning.
The microimage anti-counterfeiting codes are randomly distributed, uniformly distributed integrally and have no directivity. The anti-counterfeiting code picture is subjected to smooth filtering, binaryzation and contour searching, rectangles which are in accordance with squares in the contours are screened, whether three white circles exist in the square contours or not is judged, if the three white circles exist, the target contours are extracted, and the target images are extracted by means of image affine transformation.
And 3, step 3: as shown in fig. 3, the anti-counterfeiting code image is convolved with Sobel operators in four directions of 0 °,90 °,45 ° and 135 ° to obtain gradient images in 4 directions.
As shown in fig. 4, at step 4: calculating the gray level mean value and the ratio of the horizontal and vertical gradient mean values of the four images
And the mean ratio of the 45 DEG directional gradients and the 135 DEG directional gradients is considered as a blurred image when the sum of the ratios exceeds a threshold value. The specific formula is shown in formula 1:
Figure 196772DEST_PATH_IMAGE001
(formula 1)
Wherein the content of the first and second substances,
Figure 537885DEST_PATH_IMAGE002
the average gray value of the image after the convolution of the image and the horizontal Sobel operator,
Figure 173266DEST_PATH_IMAGE003
is the average gray value of the image after the convolution of the image and a vertical Sobel operator,
Figure 267124DEST_PATH_IMAGE004
the average gray value of the image after the convolution of the image and the Sobel operator in the 45-degree direction is obtained,
Figure 329758DEST_PATH_IMAGE005
the average gray value of the image after the convolution of the image and a 135-degree directional Sobel operator is obtained.
Figure 141856DEST_PATH_IMAGE006
Is a proportionality coefficient of the two ratios,
Figure 580928DEST_PATH_IMAGE007
representing a difference threshold. Wherein the parameter values are distributed through fuzzy data and normal data, SVM two-classification is applied, a classification line is fitted, and the classification line is determined
Figure 794872DEST_PATH_IMAGE008
The value of (c). The above formula defaults to
Figure 28407DEST_PATH_IMAGE009
In fact if
Figure 577069DEST_PATH_IMAGE010
Then get
Figure 554252DEST_PATH_IMAGE011
In the diagonal direction
Figure 622702DEST_PATH_IMAGE005
And
Figure 27139DEST_PATH_IMAGE004
the same is true. For convenience of data management and without affecting the detection result, it is considered that when the sum of the two ratios satisfies the above condition, the motion blur is considered to exist.
When the method of the invention is used, the image can be effectively and accurately detected when motion blur occurs, the phenomenon that the quality goods are changed into counterfeit goods due to the motion blur is reduced, the stability of an anti-counterfeiting detection algorithm is improved, and the robustness of identification is greatly improved.
It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.

Claims (4)

1. A microimage code motion blur detection method based on gradient symmetry is characterized by comprising the following steps:
step 1), photographing to obtain a micro image code sample picture; the micro-graph code comprises a two-dimensional code area and an anti-counterfeiting area; the anti-counterfeiting area comprises a microimage anti-counterfeiting code, wherein the microimage anti-counterfeiting code is a pattern formed by dense lattices;
step 2), positioning and deducting the regional image of the microimage anti-counterfeiting code as a target image;
step 3) calculating gradient images of 0 degrees, 90 degrees, 45 degrees and 135 degrees of the target image area;
and 4) calculating the symmetry of the 0-degree and 90-degree gradient images and the symmetry of the 45-degree and 135-degree gradient images according to the gradient images, and judging whether the images are in motion blur or not according to the symmetry.
2. The gradient symmetry-based microimage code motion blur detection method according to claim 1, wherein the area image of the microimage anti-counterfeiting code is located and deducted in the step 2), specifically as follows:
the method comprises the steps of conducting smooth filtering and binarization processing on anti-counterfeiting area patterns of a micro image code sample picture, searching for contours, screening rectangles which are in accordance with squares in the contours to serve as target contours, extracting the contours, and extracting a target image by means of image affine transformation.
3. The gradient symmetry-based micro graph code motion blur detection method according to claim 1, characterized in that in step 3), a target image and 4-directional Sobel operators are adopted to perform convolution operation, so as to obtain 4-directional gradient images.
4. The method for detecting motion blur of micro graph codes based on gradient symmetry according to claim 1, wherein in the step 4), the determination process is specifically as follows:
solving the gray level mean values of the four images, calculating the ratio of the gradient mean values in the directions of 0 degree and 90 degrees to the gradient mean values in the directions of 45 degrees and 135 degrees, and judging the images as fuzzy images when the sum of the ratios exceeds a threshold value; the specific formula is as follows:
Figure 785471DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 523620DEST_PATH_IMAGE002
the average gray value of the image after the convolution of the image and the horizontal Sobel operator,
Figure 840331DEST_PATH_IMAGE003
the average gray value of the image after the convolution of the image and the vertical Sobel operator,
Figure 31141DEST_PATH_IMAGE004
the average gray value of the image after the convolution of the image and a Sobel operator in the 45-degree direction is obtained,
Figure 209444DEST_PATH_IMAGE005
the average gray value of the image after the convolution of the image and a Sobel operator in the 135-degree direction is obtained;
Figure 536520DEST_PATH_IMAGE006
is a proportionality coefficient of the two ratios,
Figure 24133DEST_PATH_IMAGE007
representing a difference threshold.
CN202211446212.3A 2022-11-18 2022-11-18 Micro-image code motion blur detection method based on gradient symmetry Active CN115689943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211446212.3A CN115689943B (en) 2022-11-18 2022-11-18 Micro-image code motion blur detection method based on gradient symmetry

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211446212.3A CN115689943B (en) 2022-11-18 2022-11-18 Micro-image code motion blur detection method based on gradient symmetry

Publications (2)

Publication Number Publication Date
CN115689943A true CN115689943A (en) 2023-02-03
CN115689943B CN115689943B (en) 2023-07-25

Family

ID=85054513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211446212.3A Active CN115689943B (en) 2022-11-18 2022-11-18 Micro-image code motion blur detection method based on gradient symmetry

Country Status (1)

Country Link
CN (1) CN115689943B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100092100A1 (en) * 2008-10-14 2010-04-15 Shekhar Madnani Method and system for calculating blur artifact in videos
CN103324908A (en) * 2012-03-23 2013-09-25 桂林电子科技大学 Rapid iris collecting, judging and controlling method for iris identification
CN107247986A (en) * 2017-06-23 2017-10-13 邓学胜 Figure code anti-fake card, figure code anti-fake system and figure code anti-counterfeiting method
CN107301661A (en) * 2017-07-10 2017-10-27 中国科学院遥感与数字地球研究所 High-resolution remote sensing image method for registering based on edge point feature
CN108765436A (en) * 2018-04-21 2018-11-06 卞家福 Method for detecting image edge is piled up based on the irregular beverage bottle for improving Roberts operators
CN114022416A (en) * 2021-10-16 2022-02-08 泰康保险集团股份有限公司 Image definition detection method and device, electronic equipment and storage medium
CN115035038A (en) * 2022-05-12 2022-09-09 麦克奥迪实业集团有限公司 Slice fuzzy detection method based on support vector machine and digital slice scanning device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100092100A1 (en) * 2008-10-14 2010-04-15 Shekhar Madnani Method and system for calculating blur artifact in videos
CN103324908A (en) * 2012-03-23 2013-09-25 桂林电子科技大学 Rapid iris collecting, judging and controlling method for iris identification
CN107247986A (en) * 2017-06-23 2017-10-13 邓学胜 Figure code anti-fake card, figure code anti-fake system and figure code anti-counterfeiting method
CN107301661A (en) * 2017-07-10 2017-10-27 中国科学院遥感与数字地球研究所 High-resolution remote sensing image method for registering based on edge point feature
CN108765436A (en) * 2018-04-21 2018-11-06 卞家福 Method for detecting image edge is piled up based on the irregular beverage bottle for improving Roberts operators
CN114022416A (en) * 2021-10-16 2022-02-08 泰康保险集团股份有限公司 Image definition detection method and device, electronic equipment and storage medium
CN115035038A (en) * 2022-05-12 2022-09-09 麦克奥迪实业集团有限公司 Slice fuzzy detection method based on support vector machine and digital slice scanning device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HUI JI,CHAOQIANG LIU: "Motion Blur Identification from Image Gradients", 《2008 IEEE》, pages 1 - 8 *
范浩杰 等: "无参考模式图像模糊度检测方法探究", 《福建电脑》, vol. 36, no. 7, pages 61 - 63 *

Also Published As

Publication number Publication date
CN115689943B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
Bondi et al. Tampering detection and localization through clustering of camera-based CNN features
KR102406432B1 (en) Identity authentication methods and devices, electronic devices and storage media
WO2019233264A1 (en) Image processing method, computer readable storage medium, and electronic device
US8009928B1 (en) Method and system for detecting and recognizing text in images
Sedighi et al. A new and robust method for character segmentation and recognition in license plate images
CN110348264B (en) QR two-dimensional code image correction method and system
CN102930268B (en) A kind of for polluting and the accurate positioning method of DataMatrix code in various visual angles situation
CN106991423A (en) Whether the method and device of watermark is included in identification specification picture
CN110119741A (en) A kind of card card image information recognition methods having powerful connections
Chen et al. Image splicing detection via camera response function analysis
CN107016363A (en) Bill images managing device, bill images management system and method
CN102956029B (en) Image processing apparatus and image processing method
CN109409158B (en) Anti-counterfeiting method based on two-dimensional code edge roughness
CN105224903B (en) A kind of reading device of the method for anti-counterfeit and Quick Response Code of Quick Response Code
JP2018120445A (en) Car number recognition apparatus
Bahrami et al. Image tampering detection by exposing blur type inconsistency
KR102102403B1 (en) Code authentication method of counterfeit print image and its application system
WO2022021687A1 (en) Method for positioning quick response code area, and electronic device and storage medium
CN107170108B (en) A kind of splicing paper money detection method and system
CN115689943A (en) Micro graph code motion blur detection method based on gradient symmetry
CN109635679B (en) Real-time target paper positioning and loop line identification method
CN115205562B (en) Random test paper registration method based on feature points
Zhang et al. A robust license plate detection algorithm based on multi-features
CN115410191A (en) Text image recognition method, device, equipment and storage medium
CN114373147A (en) Detection method for low-texture video license plate

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