CN110889832A - Workpiece positioning method, device, electronic equipment and workpiece positioning system - Google Patents

Workpiece positioning method, device, electronic equipment and workpiece positioning system Download PDF

Info

Publication number
CN110889832A
CN110889832A CN201911128701.2A CN201911128701A CN110889832A CN 110889832 A CN110889832 A CN 110889832A CN 201911128701 A CN201911128701 A CN 201911128701A CN 110889832 A CN110889832 A CN 110889832A
Authority
CN
China
Prior art keywords
edge
workpiece
line
reference point
positioning method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911128701.2A
Other languages
Chinese (zh)
Other versions
CN110889832B (en
Inventor
杜义贤
杜兵
辛鹏武
陈招东
黄文芳
陈永进
冯英俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Lyric Robot Automation Co Ltd
Original Assignee
Guangdong Lyric Robot Automation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Lyric Robot Automation Co Ltd filed Critical Guangdong Lyric Robot Automation Co Ltd
Priority to CN201911128701.2A priority Critical patent/CN110889832B/en
Publication of CN110889832A publication Critical patent/CN110889832A/en
Application granted granted Critical
Publication of CN110889832B publication Critical patent/CN110889832B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • 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

Landscapes

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

Abstract

本申请涉及设备零件加工领域,具体而言,涉及一种工件定位方法、装置、电子设备及工件定位系统。工件包括第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻的第三边缘,工件定位方法,包括:从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线,根据第一边线,从第二边线上确定第一参考点,从第三边线上确定第二参考点,以及根据第一参考点和第二参考点,获得工件位置信息。本申请实施例提供的工件定位方法、装置、电子设备即工件定位系统,能够保证工件位置信息的准确度。

Figure 201911128701

The present application relates to the field of equipment parts processing, and specifically, to a workpiece positioning method, device, electronic device and workpiece positioning system. The workpiece includes a first edge, a second edge opposite to the first edge and irregular, and a third edge adjacent to the second edge. The workpiece positioning method includes: determining a first sideline for characterizing the first edge, a second sideline for characterizing the second edge, and a third sideline for characterizing the third edge from the acquired workpiece image, determining a first reference point from the second sideline based on the first sideline, determining a second reference point from the third sideline, and obtaining workpiece position information based on the first reference point and the second reference point. The workpiece positioning method, device, electronic device, and workpiece positioning system provided in the embodiments of the present application can ensure the accuracy of the workpiece position information.

Figure 201911128701

Description

工件定位方法、装置、电子设备及工件定位系统Workpiece positioning method, device, electronic equipment and workpiece positioning system

技术领域technical field

本申请涉及设备零件加工领域,具体而言,涉及一种工件定位方法、装置、电子设备及工件定位系统。The present application relates to the field of equipment parts processing, and in particular, to a workpiece positioning method, device, electronic equipment and workpiece positioning system.

背景技术Background technique

设备零件加工领域中,通常需要对工件进行抓取或贴合,例如,将第一工件抓取,并贴合于第二工件上,而此过程中,往往需要预先对第二工件进行定位。当第二工件边缘全部规整时,是能够保证定位准确度的,但是,当第二工件边缘不完全不规整时,往往无法保证定位准确度。基于此,对于边缘不完全不规整的工件,如何保证其定位准确度,成为设备零件加工领域亟待解决的技术问题。In the field of equipment parts processing, it is usually necessary to grasp or attach the workpiece, for example, grasp the first workpiece and attach it to the second workpiece, and in this process, the second workpiece often needs to be positioned in advance. When the edges of the second workpiece are all regular, the positioning accuracy can be guaranteed, but when the edges of the second workpiece are not completely irregular, the positioning accuracy is often not guaranteed. Based on this, how to ensure the positioning accuracy of workpieces whose edges are not completely irregular has become an urgent technical problem to be solved in the field of equipment parts processing.

发明内容SUMMARY OF THE INVENTION

本申请实施例的目的在于,提供一种工件定位方法、装置、电子设备及工件定位系统以解决上述问题。The purpose of the embodiments of the present application is to provide a workpiece positioning method, device, electronic device and workpiece positioning system to solve the above problems.

第一方面,本申请实施例提供的工件定位方法,用于获取工件位置信息,工件包括规整的第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻,且规整的第三边缘,工件定位方法,包括:In the first aspect, the workpiece positioning method provided by the embodiment of the present application is used to obtain workpiece position information, and the workpiece includes a regular first edge, an irregular second edge opposite to the first edge, and a second edge adjacent to the second edge. , and a regular third edge, the workpiece positioning method, including:

从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线;from the acquired image of the workpiece, determining a first edge line for characterizing the first edge, a second edge line for characterizing the second edge, and a third edge line for characterizing the third edge;

根据第一边线,从第二边线上确定第一参考点;According to the first edge line, determine the first reference point from the second edge line;

从第三边线上确定第二参考点;determining the second reference point from the third sideline;

根据第一参考点和第二参考点,获得工件位置信息。According to the first reference point and the second reference point, the workpiece position information is obtained.

本申请实施例中,工件包括第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻的第三边缘,工件定位方法,包括:从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线,根据第一边线,从第二边线上确定第一参考点,从第三边线上确定第二参考点,以及根据第一参考点和第二参考点,获得工件位置信息。由于,第二边线上确定的第一参考点是根据第一边线获取的,而第一边线是用于表征第一边缘,且第一边缘为规整边缘,同时,第二参考点是从第三边线上确定的,而第三边线是用于表征第三边缘,且第三边缘为规整边缘,因此,根据第一参考点和第二参考点,获得的工件位置信息具有准确性。In the embodiment of the present application, the workpiece includes a first edge, an irregular second edge opposite to the first edge, and a third edge adjacent to the second edge. The workpiece positioning method includes: from an acquired image of the workpiece , determine the first edge line for characterizing the first edge, the second edge line for characterizing the second edge, and the third edge line for characterizing the third edge, according to the first edge line, determine the first edge line from the second edge line A reference point, a second reference point is determined from the third edge line, and workpiece position information is obtained according to the first reference point and the second reference point. Because, the first reference point determined on the second edge line is obtained according to the first edge line, and the first edge line is used to represent the first edge, and the first edge is a regular edge, and at the same time, the second reference point is from the The third edge line is determined, and the third edge line is used to represent the third edge, and the third edge is a regular edge. Therefore, according to the first reference point and the second reference point, the obtained workpiece position information has accuracy.

结合第一方面,本申请实施例还提供了第一方面的第一种可选的实施方式,根据第一边线,从第二边线上确定第一参考点,包括:In conjunction with the first aspect, the embodiment of the present application also provides a first optional implementation manner of the first aspect, according to the first edge line, determining the first reference point from the second edge line, including:

获取第二边线上包括的多个边线点,以及每个边线点与第一边线的间隔距离;Obtain multiple edge points included on the second edge, and the distance between each edge point and the first edge;

从多个边线点中,获取与第一边线的间隔距离最短的边线点,作为第一参考点。From the plurality of edge points, the edge point with the shortest distance from the first edge is obtained as the first reference point.

本申请实施例中,根据第一边线,从第二边线上确定第一参考点,包括:获取第二边线上包括的多个边线点,以及每个边线点与第一边线的间隔距离,以及从多个边线点中,获取与第一边线的间隔距离最短的边线点,直接作为第一参考点,因此,能够提高工件定位方法的执行效率。In this embodiment of the present application, determining the first reference point from the second edge line according to the first edge line includes: acquiring a plurality of edge points included on the second edge line, and the distance between each edge point and the first edge line , and from a plurality of edge points, the edge point with the shortest distance from the first edge is obtained, which is directly used as the first reference point. Therefore, the execution efficiency of the workpiece positioning method can be improved.

结合第一方面,本申请实施例还提供了第一方面的第二种可选的实施方式,从第三边线上确定第二参考点,包括:In conjunction with the first aspect, the embodiments of the present application also provide a second optional implementation manner of the first aspect, where determining the second reference point from the third edge line includes:

获取第三边线的中间点,作为第二参考点。Get the middle point of the third edge as the second reference point.

本申请实施例中,从第三边线上确定第二参考点,包括:获取第三边线的中间点,直接作为第二参考点,因此,能够进一步地提高工件定位方法的执行效率。In the embodiment of the present application, determining the second reference point from the third edge line includes: acquiring the middle point of the third edge line, which is directly used as the second reference point. Therefore, the execution efficiency of the workpiece positioning method can be further improved.

结合第一方面,本申请实施例还提供了第一方面的第三种可选的实施方式,根据第一参考点和第二参考点,获得工件位置信息,包括:In conjunction with the first aspect, the embodiment of the present application also provides a third optional implementation manner of the first aspect, obtaining workpiece position information according to the first reference point and the second reference point, including:

创建经过第一参考点,且与第一边线平行的第一参考线;Create a first reference line that passes through the first reference point and is parallel to the first edge;

创建经过第二参考点,且与第一参考线垂直的第二参考线;creating a second reference line that passes through the second reference point and is perpendicular to the first reference line;

根据第一参考线和第二参考线,获得工件位置信息。According to the first reference line and the second reference line, the workpiece position information is obtained.

本申请实施例中,根据第一参考点和第二参考点,获得工件位置信息,包括:创建经过第一参考点,且与第一边线平行的第一参考线,创建经过第二参考点,且与第一参考线垂直的第二参考线,以及根据第一参考线和第二参考线,获得工件位置信息,该过程处理逻辑简单,因此,能够更进一步地提高工件定位方法的执行效率。In this embodiment of the present application, obtaining the workpiece position information according to the first reference point and the second reference point includes: creating a first reference line that passes through the first reference point and is parallel to the first edge line, and creating a first reference line that passes through the second reference point , and the second reference line perpendicular to the first reference line, and the workpiece position information is obtained according to the first reference line and the second reference line. The processing logic of this process is simple, so the execution efficiency of the workpiece positioning method can be further improved .

结合第一方面的第三种可选的实施方式,本申请实施例还提供了第一方面的第四种可选的实施方式,根据第一参考线和第二参考线,获得工件位置信息,包括:In conjunction with the third optional implementation manner of the first aspect, the embodiment of the present application also provides the fourth optional implementation manner of the first aspect, obtaining workpiece position information according to the first reference line and the second reference line, include:

获取第一参考线与第二参考线的交点位置信息,以及第二参考线的角度信息,共同作为工件位置信息。The position information of the intersection of the first reference line and the second reference line and the angle information of the second reference line are acquired, which are collectively used as the workpiece position information.

本申请实施例中,根据第一参考线和第二参考线,获得工件位置信息,包括:获取第一参考线和第二参考线的交点位置信息,以及第二参考线的角度信息,共同作为工件位置信息,从而进一步地提高工件位置信息的准确性。In the embodiment of the present application, obtaining the workpiece position information according to the first reference line and the second reference line includes: obtaining the intersection position information of the first reference line and the second reference line, and the angle information of the second reference line, which are used together as The workpiece position information, thereby further improving the accuracy of the workpiece position information.

结合第一方面,本申请实施例还提供了第一方面的第五种可选的实施方式,根据第一参考点和第二参考点,获得工件位置信息之后,工件定位方法,还包括:In conjunction with the first aspect, the embodiment of the present application also provides a fifth optional implementation manner of the first aspect. After obtaining the workpiece position information according to the first reference point and the second reference point, the workpiece positioning method further includes:

根据工件位置信息,判断工件的位置是否满足预设位置标准;According to the workpiece position information, determine whether the position of the workpiece meets the preset position standard;

当工件的位置未满足预设位置标准时,根据工件位置信息和预设位置标准,生成位置调节指令。When the position of the workpiece does not meet the preset position standard, a position adjustment instruction is generated according to the workpiece position information and the preset position standard.

本申请实施例中,根据第一参考点和第二参考点,获得工件位置信息之后,工件定位方法,还包括:根据工件位置信息,判断工件的位置是否满足预设位置标准,以及根据工件位置信息,判断工件的位置是否满足预设位置标准,从而提高工件定位方法功能的全面性。In the embodiment of the present application, after obtaining the workpiece position information according to the first reference point and the second reference point, the workpiece positioning method further includes: according to the workpiece position information, judging whether the position of the workpiece satisfies the preset position standard, and according to the workpiece position information to determine whether the position of the workpiece meets the preset position standard, thereby improving the comprehensiveness of the function of the workpiece positioning method.

第二方面,本申请实施例提供的工件定位装置,用于获取工件位置信息,工件包括规整的第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻,且规整的第三边缘,工件定位装置,包括:In the second aspect, the workpiece positioning device provided by the embodiment of the present application is used to obtain the position information of the workpiece, and the workpiece includes a regular first edge, an irregular second edge opposite to the first edge, and an irregular second edge, and adjacent to the second edge. , and a regular third edge, a workpiece positioning device, including:

第一获取模块,用于从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线;a first acquisition module, configured to determine, from the acquired workpiece image, a first edge for characterizing the first edge, a second edge for characterizing the second edge, and a third edge for characterizing the third edge;

第二获取模块,用于根据第一边线,从第二边线上确定第一参考点;a second acquiring module, configured to determine the first reference point from the second edge line according to the first edge line;

第三获取模块,用于从第三边线上确定第二参考点;The third acquisition module is used to determine the second reference point from the third sideline;

定位模块,用于根据第一参考点和第二参考点,获得工件位置信息。The positioning module is used for obtaining workpiece position information according to the first reference point and the second reference point.

本申请实施例提供的工件定位装置,具有与上述工件定位装置方法相同的有益效果,此处不作赘述。The workpiece positioning device provided by the embodiment of the present application has the same beneficial effects as the above-mentioned workpiece positioning device method, which will not be repeated here.

第三方面,本申请实施例中提供的电子设备,包括处理器和存储器,存储器上存储有计算机程序,处理器用于执行计算机程序,以实现上述第一方面,或第一方面的任意一种可选的实施方式所提供的工件定位方法。In a third aspect, the electronic device provided in the embodiments of the present application includes a processor and a memory, where a computer program is stored in the memory, and the processor is configured to execute the computer program, so as to implement the above-mentioned first aspect, or any one of the first aspect can be implemented. The workpiece positioning method provided by the selected embodiment.

本申请实施例提供的电子设备,具有与上述工件定位方法相同的有益效果,此处不作赘述。The electronic device provided by the embodiment of the present application has the same beneficial effects as the above-mentioned workpiece positioning method, which will not be repeated here.

第四方面,本申请实施例提供的工件定位系统,包括摄像设备,以及上述第三方面所提供的电子设备,摄像设备与电子设备连接;In a fourth aspect, the workpiece positioning system provided by the embodiment of the present application includes a camera device, and the electronic device provided in the third aspect above, where the camera device is connected to the electronic device;

摄像设备用于获取工件图像,并发送给电子设备;The camera device is used to obtain the workpiece image and send it to the electronic device;

电子设备用于接收工件图像,并实现上述第一方面,或第一方面的任意一种可选的实施方式所提供的工件定位方法。The electronic device is configured to receive the workpiece image, and implement the above-mentioned first aspect, or the workpiece positioning method provided by any optional implementation manner of the first aspect.

本申请实施例提供的工件定位系统,具有与上述电子设备相同的有益效果,此处不作赘述。The workpiece positioning system provided by the embodiment of the present application has the same beneficial effects as the above-mentioned electronic device, which will not be repeated here.

第五方面,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被执行时,可实现上述第一方面,或第一方面的任意一种可选的实施方式所提供的工件定位方法。In a fifth aspect, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed, the first aspect or any one of the first aspect can be implemented. A workpiece positioning method provided by an optional embodiment.

本申请实施例提供的计算机可读存储介质,具有与上述工件定位方法相同的有益效果,此处不作赘述。The computer-readable storage medium provided by the embodiment of the present application has the same beneficial effects as the above-mentioned workpiece positioning method, which will not be repeated here.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, therefore It should not be regarded as a limitation of the scope. For those of ordinary skill in the art, other related drawings can also be obtained from these drawings without any creative effort.

图1为本申请实施例提供的一种电子设备的示意性结构框图。FIG. 1 is a schematic structural block diagram of an electronic device according to an embodiment of the present application.

图2为本申请实施例提供的一种工件定位方法的步骤流程图。FIG. 2 is a flowchart of steps of a workpiece positioning method provided by an embodiment of the present application.

图3为申请实施例提供的工件定位方法的辅助性说明图。FIG. 3 is an auxiliary explanatory diagram of the workpiece positioning method provided by the embodiment of the application.

图4为本申请实施例提供的工件定位方法的另一种辅助性说明图。FIG. 4 is another auxiliary explanatory diagram of the workpiece positioning method provided by the embodiment of the present application.

图5为本申请实施例提供的工件定位装置的示意性结构框图。FIG. 5 is a schematic structural block diagram of a workpiece positioning device provided in an embodiment of the present application.

图6为本申请实施例提供的工件定位系统的示意性结构框图。FIG. 6 is a schematic structural block diagram of a workpiece positioning system provided by an embodiment of the present application.

附图标记:10-工件定位系统;100-电子设备;110-处理器;120-存储器;200-工件定位装置;210-第一获取模块;220-第二获取模块;230-第三获取模块;240-定位模块;300-摄像设备。Reference numerals: 10-workpiece positioning system; 100-electronic equipment; 110-processor; 120-memory; 200-workpiece positioning device; 210-first acquisition module; 220-second acquisition module; 230-third acquisition module ; 240 - positioning module; 300 - camera equipment.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。In order to make the purposes, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.

请参阅图1,为本申请实施例提供的一种应用工件定位方法及装置的电子设备100的示意性结构框图。本申请实施例中,电子设备100可以是,但不限于电脑、工控机等具有数据处理能力的工业设备,在结构上,电子设备100可以包括处理器110和存储器120。Please refer to FIG. 1 , which is a schematic structural block diagram of an electronic device 100 using a workpiece positioning method and apparatus according to an embodiment of the present application. In this embodiment of the present application, the electronic device 100 may be, but is not limited to, an industrial device with data processing capabilities such as a computer and an industrial computer. Structurally, the electronic device 100 may include a processor 110 and a memory 120 .

处理器110与存储器120直接或间接地电性连接,以实现数据的传输或交互,例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。工件定位装置200包括至少一个可以软件或固件(Firmware)的形式存储在存储器120中或固化在电子设备100的操作系统(Operating System,OS)中的软件模块。处理器110用于执行存储器120中存储的可执行模块,例如,工件定位装置200所包括的软件功能模块及计算机程序等,以实现工件定位方法。处理器110可以在接收到执行指令后,执行计算机程序。The processor 110 and the memory 120 are electrically connected directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The workpiece positioning apparatus 200 includes at least one software module that can be stored in the memory 120 in the form of software or firmware (Firmware) or solidified in an operating system (Operating System, OS) of the electronic device 100 . The processor 110 is configured to execute executable modules stored in the memory 120, such as software function modules and computer programs included in the workpiece positioning apparatus 200, to implement the workpiece positioning method. The processor 110 may execute the computer program after receiving the execution instruction.

其中,处理器110可以是一种集成电路芯片,具有信号处理能力。处理器110也可以是通用处理器,例如,可以是数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、分立门或晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。此外,通用处理器可以是微处理器或者任何常规处理器等。The processor 110 may be an integrated circuit chip with signal processing capability. The processor 110 may also be a general-purpose processor, for example, may be a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a discrete gate or transistor logic device, a discrete hardware component, or The methods, steps, and logic block diagrams disclosed in the embodiments of the present application are implemented or executed. Furthermore, a general purpose processor may be a microprocessor or any conventional processor or the like.

存储器120可以是,但不限于,随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可编程只读存储器(Programmable Read-OnlyMemory,PROM)、可擦可编程序只读存储器(Erasable Programmable Read-Only Memory,EPROM),以及电可擦编程只读存储器(Electric Erasable Programmable Read-OnlyMemory,EEPROM)。存储器120用于存储程序,处理器110在接收到执行指令后,执行该程序。The memory 120 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable and programmable Program read-only memory (Erasable Programmable Read-Only Memory, EPROM), and Electric Erasable Programmable Read-Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM). The memory 120 is used for storing a program, and the processor 110 executes the program after receiving the execution instruction.

应当理解,图1所示的结构仅为示意,本申请实施例提供的电子设备100还可以具有比图1更少或更多的组件,或是具有与图1所示不同的配置。此外,图1所示的各组件可以通过软件、硬件或其组合实现。It should be understood that the structure shown in FIG. 1 is for illustration only, and the electronic device 100 provided in this embodiment of the present application may further have fewer or more components than those shown in FIG. 1 , or have different configurations than those shown in FIG. 1 . In addition, each component shown in FIG. 1 may be implemented by software, hardware, or a combination thereof.

请参阅图2,图2为本申请实施例提供的工件定位方法的流程示意图,该方法应用于图1所示的电子设备100。所应说明的是,本申请实施例提供的工件定位方法不以图2及以下所示的顺序为限制,以下结合图2对工件定位方法的具体流程及步骤进行描述。Please refer to FIG. 2 , which is a schematic flowchart of a workpiece positioning method provided by an embodiment of the present application, and the method is applied to the electronic device 100 shown in FIG. 1 . It should be noted that the workpiece positioning method provided by the embodiments of the present application is not limited to the sequence shown in FIG. 2 and the following, and the specific flow and steps of the workpiece positioning method are described below with reference to FIG. 2 .

步骤S100,从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线。Step S100, from the acquired image of the workpiece, determine a first edge line representing the first edge, a second edge line representing the second edge, and a third edge line representing the third edge.

本申请实施例中,工件可以是,但不限于电池极片、半导体贴片、电阻贴片、光学显示构件。此外,在结构上,工件可以呈矩形(正方形或长方形)片状结构,而该工件中包括至少两条规整边缘线。例如,工件包括规整的第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻,且规整的第三边缘。需要说明的是,本申请实施例中,针对某条边缘,其不规整,可以理解为该边缘存在毛刺,或该边缘存在凸起,再或该边缘被异物遮挡等,因此,用于表征该边缘的边线非平滑直线。In the embodiments of the present application, the workpiece may be, but is not limited to, a battery pole piece, a semiconductor patch, a resistance patch, and an optical display member. In addition, structurally, the workpiece can be in the form of a rectangular (square or rectangular) sheet-like structure, and the workpiece includes at least two regular edge lines. For example, the workpiece includes a first edge that is regular, a second edge that is opposite to the first edge and that is irregular, and a third edge that is adjacent to the second edge and that is regular. It should be noted that, in the embodiments of the present application, for an edge, if it is irregular, it can be understood that there is a burr on the edge, or there is a bulge on the edge, or the edge is blocked by foreign objects, etc. Therefore, it is used to characterize the edge. The edges of the edges are not smooth straight lines.

本申请实施例中,在获取到用于表征工件外观的工件图像之后,可以通过找线工具,确定第一边线。找线工具的实现原理为,在获取到工件图像之后,从工件图像的第一边缘部分,获取感兴趣区域(Region Of Interest,ROI),并从ROI中获取目标数量个边线点,再对目标数量个边线点进行拟合,获得第一边线。In the embodiment of the present application, after the workpiece image used to characterize the appearance of the workpiece is acquired, the first edge line can be determined by using a line finding tool. The realization principle of the line finding tool is that after the workpiece image is obtained, the region of interest (ROI) is obtained from the first edge of the workpiece image, and the target number of edge points are obtained from the ROI, and then the target Fit a number of edge points to obtain the first edge.

其中,ROI是指机器视觉、图像处理过程中,从被处理图像中,以方框、圆、椭圆、不规则多边形等形状框架勾勒出的待处理区域。实际实施时,可以通过Halcon、OpenCV、Matlab等机器视觉软件上常用到各种算子(Operator)和函数来获取感兴趣区域。此外,本申请实施例中,目标数量可以是,但不限于3个、5个、10个,获取到目标数量个边线点之后,通过最小二乘法对目标数量个边线点进行拟合,获得第一边线。Among them, ROI refers to the to-be-processed area outlined by frame, circle, ellipse, irregular polygon and other shape frames from the processed image in the process of machine vision and image processing. In actual implementation, various operators and functions commonly used in machine vision software such as Halcon, OpenCV, and Matlab can be used to obtain regions of interest. In addition, in the embodiment of the present application, the target number may be, but is not limited to, 3, 5, or 10. After the target number of edge points is obtained, the target number of edge points is fitted by the least squares method to obtain the first number of edge points. side line.

可以理解的是,本申请实施例中,从工件图像中,确定第二边线,以及从工件图像中,确定第三边线,同样可以通过找线工具实现,因此,本申请实施例对此不作赘述。It can be understood that, in the embodiment of the present application, the determination of the second edge from the workpiece image and the determination of the third edge from the workpiece image can also be implemented by a line-finding tool. Therefore, the embodiment of the present application will not repeat them. .

此外,还可以理解的是,本申请实施例中,由于第一边缘和第三边缘为规整边缘线,第二边缘为非规则边缘线,因此,确定的第一边线和第三边线为准确的,而确定的第二边缘的准确度却是难以保证的,因此,无法直接通过第二边缘获取工件位置信息。因此,对于需要通过第二边缘进行定位的工件,现有技术中,是无法保证其定位准确度的。In addition, it can also be understood that, in the embodiment of the present application, since the first edge and the third edge are regular edge lines, and the second edge is an irregular edge line, the determined first edge line and third edge line are accurate However, the accuracy of the determined second edge is difficult to guarantee. Therefore, the workpiece position information cannot be directly obtained through the second edge. Therefore, for the workpiece that needs to be positioned by the second edge, the positioning accuracy cannot be guaranteed in the prior art.

步骤S200,根据第一边线,从第二边线上确定第一参考点。Step S200, determining a first reference point from the second edge line according to the first edge line.

本申请实施例中,第一参考点可以是,通过找线工具从工件图像中,确定第二边线的过程中,从ROI包括的目标数量个边线点中,获取的某个边线点,例如,目标数量个边线点中,与第一边线的间隔距离最短的边线点。基于此,本申请实施例中,步骤S200可以包括步骤S210和步骤S220。In the embodiment of the present application, the first reference point may be a certain edge point obtained from the target number of edge points included in the ROI during the process of determining the second edge line from the workpiece image using the line finding tool, for example, Among the target number of edge points, the edge point with the shortest distance from the first edge. Based on this, in this embodiment of the present application, step S200 may include step S210 and step S220.

步骤S210,获取第二边线上包括的多个边线点,以及每个边线点与第一边线的间隔距离。Step S210, acquiring a plurality of edge points included on the second edge line, and the distance between each edge point and the first edge line.

本申请实施例中,可以确定获取工件图像的摄像设备,以及摄像设备所对应的摄像机坐标系,再根据摄像机坐标获得工件图像的像素坐标系或物理坐标系,作为参考坐标系,最后,基于参考坐标系,获取每个边线点与第一边线的间隔距离。以下,将以根据摄像机坐标获得工件图像的物理坐标系,作为参考坐标系,且参考坐标系记作XOY为例,对步骤S210进行进一步说明。In the embodiment of the present application, the camera device for acquiring the workpiece image and the camera coordinate system corresponding to the camera device can be determined, and then the pixel coordinate system or the physical coordinate system of the workpiece image can be obtained according to the camera coordinates as the reference coordinate system. Finally, based on the reference Coordinate system, get the distance between each edge point and the first edge. Hereinafter, step S210 will be further described by taking the physical coordinate system of the workpiece image obtained according to the camera coordinates as the reference coordinate system, and the reference coordinate system is denoted as XOY as an example.

请结合图3,为方便描述,本申请实施例中,将第一边线记作a,第二边线记作b。示例性的,从工件图像的第二边缘部分获取的ROI中,包括边线点b1、边线点b2和边线点b3,在获取边线点b1与第一边线a的间隔距离的过程中,可以在第一边线a上确定与边线点b1的Y轴坐标值相同的边线点,作为目标边线点a1,此后,获取边线点b1与目标边线点a1的X轴坐标差值,作为边线点b1与第一边线a的间隔距离,同理,可以获取边线点b2与目标边线点a2的X轴坐标差值,作为边线点b2与第一边线a的间隔距离,以及获取边线点b3与目标边线点a3的X轴坐标差值,作为边线点b3与第一边线a的间隔距离。Please refer to FIG. 3 , for the convenience of description, in the embodiment of the present application, the first edge line is denoted as a, and the second edge line is denoted as b. Exemplarily, the ROI obtained from the second edge portion of the workpiece image includes the edge point b1, the edge point b2 and the edge point b3, in the process of obtaining the distance between the edge point b1 and the first edge a, you can Determine the sideline point on the first sideline a with the same Y-axis coordinate value of the sideline point b1 as the target sideline point a1, and then obtain the X-axis coordinate difference between the sideline point b1 and the target sideline point a1, as the sideline point b1 and In the same way, the distance between the first sideline a and the X-axis coordinate difference between the sideline point b2 and the target sideline point a2 can be obtained as the distance between the sideline point b2 and the first sideline a, and the sideline point b3 and the target can be obtained. The X-axis coordinate difference of the edge point a3 is used as the distance between the edge point b3 and the first edge a.

步骤S220,从多个边线点中,获取与第一边线的间隔距离最短的边线点,作为第一参考点。Step S220, from the plurality of sideline points, acquire the sideline point with the shortest distance from the first sideline as the first reference point.

步骤S300,从第三边线上确定第二参考点。Step S300, determining a second reference point from the third edge line.

本申请实施例中,第二参考点可以是第三边线的中间点。基于此,对于步骤S300,其可以包括步骤S310,获取第三边线的中间点,作为第二参考点。In this embodiment of the present application, the second reference point may be a middle point of the third edge line. Based on this, for step S300, it may include step S310, obtaining the middle point of the third edge line as the second reference point.

步骤S400,根据第一参考点和第二参考点,获得工件位置信息。In step S400, the workpiece position information is obtained according to the first reference point and the second reference point.

由于,第二边线上确定的第一参考点是根据第一边线获取的,而第一边线是用于表征第一边缘,且第一边缘为规整边缘,同时,第二参考点是从第三边线上确定的,而第三边线是用于表征第三边缘,且第三边缘为规整边缘,因此,根据第一参考点和第二参考点,获得的工件位置信息具有准确性。Because, the first reference point determined on the second edge line is obtained according to the first edge line, and the first edge line is used to represent the first edge, and the first edge is a regular edge, and at the same time, the second reference point is from the The third edge line is determined, and the third edge line is used to represent the third edge, and the third edge is a regular edge. Therefore, according to the first reference point and the second reference point, the obtained workpiece position information has accuracy.

进一步地,本申请实施例中,步骤S400可以包括步骤S410、步骤S420和步骤S430。Further, in this embodiment of the present application, step S400 may include step S410, step S420 and step S430.

步骤S410,创建经过第一参考点,且与第一边线平行的第一参考线。Step S410, creating a first reference line that passes through the first reference point and is parallel to the first edge line.

步骤S420,创建经过第二参考点,且与第一参考线垂直的第二参考线。Step S420, creating a second reference line passing through the second reference point and perpendicular to the first reference line.

步骤S430,根据第一参考线和第二参考线,获得工件位置信息。Step S430, obtaining workpiece position information according to the first reference line and the second reference line.

同样,请参阅图3,为方便描述,本申请实施例中,可以将第三边线记作c,将第二参考点记作c1,假设,第一参考点为b1,则创建经过第一参考点b1,且与第一边线a平行的第一参考线,记作d,同时,创建经过第二参考点c1,且与第一参考线d垂直的第二参考线,记作e。此后,根据第一参考线d和第二参考线e,获得工件位置信息,以实现工件定位。Similarly, referring to FIG. 3 , for the convenience of description, in this embodiment of the present application, the third edge line may be denoted as c, and the second reference point may be denoted as c1. Assuming that the first reference point is b1, the first reference point is created through the first reference point. Point b1, and the first reference line parallel to the first side line a is denoted as d, and at the same time, a second reference line passing through the second reference point c1 and perpendicular to the first reference line d is created, denoted as e. After that, according to the first reference line d and the second reference line e, the workpiece position information is obtained to realize workpiece positioning.

进一步地,作为一种可选的实施方式,本申请实施例中,对于步骤S430,其可以包括步骤S431,获取第一参考线与第二参考线的交点位置信息,以及第二参考线的角度信息,共同作为工件位置信息。需要说明的是,本申请实施例中,第一参考线与第二参考线的交点位置信息可以是,第一参考线和第二参考线的交点坐标值,而第二参考线的角度信息可以是,第二参考线与X轴之间的角度值。同样,请参阅图3,第一参考线d与第二参考线e的交点位置信息可以是,交点de1的坐标值,第二参考线e的角度信息可以是,第二参考线e与X轴之间的角度值。Further, as an optional implementation manner, in this embodiment of the present application, for step S430, it may include step S431, obtaining the position information of the intersection of the first reference line and the second reference line, and the angle of the second reference line information, together as workpiece position information. It should be noted that, in this embodiment of the present application, the position information of the intersection of the first reference line and the second reference line may be the coordinate value of the intersection of the first reference line and the second reference line, and the angle information of the second reference line may be Yes, the value of the angle between the second reference line and the X axis. Similarly, referring to FIG. 3, the position information of the intersection of the first reference line d and the second reference line e can be the coordinate value of the intersection point de1, and the angle information of the second reference line e can be, the second reference line e and the X-axis the angle value between them.

为提高工件定位方法功能的全面性,本申请实施例提供的工件定位方法还可以包括步骤S500和步骤S600。In order to improve the comprehensiveness of the functions of the workpiece positioning method, the workpiece positioning method provided by the embodiment of the present application may further include steps S500 and S600.

步骤S500,根据工件位置信息,判断工件的位置是否满足预设位置标准。Step S500, according to the workpiece position information, determine whether the position of the workpiece satisfies a preset position standard.

结合前述步骤S400的相关描述,本申请实施例中,预设位置标准可以是第一参考线与第二参考线的交点位置坐标值为目标坐标值,且第二参考线与X轴之间的角度值为目标角度值,而目标坐标值和目标角度值可以根据实际需求设定,本申请实施例对此不作具体限制。With reference to the relevant description of the foregoing step S400, in this embodiment of the present application, the preset position standard may be that the position coordinate value of the intersection of the first reference line and the second reference line is the target coordinate value, and the distance between the second reference line and the X-axis is the target coordinate value. The angle value is the target angle value, and the target coordinate value and the target angle value can be set according to actual requirements, which are not specifically limited in the embodiment of the present application.

步骤S600,当工件的位置未满足预设位置标准时,根据工件位置信息和预设位置标准,生成位置调节指令。Step S600, when the position of the workpiece does not meet the preset position standard, generate a position adjustment instruction according to the workpiece position information and the preset position standard.

本申请实施例中,位置调节指令包括坐标调节指令和角度调节指令。其中,坐标调节指令可以根据第一参考线与第二参考线的交点位置坐标值,以及目标坐标值生成,角度调节指令可以根据第二参考线与X轴之间的角度值,以及目标角度值生成。In the embodiment of the present application, the position adjustment instruction includes a coordinate adjustment instruction and an angle adjustment instruction. The coordinate adjustment instruction can be generated according to the coordinate value of the intersection point of the first reference line and the second reference line and the target coordinate value, and the angle adjustment instruction can be generated according to the angle value between the second reference line and the X axis, and the target angle value generate.

为方便描述,本申请实施例中,可以将第一参考线与第二参考线的交点,记作de1(x1,y1),将目标坐标值,记作de2(x2,y2),此后,根据交点de1与交点de2的X坐标差值,也即,x1与x2的差值,以及交点de1与交点de2的Y坐标差值,也即,y1与y2的差值生成坐标调节指令。请参阅图4,可以生成用于表征将工件朝X轴方向移动(x2-x1),以及将工件朝Y轴方向移动(y2-y1)的坐标调节指令。此外,假设,目标角度值为与X轴之间的角度值为0时,若第二参考线与X轴之间的角度值为1°,则生成用于表征将工件以第一参考线与第二参考线的交点为旋转点,往顺时针方向转动1°的角度调节指令。For convenience of description, in this embodiment of the present application, the intersection of the first reference line and the second reference line may be denoted as de1(x1, y1), and the target coordinate value may be denoted as de2(x2, y2), and thereafter, according to The X coordinate difference between the intersection de1 and the intersection de2, that is, the difference between x1 and x2, and the Y coordinate difference between the intersection de1 and de2, that is, the difference between y1 and y2, generate a coordinate adjustment command. Referring to FIG. 4 , coordinate adjustment commands representing moving the workpiece in the X-axis direction (x2-x1) and moving the workpiece in the Y-axis direction (y2-y1) can be generated. In addition, it is assumed that when the angle value between the target angle value and the X axis is 0, if the angle value between the second reference line and the X axis is 1°, a generated value for representing the workpiece with the first reference line and the X axis is generated. The intersection point of the second reference line is the rotation point, and the angle adjustment command is to rotate 1° clockwise.

基于与上述工件定位方法同样的发明构思,本申请实施例提供的工件定位装置200。请参阅图5,本申请实施例提供的工件定位装置200包括第一获取模块210、第二获取模块220、第三获取模块230和定位模块240。Based on the same inventive concept as the above-mentioned workpiece positioning method, the workpiece positioning device 200 provided in the embodiment of the present application is provided. Referring to FIG. 5 , the workpiece positioning device 200 provided by the embodiment of the present application includes a first obtaining module 210 , a second obtaining module 220 , a third obtaining module 230 , and a positioning module 240 .

第一获取模块210,用于从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线。The first acquisition module 210 is configured to determine, from the acquired image of the workpiece, a first edge line for representing the first edge, a second edge line for representing the second edge, and a third edge line for representing the third edge .

关于第一获取模块210的描述具体可参考对图2中所示的步骤S100的详细描述,也即,步骤S100可以由第一获取模块210执行。For the description of the first obtaining module 210 , reference may be made to the detailed description of step S100 shown in FIG. 2 , that is, step S100 may be executed by the first obtaining module 210 .

第二获取模块220,用于根据第一边线,从第二边线上确定第一参考点。The second obtaining module 220 is configured to determine the first reference point from the second edge line according to the first edge line.

关于第二获取模块220的描述具体可参考对图2中所示的步骤S200的详细描述,也即,步骤S200可以由第二获取模块220执行。For the description of the second acquisition module 220 , reference may be made to the detailed description of step S200 shown in FIG. 2 , that is, step S200 may be executed by the second acquisition module 220 .

第三获取模块230,用于从第三边线上确定第二参考点。The third obtaining module 230 is configured to determine the second reference point from the third edge line.

关于第三获取模块230的描述具体可参考对图2中所示的步骤S300的详细描述,也即,步骤S300可以由第三获取模块230执行。For the description of the third obtaining module 230 , reference may be made to the detailed description of step S300 shown in FIG. 2 , that is, step S300 may be executed by the third obtaining module 230 .

定位模块240,用于根据第一参考点和第二参考点,获得工件位置信息。The positioning module 240 is configured to obtain workpiece position information according to the first reference point and the second reference point.

关于定位模块240的描述具体可参考对图2中所示的步骤S400的详细描述,也即,步骤S400可以由定位模块240执行。For the description of the positioning module 240 , reference may be made to the detailed description of the step S400 shown in FIG. 2 , that is, the step S400 may be performed by the positioning module 240 .

本申请实施例中,第二获取模块220可以包括第一获取单元和第二获取单元。In this embodiment of the present application, the second obtaining module 220 may include a first obtaining unit and a second obtaining unit.

第一获取单元,用于获取第二边线上包括的多个边线点,以及每个边线点与第一边线的间隔距离;a first acquiring unit, configured to acquire a plurality of sideline points included on the second sideline, and the distance between each sideline point and the first sideline;

关于第一获取单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S210的详细描述,也即,步骤S210可以由第一获取单元执行。For the description of the first acquisition unit, reference may be made to the detailed description of step S210 in the above-mentioned embodiments of the workpiece positioning method, that is, step S210 may be performed by the first acquisition unit.

第二获取单元,用于从多个边线点中,获取与第一边线的间隔距离最短的边线点,作为第一参考点。The second obtaining unit is configured to obtain, from among the plurality of edge points, the edge point with the shortest distance from the first edge, as the first reference point.

关于第二获取单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S220的详细描述,也即,步骤S220可以由第二获取单元执行。For the description of the second acquisition unit, reference may be made to the detailed description of step S220 in the above-mentioned embodiments of the workpiece positioning method, that is, step S220 may be performed by the second acquisition unit.

本申请实施例中,第三获取模块230可以包括第三获取单元。In this embodiment of the present application, the third obtaining module 230 may include a third obtaining unit.

第三获取单元,用于获取第三边线的中间点,作为第二参考点。The third obtaining unit is used for obtaining the middle point of the third sideline as the second reference point.

关于第三获取单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S310的详细描述,也即,步骤S310可以由第三获取单元执行。For the description of the third acquisition unit, reference may be made to the detailed description of step S310 in the above-mentioned embodiments of the workpiece positioning method, that is, step S310 may be performed by the third acquisition unit.

本申请实施例中,定位模块240可以包括第一创建单元、第二创建单元和定位单元。In this embodiment of the present application, the positioning module 240 may include a first creation unit, a second creation unit, and a positioning unit.

第一创建单元,用于创建经过第一参考点,且与第一边线平行的第一参考线。The first creation unit is used for creating a first reference line passing through the first reference point and parallel to the first edge line.

关于第一创建单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S410的详细描述,也即,步骤S410可以由第一创建单元执行。For the description of the first creation unit, reference may be made to the detailed description of step S410 in the above-mentioned embodiments of the workpiece positioning method, that is, step S410 may be performed by the first creation unit.

第二创建单元,用于创建经过第二参考点,且与第一参考线垂直的第二参考线。The second creation unit is used for creating a second reference line passing through the second reference point and perpendicular to the first reference line.

关于第二创建单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S420的详细描述,也即,步骤S420可以由第二创建单元执行。For the description of the second creation unit, reference may be made to the detailed description of step S420 in the above-mentioned embodiments of the workpiece positioning method, that is, step S420 may be performed by the second creation unit.

定位单元,用于根据第一参考线和第二参考线,获得工件位置信息。The positioning unit is used for obtaining workpiece position information according to the first reference line and the second reference line.

关于定位单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S430的详细描述,也即,步骤S430可以由定位单元执行。For the description of the positioning unit, reference may be made to the detailed description of step S430 in the above-mentioned embodiments of the workpiece positioning method, that is, step S430 may be performed by the positioning unit.

本申请实施例中,定位单元可以包括定位子单元。In this embodiment of the present application, the positioning unit may include a positioning sub-unit.

定位子单元,用于获取第一参考线和第二参考线的交点位置信息,以及第二参考线的角度信息,共同作为工件位置信息。The positioning subunit is used for acquiring the position information of the intersection of the first reference line and the second reference line, and the angle information of the second reference line, which are used together as workpiece position information.

关于定位子单元的描述具体可参考上述工件定位方法相关实施例中关于步骤S431的详细描述,也即,步骤S431可以由定位子单元执行。For the description of the positioning subunit, reference may be made to the detailed description of step S431 in the above-mentioned embodiments of the workpiece positioning method, that is, step S431 may be performed by the positioning subunit.

本申请实施例中,工件定位装置200还可以包括判断模块和指令生成模块。In this embodiment of the present application, the workpiece positioning device 200 may further include a judgment module and an instruction generation module.

判断模块,用于根据工件位置信息,判断工件的位置是否满足预设位置标准。The judgment module is used for judging whether the position of the workpiece satisfies the preset position standard according to the position information of the workpiece.

关于判断模块的描述具体可参考上述工件定位方法相关实施例中关于步骤S500的详细描述,也即,步骤S500可以由判断模块执行。For the description of the judging module, reference may be made to the detailed description of step S500 in the above-mentioned embodiments of the workpiece positioning method, that is, step S500 may be executed by the judging module.

指令生成模块,用于当工件的位置未满足预设位置标准时,根据工件位置信息和预设位置标准,生成位置调节指令。The instruction generation module is used to generate a position adjustment instruction according to the workpiece position information and the preset position standard when the position of the workpiece does not meet the preset position standard.

关于指令生成模块的描述具体可参考上述工件定位方法相关实施例中关于步骤S600的详细描述,也即,步骤S600可以由指令生成模块执行。For the description of the instruction generation module, reference may be made to the detailed description of step S600 in the above-mentioned embodiments of the workpiece positioning method, that is, step S600 may be executed by the instruction generation module.

请参阅图6,本申请实施例还提供了一种工件定位系统10,工件定位系统10包括摄像设备300和电子设备100,摄像设备300与电子设备100连接。Referring to FIG. 6 , an embodiment of the present application further provides a workpiece positioning system 10 . The workpiece positioning system 10 includes a camera device 300 and an electronic device 100 , and the camera device 300 is connected to the electronic device 100 .

其中,摄像设备300用于获取工件图像,并发送给电子设备100。The imaging device 300 is used to acquire the workpiece image and send it to the electronic device 100 .

电子设备100用于接收工件图像,并实现上述工件定位方法。The electronic device 100 is configured to receive the workpiece image and implement the above-mentioned workpiece positioning method.

此外,本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被执行时,可实现上述方法实施例中提供的工件定位方法,具体可参见上述方法实施例,此处不再赘述。In addition, the embodiments of the present application also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed, the workpiece positioning method provided in the above method embodiments can be implemented. For details, please refer to The foregoing method embodiments are not repeated here.

综上所述,本申请实施例中,工件包括第一边缘、与第一边缘相对,且不规整的第二边缘,以及与第二边缘相邻的第三边缘,工件定位方法、装置、电子设备及工件定位系统能够从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线,根据第一边线,从第二边线上确定第一参考点,从第三边线上确定第二参考点,再根据第一参考点和第二参考点,获得工件位置信息。由于,第二边线上确定的第一参考点是根据第一边线获取的,而第一边线是用于表征第一边缘,且第一边缘为规整边缘,同时,第二参考点是从第三边线上确定的,而第三边线是用于表征第三边缘,且第三边缘为规整边缘,因此,根据第一参考点和第二参考点,获得的工件位置信息具有准确性。To sum up, in the embodiment of the present application, the workpiece includes a first edge, an irregular second edge opposite to the first edge, and a third edge adjacent to the second edge. The workpiece positioning method, device, electronic The device and the workpiece positioning system can determine, from the acquired image of the workpiece, a first edge line for characterizing the first edge, a second edge line for characterizing the second edge, and a third edge line for characterizing the third edge, according to For the first edge line, the first reference point is determined from the second edge line, the second reference point is determined from the third edge line, and then the workpiece position information is obtained according to the first reference point and the second reference point. Because, the first reference point determined on the second edge line is obtained according to the first edge line, and the first edge line is used to represent the first edge, and the first edge is a regular edge, and at the same time, the second reference point is from the The third edge line is determined, and the third edge line is used to represent the third edge, and the third edge is a regular edge. Therefore, according to the first reference point and the second reference point, the obtained workpiece position information has accuracy.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architectures, functions and possible implementations of apparatuses, methods and computer program products according to various embodiments of the present application. operate. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks 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 is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.

另外,在本申请每个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是每个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in each embodiment of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请每个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、RAM、ROM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, removable hard disk, RAM, ROM, magnetic disk or optical disk and other media that can store program codes.

以上所述仅为本申请的实施例而已,并不用于限制本申请的保护范围,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are merely examples of the present application, and are not intended to limit the protection scope of the present application. For those skilled in the art, various modifications and changes may be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

此外,需要说明的是,在本文中,诸如“第一”、“第二”和“第三”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。Furthermore, it should be noted that in this document, relational terms such as "first", "second" and "third" are only used to distinguish one entity or operation from another, and does not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus.

Claims (10)

1.一种工件定位方法,其特征在于,所述工件包括规整的第一边缘、与所述第一边缘相对,且不规整的第二边缘,以及与所述第二边缘相邻,且规整的第三边缘,所述工件定位方法,包括:1. a workpiece positioning method, is characterized in that, described workpiece comprises regular first edge, opposite to described first edge, and irregular second edge, and adjacent to described second edge, and regular The third edge, the workpiece positioning method, comprising: 从获取的工件图像中,确定用于表征所述第一边缘的第一边线、用于表征所述第二边缘的第二边线,以及用于表征所述第三边缘的第三边线;From the acquired image of the workpiece, determining a first edge line representing the first edge, a second edge line representing the second edge, and a third edge line representing the third edge; 根据所述第一边线,从所述第二边线上确定第一参考点;determining a first reference point from the second edge line according to the first edge line; 从所述第三边线上确定第二参考点;determining a second reference point from said third edge line; 根据所述第一参考点和所述第二参考点,获得工件位置信息。According to the first reference point and the second reference point, workpiece position information is obtained. 2.根据权利要求1所述的工件定位方法,其特征在于,所述根据所述第一边线,从所述第二边线上确定第一参考点,包括:2. The workpiece positioning method according to claim 1, wherein determining the first reference point from the second edge line according to the first edge line, comprising: 获取所述第二边线上包括的多个边线点,以及每个边线点与所述第一边线的间隔距离;acquiring a plurality of edge points included on the second edge line, and the distance between each edge point and the first edge line; 从所述多个边线点中,获取与所述第一边线的间隔距离最短的边线点,作为所述第一参考点。From the plurality of edge points, the edge point with the shortest distance from the first edge is acquired as the first reference point. 3.根据权利要求1所述的工件定位方法,其特征在于,从所述第三边线上确定第二参考点,包括:3. The workpiece positioning method according to claim 1, wherein determining the second reference point from the third edge line comprises: 获取所述第三边线的中间点,作为所述第二参考点。Obtain the middle point of the third edge line as the second reference point. 4.根据权利要求1所述的工件定位方法,其特征在于,所述根据所述第一参考点和所述第二参考点,获得工件位置信息,包括:4. The workpiece positioning method according to claim 1, wherein the obtaining workpiece position information according to the first reference point and the second reference point comprises: 创建经过所述第一参考点,且与所述第一边线平行的第一参考线;creating a first reference line that passes through the first reference point and is parallel to the first edge; 创建经过所述第二参考点,且与所述第一参考线垂直的第二参考线;creating a second reference line passing through the second reference point and perpendicular to the first reference line; 根据所述第一参考线和所述第二参考线,获得工件位置信息。According to the first reference line and the second reference line, workpiece position information is obtained. 5.根据权利要求4所述的工件定位方法,其特征在于,所述根据所述第一参考线和所述第二参考线,获得工件位置信息,包括:5. The workpiece positioning method according to claim 4, wherein the obtaining workpiece position information according to the first reference line and the second reference line comprises: 获取所述第一参考线与所述第二参考线的交点位置信息,以及所述第二参考线的角度信息,共同作为工件位置信息。The position information of the intersection of the first reference line and the second reference line and the angle information of the second reference line are acquired, which are collectively used as workpiece position information. 6.根据权利要求1所述的工件定位方法,其特征在于,所述根据所述第一参考点和所述第二参考点,获得工件位置信息之后,所述工件定位方法,还包括:6. The workpiece positioning method according to claim 1, wherein after the workpiece position information is obtained according to the first reference point and the second reference point, the workpiece positioning method further comprises: 根据所述工件位置信息,判断所述工件的位置是否满足预设位置标准;According to the workpiece position information, determine whether the position of the workpiece satisfies a preset position standard; 当所述工件的位置未满足预设位置标准时,根据所述工件位置信息和所述预设位置标准,生成位置调节指令。When the position of the workpiece does not meet the preset position standard, a position adjustment instruction is generated according to the workpiece position information and the preset position standard. 7.一种工件定位装置,其特征在于,所述工件包括规整的第一边缘、与所述第一边缘相对,且不规整的第二边缘,以及与所述第二边缘相邻,且规整的的第三边缘,所述工件定位装置,包括:7. A workpiece positioning device is characterized in that, the workpiece comprises a regular first edge, opposite to the first edge, and an irregular second edge, and adjacent to the second edge, and regular of the third edge, the workpiece positioning device, comprising: 第一获取模块,用于从获取的工件图像中,确定用于表征第一边缘的第一边线、用于表征第二边缘的第二边线,以及用于表征第三边缘的第三边线;a first acquisition module, configured to determine, from the acquired workpiece image, a first edge for characterizing the first edge, a second edge for characterizing the second edge, and a third edge for characterizing the third edge; 第二获取模块,用于根据所述第一边线,从所述第二边线上确定第一参考点;a second acquiring module, configured to determine a first reference point from the second edge line according to the first edge line; 第三获取模块,用于从所述第三边线上确定第二参考点;a third acquiring module, configured to determine a second reference point from the third sideline; 定位模块,用于根据所述第一参考点和所述第二参考点,获得工件位置信息。A positioning module, configured to obtain workpiece position information according to the first reference point and the second reference point. 8.一种电子设备,其特征在于,包括处理器和存储器,所述存储器上存储有计算机程序,所述处理器用于执行所述计算机程序,以实现权利要求1~7中任意一项所述的工件定位方法。8. An electronic device, comprising a processor and a memory, wherein a computer program is stored on the memory, and the processor is configured to execute the computer program, so as to implement the computer program described in any one of claims 1 to 7. the workpiece positioning method. 9.一种工件定位系统,其特征在于,包括摄像设备,以及权利要求8所述的电子设备,所述摄像设备与所述电子设备连接;9. A workpiece positioning system, comprising a camera device and the electronic device according to claim 8, wherein the camera device is connected to the electronic device; 所述摄像设备用于获取工件图像,并发送给所述电子设备;The camera device is used to acquire the workpiece image and send it to the electronic device; 所述电子设备用于接收所述工件图像,并实现权利要求1~7中任意一项所述的工件定位方法。The electronic device is configured to receive the workpiece image and implement the workpiece positioning method according to any one of claims 1 to 7. 10.一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其特征在于,所述计算机程序被执行时,可实现权利要求1~7中任意一项所述的工件定位方法。10. A computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed, the workpiece according to any one of claims 1 to 7 can be realized positioning method.
CN201911128701.2A 2019-11-18 2019-11-18 Workpiece positioning method and device, electronic equipment and workpiece positioning system Active CN110889832B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911128701.2A CN110889832B (en) 2019-11-18 2019-11-18 Workpiece positioning method and device, electronic equipment and workpiece positioning system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911128701.2A CN110889832B (en) 2019-11-18 2019-11-18 Workpiece positioning method and device, electronic equipment and workpiece positioning system

Publications (2)

Publication Number Publication Date
CN110889832A true CN110889832A (en) 2020-03-17
CN110889832B CN110889832B (en) 2021-03-23

Family

ID=69747865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911128701.2A Active CN110889832B (en) 2019-11-18 2019-11-18 Workpiece positioning method and device, electronic equipment and workpiece positioning system

Country Status (1)

Country Link
CN (1) CN110889832B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111366078A (en) * 2020-03-30 2020-07-03 深圳创维-Rgb电子有限公司 Robot dispensing positioning method, system, server and storage medium
CN111639644A (en) * 2020-05-29 2020-09-08 广东利元亨智能装备股份有限公司 Workpiece positioning method and device and electronic equipment
CN115098957A (en) * 2022-08-25 2022-09-23 玛斯特轻量化科技(天津)有限公司 Method and device for generating connection point of vehicle body part and electronic equipment
CN115229804A (en) * 2022-09-21 2022-10-25 荣耀终端有限公司 Component bonding method and device
CN116485893A (en) * 2023-04-23 2023-07-25 创新奇智(上海)科技有限公司 Method, system, equipment and medium for measuring article placement position

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107571048A (en) * 2017-09-06 2018-01-12 深圳市贵峰精密有限公司 The positioner and localization method of a kind of workpiece
CN109282772A (en) * 2018-11-23 2019-01-29 安徽华菱汽车有限公司 A kind of measurement of cylinder head blank and workpiece coordinate system determine method
US20190080446A1 (en) * 2017-09-11 2019-03-14 All Axis Robotics, LLC System and method for automated defect detection
CN109636849A (en) * 2018-12-29 2019-04-16 广东嘉铭智能科技有限公司 A kind of workpiece localization method, device, computer and computer readable storage medium
CN110136190A (en) * 2019-03-26 2019-08-16 华为技术有限公司 A distance measuring method and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107571048A (en) * 2017-09-06 2018-01-12 深圳市贵峰精密有限公司 The positioner and localization method of a kind of workpiece
US20190080446A1 (en) * 2017-09-11 2019-03-14 All Axis Robotics, LLC System and method for automated defect detection
CN109282772A (en) * 2018-11-23 2019-01-29 安徽华菱汽车有限公司 A kind of measurement of cylinder head blank and workpiece coordinate system determine method
CN109636849A (en) * 2018-12-29 2019-04-16 广东嘉铭智能科技有限公司 A kind of workpiece localization method, device, computer and computer readable storage medium
CN110136190A (en) * 2019-03-26 2019-08-16 华为技术有限公司 A distance measuring method and electronic equipment

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111366078A (en) * 2020-03-30 2020-07-03 深圳创维-Rgb电子有限公司 Robot dispensing positioning method, system, server and storage medium
CN111366078B (en) * 2020-03-30 2021-12-31 深圳创维-Rgb电子有限公司 Robot dispensing positioning method, system, server and storage medium
CN111639644A (en) * 2020-05-29 2020-09-08 广东利元亨智能装备股份有限公司 Workpiece positioning method and device and electronic equipment
CN115098957A (en) * 2022-08-25 2022-09-23 玛斯特轻量化科技(天津)有限公司 Method and device for generating connection point of vehicle body part and electronic equipment
CN115098957B (en) * 2022-08-25 2022-11-18 玛斯特轻量化科技(天津)有限公司 Method and device for generating connection point of vehicle body part and electronic equipment
CN115229804A (en) * 2022-09-21 2022-10-25 荣耀终端有限公司 Component bonding method and device
CN116485893A (en) * 2023-04-23 2023-07-25 创新奇智(上海)科技有限公司 Method, system, equipment and medium for measuring article placement position
CN116485893B (en) * 2023-04-23 2024-02-23 创新奇智(上海)科技有限公司 Method, system, equipment and medium for measuring article placement position

Also Published As

Publication number Publication date
CN110889832B (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN110889832A (en) Workpiece positioning method, device, electronic equipment and workpiece positioning system
CN109807885B (en) Visual calibration method and device for manipulator and intelligent terminal
JP5699788B2 (en) Screen area detection method and system
CN110599544B (en) A workpiece positioning method and device based on machine vision
CN110928235B (en) Workpiece bonding method and device, electronic equipment and workpiece bonding system
CN109784250B (en) Positioning method and device of automatic guide trolley
CN111761581B (en) Path planning method and device, and narrow space traveling method and device
CN107424160A (en) The system and method that image center line is searched by vision system
CN110539306B (en) Workpiece bonding method and equipment
CN108200416B (en) Coordinate mapping method, device and the projection device of projected image in projection device
CN105654460A (en) Point cloud splicing system and method
CN115482186A (en) Defect detection method, electronic device, and storage medium
CN114179069A (en) Automatic path correction method and system for industrial robot
JP2017084975A (en) Position detecting apparatus, position detecting method, information processing program, and recording medium
CN104679487A (en) Rotating table precision compensation system and method
US20200120268A1 (en) Image capture assist device and image capture assist method
CN109407955B (en) User interface interaction method, computer device and computer readable storage medium
CN111639644B (en) Workpiece positioning method, device and electronic equipment
CN118799368A (en) Cylinder detection method and electronic device combined with point cloud registration
JP2009276073A (en) Plane estimating method, curved surface estimating method, and plane estimating device
CN110414706B (en) Method, device and system for generating curve path
WO2019176450A1 (en) Information processing device, information processing method, and program
JP6470431B2 (en) Generating object geometry
CN109738908B (en) Lidar-based alarm method, device and system
CN111435244A (en) Loop closing method and device and robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant