CN111815552A - Workpiece detection method and device, readable storage medium and terminal equipment - Google Patents

Workpiece detection method and device, readable storage medium and terminal equipment Download PDF

Info

Publication number
CN111815552A
CN111815552A CN201910279594.7A CN201910279594A CN111815552A CN 111815552 A CN111815552 A CN 111815552A CN 201910279594 A CN201910279594 A CN 201910279594A CN 111815552 A CN111815552 A CN 111815552A
Authority
CN
China
Prior art keywords
workpiece
data
detected
data matrix
matrix
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.)
Pending
Application number
CN201910279594.7A
Other languages
Chinese (zh)
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.)
TCL Corp
TCL Research America Inc
Original Assignee
TCL Research America Inc
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 TCL Research America Inc filed Critical TCL Research America Inc
Priority to CN201910279594.7A priority Critical patent/CN111815552A/en
Publication of CN111815552A publication Critical patent/CN111815552A/en
Pending legal-status Critical Current

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • 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/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Abstract

The invention relates to the technical field of automatic detection, in particular to a workpiece detection method, a workpiece detection device, a storage medium and terminal equipment. The workpiece detection method provided by the invention comprises the following steps: acquiring a first depth image of a workpiece to be detected; extracting first depth data in the first depth image, and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data; determining a standard workpiece corresponding to the workpiece to be detected, and acquiring a second data matrix corresponding to the standard workpiece; and determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix. When the embodiment of the invention is used for acquiring the depth image and extracting the depth data of the workpiece to be detected, the acquisition and extraction speed is high, the influence of ambient light can be avoided, and the detection precision of workpiece detection is improved. In addition, in the process of analyzing the detected depth data, a matrix comparison mode can be adopted for analysis, the analysis mode is simple, convenient and fast, and the detection speed of workpiece detection can be improved.

Description

Workpiece detection method and device, readable storage medium and terminal equipment
Technical Field
The invention relates to the technical field of automatic detection, in particular to a workpiece detection method, a workpiece detection device, a computer-readable storage medium and terminal equipment.
Background
In workpiece production, in order to ensure the quality of workpiece production, it is often necessary to detect the workpiece, the conventional detection method is mainly manual sampling detection, and in a production line with higher automation, a video detection technology is adopted to detect the workpiece.
The existing video detection technology mainly comprises two types, one type is laser scanning, and the other type is structured light scanning, wherein the scanning mode of the laser scanning is point scanning, the scanning speed is relatively slow, and the detection speed and the detection efficiency of a workpiece are greatly reduced. Although structured light scanning is fast surface scanning, it depends on laser light, and is easily affected by ambient light, resulting in low detection accuracy.
Disclosure of Invention
In view of this, embodiments of the present invention provide a workpiece detection method, an apparatus, a computer-readable storage medium, and a terminal device, so as to solve the problems of low speed and low precision in the conventional workpiece detection.
In a first aspect of the embodiments of the present invention, a workpiece detection method is provided, including:
acquiring a first depth image of a workpiece to be detected;
extracting first depth data in the first depth image, and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
determining a standard workpiece corresponding to the workpiece to be detected, and acquiring a second data matrix corresponding to the standard workpiece;
and determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix.
Further, the acquiring the first depth image of the workpiece to be detected includes:
and acquiring a first depth image of the workpiece to be detected through a TOF camera.
Preferably, before acquiring the second data matrix corresponding to the standard workpiece, the method includes:
acquiring a second depth image of the standard workpiece by the TOF camera;
extracting second depth data in the second depth image, and constructing a second data matrix corresponding to the standard workpiece according to the second depth data;
and storing the second data matrix and the standard workpiece in a first preset database in an associated manner.
Optionally, the determining whether the workpiece to be detected has a defect according to the first data matrix and the second data matrix includes:
acquiring an error matrix corresponding to the standard workpiece;
determining qualified data intervals corresponding to the workpieces to be detected according to the error matrix and the second data matrix;
and determining whether the workpiece to be detected has defects according to whether the first data of the first data matrix are all located in the corresponding qualified data interval.
Further, determining each qualified data interval corresponding to the workpiece to be detected according to the error matrix and the second data matrix includes:
respectively calculating the sum and difference of each second data in the second data matrix and the error data at the corresponding position in the error matrix;
and determining each sum as the upper limit of the corresponding qualified data interval, and determining the difference value corresponding to each sum as the lower limit of the corresponding qualified data interval.
Preferably, the determining whether the workpiece to be detected has a defect according to whether each first data of the first data matrix is located in the corresponding qualified data interval includes:
if all the first data in the first data matrix are in the corresponding qualified data interval, determining that the workpiece to be detected is qualified;
and if any first data in the first data matrix is not in the corresponding qualified data interval, determining that the workpiece to be detected has defects.
Optionally, after determining that the workpiece to be detected has a defect, the method includes:
acquiring target data which is not in the corresponding qualified data interval in the first data matrix, and determining a marking color corresponding to the target data according to a preset corresponding relation;
marking the target data by adopting the marking color, and storing the first data matrix subjected to color marking and the workpiece to be detected in a second preset database in an associated manner.
Further, the acquiring the first depth image of the workpiece to be detected includes:
detecting the current position of the workpiece to be detected;
and when the current position is a preset appointed detection position, acquiring a first depth image of the workpiece to be detected.
In a second aspect of the embodiments of the present invention, there is provided a workpiece detection apparatus, including:
the first depth image acquisition module is used for acquiring a first depth image of a workpiece to be detected;
the first data matrix construction module is used for extracting first depth data in the first depth image and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
the second data matrix acquisition module is used for determining a standard workpiece corresponding to the workpiece to be detected and acquiring a second data matrix corresponding to the standard workpiece;
and the defect detection module is used for determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix.
In a third aspect of the embodiments of the present invention, there is provided a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the workpiece detection method according to the first aspect when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the workpiece detection method according to the first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, a first depth image of a workpiece to be detected is firstly acquired, first depth data in the first depth image is extracted, a first data matrix corresponding to the workpiece to be detected is constructed according to the first depth data, then a standard workpiece corresponding to the workpiece to be detected is determined, a second data matrix corresponding to the standard workpiece is acquired, and whether the workpiece to be detected has defects or not is determined according to the first data matrix and the second data matrix. In the embodiment of the invention, when the depth image of the workpiece to be detected is acquired and the depth data of the depth image is extracted, the acquisition and extraction speed is high, and the influence of ambient light can be avoided, so that the detection precision of workpiece detection is improved. In addition, in the process of analyzing the detected depth data, a matrix comparison mode can be adopted for analysis, the analysis mode is simple, convenient and fast, and the detection speed of workpiece detection can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic structural diagram of a detection system according to an embodiment of the present invention;
FIG. 2 is a flow chart of one embodiment of a method for inspecting a workpiece in accordance with one embodiment of the present invention;
fig. 3 is a schematic flowchart of a workpiece detection method for constructing a second data matrix in an application scenario according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating a method for detecting a workpiece to determine whether a defect exists in an application scenario according to an embodiment of the present invention
FIG. 5 is a block diagram of an embodiment of a workpiece inspection apparatus according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a workpiece detection method, a workpiece detection device, a computer-readable storage medium and terminal equipment, which are used for solving the problems of low speed and low precision in the conventional workpiece detection.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, "first" and "second" and the like described in the embodiments of the present invention are for distinguishing different objects, and are not for describing a specific order.
Referring to fig. 1, a workpiece detecting method according to an embodiment of the present invention is applied to the detecting system shown in fig. 1, where the detecting system may include a TOF camera 10, an image collecting device 11, a terminal device 12, a control mechanism 13 and a braking component 14, where the TOF camera 10 is configured to capture a depth image of a workpiece 15 to be detected and transmit the captured depth image to the image collecting device 11, the image collecting device 11 is connected to the terminal device 12, the terminal device 12 may read the depth image stored in the image collecting device 11 and analyze whether the workpiece 15 to be detected meets a production requirement according to the read depth image, i.e., determine whether the workpiece 15 to be detected has a defect, when the workpiece 15 to be detected meets the production requirement, and if the workpiece 15 to be detected has no defect, the terminal device 12 may transmit a control instruction to move the workpiece 15 to be detected to a qualified area 16 to the control mechanism 13, the control mechanism 13 can move by controlling the brake component 14 to move the workpiece 15 to be detected to the qualified area 16; when the workpiece 15 to be detected does not meet the production requirement, if the workpiece 15 to be detected has a defect, the terminal device 12 may send a control instruction for moving the workpiece 15 to be detected to the failing area 17 to the control mechanism 13, and the control mechanism 13 may move the workpiece 15 to be detected to the failing area 17 by controlling the brake component 14.
It is understood that TOF camera refers to a camera based on Time of Flight (Time of Flight) technology, and TOF camera mainly calculates the round trip Time to determine the distance of each point by reflecting from the light source, i.e. the sensor emits modulated near infrared light and reflects the light after encountering an object, and the sensor converts the distance of the shot object by calculating the Time difference or phase difference between the light emission and reflection to generate depth information. The TOF camera mainly calculates the light source reflection time by the physical characteristics of the sensor to determine the distance, and uses a light source with a specific wavelength as a measurement light source, so that the TOF camera is less influenced by ambient light, has high measurement speed, high measurement precision and low hardware cost, and can greatly improve the detection precision, the detection speed and the detection efficiency of workpiece detection.
The workpiece detection method will be described in detail with reference to a specific embodiment based on the detection system, wherein the main execution body of the workpiece detection method in this embodiment is the terminal device 12.
As shown in fig. 2, an embodiment of the present invention provides a workpiece detection method, including:
step S201, acquiring a first depth image of a workpiece to be detected;
specifically, in the embodiment of the present invention, the acquiring the first depth image of the workpiece to be detected may include: and acquiring a first depth image of the workpiece to be detected through a TOF camera.
In the embodiment of the present invention, a designated detection position may be set in the detection system in advance, and the TOF cameras 10 may be set around the designated detection position and configured to acquire the depth image of the workpiece to be detected located at the designated detection position, where the number of the TOF cameras 10 may be determined according to the detection requirement of the workpiece to be detected. If all appearances of the workpiece to be detected need to be detected, a TOF camera 10 can be arranged above the designated detection position and used for acquiring an overhead view test chart of the workpiece to be detected so as to acquire a depth image of the top of the workpiece to be detected, and meanwhile, 3 TOF cameras 10 can be arranged on the side surface of the designated detection position at equal intervals, for example, 3 TOF cameras 10 are arranged on the side surface at intervals of 120 degrees and used for acquiring the depth image of the side surface of the workpiece to be detected, in addition, the bottom of the designated detection position can be set to be in a hollow state, and a TOF camera 10 can be arranged on the bottom of the designated detection position and used for acquiring the depth image of the bottom of the workpiece to be detected.
It can be understood that, after the TOF camera 10 acquires each depth image of the workpiece to be detected, the TOF camera 10 may transmit the acquired depth image to the image acquisition device 11, the image acquisition device 11 may store the received depth image, and the terminal device 12 may acquire the first depth image of the workpiece to be detected by reading data stored in the image acquisition device 11. The image capturing device 11 is preferably an image capturing card, and the terminal device 12 may be an industrial computer or the like.
Further, the TOF camera 10 is often set at a specific position in the detection system, and therefore, in order to ensure accuracy of acquiring a depth image in the TOF camera, so as to improve detection efficiency and detection accuracy of workpiece detection, and the like, when acquiring the depth image of the workpiece to be detected, the workpiece to be detected is located at an appointed detection position in the detection system, that is, in the embodiment of the present invention, the acquiring the first depth image of the workpiece to be detected may include:
step a, detecting the current position of the workpiece to be detected;
and b, when the current position is a preset appointed detection position, acquiring a first depth image of the workpiece to be detected.
Here, when the workpiece to be detected enters the detection system for detection, the current position of the workpiece to be detected may be detected in real time, and whether the current position is a predetermined designated detection position is determined, if the current position is not the designated detection position, the current position of the workpiece to be detected may be adjusted, so that the workpiece to be detected reaches the designated detection position, and when the workpiece to be detected reaches the designated detection position, the first depth image of the workpiece to be detected is obtained, and if the TOF camera 10 is controlled to start, the first depth image of the workpiece to be detected may be obtained.
S202, extracting first depth data in the first depth image, and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
it can be understood that after the terminal device 12 obtains the first depth image of the workpiece to be detected, the first depth data in the first depth image may be extracted, and the first data matrix corresponding to the workpiece to be detected may be constructed according to the first depth data, for example, the first data matrix corresponding to the workpiece to be detected may be constructed according to the arrangement position of the first depth data in the first depth image, that is, each first data matrix is constructed by combining all the first depth data in the corresponding first depth image.
It should be noted that, in the embodiment of the present invention, the number of the first data matrices constructed by the terminal device 12 corresponds to the number of the first depth images, for example, when the image acquisition apparatus 11 receives five first depth images including a top first depth image, a bottom first depth image, and three side first depth images, the terminal device 12 may construct five first data matrices, which correspond to the first depth images respectively.
S203, determining a standard workpiece corresponding to the workpiece to be detected, and acquiring a second data matrix corresponding to the standard workpiece;
in the embodiment of the present invention, when constructing each first data matrix corresponding to a workpiece to be detected, the terminal device 12 may simultaneously determine a standard workpiece corresponding to the workpiece to be detected, and when detecting the workpiece to be detected, attribute information such as a category of the workpiece to be detected may be obtained by scanning information such as a two-dimensional code of the workpiece to be detected, so that the standard workpiece corresponding to the workpiece to be detected may be determined according to the attribute information such as the category, and a second data matrix corresponding to the standard workpiece may be obtained from a preset database.
Further, as shown in fig. 3, in the embodiment of the present invention, before acquiring the second data matrix corresponding to the standard workpiece, the method may further include:
s301, acquiring a second depth image of the standard workpiece through the TOF camera;
here, each of the manually determined standard workpieces may be placed at a designated detection position in the detection system, and each of the second depth images of each of the standard workpieces may be acquired by the TOF camera 10, where an acquisition process of the second depth images is similar to the above-described acquisition process of the first depth images, and the principle is the same, and for brevity, no further description is provided here.
Step S302, extracting second depth data in the second depth image, and constructing a second data matrix corresponding to the standard workpiece according to the second depth data;
it can be understood that the construction manner of the second data matrix corresponding to each standard workpiece is similar to the construction manner of the first data matrix, and the principle is the same, and for the sake of brevity, the description is omitted here.
Step S303, storing the second data matrix and the standard workpiece in a first preset database in a related manner.
In the embodiment of the present invention, after the second data matrices corresponding to the standard artifacts are constructed, the second data matrices and the standard artifacts may be stored in the first preset database in an associated manner, for example, the second data matrices and attribute information such as the type of the standard artifacts may be stored in an associated manner. Further, in the association storage, the detection sites corresponding to the respective second data matrices may be stored in association, and for example, if the second data matrix a is constructed from the first depth image a of the top of the standard workpiece and the second data matrix B is constructed from the first depth image B of the bottom of the standard workpiece, the second data matrix a may be stored in association with the top and attribute information such as the type of the standard workpiece and the like, and the second data matrix B may be stored in association with the bottom and attribute information such as the type of the standard workpiece and the like.
And S204, determining whether the workpiece to be detected has defects or not according to the first data matrix and the second data matrix.
It can be understood that after each first data matrix corresponding to the workpiece to be detected is constructed and each second data matrix of the standard workpiece corresponding to the workpiece to be detected is obtained, each first data matrix and the corresponding second data matrix can be compared, and whether the workpiece to be detected has a defect or not can be determined according to each comparison result, if the first data matrix corresponding to the bottom of the workpiece to be detected and the first data matrix corresponding to the bottom of the standard workpiece can be compared, and whether the bottom of the workpiece to be detected has a defect or not can be determined according to the comparison result of the bottom, so that whether the workpiece to be detected is a qualified workpiece or an unqualified workpiece with a defect or not can be determined according to the detection result of each detection part.
Specifically, as shown in fig. 4, in the embodiment of the present invention, the determining whether the workpiece to be detected has a defect according to the first data matrix and the second data matrix may include:
s401, acquiring an error matrix corresponding to the standard workpiece;
s402, determining qualified data intervals corresponding to the workpiece to be detected according to the error matrix and the second data matrix;
step S403, determining whether the workpiece to be detected has a defect according to whether each first data of the first data matrix is located in the corresponding qualified data interval.
In step S403, determining whether the workpiece to be detected has a defect according to whether each first data of the first data matrix is located in the corresponding qualified data interval, which may further include:
step S4030, if each first data in the first data matrix is in the corresponding qualified data interval, determining that the workpiece to be detected is qualified;
step S4032, if any first data in the first data matrix is not in the corresponding qualified data interval, determining that the workpiece to be detected has a defect.
It can be understood that a certain error may be allowed to exist in the production of the workpieces, and therefore, in the embodiment of the present invention, a user may set an allowed error according to a specific production requirement of each workpiece, and after receiving the error set by the user, the terminal device 12 may construct a corresponding error matrix according to the error, and may associate and store the error matrix and the corresponding standard workpiece. When storing each error matrix in association with the corresponding standard workpiece, the detection site corresponding to each error matrix may be stored in association with each other, for example, if the detection site corresponding to the error matrix a is the top of the workpiece and the detection site corresponding to the error matrix B is the bottom of the workpiece, when storing the error matrix in association with each other, the error matrix a may be stored in association with the top of the workpiece and the error matrix B may be stored in association with the bottom of the workpiece.
In order to make the error setting more intuitive, in the embodiment of the present invention, a two-dimensional object graph may be superimposed in the interactive interface of the terminal device 12, and a user may set different errors in the two-dimensional object graph according to production requirements of different parts of a workpiece.
For step S401, when constructing the first data matrix of the workpiece to be detected, the terminal device 12 may determine the standard workpiece corresponding to the workpiece to be detected, and may obtain the corresponding error matrix according to the determined standard workpiece.
For the step S402, it can be understood that after the second data matrix and the error matrix of the standard workpiece corresponding to the workpiece to be detected are obtained, the qualified data interval corresponding to each detection portion of the workpiece to be detected can be determined according to each second data matrix and the corresponding error matrix, and for example, the qualified data interval corresponding to the top of the workpiece to be detected can be determined according to the second data matrix corresponding to the top of the standard workpiece and the error matrix corresponding to the top, where the qualified data interval refers to a data interval allowed by each first data in the first data matrix corresponding to the workpiece to be detected. Here, each upper limit of the qualified data interval may be set to a sum value added between each second data in the second data matrix and the error data at the corresponding position in the error matrix, and each lower limit of the qualified data interval may be set to a difference value between each second data in the second data matrix and the error data at the corresponding position in the error matrix.
That is, when determining a qualified data interval, a sum and a difference between second data corresponding to the qualified data interval in the second data matrix and error data corresponding to the qualified data interval in the error matrix may be calculated first, and the obtained sum may be determined as an upper limit of the qualified data interval, and the obtained difference may be determined as a lower limit of the qualified data interval.
As for the above steps S403, S4030 and S4032, it can be understood that after determining each qualified data interval, it may be determined whether each first data in each first data matrix is within the corresponding qualified data interval, and if each first data in each first data matrix is within the corresponding qualified data interval, it indicates that the error of the workpiece to be detected is within the allowable error range, so that the workpiece to be detected may be considered as a qualified workpiece, the terminal device 12 may determine that the workpiece to be detected is qualified, generate a control command for moving the workpiece to be detected to the qualified area 16, and send the control command to the control mechanism 13, and the control mechanism 13 may control the brake component 14 to move so as to move the workpiece to be detected to the qualified area 16; if one or more first data exists in a certain first data matrix and is not in the corresponding qualified data interval, it indicates that a part beyond the error range exists in the workpiece to be detected, and therefore, the workpiece to be detected can be considered to have a defect, the terminal device 12 can determine that the workpiece to be detected has the defect and generate a control instruction for moving the workpiece to be detected to the unqualified area 17 and send the control instruction to the control mechanism 13, and the control mechanism 13 can control the brake component 14 to move so as to move the workpiece to be detected to the unqualified area 17.
It should be noted that, in the embodiment of the present invention, when all the first data in each first data matrix need to be in the corresponding qualified data interval, it may be considered that the workpiece to be detected is a qualified workpiece only by way of schematic explanation, and should not be understood as a limitation to the embodiment of the present invention.
Further, in the embodiment of the present invention, after determining that the workpiece to be detected has a defect, the method may further include:
step c, acquiring target data which are not in the corresponding qualified data interval in the first data matrix, and determining a marking color corresponding to the target data according to a preset corresponding relation;
and d, marking the target data by adopting the marking color, and storing the first data matrix subjected to color marking and the workpiece to be detected in a second preset database in an associated manner.
As for the above steps c and d, in the embodiment of the present invention, after the terminal device 12 completes the defect detection of the workpiece to be detected, the result of the defect detection and the association between each first data matrix corresponding to the workpiece to be detected and the workpiece to be detected can be stored in the second preset database, so that the relevant personnel can conveniently know each detection data of the workpiece to be detected. Further, when it is determined that the workpiece to be detected has a defect, the terminal device 12 may obtain target data in each first data matrix of the workpiece to be detected, which is not in the corresponding qualified data interval, to obtain target data corresponding to an unqualified part in the workpiece to be detected, and may determine a marking color corresponding to each target data according to a preset corresponding relationship, so that each unqualified target data may be color-marked with the corresponding marking color, and after color marking, a result of defect detection and each first data matrix corresponding to the workpiece to be detected may be associated with the workpiece to be detected and stored in a second preset database, so that the unqualified data may be marked with a conspicuous color, thereby facilitating related personnel to maintain the workpiece to be detected according to the marking data, and improving maintenance efficiency of the workpiece.
It can be understood that, in the embodiment of the present invention, the mark color corresponding to each detection portion may be set in advance according to a specific detection requirement, so that when the target data to be detected is unqualified, the detection portion corresponding to the first data matrix where the target data is located may be determined, and thus, the mark color corresponding to the target data may be determined according to the determined detection portion.
In the embodiment of the invention, a first depth image of a workpiece to be detected is firstly acquired, first depth data in the first depth image is extracted, a first data matrix corresponding to the workpiece to be detected is constructed according to the first depth data, then a standard workpiece corresponding to the workpiece to be detected is determined, a second data matrix corresponding to the standard workpiece is acquired, and whether the workpiece to be detected has defects or not is determined according to the first data matrix and the second data matrix. In the embodiment of the invention, when the depth image of the workpiece to be detected is acquired and the depth data of the depth image is extracted, the acquisition and extraction speed is high, and the influence of ambient light can be avoided, so that the detection precision of workpiece detection is improved. In addition, in the process of analyzing the detected depth data, a matrix comparison mode is adopted for analysis, the analysis mode is simple, convenient and fast, and the detection speed of workpiece detection can be improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The above mainly describes a workpiece inspection method, and a workpiece inspection apparatus will be described in detail below.
As shown in fig. 5, an embodiment of the present invention provides a workpiece detection apparatus, including:
a first depth image obtaining module 501, configured to obtain a first depth image of a workpiece to be detected;
a first data matrix construction module 502, configured to extract first depth data in the first depth image, and construct a first data matrix corresponding to the workpiece to be detected according to the first depth data;
a second data matrix obtaining module 503, configured to determine a standard workpiece corresponding to the workpiece to be detected, and obtain a second data matrix corresponding to the standard workpiece;
and a defect detection module 504, configured to determine whether the workpiece to be detected has a defect according to the first data matrix and the second data matrix.
Further, the first depth image obtaining module 501 is specifically configured to obtain a first depth image of the workpiece to be detected by a TOF camera.
Preferably, the workpiece detection apparatus may further include:
the second depth image acquisition module is used for acquiring a second depth image of the standard workpiece through the TOF camera;
the second data matrix construction module is used for extracting second depth data in the second depth image and constructing a second data matrix corresponding to the standard workpiece according to the second depth data;
and the second data matrix storage module is used for storing the second data matrix and the standard workpiece in a first preset database in a correlated manner.
Optionally, the defect detecting module 504 may include:
the error matrix acquisition unit is used for acquiring an error matrix corresponding to the standard workpiece;
a qualified interval determining unit, configured to determine, according to the error matrix and the second data matrix, each qualified data interval corresponding to the workpiece to be detected;
and the defect detection unit is used for determining whether the workpiece to be detected has defects according to whether the first data of the first data matrix are all located in the corresponding qualified data interval.
Further, the qualified interval determining unit may include:
the difference value calculating subunit is used for respectively calculating the sum value and the difference value of each second data in the second data matrix and the error data at the corresponding position in the error matrix;
and the qualified interval determining subunit is used for determining each sum as the upper limit of the corresponding qualified data interval, and determining the difference value corresponding to each sum as the lower limit of the corresponding qualified data interval.
Preferably, the defect detecting unit may include:
the first detection subunit is configured to determine that the workpiece to be detected is qualified if each first data in the first data matrix is in the corresponding qualified data interval;
and the second detection subunit is used for determining that the workpiece to be detected has a defect if any first data in the first data matrix is not in the corresponding qualified data interval.
Optionally, the workpiece detection apparatus may further include:
the color determining module is used for acquiring target data which is not in the corresponding qualified data interval in the first data matrix and determining a marking color corresponding to the target data according to a preset corresponding relation;
and the color marking module is used for marking the target data by adopting the marking color and storing the first data matrix subjected to color marking and the workpiece to be detected into a second preset database in an associated manner.
Preferably, the first depth image obtaining module 501 may include:
the current position detection unit is used for detecting the current position of the workpiece to be detected;
and the first depth image acquisition unit is used for acquiring a first depth image of the workpiece to be detected when the current position is a preset specified detection position.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62, such as a workpiece detection program, stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps in the various embodiments of the workpiece detection method described above, such as the steps S201 to S204 shown in fig. 2. Alternatively, the processor 60, when executing the computer program 62, implements the functions of each module/unit in the above-mentioned device embodiments, for example, the functions of the modules 501 to 504 shown in fig. 5.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the terminal device 6. For example, the computer program 62 may be divided into a first depth image obtaining module, a first data matrix constructing module, a second data matrix obtaining module, and a detection result determining module, and the specific functions of the modules are as follows:
the first depth image acquisition module is used for acquiring a first depth image of a workpiece to be detected;
the first data matrix construction module is used for extracting first depth data in the first depth image and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
the second data matrix acquisition module is used for determining a standard workpiece corresponding to the workpiece to be detected and acquiring a second data matrix corresponding to the standard workpiece;
and the defect detection module is used for determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix.
The terminal device 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 6 and does not constitute a limitation of terminal device 6 and may include more or less components than those shown, or some components in combination, or different components, for example, the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the modules, elements, and/or method steps of the various embodiments described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A method of inspecting a workpiece, comprising:
acquiring a first depth image of a workpiece to be detected;
extracting first depth data in the first depth image, and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
determining a standard workpiece corresponding to the workpiece to be detected, and acquiring a second data matrix corresponding to the standard workpiece;
and determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix.
2. The workpiece inspection method of claim 1, wherein said obtaining a first depth image of the workpiece to be inspected comprises:
and acquiring a first depth image of the workpiece to be detected through a TOF camera.
3. The method of claim 2, wherein prior to obtaining the second data matrix corresponding to the standard workpiece, comprising:
acquiring a second depth image of the standard workpiece by the TOF camera;
extracting second depth data in the second depth image, and constructing a second data matrix corresponding to the standard workpiece according to the second depth data;
and storing the second data matrix and the standard workpiece in a first preset database in an associated manner.
4. The method of claim 1, wherein said determining whether the workpiece to be inspected has a defect based on the first data matrix and the second data matrix comprises:
acquiring an error matrix corresponding to the standard workpiece;
determining qualified data intervals corresponding to the workpieces to be detected according to the error matrix and the second data matrix;
and determining whether the workpiece to be detected has defects according to whether the first data of the first data matrix are all located in the corresponding qualified data interval.
5. The workpiece inspection method of claim 4, wherein determining qualified data intervals corresponding to the workpieces to be inspected based on the error matrix and the second data matrix comprises:
respectively calculating the sum and difference of each second data in the second data matrix and the error data at the corresponding position in the error matrix;
and determining each sum as the upper limit of the corresponding qualified data interval, and determining the difference value corresponding to each sum as the lower limit of the corresponding qualified data interval.
6. The method according to claim 4, wherein determining whether the workpiece to be detected has a defect according to whether each first data of the first data matrix is located in the corresponding qualified data interval comprises:
if all the first data in the first data matrix are in the corresponding qualified data interval, determining that the workpiece to be detected is qualified;
and if any first data in the first data matrix is not in the corresponding qualified data interval, determining that the workpiece to be detected has defects.
7. The workpiece inspection method of claim 6, after determining that the workpiece to be inspected is defective, comprising:
acquiring target data which is not in the corresponding qualified data interval in the first data matrix, and determining a marking color corresponding to the target data according to a preset corresponding relation;
marking the target data by adopting the marking color, and storing the first data matrix subjected to color marking and the workpiece to be detected in a second preset database in an associated manner.
8. The workpiece inspection method of any of claims 1 to 7, wherein the obtaining a first depth image of a workpiece to be inspected comprises:
detecting the current position of the workpiece to be detected;
and when the current position is a preset appointed detection position, acquiring a first depth image of the workpiece to be detected.
9. A workpiece detection apparatus, comprising:
the first depth image acquisition module is used for acquiring a first depth image of a workpiece to be detected;
the first data matrix construction module is used for extracting first depth data in the first depth image and constructing a first data matrix corresponding to the workpiece to be detected according to the first depth data;
the second data matrix acquisition module is used for determining a standard workpiece corresponding to the workpiece to be detected and acquiring a second data matrix corresponding to the standard workpiece;
and the defect detection module is used for determining whether the workpiece to be detected has defects according to the first data matrix and the second data matrix.
10. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the workpiece detection method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method for workpiece inspection according to any one of claims 1 to 8.
CN201910279594.7A 2019-04-09 2019-04-09 Workpiece detection method and device, readable storage medium and terminal equipment Pending CN111815552A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910279594.7A CN111815552A (en) 2019-04-09 2019-04-09 Workpiece detection method and device, readable storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910279594.7A CN111815552A (en) 2019-04-09 2019-04-09 Workpiece detection method and device, readable storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN111815552A true CN111815552A (en) 2020-10-23

Family

ID=72843541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910279594.7A Pending CN111815552A (en) 2019-04-09 2019-04-09 Workpiece detection method and device, readable storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN111815552A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112307090A (en) * 2020-11-03 2021-02-02 中铁隆工程集团有限公司 Detection method and system based on tunnel safety data
CN112635042A (en) * 2020-12-02 2021-04-09 广州九顶软件股份有限公司 Monitor calibration method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102221559A (en) * 2011-03-05 2011-10-19 河海大学常州校区 Online automatic detection method of fabric defects based on machine vision and device thereof
JP2012159491A (en) * 2011-01-14 2012-08-23 Nippon Steel Corp Defect detecting device and defect detecting method
CN105572137A (en) * 2015-12-15 2016-05-11 重庆瑞阳科技股份有限公司 Appearance defect test method
CN107356601A (en) * 2017-07-25 2017-11-17 上海华力微电子有限公司 A kind of automatic defect of defect checking machine platform is presorted method for reporting
US20180211373A1 (en) * 2017-01-20 2018-07-26 Aquifi, Inc. Systems and methods for defect detection
CN108846837A (en) * 2018-06-01 2018-11-20 联想(北京)有限公司 Body surface defect inspection method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012159491A (en) * 2011-01-14 2012-08-23 Nippon Steel Corp Defect detecting device and defect detecting method
CN102221559A (en) * 2011-03-05 2011-10-19 河海大学常州校区 Online automatic detection method of fabric defects based on machine vision and device thereof
CN105572137A (en) * 2015-12-15 2016-05-11 重庆瑞阳科技股份有限公司 Appearance defect test method
US20180211373A1 (en) * 2017-01-20 2018-07-26 Aquifi, Inc. Systems and methods for defect detection
CN107356601A (en) * 2017-07-25 2017-11-17 上海华力微电子有限公司 A kind of automatic defect of defect checking machine platform is presorted method for reporting
CN108846837A (en) * 2018-06-01 2018-11-20 联想(北京)有限公司 Body surface defect inspection method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王晏民: "《深度图像化点云数据管理》", 31 December 2013, 北京:测绘出版社, pages: 7 - 10 *
陈奇等: "基于深度信息的钢板表面缺陷检测方法", 《2017中国自动化大会(CAC2017)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112307090A (en) * 2020-11-03 2021-02-02 中铁隆工程集团有限公司 Detection method and system based on tunnel safety data
CN112635042A (en) * 2020-12-02 2021-04-09 广州九顶软件股份有限公司 Monitor calibration method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109886928B (en) Target cell marking method, device, storage medium and terminal equipment
EP2339292A1 (en) Three-dimensional measurement apparatus and method thereof
CN103528617A (en) Cockpit instrument automatic recognizing and detecting method and device
CN108955901B (en) Infrared temperature measurement method and system and terminal equipment
CN107092905B (en) Method for positioning instrument to be identified of power inspection robot
CN112258507B (en) Target object detection method and device of internet data center and electronic equipment
CN104316033A (en) Visual inspection system for automobile parts
CN112014404A (en) Component detection method, device, system, electronic equipment and storage medium
CN111815552A (en) Workpiece detection method and device, readable storage medium and terminal equipment
CN113124763A (en) Optical axis calibration method, device, terminal, system and medium for optical axis detection system
CN111958595A (en) Multi-sensor asynchronous information fusion system and method for transformer substation inspection robot
CN114136464A (en) Performance test method, device, equipment and system of infrared sensor
CN109982074B (en) Method and device for obtaining inclination angle of TOF module and assembling method
CN105427315B (en) Digital instrument image position testing method and device
CN111336938A (en) Robot and object distance detection method and device thereof
CN107315664A (en) Video card automatic checkout system and method
CN111985266A (en) Scale map determination method, device, equipment and storage medium
JP2020160691A (en) Remote meter reading computer, method and program of the same
US11727664B2 (en) Systems and methods for determining an adaptive region of interest (ROI) for image metrics calculations
CN115249241A (en) Gluing defect detection method and device
CN115035481A (en) Image object distance fusion method, device, equipment and storage medium
CN111640096B (en) Method, device and terminal for detecting appearance of electronic product
CN113112551A (en) Camera parameter determination method and device, road side equipment and cloud control platform
KR101475742B1 (en) Apparatus and method for performing photogrammetry
CN108332779B (en) Reading method of liquid column type instrument and related device

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