IP Library › Granted Patent US 12,205,345
Granted Patent B2
US 12,205,345 · App. 17/562,284 · Granted Jan 21, 2025

Image comparison method and computing device utilizing method

Inventors: Chung-Yu Wu (New Taipei, TW); Chin-Pin Kuo (New Taipei, TW)
Assignee: HON HAI PRECISION INDUSTRY CO., LTD.
G06V10/751G06V10/44
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,205,345
App. No.
17/562,284
Granted
Jan 21, 2025
Kind
B2
Abstract

In an image comparison method, an original reference image and an original test image are obtained. The original reference image and the original test image are binarized to obtain a reference binary image and a test binary image. The reference binary image and the test binary image are detected edges to obtain a reference edge image and a test edge image. A morphological expansion is performed on the reference edge image to obtain an expanded reference edge image. An OR operation is performed on the extended reference edge image and the test edge image to obtain an extended test edge image. An XOR operation is performed on the expanded reference edge image and the expanded test edge image. The method improves the accuracy of image comparison.

Claims (72)

1. An image comparison method, comprising:

obtaining an original reference image and an original test image, wherein the original reference image is an image of a reference product, and the original test image is an image of a test product;

binarizing the original reference image and the original test image to obtain a reference binary image and a test binary image;

detecting edges of the reference binary image and the test binary image to obtain a reference edge image and a test edge image;

performing a morphological expansion on the reference edge image to obtain an expanded reference edge image;

performing an OR operation on the expanded reference edge image and the test edge image to obtain an expanded test edge image;

performing an XOR operation on the expanded reference edge image and the expanded test edge image to obtain a difference image; and

determining whether an appearance of the test product is same as an appearance of the reference product according to the difference image;

wherein determining whether the appearance of the test product is the same as the appearance of the reference product according to the difference image comprises:

calculating a sum of pixel values of the difference image;

when the sum is greater than a preset threshold, determining that the appearance of the test product is not the same as the appearance of the reference product; and

when the sum is less than or equal to the preset threshold, determining that the appearance of the test product is the same as the appearance of the reference product.

2. The image comparison method of claim 1 , wherein before binarizing the original reference image and the original test image, the method further comprises:

converting the original reference image and the original test image into grayscale images.

3. The image comparison method of claim 1 , wherein before binarizing the original reference image and the original test image, the method further comprises:

aligning the original reference image and the original test image.

4. The image comparison method of claim 1 , wherein detecting edges of the reference binary image and the test binary image comprises:

detecting the edges of the reference binary image and the test binary image using a Canny edge detection algorithm.

5. The image comparison method of claim 1 , wherein performing a morphological expansion on the reference edge image comprises:

obtaining a preset structural element; and

performing the morphological expansion on the reference edge image through the preset structural element.

6. The image comparison method of claim 1 , further comprising:

when the appearance of the test product is the same as the appearance of the reference product, further determining that the test product is qualified; and

when the appearance of the test product is not the same as the appearance of the reference product, further determining that the test product is unqualified.

7. A computing device comprising:

at least one processor; and

a storage device storing computer-readable instructions, which when executed by the at least one processor, cause the at least one processor to:

obtain an original reference image and an original test image, wherein the original reference image is an image of a reference product, and the original test image is an image of a test product;

binarize the original reference image and the original test image to obtain a reference binary image and a test binary image;

detect edges of the reference binary image and the test binary image to obtain a reference edge image and a test edge image;

perform a morphological expansion on the reference edge image to obtain an expanded reference edge image;

perform an OR operation on the expanded reference edge image and the test edge image to obtain an expanded test edge image;

perform an XOR operation on the expanded reference edge image and the expanded test edge image to obtain a difference image; and

determine whether an appearance of the test product is same as an appearance of the reference product according to the difference image;

wherein the at least one processor determining whether the appearance of the test product is same as the appearance of the reference product according to the difference image comprises:

calculating a sum of pixel values of the difference image;

when the sum is greater than a preset threshold, determining that the appearance of the test product is not the same as the appearance of the reference product; and

when the sum is less than or equal to the preset threshold, determining that the appearance of the test product is the same as the appearance of the reference product.

8. The computing device of claim 7 , wherein the at least one processor is further caused to:

convert the original reference image and the original test image into grayscale images.

9. The computing device of claim 7 , wherein the at least one processor is further caused to:

align the original reference image and the original test image.

10. The computing device of claim 7 , wherein the at least one processor is further caused to:

detect the edges of the reference binary image and the test binary image using a Canny edge detection algorithm.

11. The computing device of claim 7 , wherein the at least one processor is further caused to:

obtain a preset structural element; and

perform the morphological expansion on the reference edge image through the preset structural element.

12. The computing device of claim 7 , wherein the at least one processor is further caused to:

when the appearance of the test product is the same as the appearance of the reference product, further determine that the test product is qualified; and

when the appearance of the test product is not the same as the appearance of the reference product, further determine that test product is unqualified.

13. A non-transitory storage medium having stored thereon computer-readable instructions that, when the computer-readable instructions are executed by a processor to implement an image comparison method comprising:

obtaining an original reference image and an original test image, wherein the original reference image is an image of a reference product, and the original test image is an image of a test product;

binarizing the original reference image and the original test image to obtain a reference binary image and a test binary image;

detecting edges of the reference binary image and the test binary image to obtain a reference edge image and a test edge image;

performing a morphological expansion on the reference edge image to obtain an expanded reference edge image;

performing an OR operation on the expanded reference edge image and the test edge image to obtain an expanded test edge image;

performing an XOR operation on the expanded reference edge image and the expanded test edge image to obtain a difference image; and

determining whether an appearance of the test product is same as an appearance of the reference product according to the difference image;

wherein determining whether the appearance of the test product is the same as the appearance of the reference product according to the difference image comprises:

calculating a sum of pixel values of the difference image;

when the sum is greater than a preset threshold, determining that the appearance of the test product is not the same as the appearance of the reference product; and

when the sum is less than or equal to the preset threshold, determining that the appearance of the test product is the same as the appearance of the reference product.

14. The non-transitory storage medium of claim 13 , wherein before binarizing the original reference image and the original test image, the method further comprises:

aligning the original reference image and the original test image.

15. The non-transitory storage medium of claim 13 , wherein detecting edges of the reference binary image and the test binary image comprises:

detecting the edges of the reference binary image and the test binary image using a Canny edge detection algorithm.

16. The non-transitory storage medium of claim 13 , wherein performing a morphological expansion on the reference edge image comprises:

obtaining a preset structural element; and

performing the morphological expansion on the reference edge image through the preset structural element.

17. The non-transitory storage medium of claim 13 , wherein the method further comprises:

when the appearance of the test product is the same as the appearance of the reference product, further determining that the test product is qualified; and

when the appearance of the test product is not the same as the appearance of the reference product, further determining that test product is unqualified.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 27, 2021
From: WU, CHUNG-YU; KUO, CHIN-PIN
To: HON HAI PRECISION INDUSTRY CO., LTD.
Reel/Frame 058481/0455 →
Priority Claims (1)
CN 202011585075.2 · Dec 28, 2020 · national
Continuity (1)
Related Publication 20220207859A1 · Jun 30, 2022
References Cited (11)
US 5953461A · Yamada · 1999 [cited by examiner]
US 6888958B1 · Sawa · 2005 [cited by examiner]
US 10475179B1 · Bishop · 2019 [cited by examiner]
US 12007320B2 · Chou · 2024 [cited by examiner]
US 20110133887A1 · Tian · 2011 [cited by examiner]
US 20200126242A1 · Fang · 2020 [cited by examiner]
CN 107492091 · 2017 [cited by applicant]
CN 112085709A · 2020 [cited by examiner]
JP 4357666B2 · 2009 [cited by examiner]
Yu-Kang Chang, Master Thesis of Central South University “Automatic Optical Inspection System for Detecting Defects on PCB Film” Published on Jul. 31, 2003. [cited by applicant]
Wen-Wei Yao, Master Thesis of Kunming University of Science and Technology “Research on Defects Detection Technology and System of Printed Circuit Board” Published on Dec. 15, 2012. [cited by applicant]