CN110390682A - A kind of image partition method that template is adaptive, system and readable storage medium storing program for executing - Google Patents

A kind of image partition method that template is adaptive, system and readable storage medium storing program for executing Download PDF

Info

Publication number
CN110390682A
CN110390682A CN201910884601.6A CN201910884601A CN110390682A CN 110390682 A CN110390682 A CN 110390682A CN 201910884601 A CN201910884601 A CN 201910884601A CN 110390682 A CN110390682 A CN 110390682A
Authority
CN
China
Prior art keywords
template
product
original image
small
image
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
CN201910884601.6A
Other languages
Chinese (zh)
Other versions
CN110390682B (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.)
Sirui (hangzhou) Information Technology Co Ltd
Original Assignee
Sirui (hangzhou) Information 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 Sirui (hangzhou) Information Technology Co Ltd filed Critical Sirui (hangzhou) Information Technology Co Ltd
Priority to CN201910884601.6A priority Critical patent/CN110390682B/en
Publication of CN110390682A publication Critical patent/CN110390682A/en
Application granted granted Critical
Publication of CN110390682B publication Critical patent/CN110390682B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30121CRT, LCD or plasma display

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The present invention provides a kind of image partition method that template is adaptive, system and readable storage medium storing program for executing, which comprises receives product original image and corresponding product type to be split;The corresponding small figure of template is found according to the product type;The small figure of the template is partitioned into the product original image with the target area that the product original image is matched, and be will match to using template small figure matching algorithm;The product image divided is exported, and is shown.The present invention utilizes the small figure matching algorithm of template and template coordinate cover algorithm, processing adaptively can be split to the product original image of various products model, machine quality inspection is carried out to the product image divided in order to subsequent, and then instead of artificial quality inspection, human cost is saved, quality inspection efficiency is improved.

Description

A kind of image partition method that template is adaptive, system and readable storage medium storing program for executing
Technical field
The present invention relates to technical field of image processing more particularly to a kind of image partition methods that template is adaptive, system And readable storage medium storing program for executing.
Background technique
LED is also referred to as light emitting diode, is a kind of chip of semiconductor material that can convert electrical energy into visible light.Because its Ease for use, LED have been widely used in market, such as mobile phone, TV, architectural lighting etc..The production quality inspection of LED also at For a vital ring.Before this, the examination and test of products of LED is substantially manually to sort, not only time-consuming in this way, but also Human cost is also very high.Currently, traditional artificial quality inspection is become into machine quality inspection and has become trend, so-called machine quality inspection is to pass through The image of LED is shot to carry out quality inspection to it.But the LED image of each type must be thus split.
Currently, the method in relation to image segmentation is broadly divided into four classes: 1) based on the dividing method of threshold value, 2) and it is based on edge The dividing method of detection, 3) dividing method based on region, 4) dividing method based on clustering.
1) based on the dividing method of threshold value
Threshold segmentation method is one of the most common type image Segmentation Technology, the basic principle is that with one or several threshold values by image Grey level histogram be divided into several classes, and think that pixel of the gray value in same class belongs to same object in image.Because should Method is directly to utilize the gamma characteristic of image, therefore convenience of calculation is concise, practical.Obviously, the pass of threshold segmentation method Key and difficult point are how to obtain a suitable threshold value.And in practical application, threshold value setting is influenced vulnerable to noise and brightness, and And object to be split also might not be all in the same gray space.In this way for complicated, variation is more Image is simultaneously not suitable for.
2) based on the dividing method of edge detection
Target Segmentation and image point are carried out by detecting positioned at the edge of different zones based on the dividing method of edge detection More common one of method in cutting.The basic principle is that the variation of grey scale pixel value is often compared on edge between different regions Relatively acutely, different object segmentations is come by detecting this edge.In practice, commonly use gray scale single order or Second Order Differential Operator carries out edge detection.Its difficult point of dividing method based on edge is to measure noise immunity and inspection when edge detection Survey precision.If improving detection accuracy, the pseudo-edge that noise generates will lead to unreasonable profile, cause to divide undesirable.If Noise immunity is improved, then can generate target missing inspection and position deviation.Institute is also difficult to generally applicable in this way.
3) based on the dividing method in region
Method based on region segmentation is exactly that the pixel with certain similar quality is connected to, to constitute final segmentation Region.This process employs the local spatial informations of image, can be small efficiently against image segmentation space existing for other methods Continuous disadvantage.In such method, if determining each pixel by the consistent criterion of area attribute feature from full figure Region affiliation, forming region figure, the often referred to as dividing method of region growing.If from pixel, by area attribute feature The close connected pixel of attribute is collected as region by consistent criterion, then is the dividing method that region increases.
4) based on the dividing method of clustering
Feature space clustering procedure indicates the pixel in image with corresponding feature space point, according to them in the poly- of feature space Collection state is split feature space, they are then mapped back original image again, obtains segmentation result.Wherein, K mean value, mould Pasting C means clustering algorithm is more commonly used clustering algorithm.Clustering algorithm can be split according to the feature space of image, be subtracted Few artificial intervention, but itself it needs to be determined that the class number of cluster, cluster the parameters such as initial value.In addition clustering algorithm usually compares Time-consuming also receives certain limitation in specific application.
In view of this, above-mentioned image partition method is unsuitable to be applied to LED quality inspection industry, to all kinds of models LED image is split processing, is badly in need of proposing that one kind can carry out the LED image of all kinds of models efficient, accurate point at present The method cut.
Summary of the invention
In order to solve at least one above-mentioned technical problem, the invention proposes a kind of image segmentation sides that template is adaptive Method, system and readable storage medium storing program for executing.
To achieve the goals above, first aspect present invention proposes a kind of image partition method that template is adaptive, institute The method of stating includes:
Receive product original image and corresponding product type to be split;
The corresponding small figure of template is found according to the product type;
The mesh that the small figure of the template is matched with the product original image, and will match to using template small figure matching algorithm Mark region is partitioned into the product original image;
The product image divided is exported, and is shown.
In the present solution, the method is also wrapped after receiving product original image and corresponding product type to be split It includes:
Corresponding template coordinate is found according to the product type;
The target area that the small figure of the template and the product original image are matched, and will match to is in the product original image It is partitioned into as in;
Judge whether match whole target areas in the product original image;
If so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to the product The target area that original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and carry out Display.
In the present solution, before finding corresponding template coordinate according to the product type, the method also includes:
The coordinate value of all target areas is determined on complete product original image;
The template coordinate is obtained according to the coordinate value of all target areas, and carries out prestoring processing.
In the present solution, being mended using the target area that template coordinate cover algorithm does not match the product original image Position processing, specifically includes:
On the target area coordinates that the template coordinate matching is had detected that the product original image, counter push away obtains the production The undetected target area coordinates of product original image;
According to undetected target area coordinates, undetected target area is partitioned into the product original image.
In the present solution, matched the small figure of the template with the product original image using the small figure matching algorithm of template, It specifically includes:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
In the present solution, the method is also wrapped before receiving product original image and corresponding product type to be split It includes:
Prestore the small figure of the corresponding template of each product type.
Second aspect of the present invention also proposes a kind of image segmentation system that template is adaptive, the adaptive image of the template Segmenting system includes: memory and processor, includes a kind of image partition method program that template is adaptive in the memory, The template adaptive image partition method program realizes following steps when being executed by the processor:
Receive product original image and corresponding product type to be split;
The corresponding small figure of template is found according to the product type;
The mesh that the small figure of the template is matched with the product original image, and will match to using template small figure matching algorithm Mark region is partitioned into the product original image;
The product image divided is exported, and is shown.
In the present solution, after receiving product original image and corresponding product type to be split, further includes:
Corresponding template coordinate is found according to the product type;
The target area that the small figure of the template and the product original image are matched, and will match to is in the product original image It is partitioned into as in;
Judge whether match whole target areas in the product original image;
If so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to the product The target area that original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and carry out Display.
In the present solution, matched the small figure of the template with the product original image using the small figure matching algorithm of template, It specifically includes:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
Third aspect present invention also proposes a kind of computer readable storage medium, wraps in the computer readable storage medium A kind of image partition method program that template is adaptive is included, the adaptive image partition method program of the template is held by processor When row, realize such as the step of a kind of above-mentioned template adaptive image partition method.
The present invention utilizes the small figure matching algorithm of template and template coordinate cover algorithm, can be adaptive to various products type Number product original image be split processing, machine quality inspection is carried out to the product image divided in order to subsequent, and then substitute Artificial quality inspection, saves human cost, improves quality inspection efficiency.
Additional aspect and advantage of the invention will provide in following description section, will partially become from the following description Obviously, or practice through the invention is recognized.
Detailed description of the invention
Fig. 1 shows a kind of flow chart for the image partition method that template is adaptive of the present invention;
Fig. 2 shows the small figure of the corresponding template of three kinds of product types of the invention and product original images;
Fig. 3 shows the matching result of the small figure of template of certain product type of the invention;
Fig. 4 shows the flow chart of the adaptive image partition method of another template of the invention;
Fig. 5 shows the corresponding abnormal products original image of three kinds of product types of the invention;
Fig. 6 shows the segmentation result of the corresponding abnormal products original image of certain product type of the invention;
Fig. 7 shows a kind of block diagram for the image segmentation system that template is adaptive of the present invention;
Fig. 8 shows the flow chart of the adaptive image partition method of template of one embodiment of the invention.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real Applying mode, the present invention is further described in detail.It should be noted that in the absence of conflict, the implementation of the application Feature in example and embodiment can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, still, the present invention may be used also To be implemented using other than the one described here other modes, therefore, protection scope of the present invention is not by described below Specific embodiment limitation.
Fig. 1 shows a kind of flow chart for the image partition method that template is adaptive of the present invention.
As shown in Figure 1, first aspect present invention proposes a kind of image partition method that template is adaptive, the method packet It includes:
S102 receives product original image and corresponding product type to be split;
S104 finds the corresponding small figure of template according to the product type;
S106 is matched the small figure of the template with the product original image using the small figure matching algorithm of template, and will matching To target area be partitioned into the product original image;
S108 exports the product image divided, and is shown.
It should be noted that technical solution of the present invention can be operated in the terminal devices such as PC, mobile phone, PAD.
Preferably, the product can be LED, but not limited to this.The target area refers to the area to be detected where LED Domain carries out machine quality inspection to LED in order to subsequent by the way that the region where LED is detected and be partitioned into LED original image.
According to an embodiment of the invention, using the small figure matching algorithm of template by the small figure of the template and the product original image It is matched, is specifically included:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
Further, before receiving product original image and corresponding product type to be split, the method is also wrapped It includes:
Prestore the small figure of the corresponding template of each product type.
It should be noted that the present invention is suitable for being split various types of product images, before this, for every A kind of product type is required to select the corresponding small figure of template, and Fig. 2 illustrates the corresponding small figure of template of three kinds of product types With product original image.Three width figures of the first row are the corresponding product original image of three kinds of product types, three width figures of the second row in Fig. 2 For the corresponding small figure of template of three kinds of product types, for convenient for showing, the small figure of template passes through scaling processing.
It should be noted that the small figure matching algorithm of template is exactly to find and the small figure of template in product original image to be split Similar image.When specific operation, can be compared using the possible position of each of the small figure traversal product original image of template It is whether similar to the small figure of template everywhere, when similarity is sufficiently high, then it is assumed that have found the target area met (i.e. where LED Region), and carry out dividing processing.
Preferably, the threshold value setting of similarity is 0.85, i.e. the similarity when certain position with the small figure of template is more than or equal to When 0.85, then it is assumed that the position is target area.It is appreciated that the threshold values also should be less than being equal to 1.
It should be noted that when being split processing to target area on product original image, it can be using closure wire The mode combined with central point.Specifically, the partitioning boundary of target area delimited with closure wire, at the center of target area Central point is marked, with the center in label target region.Fig. 3 shows the matching of the small figure of template of certain product type of the invention As a result, Fig. 3 (a) is product original image to be split, Fig. 3 (b) is the product image that the small figure of template is matched to.Preferably, it is closed frame The color of line and central point can be blue, but not limited to this.
As shown in figure 4, the method is also wrapped after receiving product original image and corresponding product type to be split It includes:
S402 finds corresponding template coordinate according to the product type;
S404, the target area that the small figure of the template and the product original image are matched, and will match to is in the production It is partitioned into product original image;
S406 judges whether match whole target areas in the product original image;
S408, if so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to described The target area that product original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and It is shown.
It should be noted that the corresponding product original image of each product type should have the target area of preferred number (such as LED).When judging whether to match whole target areas in the product original image, it can be matched to by calculating Target area number (such as LED number), and by the standard of the number being calculated product original image corresponding with the product type Number is compared, if the number being calculated is equal with preferred number, determines to have matched whole target areas, such as The number that fruit is calculated is less than preferred number, then determines not matching whole target areas.
It should be noted that in the small figure matching of template, if product original image to be split does not occur than more complete When abnormal, then segmentation result is usually more perfect.But generated because having various situation in practical application, such as LED vacancy, LED is abnormal, as shown in Figure 5.At this point, cannot then such LED be detected by relying solely on the small figure matching of template, this hair It is bright that the abnormal conditions of various LED are coped with using a kind of template coordinate cover algorithm, and can make up for it the small figure of template and can not detect The loophole of abnormal LED.
According to an embodiment of the invention, before finding corresponding template coordinate according to the product type, the side Method further include:
The coordinate value of all target areas is determined on complete product original image;
The template coordinate is obtained according to the coordinate value of all target areas, and carries out prestoring processing.
It should be noted that being required to select a complete product original image for each product type, and it is directed to The complete product original image of each product type determines the coordinate value of all target areas respectively, and then obtains each product type Number corresponding template coordinate, and carry out prestoring processing.When prestoring template coordinate, need each template coordinate and corresponding production Product model is associated, when receiving product type, by the product type can associative search to corresponding template coordinate, Improve the search efficiency of template coordinate.
According to an embodiment of the invention, the target not matched using template coordinate cover algorithm to the product original image Region carries out cover processing, specifically includes:
On the target area coordinates that the template coordinate matching is had detected that the product original image, counter push away obtains the production The undetected target area coordinates of product original image;
According to undetected target area coordinates, undetected target area is partitioned into the product original image.
By taking LED product as an example, template coordinate cover algorithm of the invention is exactly first to ask on a complete LED original image It obtains the coordinate value of each LED and is stored as template coordinate file.Since the relative position of the LED of each model is fixed, institute With when not looking for full LED in the small figure matching process of template, using the template coordinate matching to having detected that on LED coordinate, just The coordinate for the LED that can not detected.Fig. 6 shows the segmentation result of exception LED of the invention, and Fig. 6 (a) is incomplete LED original image, as LED have black dots be difficult to the small figure matching detection of template come out, Fig. 6 (b) is split LED image (is indicated) with central point and closure wire.It can thus be seen that the small figure matching algorithm of present invention combination template and template Coordinate cover algorithm can be accurately detected the position of LED.
Fig. 7 shows a kind of block diagram for the image segmentation system that template is adaptive of the present invention.
As shown in fig. 7, second aspect of the present invention also proposes a kind of image segmentation system that template is adaptive 7, the template Adaptive image segmentation system 7 includes: memory 71 and processor 72, includes that a kind of template is adaptive in the memory 71 Image partition method program, when the adaptive image partition method program of the template is executed by the processor 72 realize such as Lower step:
Receive product original image and corresponding product type to be split;
The corresponding small figure of template is found according to the product type;
The mesh that the small figure of the template is matched with the product original image, and will match to using template small figure matching algorithm Mark region is partitioned into the product original image;
The product image divided is exported, and is shown.
It should be noted that system of the invention can be operated in the terminal devices such as PC, mobile phone, PAD.
It should be noted that the processor can be central processing unit (Central Processing Unit, CPU), it can also be other general processors, Digital Signal Processing (Digital Signal Processor, DSP), dedicated collection At circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
Preferably, the product can be LED, but not limited to this.The target area refers to the area to be detected where LED Domain carries out machine quality inspection to LED in order to subsequent by the way that the region where LED is detected and be partitioned into LED original image.
According to an embodiment of the invention, using the small figure matching algorithm of template by the small figure of the template and the product original image It is matched, is specifically included:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
Further, before receiving product original image and corresponding product type to be split, the method is also wrapped It includes:
Prestore the small figure of the corresponding template of each product type.
It should be noted that system of the invention is suitable for being split various types of product images, before this, Each product type is required to select the corresponding small figure of template.Three width figures of the first row are three kinds of products in Fig. 2 The corresponding product original image of model, three width figures of the second row are the corresponding small figure of template of three kinds of product types, for convenient for displaying, mould The small figure of plate passes through scaling processing.
It should be noted that the small figure matching algorithm of template is exactly to find and the small figure of template in product original image to be split Similar image.When specific operation, can be compared using the possible position of each of the small figure traversal product original image of template It is whether similar to the small figure of template everywhere, when similarity is sufficiently high, then it is assumed that have found the target area met (i.e. where LED Region), and carry out dividing processing.
Preferably, the threshold value setting of similarity is 0.85, i.e. the similarity when certain position with the small figure of template is more than or equal to When 0.85, then it is assumed that the position is target area.It is appreciated that the threshold values also should be less than being equal to 1.
It should be noted that when being split processing to target area on product original image, it can be using closure wire The mode combined with central point.Specifically, the partitioning boundary of target area delimited with closure wire, at the center of target area Central point is marked, with the center in label target region.Fig. 3 (a) is product original image to be split, and Fig. 3 (b) is the small figure of template The product image being matched to.Preferably, the color for being closed wire and central point can be blue, but not limited to this.
According to an embodiment of the invention, after receiving product original image and corresponding product type to be split, also Include:
Corresponding template coordinate is found according to the product type;
The target area that the small figure of the template and the product original image are matched, and will match to is in the product original image It is partitioned into as in;
Judge whether match whole target areas in the product original image;
If so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to the product The target area that original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and carry out Display.
It should be noted that the corresponding product original image of each product type should have the target area of preferred number (such as LED).When judging whether to match whole target areas in the product original image, it can be matched to by calculating Target area number (such as LED number), and by the standard of the number being calculated product original image corresponding with the product type Number is compared, if the number being calculated is equal with preferred number, determines to have matched whole target areas, such as The number that fruit is calculated is less than preferred number, then determines not matching whole target areas.
It should be noted that in the small figure matching of template, if product original image to be split does not occur than more complete When abnormal, then segmentation result is usually more perfect.But generated because having various situation in practical application, such as LED vacancy, LED are abnormal.At this point, cannot then such LED be detected that the present invention is using a kind of by relying solely on the small figure matching of template Template coordinate cover algorithm copes with the abnormal conditions of various LED, and can make up for it the small figure of template and can not detect the leakage of abnormal LED Hole.
According to an embodiment of the invention, before finding corresponding template coordinate according to the product type, the side Method further include:
The coordinate value of all target areas is determined on complete product original image;
The template coordinate is obtained according to the coordinate value of all target areas, and carries out prestoring processing.
It should be noted that being required to select a complete product original image for each product type, and it is directed to The complete product original image of each product type determines the coordinate value of all target areas respectively, and then obtains each product type Number corresponding template coordinate, and carry out prestoring processing.When prestoring template coordinate, need each template coordinate and corresponding production Product model is associated, when receiving product type, by the product type can associative search to corresponding template coordinate, Improve the search efficiency of template coordinate.
According to an embodiment of the invention, the target not matched using template coordinate cover algorithm to the product original image Region carries out cover processing, specifically includes:
On the target area coordinates that the template coordinate matching is had detected that the product original image, counter push away obtains the production The undetected target area coordinates of product original image;
According to undetected target area coordinates, undetected target area is partitioned into the product original image.
By taking LED product as an example, template coordinate cover algorithm of the invention is exactly first to ask on a complete LED original image It obtains the coordinate value of each LED and is stored as template coordinate file.Since the relative position of the LED of each model is fixed, institute With when not looking for full LED in the small figure matching process of template, using the template coordinate matching to having detected that on LED coordinate, just The coordinate for the LED that can not detected.Fig. 6 (a) is incomplete LED original image, and have black dots as LED is to be difficult to It is come out with the small figure matching detection of template, Fig. 6 (b) is the LED image (being indicated with central point and closure wire) split.By This can be seen that the position that the present invention combines the small figure matching algorithm of template and template coordinate cover algorithm that can be accurately detected LED It sets.
Third aspect present invention also proposes a kind of computer readable storage medium, wraps in the computer readable storage medium A kind of image partition method program that template is adaptive is included, the adaptive image partition method program of the template is held by processor When row, realize such as the step of a kind of above-mentioned template adaptive image partition method.
In order to further explain the technical solution of the present invention, being illustrated below by one embodiment.
As shown in figure 8, LED original image and LED type number are inputted first into system, by the LED type number in system It is middle to find the small figure of corresponding template and template coordinate.Then LED original image is matched with the small figure of template, and be partitioned into The LED being fitted on.Judge whether to look for full LED, if so, the LED image divided directly is exported, if it is not, then needing to carry out template Coordinate cover, and the LED that the small figure of template does not match is also partitioned into, it has been partitioned into all LED, has then exported and divide LED image.
The present embodiment matches LED original image using the small figure of template of corresponding LED type number, the target area that will match into Row screening, gets rid of invalid targets.For the LED not detected, is matched and mended with the template coordinate solved in advance Position, may finally all split all LED.
The present invention utilizes the small figure matching algorithm of template and template coordinate cover algorithm, can be adaptive to various products type Number product original image be split processing, machine quality inspection is carried out to the product image divided in order to subsequent, and then substitute Artificial quality inspection, saves human cost, improves quality inspection efficiency.
In several embodiments provided herein, it should be understood that disclosed device and method can pass through it Its mode is realized.Apparatus embodiments described above are merely indicative, for example, the division of the unit, only A kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can combine, or It is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed each composition portion Mutual coupling or direct-coupling or communication connection is divided to can be through some interfaces, the INDIRECT COUPLING of equipment or unit Or communication connection, it can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit;Both it can be located in one place, and may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated in one processing unit, it can also To be each unit individually as a unit, can also be integrated in one unit with two or more units;It is above-mentioned Integrated unit both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can store in computer-readable storage medium, which exists When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: movable storage device, read-only deposits Reservoir (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or The various media that can store program code such as CD.
If alternatively, the above-mentioned integrated unit of the present invention is realized in the form of software function module and as independent product When selling or using, it also can store in a computer readable storage medium.Based on this understanding, the present invention is implemented Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words, The computer software product is stored in a storage medium, including some instructions are used so that computer equipment (can be with It is personal computer, server or network equipment etc.) execute all or part of each embodiment the method for the present invention. And storage medium above-mentioned includes: that movable storage device, ROM, RAM, magnetic or disk etc. are various can store program code Medium.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (7)

1. a kind of image partition method that template is adaptive, which is characterized in that the described method includes:
Receive product original image and corresponding product type to be split;
The corresponding small figure of template is found according to the product type;
The coordinate value of all target areas is determined on complete product original image;
Template coordinate is obtained according to the coordinate value of all target areas, and carries out prestoring processing;
Corresponding template coordinate is found according to the product type;
The mesh that the small figure of the template is matched with the product original image, and will match to using template small figure matching algorithm Mark region is partitioned into the product original image;
Judge whether match whole target areas in the product original image;
If so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to the product The target area that original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and carry out Display.
2. a kind of adaptive image partition method of template according to claim 1, which is characterized in that use template coordinate Cover algorithm carries out cover processing to the target area that the product original image does not match, specifically includes:
On the target area coordinates that the template coordinate matching is had detected that the product original image, counter push away obtains the production The undetected target area coordinates of product original image;
According to undetected target area coordinates, undetected target area is partitioned into the product original image.
3. a kind of adaptive image partition method of template according to claim 1, which is characterized in that use the small figure of template Matching algorithm matches the small figure of the template with the product original image, specifically includes:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
4. a kind of adaptive image partition method of template according to claim 1, which is characterized in that be split receiving Product original image and corresponding product type before, the method also includes:
Prestore the small figure of the corresponding template of each product type.
5. a kind of image segmentation system that template is adaptive, which is characterized in that the adaptive image segmentation system packet of the template Include: memory and processor, include a kind of image partition method program that template is adaptive in the memory, the template from The image partition method program of adaptation realizes following steps when being executed by the processor:
Receive product original image and corresponding product type to be split;
The corresponding small figure of template is found according to the product type;
The coordinate value of all target areas is determined on complete product original image;
Template coordinate is obtained according to the coordinate value of all target areas, and carries out prestoring processing;
Corresponding template coordinate is found according to the product type;
The mesh that the small figure of the template is matched with the product original image, and will match to using template small figure matching algorithm Mark region is partitioned into the product original image;
Judge whether match whole target areas in the product original image;
If so, the product image that output has been divided, and shown, if it is not, using template coordinate cover algorithm to the product The target area that original image does not match carries out cover processing, after the completion of cover, exports the product image divided, and carry out Display.
6. a kind of adaptive image segmentation system of template according to claim 5, which is characterized in that use the small figure of template Matching algorithm matches the small figure of the template with the product original image, specifically includes:
Each position in the product original image, more each position and the small figure of the template are traversed using the small figure of the template Similarity;
When the threshold values of certain position and the super multiple preset of similarity of the small figure of the template, then determine the position for target area.
7. a kind of computer readable storage medium, which is characterized in that include a kind of template in the computer readable storage medium Adaptive image partition method program when the adaptive image partition method program of the template is executed by processor, is realized A kind of the step of image partition method that template is adaptive according to any one of claims 1 to 4.
CN201910884601.6A 2019-09-19 2019-09-19 Template self-adaptive image segmentation method, system and readable storage medium Active CN110390682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910884601.6A CN110390682B (en) 2019-09-19 2019-09-19 Template self-adaptive image segmentation method, system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910884601.6A CN110390682B (en) 2019-09-19 2019-09-19 Template self-adaptive image segmentation method, system and readable storage medium

Publications (2)

Publication Number Publication Date
CN110390682A true CN110390682A (en) 2019-10-29
CN110390682B CN110390682B (en) 2019-12-27

Family

ID=68289703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910884601.6A Active CN110390682B (en) 2019-09-19 2019-09-19 Template self-adaptive image segmentation method, system and readable storage medium

Country Status (1)

Country Link
CN (1) CN110390682B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802015A (en) * 2020-05-08 2021-05-14 视睿(杭州)信息科技有限公司 Industrial particle continuous product image cutting method and device based on template matching
CN114486918A (en) * 2022-02-15 2022-05-13 凌云光技术股份有限公司 Self-adaptive product appearance defect positioning method and system
WO2023001193A1 (en) * 2021-07-20 2023-01-26 United Imaging Research Institute of Innovative Medical Equipment Systems and methods for image segmentation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110158501A1 (en) * 2008-05-30 2011-06-30 Novacyt Method for sample cell analysis using a virtual analysis plate
CN106228548A (en) * 2016-07-18 2016-12-14 图麟信息科技(上海)有限公司 The detection method of a kind of screen slight crack and device
CN109118482A (en) * 2018-08-07 2019-01-01 腾讯科技(深圳)有限公司 A kind of panel defect analysis method, device and storage medium
CN109767447A (en) * 2019-01-04 2019-05-17 腾讯科技(深圳)有限公司 A kind of template matching method, device, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110158501A1 (en) * 2008-05-30 2011-06-30 Novacyt Method for sample cell analysis using a virtual analysis plate
CN106228548A (en) * 2016-07-18 2016-12-14 图麟信息科技(上海)有限公司 The detection method of a kind of screen slight crack and device
CN109118482A (en) * 2018-08-07 2019-01-01 腾讯科技(深圳)有限公司 A kind of panel defect analysis method, device and storage medium
CN109767447A (en) * 2019-01-04 2019-05-17 腾讯科技(深圳)有限公司 A kind of template matching method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴学文等: "基于多模板方向的图像修复方法", 《科学技术与工程》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802015A (en) * 2020-05-08 2021-05-14 视睿(杭州)信息科技有限公司 Industrial particle continuous product image cutting method and device based on template matching
WO2023001193A1 (en) * 2021-07-20 2023-01-26 United Imaging Research Institute of Innovative Medical Equipment Systems and methods for image segmentation
CN114486918A (en) * 2022-02-15 2022-05-13 凌云光技术股份有限公司 Self-adaptive product appearance defect positioning method and system
CN114486918B (en) * 2022-02-15 2023-11-10 凌云光技术股份有限公司 Self-adaptive product appearance defect positioning method and system

Also Published As

Publication number Publication date
CN110390682B (en) 2019-12-27

Similar Documents

Publication Publication Date Title
CN109829914B (en) Method and device for detecting product defects
US11087554B2 (en) Generating an augmented reality image using a blending factor
US10445557B2 (en) Learning pixel visual context from object characteristics to generate rich semantic images
CN110390682A (en) A kind of image partition method that template is adaptive, system and readable storage medium storing program for executing
US8452109B2 (en) Image segregation system with method for handling textures
Shih et al. Automatic reference color selection for adaptive mathematical morphology and application in image segmentation
CN113439276A (en) Defect classification in semiconductor samples based on machine learning
JP2018506046A (en) Method for detecting defects on the tire surface
US20150324662A1 (en) Method for identifying color-based vectors for analysis of frames of a video
US20220122244A1 (en) Defect image generation method for deep learning and system therefor
US20150324660A1 (en) Multi-scale pyramid arrangement for use in an image segregation
CN111325728B (en) Product defect detection method, device, equipment and storage medium
Haq et al. An edge-aware based adaptive multi-feature set extraction for stereo matching of binocular images
CN108830184A (en) Black eye recognition methods and device
CN117437406A (en) Multi-target detection method and device
CN112070762A (en) Mura defect detection method and device for liquid crystal panel, storage medium and terminal
Park et al. Automated defect inspection systems by pattern recognition
WO2015171355A1 (en) A method for identifying color-based vectors for analysis of frames of a video
Vite-Chávez et al. Improvement Procedure for Image Segmentation of Fruits and Vegetables Based on the Otsu Method
CN115082484B (en) Automatic semiconductor partitioning method based on image processing
US9158989B1 (en) Color pure scale-spaced pyramid arrangement for use in an image segregation
CN116258703A (en) Defect detection method, defect detection device, electronic equipment and computer readable storage medium
CN117011216A (en) Defect detection method and device, electronic equipment and storage medium
Balaji et al. Effective features of remote sensing image classification using interactive adaptive thresholding method
CN103927544A (en) Machine vision grading method for ginned cotton rolling quality

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