Disclosure of Invention
In view of the above, the present invention is proposed to provide a method, device, apparatus and system for detecting dispensing that overcome the above problems or at least partially solve the above problems.
In a first aspect, a method for detecting dispensing is provided, including:
acquiring a first image of the shot target module after dispensing;
aligning the first image with a template image to align an actual dispensing area in the first image with a pre-estimated dispensing area preset in the template image, wherein the template image is an image obtained by shooting a template module before dispensing, and the template module is a module of the same type as the target module;
and analyzing the aligned first image and the template image to obtain a dispensing detection result.
Optionally, the aligning the first image with the template image includes: aligning an imaging center of the target module in the first image with an imaging center of the template module in the template image; and rotating the first image to align the actual dispensing area of the target module in the first image with the pre-estimated dispensing area preset by the template module in the template image.
Optionally, the target module is a camera module, the actual dispensing area is a gap area between threads of the camera module, and the threads are located between the lens barrel and the lens.
Optionally, the analyzing the aligned first image and the aligned template image to obtain a dispensing detection result includes: calculating the difference between the first image and the template image to obtain a difference image; and obtaining a dispensing detection result according to the difference image.
Optionally, the calculating a difference between the first image and the template image to obtain a difference image includes: and calculating the difference between the first image and the template image, and performing binarization processing on the calculated difference data to obtain the difference image.
Optionally, the obtaining a dispensing detection result according to the difference image includes: determining the number of dispensing areas of the target module and dispensing amount data of each dispensing area according to the difference data represented by the difference image; and determining the dispensing detection result according to the number of the dispensing areas and the dispensing amount data.
Optionally, the obtaining a dispensing detection result according to the difference image includes: determining the number of dispensing areas of the target module and the area ratio of each dispensing area in the dispensing area according to the difference data represented by the difference image and a preset dispensing area; judging whether the number of the dispensing areas meets a preset number and whether the area ratio meets a preset ratio; and if the dispensing detection results are all satisfied, determining that the dispensing detection result is qualified.
In a second aspect, a dispensing detection device is provided, which includes:
the acquisition module is used for acquiring a first image of the shot and glued target module;
the alignment module is used for aligning the first image with a template image so that an actual dispensing area in the first image is aligned with an estimated dispensing area preset in the template image, wherein the template image is an image obtained by shooting a template module before dispensing, and the template module is a module of the same type as the target module;
and the analysis module is used for analyzing the aligned first image and the template image to obtain a dispensing detection result.
In a third aspect, an electronic device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing any of the method steps of the first aspect when executing the program.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of the first aspect.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages:
according to the method, the device, the equipment and the system for detecting the dispensing, provided by the embodiment of the invention, the image shot by the template module before dispensing is taken as the template image, and the target module with the same type as the template module can be taken as a comparison basis when the dispensing is detected. The specific detection method comprises the steps of shooting and obtaining a first image after the target module is subjected to glue dispensing, aligning the image of the actual glue dispensing position in the first image with the image of the estimated glue dispensing position in the template image, and analyzing the two aligned images to obtain a glue dispensing detection result, so that the problem of missing detection of manual detection is avoided, and the labor cost is also saved. And because do not need every module of making a video recording all to shoot before the point is glued, all detect with the template image of template module as the benchmark, simplified the detection procedure.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Detailed Description
The technical scheme in the embodiment of the invention has the following general idea:
in this embodiment, a first image of a target module after shooting and dispensing is acquired, and the first image is aligned with a template image corresponding to a template module of the same model before dispensing, so that an actual dispensing position in the first image is aligned with an estimated dispensing position preset in the template image. And analyzing the aligned first image and the template image to obtain a dispensing detection result. On the one hand, avoided artifical detection's the hourglass to examine the problem, practiced thrift the human cost, on the other hand, all detect as the benchmark with the template image of template module owing to all shoot before not needing every module point of making a video recording to glue, improved detection efficiency.
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment provides a method for detecting dispensing, as shown in fig. 1, including:
step S101, acquiring a first image of a shot and glued target module;
step S102, aligning the first image with a template image to align an actual dispensing area in the first image with an estimated dispensing area preset in the template image, wherein the template image is an image obtained by shooting a template module before dispensing, and the template module is a module of the same type as the target module;
step S103, analyzing the aligned first image and the template image to obtain a dispensing detection result.
It should be noted that the method for detecting dispensing can be applied to a computer, a tester, and other independent computing devices, and can also be applied to a detection module integrated on a test production line or a test machine, which is not limited herein and is not listed.
The target module may be a camera module, a distance measuring module, etc., and the detected glue may be the glue of the lens and the lens barrel, or the glue of the sensor and the frame, which are not limited herein.
Next, taking the template module and the template module as the camera module as an example, the implementation steps of the method provided in this embodiment are described in detail with reference to fig. 1:
firstly, a template image needs to be prepared in advance, and in order to ensure the matching of the template image and a module to be detected, the template image shot before dispensing by the template module with the same model as a target module to be detected is selected as the template image. For example, as shown in fig. 2, a template image is obtained by photographing the template module.
Preferably, in order to facilitate more accurate subsequent alignment, the pre-estimated dispensing area may be marked on the template image in advance, and specifically, the center line of the pre-estimated dispensing area and the boundary line of the area expected to be dispensed may be marked to ensure alignment. For example, as shown in fig. 3, when the lens and the lens barrel of the camera module are fixed by dispensing, the dispensing area is estimated to be a gap area between the screw teeth 31 of the camera module, and the screw teeth 31 are located between the lens barrel 32 and the lens 33. An imaging center O of the template module is marked on the template image in advance, a center line a and two boundary lines b of any pre-estimated dispensing area are marked, and a reference line c in the 12-point direction relative to the midpoint O can be marked on the image, so that subsequent accurate alignment is facilitated.
Then, step S101 is executed to obtain a first image of the shot dispensed target module.
Specifically, after the target module passes through a dispensing process on a production line, a picture of the target module is taken and acquired as a first image. Preferably, the angle and distance of the shooting target module are the same as or as much as possible with the angle and distance of the shooting template module, so as to facilitate subsequent alignment and analysis. For example, as shown in fig. 4, the first image of the target module after dispensing is taken, in which the black area 41 is the area where the glue is dispensed and is the gap area between the threads of the camera module.
And step S102 is executed, the first image is aligned with the template image, so that the actual dispensing area in the first image is aligned with the pre-estimated dispensing area preset in the template image.
Specifically, the actual dispensing area may be determined by performing a graphic feature analysis on the first image (for example, the graphic analysis identifies a gap area between the threads), and then the imaging center O ' of the target module in the first image and the center line a ' and two boundary lines b ' of any actual dispensing area may be aligned accurately for subsequent alignment.
Preferably, the imaging center of the target module in the first image may be aligned with the imaging center of the template module in the template image. And then, rotating the first image to align the actual dispensing area of the target module in the first image with the pre-estimated dispensing area preset by the template module in the template image. For example, the first image is first translated by X0-X1 pixels in the X-axis direction and by Y0-Y1 pixels in the Y-axis positive direction, so that the imaging center O' of the template module in the first image is aligned with the imaging center O of the template module in the template image. As shown in fig. 5, according to the angle difference between the actual dispensing area and the estimated dispensing area, the imaging center O' of the template module in the first image is used as the axis to rotate the first image so that the actual dispensing area and the estimated dispensing area are aligned and overlapped. The specific rotation angle may be determined according to any one of the pre-estimated center line a and two boundary lines b of the dispensing region marked before and the pre-estimated center line a 'and two boundary lines b' of the actual dispensing region marked before, for example, the rotation angle is equal to an included angle between the pre-estimated center line a of the dispensing region and the actual center line a 'of the dispensing region after aligning the imaging center O' of the target module in the first image with the imaging center O of the template module in the template image. Because the dispensing positions of the camera module are always uniformly and symmetrically distributed, after any actual dispensing area is aligned with the estimated dispensing area after rotation, other actual dispensing areas can be aligned with the area needing dispensing on the template image.
Of course, the method for aligning the first image with the template image is not limited to the above, and the first image and the template image may be directly defaulted to have no deflection, so that only center alignment is performed; the first image and the frame region imaged by the module in the template image can be aligned according to the frame after being subjected to pattern matching, which is not limited and is not listed.
Next, step S103 is executed to analyze the aligned first image and the template image, and obtain a dispensing detection result.
The two aligned images may be analyzed by performing a translucency process on the two images, placing the two images in an overlapping manner, and performing a manual analysis or an image characteristic analysis.
Preferably, the difference between the first image and the template image is calculated to obtain a difference image, and then the dispensing detection result is obtained according to the difference image. Specifically, calculating the difference between the first image and the template image may be comparing features of the two images, and extracting and displaying different image features on the difference image to obtain the dispensing detection result according to the difference image (for example, manually checking the difference image to obtain the dispensing detection result). Because the two images are before and after dispensing, the difference is the dispensing area, the difference is extracted to generate a difference image, the interference of other image areas is eliminated, and the rapid failure of the dispensing area and the dispensing condition can be helped.
Preferably, as shown in fig. 6, the difference image may be obtained by calculating a difference between the first image and the template image and performing binarization processing on the calculated difference data. Differences are highlighted through binarization, so that the dispensing area is easier to identify accurately.
Preferably, the method for obtaining the dispensing detection result according to the difference image may further comprise determining the number of dispensing areas of the target module and the dispensing amount data of each dispensing area according to the difference data represented by the difference image, and determining the dispensing detection result according to the number of dispensing areas and the dispensing amount data.
Specifically, as shown in fig. 7, the dispensing required area (the area within the fan-shaped frame in fig. 7) is preset, and then the number of dispensing areas of the target module and the area ratio of each dispensing area in the dispensing required area are determined according to the difference data (the white irregular stripe area in fig. 7) represented by the difference image and the dispensing required area. And then judging whether the quantity of the dispensing areas meets the preset quantity and whether the area ratio meets the preset ratio, and if so, determining that the dispensing detection result is qualified.
For example, in fig. 7, all the 4 predetermined dispensing areas have dispensing, and the area ratio of each dispensing area in the dispensing area is greater than the predetermined specification of 70%, the dispensing detection result of the template module is determined to be qualified.
Specifically, template images of the template modules are used as the reference, and the template modules of the same model are analyzed after being aligned, so that on one hand, the problem of missing detection of manual detection is avoided, the labor cost is saved, on the other hand, because each camera module is not required to be photographed before dispensing, the template images of the template modules are used as the reference for detection, and the detection efficiency is improved. In addition, after the first detection is unqualified and the reworking of the dispensing process is carried out, the reworked module can be detected by the dispensing detection method provided by the application.
Based on the same inventive concept, an embodiment of the present invention further provides a dispensing detection apparatus, as shown in fig. 8, including:
an obtainingmodule 801, configured to obtain a first image of a target module after shooting and dispensing;
analignment module 802, configured to align the first image with a template image, so that an actual dispensing area in the first image is aligned with an estimated dispensing area preset in the template image, where the template image is an image obtained by shooting a template module before dispensing, and the template module is a module of the same model as the target module;
ananalyzing module 803, configured to analyze the aligned first image and the template image to obtain a dispensing detection result.
It should be noted that the apparatus may be a computer, a tester, or other separate computing devices, or may be a detection module integrated on a test production line or a test machine, which is not limited herein and is not listed.
The target module may be a camera module, a distance measuring module, etc., and the detected glue may be the glue of the lens and the lens barrel, or the glue of the sensor and the frame, which are not limited herein.
Since the apparatus described in the embodiment of the present invention is an apparatus used for implementing the method in the embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the apparatus based on the method described in the embodiment of the present invention, and thus the detailed description is omitted here. All devices adopted by the method of the embodiment of the invention belong to the protection scope of the invention.
Based on the same inventive concept, an embodiment of the present invention further provides an electronic device, as shown in fig. 9, including amemory 910, aprocessor 920, and acomputer program 911 stored on thememory 910 and operable on theprocessor 920, where theprocessor 920 executes thecomputer program 911 to implement the following steps:
acquiring a first image of the shot target module after dispensing;
aligning the first image with a template image to align an actual dispensing area in the first image with a pre-estimated dispensing area preset in the template image, wherein the template image is an image obtained by shooting a template module before dispensing, and the template module is a module of the same type as the target module;
and analyzing the aligned first image and the template image to obtain a dispensing detection result.
In the embodiment of the present invention, when theprocessor 920 executes thecomputer program 911, any implementation manner of the method of the embodiment of the present invention can be implemented.
Since the electronic device described in the embodiment of the present invention is a device used for implementing the method in the embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the device based on the method described in the embodiment of the present invention, and thus details are not described herein. All the devices adopted by the method of the embodiment of the invention belong to the protection scope of the invention.
Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium 1000, as shown in fig. 10, on which acomputer program 1011 is stored, and when being executed by a processor, thecomputer program 1011 implements the following steps:
determining the position of a field point on a test chart according to a preset field condition, wherein the test chart is an imaging chart obtained by shooting a checkerboard chart by the camera module;
determining N target rectangular squares on the test chart according to the position of the field-of-view point and the position of a preset reference point and a preset rule, wherein N is more than or equal to 1;
and according to the N target rectangular grids, carrying out analysis force test on the camera module.
In a specific implementation, thecomputer program 1011, when executed by a processor, may implement any of the method embodiments of the present invention.
Since the storage medium described in the embodiment of the present invention is a storage medium where a computer program corresponding to a method for implementing the embodiment of the present invention is located, based on the method described in the embodiment of the present invention, a person skilled in the art can know the computer program stored in the storage medium, and thus details are not described here. Any storage medium on which a computer program of the method of the embodiment of the present invention is stored falls within the scope of the present invention.
The technical scheme provided by the embodiment of the invention at least has the following technical effects or advantages:
according to the method, the device, the equipment and the system for detecting the dispensing, provided by the embodiment of the invention, the image shot by the template module before dispensing is taken as the template image, and the target module with the same type as the template module can be taken as a comparison basis when the dispensing is detected. The specific detection method comprises the steps of shooting and obtaining a first image after the target module is subjected to glue dispensing, aligning the image of the actual glue dispensing position in the first image with the image of the estimated glue dispensing position in the template image, and analyzing the two aligned images to obtain a glue dispensing detection result, so that the problem of missing detection of manual detection is avoided, and the labor cost is also saved. And because do not need every module of making a video recording all to shoot before the point is glued, all detect with the template image of template module as the benchmark, simplified the detection procedure.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of an apparatus, device, or device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.