TWI730575B - Computer device and method for determining depth standard value of marker - Google Patents

Computer device and method for determining depth standard value of marker Download PDF

Info

Publication number
TWI730575B
TWI730575B TW108148764A TW108148764A TWI730575B TW I730575 B TWI730575 B TW I730575B TW 108148764 A TW108148764 A TW 108148764A TW 108148764 A TW108148764 A TW 108148764A TW I730575 B TWI730575 B TW I730575B
Authority
TW
Taiwan
Prior art keywords
marker
depth
value
clamp
axis
Prior art date
Application number
TW108148764A
Other languages
Chinese (zh)
Other versions
TW202127377A (en
Inventor
謝東村
吳仲偉
李智偉
林佳億
Original Assignee
群邁通訊股份有限公司
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 群邁通訊股份有限公司 filed Critical 群邁通訊股份有限公司
Priority to TW108148764A priority Critical patent/TWI730575B/en
Application granted granted Critical
Publication of TWI730575B publication Critical patent/TWI730575B/en
Publication of TW202127377A publication Critical patent/TW202127377A/en

Links

Images

Abstract

The present invention provides a method for determining a depth standard value of a marker. The method includes: obtaining a maximum depth value; obtaining a depth reference value of the marker based on a depth image of the marker; obtaining a Z-axis coordinate value of the mark based on a color image of the marker; when the depth reference value of the marker and the Z-axis coordinate value are both smaller than the maximum depth value, and when a difference between the depth reference value of the marker and the Z-axis coordinate value is not greater than 0, the depth reference value is used as the depth standard value of the marker; and when the difference value is greater than 0, the Z-axis coordinate value is used as the depth standard value of the marker. The present invention also provides a computer device. The standard invention can quickly and accurately determine the depth standard value of the marker.

Description

確定標記物的深度標準值的方法、電腦裝置 Method and computer device for determining depth standard value of marker

本發明涉及機器人控制技術領域,具體涉及一種確定標記物的深度標準值的方法、電腦裝置。 The invention relates to the technical field of robot control, in particular to a method and a computer device for determining the depth standard value of a marker.

工廠在使用機械手臂實施自動化生產時,通常是根據目標物件上所貼的標記物來找到目標物件的夾取位置的。因此,所述標記物的深度值的準確與否直接影響到機械手臂對目標物件能否成功抓取。 When factories use robotic arms to implement automated production, they usually find the gripping position of the target object based on the markers attached to the target object. Therefore, the accuracy of the depth value of the marker directly affects whether the robotic arm can successfully grasp the target object.

鑒於以上內容,有必要提出一種確定標記物的深度標準值的方法、電腦裝置,能夠在無需更改現有治具及環境的前提下,快速準確地確定標記物的深度值,進而使得機械手臂能夠根據所確定的標記物的深度值來找到目標物件的夾取位置。 In view of the above, it is necessary to propose a method and computer device for determining the depth standard value of the marker, which can quickly and accurately determine the depth value of the marker without changing the existing fixture and environment, so that the robotic arm can be based on The determined depth value of the marker is used to find the gripping position of the target object.

本發明第一方面提供一種確定標記物的深度標準值的方法,應用於電腦裝置,該方法包括:根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;控制所述機械手臂的攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像; 從所述標記物的深度圖像獲取所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值。 The first aspect of the present invention provides a method for determining the standard value of the depth of a marker, which is applied to a computer device. The method includes: calculating the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm. Maximum depth upper limit; controlling the camera of the robotic arm to take photos of the marker, and obtain a depth image and a color image containing the marker; Obtain the depth values of the four corners of the marker from the depth image of the marker; calculate the depth reference value of the marker based on the depth values of the four corners of the marker; based on the color map Obtain the Z-axis coordinate value of the marker; when both the depth reference value of the marker and the Z-axis coordinate value of the marker are less than the maximum depth upper limit, the depth of the marker is calculated The difference between the reference value and the Z-axis coordinate value of the marker; when the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; and when the difference is When the value is greater than 0, the Z-axis coordinate value is used as the depth standard value of the marker.

優選地,該方法還包括:當所述標記物的深度參照值及所述標記物的Z軸座標值中任意一者大於或者等於所述最大深度上限值時,根據所述機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力重新計算所述最大深度上限值。 Preferably, the method further includes: when any one of the depth reference value of the marker and the Z-axis coordinate value of the marker is greater than or equal to the maximum depth upper limit, according to the force of the robot arm The pressure of the clamp in the Z-axis direction detected by the sensor recalculates the upper limit of the maximum depth.

優選地,所述根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值包括:將所述機械手臂的夾具設置在距離承載平臺之一預設距離的位置;控制所述機械手臂帶動所述夾具勻速下移,同時利用所述力感測器檢測所述夾具在Z軸方向所受的壓力;當根據所述力感測器所檢測的所述夾具在Z軸方向所受的壓力確定所述夾具在Z軸方向所受的壓力的變化大於預設值時,讀取所述機械手臂的Z軸座標值;當讀取到N個所述機械手臂的Z軸座標值時,根據方均根演算法基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值。 Preferably, the calculation of a maximum depth upper limit value based on the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm includes: setting the clamp of the robot arm at one of the distance bearing platforms The position of the preset distance; control the robot arm to drive the clamp to move down at a constant speed, and use the force sensor to detect the pressure of the clamp in the Z-axis direction; when the force sensor detects When the pressure of the clamp in the Z-axis direction determines that the change in the pressure of the clamp in the Z-axis direction is greater than the preset value, read the Z-axis coordinate value of the robot arm; when N numbers are read When the Z-axis coordinate value of the robot arm is used, the maximum depth upper limit value is calculated based on the Z-axis coordinate value of the N robot arms according to a root-mean-square algorithm.

優選地,該方法根據方均根演算法基於所述標記物的四個角的深 度值計算得到所述標記物的深度參照值。 Preferably, the method is based on the depth of the four corners of the marker according to the root-mean-square algorithm. The degree value is calculated to obtain the depth reference value of the marker.

優選地,所述基於所述彩色圖像獲得所述標記物的Z軸的座標值包括:利用OPENCV函數基於所述彩色圖像獲得所述標記物的Z軸的座標值。 Preferably, the obtaining the coordinate value of the Z axis of the marker based on the color image includes: obtaining the coordinate value of the Z axis of the marker based on the color image by using an OPENCV function.

優選地,所述標記物位於承載平臺上且該標記物的四邊平行於該承載平臺。 Preferably, the marker is located on the carrying platform and the four sides of the marker are parallel to the carrying platform.

本發明第二方面提供一種電腦裝置,所述電腦裝置包括儲存器和處理器,所述儲存器用於儲存多個模組,所述處理器用於執行所述多個模組,其中,所述多個模組包括:執行模組,用於根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;拍攝模組,用於控制所述機械手臂的攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像;所述執行模組,還用於從所述標記物的深度圖像獲取所述標記物的四個角的深度值;所述執行模組,還用於基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;所述執行模組,還用於基於所述彩色圖像獲得所述標記物的Z軸的座標值;所述執行模組,還用於當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;所述執行模組,還用於當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及所述執行模組,還用於當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值。 A second aspect of the present invention provides a computer device, the computer device includes a storage and a processor, the storage is used to store a plurality of modules, the processor is used to execute the plurality of modules, wherein the multiple Each module includes: an execution module, which is used to calculate a maximum depth limit based on the pressure of the fixture in the Z-axis direction detected by the force sensor of the robotic arm; and a shooting module, which is used to control the The camera of the robotic arm takes photos of the marker to obtain a depth image and a color image containing the marker; the execution module is also used to obtain four images of the marker from the depth image of the marker. The depth value of each corner; the execution module is also used to calculate the depth reference value of the marker based on the depth values of the four corners of the marker; the execution module is also used to calculate the depth reference value of the marker based on the The color image obtains the Z-axis coordinate value of the marker; the execution module is also used when the depth reference value of the marker and the Z-axis coordinate value of the marker are both less than the maximum depth. When the limit value is set, the difference between the depth reference value of the marker and the Z-axis coordinate value of the marker is calculated; the execution module is also used to calculate the difference when the difference is less than or equal to 0 The depth reference value is used as the depth standard value of the marker; and the execution module is further configured to use the Z-axis coordinate value as the depth standard value of the marker when the difference is greater than 0 .

優選地,所述執行模組,還用於:當所述標記物的深度參照值及 所述標記物的Z軸座標值中任意一者大於或者等於所述最大深度上限值時,根據所述機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力重新計算所述最大深度上限值。 Preferably, the execution module is also used for: when the depth reference value of the marker and When any one of the Z-axis coordinate values of the marker is greater than or equal to the upper limit of the maximum depth, recalculate according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm The upper limit of the maximum depth.

優選地,所述根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值包括:將所述機械手臂的夾具設置在距離承載平臺之一預設距離的位置;控制所述機械手臂帶動所述夾具勻速下移,同時利用所述力感測器檢測所述夾具在Z軸方向所受的壓力;當根據所述力感測器所檢測的所述夾具在Z軸方向所受的壓力確定所述夾具在Z軸方向所受的壓力的變化大於預設值時,讀取所述機械手臂的Z軸座標值;當讀取到N個所述機械手臂的Z軸座標值時,根據方均根演算法基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值。 Preferably, the calculation of a maximum depth upper limit value based on the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm includes: setting the clamp of the robot arm at one of the distance bearing platforms The position of the preset distance; control the robot arm to drive the clamp to move down at a constant speed, and use the force sensor to detect the pressure of the clamp in the Z-axis direction; when the force sensor detects When the pressure of the clamp in the Z-axis direction determines that the change in the pressure of the clamp in the Z-axis direction is greater than the preset value, read the Z-axis coordinate value of the robot arm; when N numbers are read When the Z-axis coordinate value of the robot arm is used, the maximum depth upper limit value is calculated based on the Z-axis coordinate value of the N robot arms according to a root-mean-square algorithm.

優選地,所述執行模組根據方均根演算法基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值。 Preferably, the execution module calculates the depth reference value of the marker based on the depth values of the four corners of the marker according to a root-mean-square algorithm.

優選地,所述基於所述彩色圖像獲得所述標記物的Z軸的座標值包括:利用OPENCV函數基於所述彩色圖像獲得所述標記物的Z軸的座標值。 Preferably, the obtaining the coordinate value of the Z axis of the marker based on the color image includes: obtaining the coordinate value of the Z axis of the marker based on the color image by using an OPENCV function.

優選地,所述標記物位於承載平臺上且該標記物的四邊平行於該承載平臺。 Preferably, the marker is located on the carrying platform and the four sides of the marker are parallel to the carrying platform.

本發明實施例中所述的確定標記物的深度標準值的方法、電腦裝置,通過根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;控制所述機械手臂的深度攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像;基於所述標記物的深度圖像獲取到所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差 值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值,能夠在無需更改現有治具及環境的前提下,快速準確地確定標記物的深度值,進而使得機械手臂能夠根據所確定的標記物的深度值來找到目標物件的夾取位置。 The method and computer device for determining the standard value of the depth of the marker described in the embodiment of the present invention obtain an upper limit of the maximum depth by calculating according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm Value; control the depth camera of the robotic arm to take photos of the marker to obtain a depth image and a color image containing the marker; obtain the four corners of the marker based on the depth image of the marker The depth value of the marker; the depth reference value of the marker is calculated based on the depth values of the four corners of the marker; the Z-axis coordinate value of the marker is obtained based on the color image; when the marker When the depth reference value of and the Z-axis coordinate value of the marker are both less than the maximum depth upper limit, the difference between the depth reference value of the marker and the Z-axis coordinate value of the marker is calculated When the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; and when the difference is greater than 0, the Z-axis coordinate value is used as the marker The standard depth value of the object can quickly and accurately determine the depth value of the marker without changing the existing fixture and environment, so that the robotic arm can find the target object according to the determined depth value of the marker. position.

30:確定系統 30: Determine the system

301:執行模組 301: Execution module

302:拍攝模組 302: Shooting module

1:電腦裝置 1: computer device

2:機械手臂 2: Robotic arm

3:外治具 3: External fixture

31:治具 31: Fixture

4:承載平臺 4: Bearer platform

51:儲存器 51: Storage

52:處理器 52: processor

21:基座 21: Pedestal

22:臂部 22: Arm

23:夾具 23: Fixture

24:力感測器 24: Force sensor

25:攝像機 25: Camera

41:標記物 41: Marker

40:目標物件 40: target object

D11、D12、D13、D14:標記物的四個角的深度 D11, D12, D13, D14: the depth of the four corners of the marker

為了更清楚地說明本發明實施例或習知技術中的技術方案,下面將對實施例或習知技術描述中所需要使用的附圖作簡單地介紹,顯而易見地,下面描述中的附圖僅僅是本發明的實施例,對於本領域普通技術人員來講,在不付出創造性勞動的前提下,還可以根據提供的附圖獲得其他的附圖。 In order to more clearly describe the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are merely It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work.

圖1是本發明較佳實施例提供的確定標記物的深度標準值的方法的應用環境圖。 Fig. 1 is an application environment diagram of the method for determining the depth standard value of a marker provided by a preferred embodiment of the present invention.

圖2示意機械手臂以及治具。 Figure 2 shows the robotic arm and fixture.

圖3是本發明較佳實施例提供的確定標記物的深度標準值的方法的流程圖。 Fig. 3 is a flowchart of a method for determining the depth standard value of a marker provided by a preferred embodiment of the present invention.

圖4是本發明較佳實施例提供的確定系統的功能模組圖。 Fig. 4 is a functional module diagram of a determining system provided by a preferred embodiment of the present invention.

圖5是本發明較佳實施例提供的電腦裝置的架構圖。 FIG. 5 is a structural diagram of a computer device provided by a preferred embodiment of the present invention.

如下具體實施方式將結合上述附圖進一步說明本發明。 The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings.

為了能夠更清楚地理解本發明的上述目的、特徵和優點,下面結合附圖和具體實施例對本發明進行詳細描述。需要說明的是,在不衝突的情況下,本發明的實施例及實施例中的特徵可以相互組合。 In order to be able to understand the above objectives, features and advantages of the present invention more clearly, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other if there is no conflict.

在下面的描述中闡述了很多具體細節以便於充分理解本發明,所描述的實施例僅僅是本發明一部分實施例,而不是全部的實施例。基於本發明 中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。 In the following description, many specific details are explained in order to fully understand the present invention. The described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the invention The embodiments in and all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.

除非另有定義,本文所使用的所有的技術和科學術語與屬於本發明的技術領域的技術人員通常理解的含義相同。本文中在本發明的說明書中所使用的術語只是為了描述具體的實施例的目的,不是旨在於限制本發明。 Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments, and are not intended to limit the present invention.

請參圖1所示,在本實施例中,所述確定標記物的深度標準值的方法可以應用於由電腦裝置1以及機械手臂2所構成的應用環境中。 Please refer to FIG. 1, in this embodiment, the method for determining the depth standard value of the marker can be applied to an application environment composed of a computer device 1 and a robot arm 2.

本實施例中,電腦裝置1可以與所述機械手臂2建立無線通訊連接。例如,所述電腦裝置1可以通過無線路由器(圖中未示出)與機械手臂2建立通訊連接。 In this embodiment, the computer device 1 can establish a wireless communication connection with the robotic arm 2. For example, the computer device 1 may establish a communication connection with the robotic arm 2 through a wireless router (not shown in the figure).

請同時結合圖2所示,本實施例中,所述機械手臂2置於承載平臺4上。該承載平臺4可以為可移動平臺。本實施例中,該承載平臺4上還同時承載了一個外治具3。該外治具3還可以包括多個治具31。 Please also refer to FIG. 2 as shown. In this embodiment, the robotic arm 2 is placed on the carrying platform 4. The bearing platform 4 may be a movable platform. In this embodiment, the carrying platform 4 also carries an external jig 3 at the same time. The external jig 3 may also include a plurality of jigs 31.

本實施例中,所述機械手臂2包括基座21、臂部22、夾具23、力感測器(Force-Torque Sensor)24,以及攝像機25。所述臂部22與所述基座21連接,所述力感測器24設置於所述臂部22與所述攝像機25之間。所述夾具23設置在所述臂部22的前端。所述攝像機25可以為深度攝像機。 In this embodiment, the robotic arm 2 includes a base 21, an arm 22, a clamp 23, a force-torque sensor (Force-Torque Sensor) 24, and a camera 25. The arm 22 is connected to the base 21, and the force sensor 24 is disposed between the arm 22 and the camera 25. The clamp 23 is provided at the front end of the arm 22. The camera 25 may be a depth camera.

參閱圖2所示,本實施例中,所述機械手臂2所在的三維座標系可以是以所述機械手臂2的基座21的底端為原點O,以該基座21的底端所在的水平面為XOY平面,以及以豎直向上垂直於該XOY平面所在方向為Z軸。 Referring to FIG. 2, in this embodiment, the three-dimensional coordinate system where the robotic arm 2 is located can be based on the origin O of the base 21 of the robotic arm 2 and the bottom end of the base 21 is located The horizontal plane of is the XOY plane, and the vertical direction perpendicular to the XOY plane is the Z axis.

本實施例中,所述電腦裝置1可以控制機械手臂2抓取置於所述治具31上的目標物件40,並將目標物件40放置到所述承載平臺4上。 In this embodiment, the computer device 1 can control the robotic arm 2 to grab the target object 40 placed on the jig 31 and place the target object 40 on the carrier platform 4.

本實施例中,該目標物件40可以為任何產品例如主機板或其他產品。 In this embodiment, the target object 40 can be any product such as a motherboard or other products.

本實施例中,所述目標物件40上設置有標記物(Marker)41。該標記物41可以為ArUco Markers。 In this embodiment, a marker 41 is provided on the target object 40. The marker 41 may be ArUco Markers.

需要說明的是,ArUco marker是一個二進位平方標記,它由一個寬的黑邊和一個內部的二進位矩陣組成,內部的矩陣決定了ID。黑色的邊界有利於快速檢測到圖像,二進位編碼可以驗證ID,並且允許錯誤檢測和矯正技術的應用。ArUco Markers的大小決定了內部矩陣的大小。例如,一個4cm *4cm的ArUco Markers由16bits組成。 It should be noted that ArUco marker is a binary square marker, which consists of a wide black border and an internal binary matrix, which determines the ID. The black border is conducive to the rapid detection of the image, the binary code can verify the ID, and allows the application of error detection and correction technology. The size of ArUco Markers determines the size of the internal matrix. For example, a 4cm * 4cm ArUco Markers consists of 16 bits.

本實施例中,所述標記物41的大小可以是4cm*4cm。當然,在其他實施例中,該標記物41的大小也可以為其他尺寸。本實施例中,所述機械手臂2可以根據所述標記物41來找到目標物件40的夾取位置。因此,所述標記物41的深度值的準確與否直接影響到機械手臂2能否成功抓取目標物件40。 In this embodiment, the size of the marker 41 may be 4cm*4cm. Of course, in other embodiments, the size of the marker 41 can also be other sizes. In this embodiment, the robotic arm 2 can find the gripping position of the target object 40 according to the marker 41. Therefore, the accuracy of the depth value of the marker 41 directly affects whether the robotic arm 2 can successfully grasp the target object 40.

本實施例中,所述承載平臺4上還設置有一標記物41,該標記物41的四邊平行於該承載平臺4。下面將結合圖3來說明如何確定所述標記物41的深度值。在這裡,為便於清楚簡單說明本發明,將接下來所要確定的所述標記物41的深度值稱為深度標準值。 In this embodiment, the carrying platform 4 is further provided with a marker 41, and four sides of the marker 41 are parallel to the carrying platform 4. The following will describe how to determine the depth value of the marker 41 in conjunction with FIG. 3. Here, in order to explain the present invention clearly and simply, the depth value of the marker 41 to be determined next is referred to as the depth standard value.

在本實施例中,所述確定標記物41的深度標準值的方法可以應用於電腦裝置1中,對於需要確定標記物的深度標準值的電腦裝置1,可以直接在電腦裝置1上集成本發明的方法所提供的用於確定標記物41的深度標準值的功能,或者以軟體開發套件(Software Development Kit,SDK)的形式運行在電腦裝置上。 In this embodiment, the method for determining the depth standard value of the marker 41 can be applied to the computer device 1. For the computer device 1 that needs to determine the depth standard value of the marker, the present invention can be directly integrated on the computer device 1. The function provided by the method for determining the depth standard value of the marker 41 may be run on a computer device in the form of a software development kit (SDK).

如圖3所示,所述確定標記物的深度標準值的方法具體包括以下步驟,根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。 As shown in FIG. 3, the method for determining the depth standard value of the marker specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

步驟S1,電腦裝置1根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力計算得到一個最大深度上限值Zmax。電腦裝置1以承載所述機械手臂2的承載平臺4所在的水平面建立XOY平面,以垂直於所述XOY平面所在方向為Z軸建立座標系O-XYZ。 In step S1, the computer device 1 calculates a maximum depth upper limit Zmax based on the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24 of the robot arm 2. The computer device 1 establishes an XOY plane with the horizontal plane on which the carrying platform 4 carrying the robot arm 2 is located, and establishes the coordinate system O-XYZ with the Z axis as the direction perpendicular to the XOY plane.

具體地,參閱圖2所示,本實施例中,電腦裝置1以所述機械手臂2的基座21的底端為原點O,以該基座21的底端所在的水平面為XOY平面, 以及以豎直向上垂直於該XOY平面所在方向為Z軸建立座標系O-XYZ。 Specifically, referring to FIG. 2, in this embodiment, the computer device 1 uses the bottom end of the base 21 of the robot arm 2 as the origin O, and the horizontal plane where the bottom end of the base 21 is located is the XOY plane. And the coordinate system O-XYZ is established with the Z axis as the Z-axis in the vertical upward direction perpendicular to the XOY plane.

在一個實施例中,所述根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力計算得到一個最大深度上限值Zmax包括(a1)-(a6): In one embodiment, the maximum depth limit Zmax calculated according to the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24 of the robot arm 2 includes (a1)-(a6):

(a1)將所述機械手臂2的夾具23設置在距離所述承載平臺4為預設距離的位置。 (a1) The clamp 23 of the robot arm 2 is set at a predetermined distance from the carrying platform 4.

本實施例中,所述預設距離可以為30釐米、35釐米。該預設距離可根據實際應用場景來設置。 In this embodiment, the preset distance may be 30 cm or 35 cm. The preset distance can be set according to actual application scenarios.

(a2)控制所述機械手臂2帶動所述夾具23勻速下移,同時利用所述機械手臂2的力感測器24檢測所述夾具23在Z軸方向所受的壓力。 (a2) Control the robot arm 2 to drive the clamp 23 to move down at a uniform speed, and use the force sensor 24 of the robot arm 2 to detect the pressure of the clamp 23 in the Z-axis direction.

具體地,可以控制所述機械手臂2帶動所述夾具23作垂直向下的勻速運動。 Specifically, the robot arm 2 can be controlled to drive the clamp 23 to move vertically downward at a constant speed.

(a3)根據所述力感測器24所檢測的所述夾具23在Z軸方向所受的壓力判斷所述夾具23在Z軸方向所受的壓力的變化是否大於預設值(例如1牛頓、1.5牛頓,或者其他值)。當所述夾具23在Z軸方向所受的壓力的變化大於所述預設值時,執行(a4)。當所述夾具23在Z軸方向所受的壓力的變化小於或者等於所述預設值時,繼續執行(a3)。 (a3) According to the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24, determine whether the change in the pressure of the clamp 23 in the Z-axis direction is greater than a preset value (for example, 1 Newton) , 1.5 Newtons, or other values). When the change in the pressure of the clamp 23 in the Z-axis direction is greater than the preset value, (a4) is executed. When the change in the pressure of the clamp 23 in the Z-axis direction is less than or equal to the preset value, continue to perform (a3).

在一個實施例中,所述夾具23在Z軸方向所受的壓力的變化可以是指第一壓力值與第二壓力值之間的差值,其中,該第一壓力值是指所述機械手臂2帶動所述夾具23勻速下移過程中,所述夾具23在Z軸方向所受的壓力。所述第二壓力值是指所述機械手臂2未帶動所述夾具23勻速下移時所述夾具23在Z軸方向所受的壓力。換句話來講,所述第二壓力值是指所述機械手臂2帶動所述夾具23作勻速下移運動之前,該力感測器24所檢測獲得的壓力值。 In one embodiment, the change in the pressure of the clamp 23 in the Z-axis direction may refer to the difference between the first pressure value and the second pressure value, where the first pressure value refers to the mechanical When the arm 2 drives the clamp 23 to move down at a uniform speed, the clamp 23 is subjected to pressure in the Z-axis direction. The second pressure value refers to the pressure of the clamp 23 in the Z-axis direction when the robot arm 2 does not drive the clamp 23 to move down at a constant speed. In other words, the second pressure value refers to the pressure value detected by the force sensor 24 before the mechanical arm 2 drives the clamp 23 to move down at a uniform speed.

(a4)當所述夾具23在Z軸方向所受的壓力的變化大於所述預設值時,讀取所述機械手臂2的Z軸座標值,將已經獲得的所述機械手臂2的 Z軸座標值的數目加1以統計已經獲得的所述機械手臂2的Z軸座標值的總數。 (a4) When the change in the pressure of the clamp 23 in the Z-axis direction is greater than the preset value, read the Z-axis coordinate value of the robot arm 2 and replace the obtained value of the robot arm 2 The number of Z-axis coordinate values is increased by 1 to count the total number of Z-axis coordinate values of the robot arm 2 that have been obtained.

(a5)判斷是否已經獲得N個所述機械手臂2的Z軸座標值。若已經獲得N個所述機械手臂2的Z軸座標值,執行(a6)。若尚未獲得N個所述機械手臂2的Z軸座標值,執行(a1)。 (a5) Determine whether the Z-axis coordinate values of the N robot arms 2 have been obtained. If N coordinate values of the Z-axis of the robot arm 2 have been obtained, execute (a6). If the Z-axis coordinate values of the N robot arms 2 have not been obtained, execute (a1).

本實施例中,N可以等於30,或者其他值,例如40或者50。 In this embodiment, N may be equal to 30, or other values, such as 40 or 50.

(a6)當已經獲得N個所述機械手臂2的Z軸座標值時,根據方均根演算法(Root Mean Square,縮寫為RMS)基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值Zmax。 (a6) When the Z-axis coordinate values of the N robot arms 2 have been obtained, calculate the maximum value based on the Z-axis coordinate values of the N robot arms according to the root mean square algorithm (Root Mean Square, abbreviated as RMS) The upper limit of depth Zmax.

所述方均根演算法也叫平方平均數(Quadratic mean),是2次方的廣義平均數的運算式,也可叫做2次冪平均數。具體地,所述最大深度上限值Zmax的計算公式是:

Figure 108148764-A0305-02-0011-2
The root-mean-square algorithm is also called quadratic mean, which is an operation formula of generalized mean to the power of 2 and can also be called power-of-two mean. Specifically, the calculation formula of the maximum depth upper limit Zmax is:
Figure 108148764-A0305-02-0011-2

其中,n表示所獲得的所述機械手臂2的Z軸座標值的總數(即本實施例中n=N,例如n=30),x i 表示所獲得的每個所述機械手臂2的Z軸座標值。 Wherein, n represents the total number of obtained Z-axis coordinate values of the robotic arm 2 (that is, n=N in this embodiment, for example, n=30), and x i represents the obtained Z of each of the robotic arms 2 Axis coordinate value.

步驟S2,電腦裝置1控制所述機械手臂2的攝像機25對位於所述承載平臺4的標記物41拍攝照片,獲得包含所述標記物41的深度圖像和彩色圖像。 In step S2, the computer device 1 controls the camera 25 of the robotic arm 2 to take a picture of the marker 41 located on the carrying platform 4 to obtain a depth image and a color image containing the marker 41.

如前面所述,位於所述承載平臺4的標記物41的四邊平行於該承載平臺4。如圖2所示。 As mentioned above, the four sides of the marker 41 on the carrying platform 4 are parallel to the carrying platform 4. as shown in picture 2.

需要說明的是,以下步驟中所提及的標記物41均指位於所述承載平臺4的標記物41,即不是指位於治具31上的目標物件40上的標記物41。 It should be noted that the markers 41 mentioned in the following steps all refer to the markers 41 on the carrying platform 4, that is, they do not refer to the markers 41 on the target object 40 on the jig 31.

步驟S3,電腦裝置1從所述標記物41的深度圖像獲取所述標記物41的四個角的深度值。 In step S3, the computer device 1 obtains the depth values of the four corners of the marker 41 from the depth image of the marker 41.

例如,參閱圖2所示,電腦裝置1獲取到所述標記物41的四個 角的深度值D11、D12、D13、D14。 For example, referring to FIG. 2, the computer device 1 obtains four of the markers 41 The depth values of the corners are D11, D12, D13, D14.

步驟S4,電腦裝置1基於所述標記物41的四個角的深度值計算得到所述標記物41的深度參照值Zrms。 In step S4, the computer device 1 calculates the depth reference value Zrms of the marker 41 based on the depth values of the four corners of the marker 41.

本實施例中,電腦裝置1根據所述方均根演算法基於所述標記物41的四個角的深度值計算得到所述標記物41的深度參照值Zrms。 In this embodiment, the computer device 1 calculates the depth reference value Zrms of the marker 41 based on the depth values of the four corners of the marker 41 according to the root-mean-square algorithm.

具體地,所述深度參照值Zrms計算公式為:

Figure 108148764-A0305-02-0012-3
Specifically, the formula for calculating the depth reference value Zrms is:
Figure 108148764-A0305-02-0012-3

其中,n表示所述標記物41的角的數目(即本實施例中n=4),x i 表示所述標記物41的每個角的深度值。 Wherein, n represents the number of corners of the marker 41 (that is, n=4 in this embodiment), and x i represents the depth value of each corner of the marker 41.

步驟S5,電腦裝置1基於所述標記物41的彩色圖像獲得所述標記物41的Z軸的座標值Zcv。 In step S5, the computer device 1 obtains the coordinate value Zcv of the Z axis of the marker 41 based on the color image of the marker 41.

具體地,電腦裝置1可以利用OPENCV函數基於所述彩色圖像來計算獲得所述標記物41的Z軸的座標值Zcv。 Specifically, the computer device 1 may use the OPENCV function to calculate and obtain the coordinate value Zcv of the Z axis of the marker 41 based on the color image.

步驟S6,電腦裝置1判斷所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv是否都小於所述最大深度上限值Zmax。 In step S6, the computer device 1 determines whether the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 are both smaller than the maximum depth upper limit Zmax.

當所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv都小於所述最大深度上限值Zmax時,執行步驟S7。 When the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 are both less than the maximum depth upper limit Zmax, step S7 is executed.

當所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv中任意一者大於或者等於所述最大深度上限值Zmax時,執行步驟S61,並於執行完步驟S61後回到步驟S1,由電腦裝置1根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力重新計算所述最大深度上限值Zmax。 When any one of the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 is greater than or equal to the maximum depth upper limit Zmax, step S61 is executed, and after step S61 is completed Then return to step S1, the computer device 1 recalculates the maximum depth upper limit Zmax based on the pressure of the clamp 23 in the Z axis direction detected by the force sensor 24 of the robot arm 2.

步驟S61,電腦裝置1可以直接重新校準攝像機25或者發出提示,提示用戶重新校準所述攝像機25。 In step S61, the computer device 1 may directly recalibrate the camera 25 or issue a prompt to prompt the user to recalibrate the camera 25.

具體地,所述重新校準攝像機25包括校準所述攝像機25的拍攝參數例如焦距等。 Specifically, the recalibration of the camera 25 includes calibrating the shooting parameters of the camera 25, such as the focal length.

步驟S7,當所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv都小於所述最大深度上限值Zmax時,電腦裝置1計算所述標記物41的深度參照值Zrms與所述標記物41的Z軸座標值Zcv之間的差值。當所述差值小於或者等於0時,將所述深度參照值Zrms作為所述標記物41的深度標準值;及當所述差值大於0時,將所述標記物41的Z軸座標值Zcv作為所述標記物41的深度標準值。 Step S7, when the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 are both less than the maximum depth upper limit Zmax, the computer device 1 calculates the depth reference of the marker 41 The difference between the value Zrms and the Z-axis coordinate value Zcv of the marker 41. When the difference is less than or equal to 0, use the depth reference value Zrms as the depth standard value of the marker 41; and when the difference is greater than 0, use the Z-axis coordinate value of the marker 41 Zcv is used as the standard value of the depth of the marker 41.

在其他實施例中,本發明還可以包括步驟S8。 In other embodiments, the present invention may further include step S8.

步驟S8,當所述標記物41貼在治具31上的目標物件40上時,電腦裝置1可以控制機械手臂2根據上述確定的所述標記物41的深度標準值抓取與所述標記物41對應的目標物件40。 In step S8, when the marker 41 is attached to the target object 40 on the jig 31, the computer device 1 can control the robotic arm 2 to grab the marker 41 according to the depth standard value of the marker 41 determined above. 41 corresponds to the target object 40.

根據上述記載可知,本發明實施例的所述確定標記物的深度標準值的方法,通過根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值,其中,以承載所述機械手臂的承載平臺的水平面建立XOY平面,以垂直於所述XOY平面所在方向為Z軸建立座標系O-XYZ;控制所述機械手臂的深度攝像機對位於所述承載平臺的標記物拍攝照片,獲得所述標記物的深度圖像和彩色圖像;基於所述標記物的深度圖像獲取到所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值,能夠在無需更改現有治具及環境的前提下,快速準確地確定標記物的深度值,進而使得機械手臂能夠根據所確定的標記物的深度值來找到目標物件的夾取位置。 According to the above description, the method for determining the standard value of the depth of the marker in the embodiment of the present invention calculates a maximum depth based on the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm. Limit, where the XOY plane is established with the horizontal plane of the carrying platform carrying the robot arm, and the coordinate system O-XYZ is established with the Z axis as the direction perpendicular to the XOY plane; and the depth camera of the robot arm is controlled to be positioned at all Taking photos of the marker on the bearing platform to obtain the depth image and color image of the marker; obtaining the depth values of the four corners of the marker based on the depth image of the marker; The depth value of the four corners of the marker is calculated to obtain the depth reference value of the marker; the Z-axis coordinate value of the marker is obtained based on the color image; when the depth reference value of the marker and the marker When the Z-axis coordinate value of the object is less than the upper limit of the maximum depth, the difference between the depth reference value of the marker and the Z-axis coordinate value of the marker is calculated; when the difference is less than or equal to When 0, the depth reference value is used as the depth standard value of the marker; and when the difference is greater than 0, the Z-axis coordinate value is used as the depth standard value of the marker, which can be changed without changing Under the premise of the existing fixture and the environment, the depth value of the marker can be determined quickly and accurately, so that the robotic arm can find the gripping position of the target object according to the determined depth value of the marker.

上述圖3詳細介紹了本發明的確定標記物的深度標準值的方法, 下面結合圖4和圖5,分別對實現確定標記物的深度標準值的方法的軟體裝置的功能模組以及實現確定標記物的深度標準值的方法的硬體裝置架構進行介紹。 The above-mentioned Figure 3 details the method for determining the depth standard value of the marker of the present invention, 4 and 5, the functional modules of the software device that implements the method for determining the depth standard value of the marker and the hardware device architecture that implements the method for determining the depth standard value of the marker are respectively introduced below.

應該瞭解,所述實施例僅為說明之用,在專利申請範圍上並不受此結構的限制。 It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.

參閱圖4所示,是本發明較佳實施例提供的確定系統30的功能模組圖。 Refer to FIG. 4, which is a functional module diagram of the determining system 30 provided by a preferred embodiment of the present invention.

在一些實施例中,所述確定系統30運行於電腦裝置1中。所述確定系統30可以包括多個由程式碼段所組成的功能模組。所述確定系統30中的各個程式段的電腦程式代碼可以儲存於電腦裝置1的儲存器中,並由所述電腦裝置1的至少一個處理器所執行,以實現確定標記物的深度標準值(詳見對圖3描述)。 In some embodiments, the determination system 30 runs in the computer device 1. The determination system 30 may include a plurality of functional modules composed of code segments. The computer program code of each program segment in the determination system 30 can be stored in the memory of the computer device 1 and executed by at least one processor of the computer device 1 to determine the depth standard value of the marker ( See the description of Figure 3 for details).

本實施例中,所述確定系統30根據其所執行的功能,可以被劃分為多個功能模組。所述功能模組可以包括:執行模組301、拍攝模組302。本發明所稱的模組是指一種能夠被至少一個處理器所執行並且能夠完成固定功能的一系列電腦程式段,其儲存在儲存器中。在本實施例中,關於各模組的功能將在後續的實施例中詳述。 In this embodiment, the determining system 30 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an execution module 301 and a photographing module 302. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

執行模組301根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力計算得到一個最大深度上限值Zmax。執行模組301以承載所述機械手臂2的承載平臺4所在的水平面建立XOY平面,以垂直於所述XOY平面所在方向為Z軸建立座標系O-XYZ。 The execution module 301 calculates a maximum depth upper limit Zmax based on the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24 of the robot arm 2. The execution module 301 establishes the XOY plane on the horizontal plane where the carrying platform 4 carrying the robot arm 2 is located, and establishes the coordinate system O-XYZ with the Z axis as the direction perpendicular to the XOY plane.

具體地,參閱圖2所示,本實施例中,執行模組301以所述機械手臂2的基座21的底端為原點O,以該基座21的底端所在的水平面為XOY平面,以及以豎直向上垂直於該XOY平面所在方向為Z軸建立座標系O-XYZ。 Specifically, referring to FIG. 2, in this embodiment, the execution module 301 uses the bottom end of the base 21 of the robot arm 2 as the origin O, and the horizontal plane where the bottom end of the base 21 is located is the XOY plane. , And establish a coordinate system O-XYZ with the Z axis as the Z-axis in the vertical upward direction perpendicular to the XOY plane.

在一個實施例中,所述根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力計算得到一個最大深度上限值Zmax包括(a1) -(a6): In one embodiment, the maximum depth limit Zmax is calculated based on the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24 of the robot arm 2 including (a1) -(a6):

(a1)將所述機械手臂2的夾具23設置在距離所述承載平臺4為預設距離的位置。 (a1) The clamp 23 of the robot arm 2 is set at a predetermined distance from the carrying platform 4.

本實施例中,所述預設距離可以為30釐米、35釐米。該預設距離可根據實際應用場景來設置。 In this embodiment, the preset distance may be 30 cm or 35 cm. The preset distance can be set according to actual application scenarios.

(a2)控制所述機械手臂2帶動所述夾具23勻速下移,同時利用所述機械手臂2的力感測器24檢測所述夾具23在Z軸方向所受的壓力。 (a2) Control the robot arm 2 to drive the clamp 23 to move down at a uniform speed, and use the force sensor 24 of the robot arm 2 to detect the pressure of the clamp 23 in the Z-axis direction.

具體地,可以控制所述機械手臂2帶動所述夾具23作垂直向下的勻速運動。 Specifically, the robot arm 2 can be controlled to drive the clamp 23 to move vertically downward at a constant speed.

(a3)根據所述力感測器24所檢測的所述夾具23在Z軸方向所受的壓力判斷所述夾具23在Z軸方向所受的壓力的變化是否大於預設值(例如1牛頓、1.5牛頓,或者其他值)。當所述夾具23在Z軸方向所受的壓力的變化大於所述預設值時,執行(a4)。當所述夾具23在Z軸方向所受的壓力的變化小於或者等於所述預設值時,繼續執行(a3)。 (a3) According to the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24, determine whether the change in the pressure of the clamp 23 in the Z-axis direction is greater than a preset value (for example, 1 Newton) , 1.5 Newtons, or other values). When the change in the pressure of the clamp 23 in the Z-axis direction is greater than the preset value, (a4) is executed. When the change in the pressure of the clamp 23 in the Z-axis direction is less than or equal to the preset value, continue to perform (a3).

在一個實施例中,所述夾具23在Z軸方向所受的壓力的變化可以是指第一壓力值與第二壓力值之間的差值,其中,該第一壓力值是指所述機械手臂2帶動所述夾具23勻速下移過程中,所述夾具23在Z軸方向所受的壓力。所述第二壓力值是指所述機械手臂2未帶動所述夾具23勻速下移時所述夾具23在Z軸方向所受的壓力。換句話來講,所述第二壓力值是指所述機械手臂2帶動所述夾具23作勻速下移運動之前,該力感測器24所檢測獲得的壓力值。 In one embodiment, the change in the pressure of the clamp 23 in the Z-axis direction may refer to the difference between the first pressure value and the second pressure value, where the first pressure value refers to the mechanical When the arm 2 drives the clamp 23 to move down at a uniform speed, the clamp 23 is subjected to pressure in the Z-axis direction. The second pressure value refers to the pressure of the clamp 23 in the Z-axis direction when the robot arm 2 does not drive the clamp 23 to move down at a constant speed. In other words, the second pressure value refers to the pressure value detected by the force sensor 24 before the mechanical arm 2 drives the clamp 23 to move down at a uniform speed.

(a4)當所述夾具23在Z軸方向所受的壓力的變化大於所述預設值時,讀取所述機械手臂2的Z軸座標值,將已經獲得的所述機械手臂2的Z軸座標值的數目加1以統計已經獲得的所述機械手臂2的Z軸座標值的總數。 (a4) When the change in the pressure of the clamp 23 in the Z-axis direction is greater than the preset value, read the Z-axis coordinate value of the robot arm 2 and use the obtained Z-axis coordinate value of the robot arm 2 The number of axis coordinate values is increased by 1 to count the total number of Z axis coordinate values of the robot arm 2 that have been obtained.

(a5)判斷是否已經獲得N個所述機械手臂2的Z軸座標值。若 已經獲得N個所述機械手臂2的Z軸座標值,執行(a6)。若尚未獲得N個所述機械手臂2的Z軸座標值,執行(a1)。 (a5) Determine whether the Z-axis coordinate values of the N robot arms 2 have been obtained. If Having obtained N coordinate values of the Z-axis of the robot arm 2, execute (a6). If the Z-axis coordinate values of the N robot arms 2 have not been obtained, execute (a1).

本實施例中,N可以等於30,或者其他值,例如40或者50。 In this embodiment, N may be equal to 30, or other values, such as 40 or 50.

(a6)當已經獲得N個所述機械手臂2的Z軸座標值時,根據方均根演算法(Root Mean Square,縮寫為RMS)基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值Zmax。 (a6) When the Z-axis coordinate values of the N robot arms 2 have been obtained, calculate the maximum value based on the Z-axis coordinate values of the N robot arms according to the root mean square algorithm (Root Mean Square, abbreviated as RMS) The upper limit of depth Zmax.

所述方均根演算法也叫平方平均數(Quadratic mean),是2次方的廣義平均數的運算式,也可叫做2次冪平均數。具體地,所述最大深度上限值Zmax的計算公式是:

Figure 108148764-A0305-02-0016-4
The root-mean-square algorithm is also called quadratic mean, which is an operation formula of generalized mean to the power of 2 and can also be called power-of-two mean. Specifically, the calculation formula of the maximum depth upper limit Zmax is:
Figure 108148764-A0305-02-0016-4

其中,n表示所獲得的所述機械手臂2的Z軸座標值的總數(即本實施例中n=N),x i 表示所獲得的每個所述機械手臂2的Z軸座標值。 Wherein, n represents the total number of obtained Z-axis coordinate values of the robot arm 2 (that is, n=N in this embodiment), and x i represents the obtained Z-axis coordinate value of each robot arm 2.

拍攝模組302控制所述機械手臂2的攝像機25對位於所述承載平臺4的標記物41拍攝照片,獲得包含所述標記物41的深度圖像和彩色圖像。 The photographing module 302 controls the camera 25 of the robotic arm 2 to take photos of the marker 41 located on the carrying platform 4 to obtain a depth image and a color image containing the marker 41.

如前面所述,位於所述承載平臺4的標記物41的四邊平行於該承載平臺4。如圖2所示。 As mentioned above, the four sides of the marker 41 on the carrying platform 4 are parallel to the carrying platform 4. as shown in picture 2.

需要說明的是,以下所提及的標記物41均指位於所述承載平臺4的標記物41,即不是指位於治具31上的目標物件40上的標記物41。 It should be noted that the markers 41 mentioned below all refer to the markers 41 on the carrying platform 4, that is, they do not refer to the markers 41 on the target object 40 on the jig 31.

所述執行模組301從所述標記物41的深度圖像獲取所述標記物41的四個角的深度值。 The execution module 301 obtains the depth values of the four corners of the marker 41 from the depth image of the marker 41.

例如,參閱圖2所示,所述執行模組301獲取到所述標記物41的四個角的深度值D11、D12、D13、D14。 For example, referring to FIG. 2, the execution module 301 obtains the depth values D11, D12, D13, and D14 of the four corners of the marker 41.

所述執行模組301基於所述標記物41的四個角的深度值計算得到所述標記物41的深度參照值Zrms。 The execution module 301 calculates the depth reference value Zrms of the marker 41 based on the depth values of the four corners of the marker 41.

本實施例中,所述執行模組301根據所述方均根演算法基於所述 標記物41的四個角的深度值計算得到所述標記物41的深度參照值Zrms。 In this embodiment, the execution module 301 is based on the root-mean-square algorithm based on the The depth values of the four corners of the marker 41 are calculated to obtain the depth reference value Zrms of the marker 41.

具體地,所述深度參照值Zrms計算公式為:

Figure 108148764-A0305-02-0017-6
Specifically, the formula for calculating the depth reference value Zrms is:
Figure 108148764-A0305-02-0017-6

其中,n表示所述標記物41的角的數目(即本實施例中n=4),x i 表示所述標記物41的每個角的深度值。 Wherein, n represents the number of corners of the marker 41 (that is, n=4 in this embodiment), and x i represents the depth value of each corner of the marker 41.

所述執行模組301基於所述標記物41的彩色圖像獲得所述標記物41的Z軸的座標值Zcv。 The execution module 301 obtains the coordinate value Zcv of the Z axis of the marker 41 based on the color image of the marker 41.

具體地,所述執行模組301可以利用OPENCV函數基於所述彩色圖像來計算獲得所述標記物41的Z軸的座標值Zcv。 Specifically, the execution module 301 may use the OPENCV function to calculate and obtain the coordinate value Zcv of the Z axis of the marker 41 based on the color image.

所述執行模組301判斷所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv是否都小於所述最大深度上限值Zmax。 The execution module 301 determines whether the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 are both smaller than the maximum depth upper limit Zmax.

當所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv中任意一者大於或者等於所述最大深度上限值Zmax時,執行模組301重新校準攝像機25或者發出提示,提示用戶重新校準所述攝像機25,然後由執行模組301根據機械手臂2的力感測器24所檢測到的夾具23在Z軸方向所受的壓力重新計算所述最大深度上限值Zmax。 When any one of the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 is greater than or equal to the maximum depth upper limit Zmax, the execution module 301 recalibrates the camera 25 or sends out Prompt, the user is prompted to recalibrate the camera 25, and then the execution module 301 recalculates the upper limit of the maximum depth based on the pressure of the clamp 23 in the Z-axis direction detected by the force sensor 24 of the robotic arm 2 Zmax.

具體地,所述重新校準攝像機25包括校準所述攝像機25的拍攝參數例如焦距等。 Specifically, the recalibration of the camera 25 includes calibrating the shooting parameters of the camera 25, such as the focal length.

當所述標記物41的深度參照值Zrms及所述標記物41的Z軸座標值Zcv都小於所述最大深度上限值Zmax時,執行模組301計算所述標記物41的深度參照值Zrms與所述標記物41的Z軸座標值Zcv之間的差值。當所述差值小於或者等於0時,將所述深度參照值Zrms作為所述標記物41的深度標準值;及當所述差值大於0時,將所述標記物41的Z軸座標值Zcv作為所述標記物41的深度標準值。 When the depth reference value Zrms of the marker 41 and the Z-axis coordinate value Zcv of the marker 41 are both less than the maximum depth upper limit Zmax, the execution module 301 calculates the depth reference value Zrms of the marker 41 The difference with the Z-axis coordinate value Zcv of the marker 41. When the difference is less than or equal to 0, use the depth reference value Zrms as the depth standard value of the marker 41; and when the difference is greater than 0, use the Z-axis coordinate value of the marker 41 Zcv is used as the standard value of the depth of the marker 41.

當所述標記物41貼在治具31上的目標物件40上時,執行模組301可以控制機械手臂2根據上述確定的所述標記物41的深度標準值抓取與所 述標記物41對應的目標物件40。 When the marker 41 is affixed to the target object 40 on the jig 31, the execution module 301 can control the robotic arm 2 to grab and hold the target object according to the depth standard value of the marker 41 determined above. The target object 40 corresponding to the marker 41.

根據上述記載可知,本發明實施例的所述的用於確定標記物的深度標準值的確定系統30,通過根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值,其中,以承載所述機械手臂的承載平臺的水平面建立XOY平面,以垂直於所述XOY平面所在方向為Z軸建立座標系O-XYZ;控制所述機械手臂的深度攝像機對位於所述承載平臺的標記物拍攝照片,獲得所述標記物的深度圖像和彩色圖像;基於所述標記物的深度圖像獲取到所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值,能夠在無需更改現有治具及環境的前提下,快速準確地確定標記物的深度值,進而使得機械手臂能夠根據所確定的標記物的深度值來找到目標物件的夾取位置。 According to the above description, the determination system 30 for determining the depth standard value of the marker according to the embodiment of the present invention calculates the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm. Obtain a maximum depth upper limit, where the XOY plane is established with the horizontal plane of the bearing platform carrying the robot arm, and the coordinate system O-XYZ is established with the Z axis as the direction perpendicular to the XOY plane; controlling the robot arm The depth camera takes photos of the marker on the bearing platform to obtain the depth image and color image of the marker; and obtains the depth values of the four corners of the marker based on the depth image of the marker ; The depth reference value of the marker is calculated based on the depth values of the four corners of the marker; the Z-axis coordinate value of the marker is obtained based on the color image; when the depth of the marker is referenced When the value and the Z-axis coordinate value of the marker are both less than the upper limit of the maximum depth, the difference between the depth reference value of the marker and the Z-axis coordinate value of the marker is calculated; when the When the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; and when the difference is greater than 0, the Z-axis coordinate value is used as the depth standard value of the marker , Can quickly and accurately determine the depth value of the marker without changing the existing jig and environment, so that the robotic arm can find the gripping position of the target object according to the determined depth value of the marker.

參閱圖5所示,為本發明較佳實施例提供的電腦裝置的結構示意圖。 Refer to FIG. 5, which is a schematic structural diagram of a computer device provided by a preferred embodiment of the present invention.

本發明的較佳實施例中,電腦裝置1包括互相之間電氣連接的儲存器51、至少一個處理器52。 In a preferred embodiment of the present invention, the computer device 1 includes a storage 51 and at least one processor 52 that are electrically connected to each other.

本領域技術人員應該瞭解,圖1示出的電腦裝置1的結構並不構成本發明實施例的限定,所述電腦裝置1還可以包括比圖示更多或更少的其他硬體或者軟體,或者不同的部件佈置。例如,所述電腦裝置1還可以包括顯示幕等部件。 Those skilled in the art should understand that the structure of the computer device 1 shown in FIG. 1 does not constitute a limitation of the embodiment of the present invention. The computer device 1 may also include more or less other hardware or software than shown in the figure. Or different component arrangements. For example, the computer device 1 may also include components such as a display screen.

在一些實施例中,所述電腦裝置1包括一種能夠按照事先設定或儲存的指令,自動進行數值計算和/或資訊處理的終端,其硬體包括但不限於微 處理器、專用積體電路、可程式設計閘陣列、數文書處理器及嵌入式設備等。 In some embodiments, the computer device 1 includes a terminal that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to micro Processors, dedicated integrated circuits, programmable gate arrays, digital word processors and embedded devices, etc.

需要說明的是,所述電腦裝置1僅為舉例,其他現有的或今後可能出現的電子產品如可適應於本發明,也應包含在本發明的保護範圍以內,並以引用方式包含於此。 It should be noted that the computer device 1 is only an example, and other existing or future electronic products that can be adapted to the present invention should also be included in the protection scope of the present invention and included here by reference.

在一些實施例中,所述儲存器51可以用於儲存電腦程式的程式碼和各種資料。例如,所述儲存器51可以用於儲存安裝在所述電腦裝置1中的確定系統30,並在電腦裝置1的運行過程中實現高速、自動地完成程式或資料的存取。所述儲存器51可以是包括唯讀儲存器(Read-Only Memory,ROM)、可程式設計唯讀儲存器(Programmable Read-Only Memory,PROM)、可抹除可程式設計唯讀儲存器(Erasable Programmable Read-Only Memory,EPROM)、一次可程式設計唯讀儲存器(One-time Programmable Read-Only Memory,OTPROM)、電子抹除式可複寫唯讀儲存器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、唯讀光碟(Compact Disc Read-Only Memory,CD-ROM)或其他光碟儲存器、磁碟儲存器、磁帶儲存器、或者任何其他能夠用於攜帶或儲存資料的電腦可讀的儲存介質。 In some embodiments, the storage 51 may be used to store program codes and various data of a computer program. For example, the storage 51 can be used to store the determination system 30 installed in the computer device 1 and realize high-speed and automatic access to programs or data during the operation of the computer device 1. The storage 51 may include a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable Read-Only Memory, PROM), and an erasable programmable read-only memory (Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory, EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable storage medium that can be used to carry or store data .

在一些實施例中,所述至少一個處理器52可以由積體電路組成。例如,可以由單個封裝的積體電路所組成,也可以是由多個相同功能或不同功能封裝的積體電路所組成,包括一個或者多個中央處理器(Central Processing unit,CPU)、微處理器、數文書處理晶片、圖形處理器及各種控制晶片的組合等。所述至少一個處理器52是所述電腦裝置1的控制核心(Control Unit),利用各種介面和線路連接整個電腦裝置1的各個部件,通過運行或執行儲存在所述儲存器51內的程式或者模組,以及調用儲存在所述儲存器51內的資料,以執行電腦裝置1的各種功能和處理資料。 In some embodiments, the at least one processor 52 may be composed of an integrated circuit. For example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple packaged integrated circuits with the same function or different functions, including one or more central processing units (CPU), micro-processing Combinations of processors, digital word processing chips, graphics processors, and various control chips. The at least one processor 52 is the control core (Control Unit) of the computer device 1, which uses various interfaces and lines to connect the various components of the entire computer device 1, by running or executing programs stored in the storage 51 or Modules and call data stored in the storage 51 to perform various functions of the computer device 1 and process data.

儘管未示出,所述電腦裝置1還可以包括給各個部件供電的電源(比如電池),優選的,電源可以通過電源管理裝置與所述至少一個處理器52邏輯相連,從而通過電源管理裝置實現管理充電、放電、以及功耗管理等功能。 電源還可以包括一個或一個以上的直流或交流電源、再充電裝置、電源故障檢測電路、電源轉換器或者逆變器、電源狀態指示器等任意元件。所述電腦裝置1還可以包括多種感測器、藍牙模組、Wi-Fi模組等,在此不再贅述。 Although not shown, the computer device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 52 through a power management device, so as to be realized by the power management device. Manage functions such as charging, discharging, and power management. The power supply may also include one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, power supply status indicators and other arbitrary components. The computer device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

應該瞭解,所述實施例僅為說明之用,在專利申請範圍上並不受此結構的限制。 It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.

上述以軟體功能模組的形式實現的集成的單元,可以儲存在一個電腦可讀取儲存介質中。上述軟體功能模組包括若干指令,該若干指令用以使得一台電腦裝置(可以車載電腦等)或處理器(processor)執行本發明各個實施例所述方法的部分。 The above-mentioned integrated unit realized in the form of a software function module can be stored in a computer readable storage medium. The above-mentioned software function module includes several instructions, which are used to make a computer device (can be a vehicle-mounted computer, etc.) or a processor execute part of the method described in each embodiment of the present invention.

在進一步的實施例中,結合圖4,所述至少一個處理器52可執行所述電腦裝置1的操作裝置以及安裝的各類應用程式(如確定系統30)等。 In a further embodiment, with reference to FIG. 4, the at least one processor 52 can execute the operating device of the computer device 1 and various installed applications (such as the determination system 30) and so on.

所述儲存器51中儲存有電腦程式代碼,且所述至少一個處理器52可調用所述儲存器51中儲存的電腦程式代碼以執行相關的功能。例如,圖5中所述的各個模組是儲存在所述儲存器51中的電腦程式代碼,並由所述至少一個處理器52所執行,從而實現所述各個模組的功能如確定標記物的深度值。 The storage 51 stores computer program codes, and the at least one processor 52 can call the computer program codes stored in the storage 51 to perform related functions. For example, the various modules described in FIG. 5 are computer program codes stored in the storage 51 and executed by the at least one processor 52, so as to realize the functions of the various modules, such as determining markers. The depth value.

在本發明的一個實施例中,所述儲存器51儲存多個指令,所述多個指令被所述至少一個處理器52所執行以確定標記物的深度值。 In an embodiment of the present invention, the storage 51 stores a plurality of instructions, and the plurality of instructions are executed by the at least one processor 52 to determine the depth value of the marker.

具體地,結合圖3所示,所述至少一個處理器52執行上述多個指令以確定標記物的深度值的方法包括:根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;控制所述機械手臂的攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像;從所述標記物的深度圖像獲取所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值; 基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;及當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值。 Specifically, as shown in FIG. 3, the method for the at least one processor 52 to execute the above-mentioned multiple instructions to determine the depth value of the marker includes: according to the position of the clamp in the Z-axis direction detected by the force sensor of the robotic arm. The pressure received is calculated to obtain a maximum depth upper limit; the camera of the robotic arm is controlled to take a photo of the marker to obtain a depth image and a color image containing the marker; to obtain the depth image of the marker Depth values of the four corners of the marker; calculating the depth reference value of the marker based on the depth values of the four corners of the marker; Obtain the Z-axis coordinate value of the marker based on the color image; when the depth reference value of the marker and the Z-axis coordinate value of the marker are both less than the maximum depth upper limit, calculate The difference between the depth reference value of the marker and the Z-axis coordinate value of the marker; when the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; And when the difference is greater than 0, the Z-axis coordinate value is used as the depth standard value of the marker.

優選地,該方法還包括:當所述標記物的深度參照值及所述標記物的Z軸座標值中任意一者大於或者等於所述最大深度上限值時,根據所述機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力重新計算所述最大深度上限值。 Preferably, the method further includes: when any one of the depth reference value of the marker and the Z-axis coordinate value of the marker is greater than or equal to the maximum depth upper limit, according to the force of the robot arm The pressure of the clamp in the Z-axis direction detected by the sensor recalculates the upper limit of the maximum depth.

優選地,所述根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值包括:將所述機械手臂的夾具設置在距離所述XOY平面為預設距離的位置;控制所述機械手臂帶動所述夾具勻速下移,同時利用所述力感測器檢測所述夾具在Z軸方向所受的壓力;當根據所述力感測器所檢測的所述夾具在Z軸方向所受的壓力確定所述夾具在Z軸方向所受的壓力的變化大於預設值時,讀取所述機械手臂的Z軸座標值;當讀取到N個所述機械手臂的Z軸座標值時,根據方均根演算法基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值。 Preferably, said calculating a maximum depth upper limit value according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm includes: setting the clamp of the robot arm at a distance from the XOY plane Is a preset distance position; controlling the robotic arm to drive the clamp to move down at a constant speed, and at the same time using the force sensor to detect the pressure of the clamp in the Z-axis direction; When the detected pressure of the clamp in the Z-axis direction determines that the change in the pressure of the clamp in the Z-axis direction is greater than the preset value, read the Z-axis coordinate value of the robot arm; when N is read When the Z-axis coordinate values of each of the robot arms are calculated, the maximum depth upper limit value is calculated based on the Z-axis coordinate values of the N robot arms according to a root-mean-square algorithm.

優選地,該方法根據方均根演算法基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值。 Preferably, the method calculates the depth reference value of the marker based on the depth values of the four corners of the marker according to the root-mean-square algorithm.

優選地,所述基於所述彩色圖像獲得所述標記物的Z軸的座標值包括:利用OPENCV函數基於所述彩色圖像獲得所述標記物的Z軸的座標值。 Preferably, the obtaining the coordinate value of the Z axis of the marker based on the color image includes: obtaining the coordinate value of the Z axis of the marker based on the color image by using an OPENCV function.

優選地,所述標記物位於所述承載平臺上且該標記物的四邊平行於該承載平臺。 Preferably, the marker is located on the carrying platform and the four sides of the marker are parallel to the carrying platform.

在本發明所提供的幾個實施例中,應該理解到,所揭露的電腦可讀儲存介質,裝置和方法,可以通過其它的方式實現。例如,以上所描述的裝置實施例僅僅是示意性的,例如,所述模組的劃分,僅僅為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。 In the several embodiments provided by the present invention, it should be understood that the disclosed computer-readable storage medium, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,作為模組顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。 The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple networks Unit. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.

另外,在本發明各個實施例中的各功能模組可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。 In addition, the functional modules in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized either in the form of hardware, or in the form of hardware plus software functional modules.

對於本領域技術人員而言,顯然本發明不限於上述示範性實施例的細節,而且在不背離本發明的精神或基本特徵的情況下,能夠以其他的具體形式實現本發明。因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本發明的範圍由所附申請專利範圍而不是上述說明限定,因此旨在將落在申請專利範圍的等同要件的含義和範圍內的所有變化涵括在本發明內。不應將申請專利範圍中的任何附圖標記視為限制所涉及的申請專利範圍。此外,顯然“包括”一詞不排除其他單元或,單數不排除複數。裝置申請專利範圍中陳述的多個單元或裝置也可以由一個單元或裝置通過軟體或者硬體來實現。第一,第二等詞語用來表示名稱,而並不表示任何特定的順序。 For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the scope of the attached patent application rather than the above description, and therefore it is intended to fall within the scope of the application. The meaning of the equivalent elements of the patent scope and all changes within the scope are included in the present invention. Any reference signs in the scope of the patent application should not be regarded as limiting the scope of the patent application involved. In addition, it is obvious that the word "including" does not exclude other elements or the singular number does not exclude the plural number. Multiple units or devices stated in the scope of the device patent application can also be implemented by one unit or device through software or hardware. Words such as first and second are used to denote names, but do not denote any specific order.

最後應說明的是,以上實施例僅用以說明本發明的技術方案而非限制,儘管參照較佳實施例對本發明進行了詳細說明,本領域的普通技術人員應當理解,可以對本發明的技術方案進行修改或等同替換,而不脫離本發明技 術方案的精神和範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than limiting. Although the present invention has been described in detail with reference to preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Make modifications or equivalent substitutions without departing from the technology of the present invention The spirit and scope of the surgical plan.

Claims (12)

一種確定標記物的深度標準值的方法,應用於電腦裝置,其中,該方法包括:根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;控制所述機械手臂的攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像,其中,所述標記物貼在目標物件上;從所述標記物的深度圖像獲取所述標記物的四個角的深度值;基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值;基於所述彩色圖像獲得所述標記物的Z軸的座標值;當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值;及控制所述機械手臂基於所述標記物的深度標準值抓取所述目標物件。 A method for determining the standard value of the depth of a marker, which is applied to a computer device, wherein the method includes: calculating a maximum depth limit based on the pressure of the clamp in the Z-axis direction detected by the force sensor of the robotic arm Value; control the camera of the robotic arm to take a photo of the marker to obtain a depth image and a color image containing the marker, wherein the marker is attached to the target object; from the depth map of the marker Image acquiring the depth values of the four corners of the marker; calculating the depth reference value of the marker based on the depth values of the four corners of the marker; obtaining the Z of the marker based on the color image Axis coordinate value; when the depth reference value of the marker and the Z-axis coordinate value of the marker are both less than the upper limit of the maximum depth, the depth reference value of the marker and the value of the marker are calculated The difference between the Z-axis coordinate values; when the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; when the difference is greater than 0, the Z The axis coordinate value is used as the depth standard value of the marker; and the robotic arm is controlled to grab the target object based on the depth standard value of the marker. 如請求項1所述的確定標記物的深度標準值的方法,其中,該方法還包括:當所述標記物的深度參照值及所述標記物的Z軸座標值中任意一者大於或者等於所述最大深度上限值時,根據所述機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力重新計算所述最大深度上限值。 The method for determining the depth standard value of a marker according to claim 1, wherein the method further includes: when any one of the depth reference value of the marker and the Z-axis coordinate value of the marker is greater than or equal to When the maximum depth upper limit is used, the maximum depth upper limit is recalculated according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm. 如請求項2所述的確定標記物的深度標準值的方法,其中,所述根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值包括: 將所述機械手臂的夾具設置在距離承載平臺之一預設距離的位置;控制所述機械手臂帶動所述夾具勻速下移,同時利用所述力感測器檢測所述夾具在Z軸方向所受的壓力;當根據所述力感測器所檢測的所述夾具在Z軸方向所受的壓力確定所述夾具在Z軸方向所受的壓力的變化大於預設值時,讀取所述機械手臂的Z軸座標值;當讀取到N個所述機械手臂的Z軸座標值時,根據方均根演算法基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值。 The method for determining the depth standard value of a marker according to claim 2, wherein the maximum depth upper limit value is calculated according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm include: Set the gripper of the robotic arm at a preset distance from one of the load-bearing platforms; control the robotic arm to drive the gripper to move down at a constant speed, and at the same time, use the force sensor to detect the movement of the gripper in the Z-axis direction. When the pressure of the clamp in the Z-axis direction determined by the force sensor detects that the change in the pressure of the clamp in the Z-axis direction is greater than a preset value, read the The Z-axis coordinate value of the robot arm; when the Z-axis coordinate values of the N robot arms are read, the maximum depth upper limit is calculated based on the Z-axis coordinate values of the N robot arms according to the root-mean-square algorithm . 如請求項1所述的確定標記物的深度標準值的方法,其中,該方法根據方均根演算法基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值。 The method for determining the depth standard value of a marker according to claim 1, wherein the method calculates the depth reference value of the marker based on the depth values of the four corners of the marker according to a root-mean-square algorithm. 如請求項1所述的確定標記物的深度標準值的方法,其中,所述基於所述彩色圖像獲得所述標記物的Z軸的座標值包括:利用OPENCV函數基於所述彩色圖像獲得所述標記物的Z軸的座標值。 The method for determining the depth standard value of a marker according to claim 1, wherein the obtaining the Z-axis coordinate value of the marker based on the color image includes: obtaining the coordinate value of the marker based on the color image by using an OPENCV function The coordinate value of the Z axis of the marker. 如請求項1所述的確定標記物的深度標準值的方法,其中,所述標記物位於承載平臺上且該標記物的四邊平行於該承載平臺。 The method for determining the depth standard value of a marker according to claim 1, wherein the marker is located on a carrying platform and four sides of the marker are parallel to the carrying platform. 一種電腦裝置,其中,所述電腦裝置包括儲存器和處理器,所述儲存器用於儲存多個模組,所述處理器用於執行所述多個模組,其中,所述多個模組包括:執行模組,用於根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值;拍攝模組,用於控制所述機械手臂的攝像機對標記物拍攝照片,獲得包含所述標記物的深度圖像和彩色圖像,其中,所述標記物貼在目標物件上;所述執行模組,還用於從所述標記物的深度圖像獲取所述標記物的四個角的深度值;所述執行模組,還用於基於所述標記物的四個角的深度值計算得到所述標 記物的深度參照值;所述執行模組,還用於基於所述彩色圖像獲得所述標記物的Z軸的座標值;所述執行模組,還用於當所述標記物的深度參照值及所述標記物的Z軸座標值都小於所述最大深度上限值時,計算所述標記物的深度參照值與所述標記物的Z軸座標值之間的差值;所述執行模組,還用於當所述差值小於或者等於0時,將所述深度參照值作為所述標記物的深度標準值;所述執行模組,還用於當所述差值大於0時,將所述Z軸座標值作為所述標記物的深度標準值;及所述執行模組,還用於控制所述機械手臂基於所述標記物的深度標準值抓取所述目標物件。 A computer device, wherein the computer device includes a memory and a processor, the memory is used to store a plurality of modules, and the processor is used to execute the plurality of modules, wherein the plurality of modules include : Execution module, used to calculate a maximum depth limit based on the pressure of the fixture in the Z-axis direction detected by the force sensor of the robotic arm; shooting module, used to control the camera of the robotic arm Take a picture of the marker to obtain a depth image and a color image containing the marker, wherein the marker is attached to the target object; the execution module is also used to obtain the depth image of the marker Image acquisition of the depth values of the four corners of the marker; the execution module is also used to calculate the depth values of the four corners of the marker to obtain the marker The depth reference value of the marker; the execution module is also used to obtain the Z-axis coordinate value of the marker based on the color image; the execution module is also used to calculate the depth of the marker When the reference value and the Z-axis coordinate value of the marker are both less than the upper limit of the maximum depth, the difference between the depth reference value of the marker and the Z-axis coordinate value of the marker is calculated; The execution module is also used for when the difference is less than or equal to 0, the depth reference value is used as the depth standard value of the marker; the execution module is also used for when the difference is greater than 0 When the Z-axis coordinate value is used as the standard depth value of the marker; and the execution module is also used to control the robotic arm to grab the target object based on the standard depth value of the marker. 如請求項7所述的電腦裝置,其中,所述執行模組,還用於:當所述標記物的深度參照值及所述標記物的Z軸座標值中任意一者大於或者等於所述最大深度上限值時,根據所述機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力重新計算所述最大深度上限值。 The computer device according to claim 7, wherein the execution module is further used for: when any one of the depth reference value of the marker and the Z-axis coordinate value of the marker is greater than or equal to the When the maximum depth upper limit is used, the maximum depth upper limit is recalculated according to the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm. 如請求項8所述的電腦裝置,其中,所述根據機械手臂的力感測器所檢測到的夾具在Z軸方向所受的壓力計算得到一個最大深度上限值包括:將所述機械手臂的夾具設置在距離承載平臺之一預設距離的位置;控制所述機械手臂帶動所述夾具勻速下移,同時利用所述力感測器檢測所述夾具在Z軸方向所受的壓力;當根據所述力感測器所檢測的所述夾具在Z軸方向所受的壓力確定所述夾具在Z軸方向所受的壓力的變化大於預設值時,讀取所述機械手臂的Z軸座標值;當讀取到N個所述機械手臂的Z軸座標值時,根據方均根演算法基於該N個所述機械手臂的Z軸座標值計算所述最大深度上限值。 The computer device according to claim 8, wherein the calculation of a maximum depth upper limit value based on the pressure of the clamp in the Z-axis direction detected by the force sensor of the robot arm includes: The clamp is set at a preset distance from one of the load-bearing platforms; the robot arm is controlled to drive the clamp to move down at a constant speed, and the force sensor is used to detect the pressure of the clamp in the Z-axis direction; when When it is determined according to the pressure of the clamp in the Z-axis direction detected by the force sensor that the change in the pressure of the clamp in the Z-axis direction is greater than a preset value, read the Z-axis of the robot arm Coordinate value; when the Z-axis coordinate values of the N robot arms are read, the maximum depth upper limit is calculated based on the Z-axis coordinate values of the N robot arms according to the root-mean-square algorithm. 如請求項7所述的電腦裝置,其中,所述執行模組根據方均根演算法基於所述標記物的四個角的深度值計算得到所述標記物的深度參照值。 The computer device according to claim 7, wherein the execution module calculates the depth reference value of the marker based on the depth values of the four corners of the marker according to a root-mean-square algorithm. 如請求項7所述的電腦裝置,其中,所述基於所述彩色圖像獲得所述標記物的Z軸的座標值包括:利用OPENCV函數基於所述彩色圖像獲得所述標記物的Z軸的座標值。 The computer device according to claim 7, wherein the obtaining the coordinate value of the Z-axis of the marker based on the color image comprises: obtaining the Z-axis of the marker based on the color image by using an OPENCV function The coordinate value. 如請求項7所述的電腦裝置,其中,所述標記物位於承載平臺上且該標記物的四邊平行於該承載平臺。 The computer device according to claim 7, wherein the marker is located on a carrying platform and four sides of the marker are parallel to the carrying platform.
TW108148764A 2019-12-31 2019-12-31 Computer device and method for determining depth standard value of marker TWI730575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108148764A TWI730575B (en) 2019-12-31 2019-12-31 Computer device and method for determining depth standard value of marker

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108148764A TWI730575B (en) 2019-12-31 2019-12-31 Computer device and method for determining depth standard value of marker

Publications (2)

Publication Number Publication Date
TWI730575B true TWI730575B (en) 2021-06-11
TW202127377A TW202127377A (en) 2021-07-16

Family

ID=77517252

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108148764A TWI730575B (en) 2019-12-31 2019-12-31 Computer device and method for determining depth standard value of marker

Country Status (1)

Country Link
TW (1) TWI730575B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201622916A (en) * 2014-12-26 2016-07-01 國立交通大學 Robot and control method thereof
CN106272424A (en) * 2016-09-07 2017-01-04 华中科技大学 A kind of industrial robot grasping means based on monocular camera and three-dimensional force sensor
CN106826815A (en) * 2016-12-21 2017-06-13 江苏物联网研究发展中心 Target object method of the identification with positioning based on coloured image and depth image
US20190248002A1 (en) * 2017-02-06 2019-08-15 Cobalt Robotics Inc. Robot with rotatable arm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201622916A (en) * 2014-12-26 2016-07-01 國立交通大學 Robot and control method thereof
CN106272424A (en) * 2016-09-07 2017-01-04 华中科技大学 A kind of industrial robot grasping means based on monocular camera and three-dimensional force sensor
CN106826815A (en) * 2016-12-21 2017-06-13 江苏物联网研究发展中心 Target object method of the identification with positioning based on coloured image and depth image
US20190248002A1 (en) * 2017-02-06 2019-08-15 Cobalt Robotics Inc. Robot with rotatable arm

Also Published As

Publication number Publication date
TW202127377A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
KR101636605B1 (en) System and method for calibration of machine vision cameras along at least three discrete planes
WO2019176829A1 (en) Workpiece picking device and workpiece picking method
WO2022052404A1 (en) Memory alignment and insertion method and system based on machine vision, device, and storage medium
JP2020011339A (en) Robot system control method and robot system
US20180297198A1 (en) Teaching point correcting method, program, recording medium, robot apparatus, imaging point creating method, and imaging point creating apparatus
CN112621743B (en) Robot, hand-eye calibration method for fixing camera at tail end of robot and storage medium
CN113119103B (en) Method and computer device for determining depth standard value of marker
TW200402117A (en) Carriage robot system and controlling method thereof
JP2016078195A (en) Robot system, robot, control device and control method of robot
WO2018209592A1 (en) Movement control method for robot, robot and controller
CN116759358A (en) Wafer edge alignment method and system
TWI730575B (en) Computer device and method for determining depth standard value of marker
TWI709468B (en) Computer device and method for determinig coordinates for mechanical arm
JP2017512120A (en) Calibration method for viscous fluid dispensing system
CN110842917B (en) Method for calibrating mechanical parameters of series-parallel connection machinery, electronic device and storage medium
CN113628284B (en) Pose calibration data set generation method, device and system, electronic equipment and medium
CN112775955B (en) Mechanical arm coordinate determination method and computer device
US11577400B2 (en) Method and apparatus for managing robot system
JP2008166410A (en) Positioning calibration method, and mounting device applying the same
CN115990890B (en) Calibration method and device for manipulator, computer equipment and storage medium
TW202327418A (en) Optical positioning and depaneling system and circuit board manufacturing method
JP2014179559A (en) Recipe selection method and die bonder
CN115415677B (en) Laser marking method, laser marking apparatus, laser marking control system, and computer-readable storage medium
TW202009781A (en) Object positioning guidance system and method thereof
CN116423525B (en) Automatic hand-eye calibration method and system and storage medium