Disclosure of Invention
An object of the embodiments of the present invention is to provide a visual inspection method, apparatus, device and readable storage medium.
According to a first aspect of the present disclosure, there is provided a visual inspection method comprising:
acquiring a first processing drawing and a first visual detection parameter of a product to be detected;
Obtaining conversion parameters from the actual size of the product to be detected to the pixel size of the camera visual field;
generating a first detection program of the product to be detected according to the first processing drawing, the first visual detection parameter and the conversion parameter, wherein the first detection program comprises at least one first detection frame of the product to be detected in a camera view;
And performing visual inspection on the product to be inspected according to the first inspection program.
Optionally, the obtaining the first processing drawing and the first visual detection parameter of the product to be detected includes:
obtaining product information of the product to be tested;
And acquiring a first processing drawing and a first visual detection parameter of the product to be detected from a server according to the product information.
Optionally, the method further comprises:
comparing the first visual detection parameter with a second visual parameter of a product to be detected;
and executing the step of generating a first detection program of the product to be detected according to the first processing drawing, the first visual detection parameter and the conversion parameter when the first visual parameter is different from the second visual parameter.
Optionally, the method further comprises:
And when the first visual parameter is the same as the second visual parameter, performing visual detection on the product to be detected according to a second detection program, wherein the second detection program is a detection program obtained according to the first processing drawing, the second visual detection parameter and the conversion parameter.
Optionally, the method further comprises:
When the first visual parameter is different from the second visual parameter, sending an alarm;
and responding to the confirmation operation of the modification of the visual inspection parameters, and executing the step of generating a first inspection program of the product to be inspected according to the first processing drawing, the first visual inspection parameters and the conversion parameters.
Optionally, the generating a first detection program of the product to be detected according to the first processing drawing, the first visual detection parameter and the conversion parameter includes:
generating a second detection frame represented by the actual size of the product to be detected according to the first processing drawing;
Processing the second detection frame according to the conversion parameters to obtain the first detection frame;
and obtaining the first detection program according to the first detection frame and the first visual detection parameters.
Optionally, the processing drawing is a 3D drawing, and generating, according to the first processing drawing, a second detection frame represented by an actual size of the product to be detected includes:
Generating a 2D drawing of the product to be tested according to the 3D drawing;
And analyzing the 2D drawing to obtain the second detection frame.
According to a second aspect of the present disclosure, there is provided a visual inspection apparatus comprising:
The detection parameter acquisition module is used for acquiring a first processing drawing and a first visual detection parameter of the product to be detected;
the conversion parameter acquisition module is used for acquiring conversion parameters from the actual size of the product to be detected to the pixel size of the camera visual field;
the detection program generation module is used for generating a first detection program of the product to be detected according to the first processing drawing, the first visual detection parameter and the conversion parameter, wherein the first detection program comprises at least one first detection frame of the product to be detected in a camera view;
And the visual detection module is used for performing visual detection on the product to be detected according to the first detection program.
According to a third aspect of the present disclosure there is provided a visual inspection apparatus comprising a processor and a memory for storing a computer program for controlling the processor to perform the method according to the first aspect of the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method according to the first aspect of the present disclosure.
According to the embodiment of the disclosure, the first detection program of the product to be detected is automatically generated according to the first processing drawing of the product to be detected, the first visual detection parameter and the conversion parameter from the actual size of the product to be detected to the pixel size of the camera visual field, and the product to be detected is visually detected according to the first detection program, so that a tester does not need to manually draw a detection frame to obtain the detection program, the generation efficiency and accuracy of the detection program can be improved, and the visual detection efficiency of the product to be detected is further improved.
Other features of the present invention and its advantages will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of the regions and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The following description of at least one exemplary embodiment is merely exemplary in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of exemplary embodiments may have different values.
It should be noted that like reference numerals and letters refer to like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
The present embodiment provides a visual inspection method, which may be implemented by a visual inspection apparatus.
Fig. 1 is a flowchart of a visual inspection method provided in accordance with an embodiment of the present disclosure.
As shown in FIG. 1, the product assembling method may include the following steps S1100-S1400:
step S1100, a first processing drawing and a first visual inspection parameter of a product to be tested are obtained.
In this embodiment, the first processing drawing may be a drawing for processing a product to be tested, and the first processing drawing may be a 3D digital-analog drawing.
The first visual inspection parameter may be a threshold and/or upper and lower limits representing a visual inspection pass range of the product under inspection. The first visual inspection parameter may be stored in a csv file.
In one embodiment, the first processing drawing and the first visual inspection parameter of the product to be inspected may be pre-stored on a visual inspection apparatus that performs the method of the present embodiment.
In one embodiment, the first processing drawing and the first visual parameter of the product to be tested may be stored on a server, and the visual inspection apparatus performing the method of the embodiment is obtained from the server. The method for obtaining the first processing drawing and the first visual detection parameter of the product to be detected comprises the steps of obtaining product information of the product to be detected, and obtaining the first processing drawing and the first visual detection parameter of the product to be detected from a server according to the product information of the product to be detected.
In this embodiment, the user may set product information of the product to be tested for the visual inspection in the visual inspection device through a first configuration interface, where the first configuration interface may be as shown in fig. 2. The product information may be, for example, an item code for representing a product type of the product to be measured.
In the server, a second configuration interface can be provided, a user can set the second configuration interface, the user can configure product information of the product to be tested through the second configuration interface, and the first processing drawing and the first visual detection parameter of the product to be tested are uploaded through the second configuration interface so as to correlate the product information of the product to be tested with the first processing drawing and the first visual detection parameter of the product to be tested.
Further, the user can configure the association relationship among the work station, the working procedure and the product information through the server.
Specifically, the user can configure item codes, station codes, system line identification codes, line types, procedures, station codes and station names through the server. The basic information is the basis for realizing parameter uploading and parameter issuing acquisition.
In one example, as shown in fig. 3, the server may synchronize project information of the basic data platform, may input project codes or factory instance information that may synchronize the basic data platform unit with the station position, and may input inventory organization codes that may synchronize the project material number information of the basic data platform.
In one example, as shown in fig. 3, the server may further provide a quality parameter management list in the second configuration interface, where the quality parameter management list is displayed based on the item, unit, and test class, and only the latest version of the quality parameter is displayed. The server can also screen and display the items for users with different data authorities.
In one example, as shown in FIG. 4, the user may click on a new button in the second configuration interface to enter the quality parameter maintenance page. In the quality parameter maintenance page, a user can select to upload a file in a CSV format, check corresponding unit station position information, and click a confirmation button to upload the first visual detection parameter.
In one example, as shown in fig. 3, the server may provide all versions of visual parameters of the corresponding project in the event that the user selects the corresponding project workstation, for the user to view all parameter upload versions, each version's visual parameters may contain project base information, upload time, version content, and so forth.
In one embodiment, the visual inspection apparatus for performing the method of the present embodiment may acquire the first processing drawing and the first visual parameter of the product to be tested from the server in the event of the parameter acquisition event. The event of acquiring the parameter may include receiving an operation of acquiring the parameter, and reaching a set update time.
In another embodiment, the visual inspection apparatus performing the method of the present embodiment may acquire the first processing drawing and the first visual parameter of the product to be tested from the server in the case that the operation of acquiring the parameter is received. The visual inspection device may be configured to obtain the first visual parameter of the product to be inspected from the server if the set update time is reached.
The operation of obtaining the parameter may be an operation of clicking a first button in the first configuration interface when the user sets product information of the product to be tested for visual detection in the visual detection device through the first configuration interface. The first configuration interface may be as shown in fig. 2, and the first button may be a "pull parameter and save to local" button in the first configuration interface as shown in fig. 2.
In this embodiment, the user may set, in advance, a time interval for updating the visual parameter in the visual inspection process of the product to be inspected through the first configuration interface in the visual inspection apparatus, where the time interval may be, for example, 5 minutes. Then, in the case where the time interval for updating the visual parameters reaches 5 minutes, the step of acquiring the first visual inspection parameters is performed once.
In one embodiment of the disclosure, the method may further include comparing the first visual inspection parameter with a second visual parameter of the product to be inspected, and executing a first inspection program for the product to be inspected according to the first processing drawing, the first visual inspection parameter, and the conversion parameter when the first visual parameter is different from the second visual parameter.
In this embodiment, the second visual parameter may be a visual parameter that the visual detection device is using. That is, a second inspection program, which is being used by the visual inspection apparatus to perform visual inspection of the product to be inspected, is generated based on the second visual parameters.
Further, in the case that the second visual parameter is not stored in the visual inspection apparatus, the step of comparing the first visual inspection parameter with the second visual parameter of the product to be inspected may not be performed, and steps S1200 to S1400 may be continuously performed.
According to the embodiment, under the condition that the visual parameters are updated, the detection program used by the visual detection equipment can be updated in time, so that inaccurate visual detection results of the products to be detected caused by untimely updating of the detection program are avoided, and the qualification rate of the products to be detected is further influenced.
In one embodiment of the present disclosure, the method further includes the step of issuing an alarm when the first visual parameter is different from the second visual parameter, and executing a first inspection program that generates the product under inspection from the first machining drawing, the first visual inspection parameter, and the conversion parameter in response to a confirmation operation of the modification of the visual inspection parameter.
In this embodiment, when the first visual parameter is different from the second visual parameter, an alarm is sent, so that a tester can be reminded to confirm whether to test the product to be tested by using the first visual parameter. Under the condition that the tester confirms that the product to be tested is tested by using the first visual parameters, the tester can execute the confirmation operation of modifying the visual detection parameters, so that the visual detection equipment executes the subsequent steps S1200-S1400.
By the embodiment, the reliability and the accuracy of the visual detection result can be improved.
In one embodiment of the disclosure, the method further comprises visually inspecting the product under inspection according to a second inspection program when the first visual parameter is the same as the second visual parameter, wherein the second inspection program is an inspection program obtained according to the first processing drawing, the second visual inspection parameter and the conversion parameter.
In this embodiment, when the first visual parameter is the same as the second visual parameter, it indicates that the visual parameter of the product to be tested is not changed, and in order to reduce the computing power of the visual detection device, it may be unnecessary to generate the first detection program according to the first visual parameter to perform visual detection on the product to be tested. Thus, the second inspection program generated according to the second visual parameter can be used for continuously performing visual inspection on the product to be inspected.
By this embodiment, the computational effort of the visual inspection apparatus can be reduced.
Step S1200, obtaining a conversion parameter from the actual size of the product to be detected to the pixel size of the camera field of view.
In this embodiment, the camera may be calibrated according to the calibration product, to obtain a conversion parameter from the actual size of the product to be detected to the pixel size of the field of view of the camera.
In some embodiments, the camera may be recalibrated prior to visual inspection in the event that the visual inspection apparatus is replaced with a type of product that requires visual inspection.
In some embodiments, the conversion parameters may be stored in the visual inspection apparatus after calibration of the camera, and in the event that the inspection apparatus is not replaced with an inspected product type, the stored conversion parameters may be retrieved from the visual inspection apparatus if it is desired to generate an inspection program.
Step S1300, a first detection program of the product to be detected is generated according to the first processing drawing, the first visual detection parameters and the converted parameters.
The first detection program comprises at least one first detection frame of the product to be detected in the field of view of the camera.
In this embodiment, the first detection program may be configured to detect whether the deviation between the at least one to-be-detected area of the product to be detected and the corresponding first detection frame in the camera field of view corresponds to the corresponding first visual parameter.
In one embodiment of the disclosure, a first detection program of a product to be detected is generated according to a first processing drawing, a first visual detection parameter and a conversion parameter, and the first detection program is obtained according to the first processing drawing, a second detection frame represented by the actual size of the product to be detected is generated according to the first processing drawing, the second detection frame is processed according to the conversion parameter to obtain a first detection frame, and the first detection program is obtained according to the first detection frame and the first visual detection parameter.
In this embodiment, the second detection frame indicates the actual size of the product to be detected and the actual position of the area to be detected in the product to be detected.
Because the visual inspection is to shoot the product to be inspected by the camera, and whether the product to be inspected has defects is inspected according to the shot image to be inspected, the second inspection frame in the product to be inspected needs to be converted into the field of view of the camera according to the conversion parameters, so as to obtain the first inspection frame.
In one embodiment of the disclosure, the processing drawing is a 3D drawing, and generating a second detection frame represented by the actual size of the product to be detected according to the first processing drawing includes generating a 2D drawing of the product to be detected according to the 3D drawing, and analyzing the 2D drawing to obtain the second detection frame.
According to the embodiment, the detection program of the product to be detected can be automatically generated according to the 3D drawing, a tester is not required to manually draw the detection frame, the generation efficiency and accuracy of the detection program are improved, and the production efficiency of the product to be detected is further improved.
In step S1400, the product to be tested is visually inspected according to the first inspection program.
In this embodiment, the visual inspection of the product to be inspected according to the first inspection program may include controlling the camera to capture the product to be inspected to obtain an image to be inspected, and performing the visual inspection of the image to be inspected according to the first inspection program to obtain a visual inspection result of the product to be inspected.
According to the embodiment of the disclosure, the first detection program of the product to be detected is automatically generated according to the first processing drawing of the product to be detected, the first visual detection parameter and the conversion parameter from the actual size of the product to be detected to the pixel size of the camera visual field, and the product to be detected is visually detected according to the first detection program, so that a tester does not need to manually draw a detection frame to obtain the detection program, the generation efficiency and accuracy of the detection program can be improved, and the visual detection efficiency of the product to be detected is further improved.
The present embodiment also provides a visual inspection apparatus 5000, as shown in fig. 5, the visual inspection apparatus 5000 includes a detection parameter acquisition module 5100, a conversion parameter acquisition module 5200, a detection program generation module 5300, and a visual inspection module 5400.
The detection parameter obtaining module 5100 is configured to obtain a first processing drawing and a first visual detection parameter of a product to be detected.
The conversion parameter obtaining module 5200 is configured to obtain a conversion parameter from an actual size of the product to be measured to a pixel size of a camera field of view.
The inspection program generation module 5300 is configured to generate a first inspection program of the product to be inspected according to the first processing drawing, the first visual inspection parameter, and the conversion parameter, where the first inspection program includes at least one first inspection frame of the product to be inspected in a camera field of view.
The visual inspection module 5400 is used for performing visual inspection on the product to be inspected according to the first inspection program.
In one embodiment of the present disclosure, the detection parameter obtaining module 5100 is configured to:
obtaining product information of the product to be tested;
And acquiring a first processing drawing and a first visual detection parameter of the product to be detected from a server according to the product information.
In one embodiment of the present disclosure, the visual inspection apparatus 5000 further includes:
a module for comparing the first visual inspection parameter with a second visual parameter of the product to be inspected;
the inspection program generating module 5300 is configured to execute the step of generating the first inspection program of the product to be inspected according to the first processing drawing, the first visual inspection parameter, and the conversion parameter when the first visual parameter is different from the second visual parameter.
In one embodiment of the present disclosure, the visual inspection apparatus 5000 further includes:
And the module is used for carrying out visual detection on the product to be detected according to a second detection program when the first visual parameter is the same as the second visual parameter, wherein the second detection program is a detection program obtained according to the first processing drawing, the second visual detection parameter and the conversion parameter.
In one embodiment of the present disclosure, the visual inspection apparatus 5000 further includes:
Means for issuing an alarm when the first visual parameter is different from the second visual parameter;
The inspection program generating module 5300 is configured to execute the step of generating the first inspection program of the product to be inspected according to the first processing drawing, the first visual inspection parameter and the conversion parameter in response to the confirmation operation of the modification of the visual inspection parameter.
In one embodiment of the present disclosure, the detection program generation module 5300 is configured to:
generating a second detection frame represented by the actual size of the product to be detected according to the first processing drawing;
Processing the second detection frame according to the conversion parameters to obtain the first detection frame;
and obtaining the first detection program according to the first detection frame and the first visual detection parameters.
In one embodiment of the disclosure, the processing drawing is a 3D drawing, and the generating, according to the first processing drawing, a second detection frame represented by an actual size of the product to be detected includes:
Generating a 2D drawing of the product to be tested according to the 3D drawing;
And analyzing the 2D drawing to obtain the second detection frame.
The present embodiment also provides a visual inspection apparatus 6000, as shown in fig. 6, comprising a processor 6100 and a memory 6200, the memory 6200 being configured to store a computer program for controlling the processor 6100 to perform a method according to any of the embodiments of the present disclosure.
The present embodiment also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method according to any of the embodiments of the present disclosure.
The embodiments described above mainly focus on differences from other embodiments, but it should be clear to a person skilled in the art that the embodiments described above may be used alone or in combination with each other as desired.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are referred to each other, and each embodiment is mainly described as different from other embodiments, but it should be apparent to those skilled in the art that the above embodiments may be used alone or in combination with each other as required. In addition, for the device embodiment, since it corresponds to the method embodiment, description is relatively simple, and reference should be made to the description of the corresponding part of the method embodiment for relevant points. The system embodiments described above are merely illustrative, in that the modules illustrated as separate areas may or may not be physically separate.
The present invention may be an apparatus, method and/or computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical compression device, punch cards or intra-groove protrusion structures such as those having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as SMALLTALK, C ++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information for computer readable program instructions, which can execute the computer readable program instructions.
Various aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvement of the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.