TW202238530A - Image processing method and electronic device using the same - Google Patents

Image processing method and electronic device using the same Download PDF

Info

Publication number
TW202238530A
TW202238530A TW110110837A TW110110837A TW202238530A TW 202238530 A TW202238530 A TW 202238530A TW 110110837 A TW110110837 A TW 110110837A TW 110110837 A TW110110837 A TW 110110837A TW 202238530 A TW202238530 A TW 202238530A
Authority
TW
Taiwan
Prior art keywords
points
wall
unreliable
point cloud
line segment
Prior art date
Application number
TW110110837A
Other languages
Chinese (zh)
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 TW110110837A priority Critical patent/TW202238530A/en
Publication of TW202238530A publication Critical patent/TW202238530A/en

Links

Images

Abstract

An image processing method includes the following steps. Firstly, a three-dimensional point cloud image is captured, wherein the three-dimensional point cloud image includes several pixels. Then, the pixels are distinguished into several reliable points and several unreliable points. Then, from these reliable points, several straight lines are determined, wherein each straight line passes through two of the reliable points. Then, selected one of the straight line is used as a wall line segment. Then, the unreliable points are moved to the wall line segment.

Description

影像處理方法及應用其之電子裝置Image processing method and electronic device using same

本發明是有關於一種處理方法及應用其之電子裝置,且特別是有關於一種影像處理方法及應用其之電子裝置。The present invention relates to a processing method and an electronic device using it, and in particular to an image processing method and an electronic device using it.

多路徑干擾(Multipath Interference, MPI)是飛時測距(Time of Flight, ToF)攝像器的先天特性,其是指ToF攝像器所發出的偵測訊號受到障礙物的多重反射所造成的干擾,此現象造成ToF攝像器所測深度不正確。例如,在多路徑干擾下,對於實際上平直的牆面會得到彎曲牆面的偵測結果。因此,如何改善預防多路徑干擾是本技術領域業者重要的議題。Multipath Interference (MPI) is an innate characteristic of Time of Flight (ToF) cameras. It refers to the interference caused by multiple reflections of obstacles on the detection signal sent by ToF cameras. This phenomenon causes the depth measured by the ToF camera to be incorrect. For example, under multi-path interference, the detection result of a curved wall will be obtained for an actually straight wall. Therefore, how to improve the prevention of multipath interference is an important issue for those in the technical field.

因此,本發明提出一種影像處理方法及應用其之電子裝置,可改善習知問題。Therefore, the present invention proposes an image processing method and an electronic device using the same, which can improve the conventional problems.

本發明一實施例提出一種影像處理方法。影像處理方法包括以下步驟。擷取一三維點雲圖,三維點雲圖包含數個像素點;區分此些像素點為數個可靠點及複數個不可靠點;從此些可靠點中,決定數條直線段,其中各直線段通過此些可靠點之二者;以此些直線段之一所選者做為一牆面線段;以及,將此些不可靠點移至牆面線段。An embodiment of the invention provides an image processing method. The image processing method includes the following steps. Extract a 3D point cloud image, the 3D point cloud image contains several pixel points; distinguish these pixel points into several reliable points and plural unreliable points; from these reliable points, determine several straight line segments, wherein each straight line segment passes through this Two of these reliable points; one of these straight line segments is selected as a wall line segment; and these unreliable points are moved to the wall line segment.

本發明另一實施例提出一種電子裝置。電子裝置包括攝像器及處理器。攝像器用以擷取一三維點雲圖,三維點雲圖包含數個像素點。處理器用以:區分此些像素點為數個可靠點及複數個不可靠點;從此些可靠點中,決定數條直線段,其中各直線段通過此些可靠點之二者;以此些直線段之一所選者做為一牆面線段;以及,將此些不可靠點移至牆面線段。Another embodiment of the invention provides an electronic device. The electronic device includes a camera and a processor. The camera is used to capture a 3D point cloud image, and the 3D point cloud image includes several pixels. The processor is used to: distinguish these pixel points as several reliable points and plural unreliable points; from these reliable points, determine several straight line segments, wherein each straight line segment passes through these two reliable points; One of the selected ones is used as a wall line segment; and, these unreliable points are moved to the wall line segment.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to have a better understanding of the above-mentioned and other aspects of the present invention, the following specific examples are given in detail with the accompanying drawings as follows:

請參照第1及2A~2E圖,第1圖繪示依照本發明一實施例之電子裝置100的示意圖,而第2A~2E圖繪示第1圖之電子裝置100的影像處理方法的過程圖,其中第2A圖繪示第1圖之電子裝置100之攝像器110所擷取之三維點雲圖M1的示意圖,而第2B~2E圖繪示第2A圖之三維點雲圖M1之二維點雲圖M2的示意圖。Please refer to Figures 1 and 2A~2E, Figure 1 shows a schematic diagram of an electronic device 100 according to an embodiment of the present invention, and Figures 2A~2E show a process diagram of the image processing method of the electronic device 100 in Figure 1 , wherein Figure 2A shows a schematic diagram of the three-dimensional point cloud image M1 captured by the camera 110 of the electronic device 100 in Figure 1, and Figures 2B-2E show the two-dimensional point cloud image of the three-dimensional point cloud image M1 in Figure 2A Schematic of M2.

電子裝置100例如是掃地機器人。電子裝置100可偵測前方障礙物(如,牆面)的邊界,以在移動過程中避開此障礙物。The electronic device 100 is, for example, a cleaning robot. The electronic device 100 can detect the boundary of an obstacle (eg, a wall) ahead, so as to avoid the obstacle during the movement.

電子裝置100包括攝像器110及處理器(processor)120。攝像器110用以:擷取一三維點雲圖M1 (如第2A圖所示),三維點雲圖M1包含數個像素點P1(如第2A圖所示)。處理器120用以:(1). 區分此些像素點P1為數個可靠點P21及數個不可靠點P22 (可靠點P21及不可靠點P22繪示於第2C圖);(2).從此些可靠點P21中,決定數條直線段L1 (如第2C圖所示),其中各直線段L1通過此些可靠點P21之二者;(3). 以此些直線段L1之一所選者做為一牆面線段(如第2C圖所示之L21~L23);(4). 將此些不可靠點P22移至牆面線段。如此,電子裝置100可改善多路徑干擾所導致的問題,即,電子裝置100可取得接近實際平直牆面的偵測結果。The electronic device 100 includes a camera 110 and a processor 120 . The camera 110 is used to: capture a 3D point cloud image M1 (as shown in FIG. 2A ), and the 3D point cloud image M1 includes several pixel points P1 (as shown in FIG. 2A ). The processor 120 is used to: (1). Distinguish these pixel points P1 into several reliable points P21 and several unreliable points P22 (reliable points P21 and unreliable points P22 are shown in FIG. 2C); (2). From then on Among these reliable points P21, determine a number of straight line segments L1 (as shown in Figure 2C), wherein each straight line segment L1 passes through both of these reliable points P21; (3). Select one of these straight line segments L1 Or as a wall line segment (L21~L23 shown in Figure 2C); (4). Move these unreliable points P22 to the wall line segment. In this way, the electronic device 100 can improve the problem caused by multipath interference, that is, the electronic device 100 can obtain a detection result close to an actual straight wall.

攝像器110例如是ToF攝像器。三維點雲圖M1可採用ToF偵測技術取得。攝像器110可於不同數個時點或連續數個時點持續擷取數張三維點雲圖M1,攝像器110可對每一張點雲圖M1執行本文所述之影像處理流程。處理器120例如是採用半導體製程所形成的實體電路(circuit)。The camera 110 is, for example, a ToF camera. The 3D point cloud image M1 can be obtained using ToF detection technology. The camera 110 can continuously capture several 3D point cloud images M1 at different or consecutive time points, and the camera 110 can execute the image processing procedure described herein for each point cloud image M1. The processor 120 is, for example, a physical circuit (circuit) formed by semiconductor manufacturing process.

請參照第3圖,其繪示第1圖之電子裝置100的影像處理方法的流程圖。Please refer to FIG. 3 , which shows a flow chart of the image processing method of the electronic device 100 in FIG. 1 .

在步驟S110中,如第2A圖所示,攝像器110擷取三維點雲圖M1,三維點雲圖M1包含數個像素點P1。各像素點P1具有一座標(未繪示),其座標值例如是相對於圖示的x-y-z座標系定義。z軸例如是攝像器110的前方方向,x-y平面例如示垂直於z軸,x-z平面例如是電子裝置100的移動平面。In step S110 , as shown in FIG. 2A , the camera 110 captures a 3D point cloud image M1 , and the 3D point cloud image M1 includes several pixel points P1 . Each pixel point P1 has a coordinate (not shown), and its coordinate value is, for example, defined relative to the illustrated x-y-z coordinate system. The z-axis is, for example, the front direction of the camera 110 , the x-y plane is, for example, perpendicular to the z-axis, and the x-z plane is, for example, the moving plane of the electronic device 100 .

在步驟S120中,如第2B圖所示,處理器120將三維點雲圖M1的此些像素點P1轉換至二維點雲圖M2。二維點雲圖M2包含數個像素點P2,其中三維點雲圖M1之各像素點P1皆轉換至二維點雲圖M2的對應之像素點P2。此外,二維點雲圖M2之數個像素點P2的數量與三維點雲圖M1之數個像素點P1的數量大致上相同。在二維點雲圖M2中,各像素點P1的y座標值例如是0。在一實施例中,處理器120可將三維點雲圖M1的此些像素點P1透過一轉換矩陣RT,轉換成二維點雲圖M2。此轉換矩陣RT可採用任何合適之數學方法取得,本發明實施例不加以限定。In step S120 , as shown in FIG. 2B , the processor 120 converts the pixels P1 of the 3D point cloud image M1 into a 2D point cloud image M2 . The 2D point cloud image M2 includes several pixel points P2, wherein each pixel point P1 of the 3D point cloud image M1 is converted to the corresponding pixel point P2 of the 2D point cloud image M2. In addition, the number of pixels P2 in the 2D point cloud image M2 is substantially the same as the number of pixels P1 in the 3D point cloud image M1 . In the two-dimensional point cloud image M2, the y-coordinate value of each pixel point P1 is, for example, 0. In one embodiment, the processor 120 can convert the pixel points P1 of the 3D point cloud image M1 into a 2D point cloud image M2 through a transformation matrix RT. The conversion matrix RT can be obtained by any suitable mathematical method, which is not limited in the embodiment of the present invention.

在步驟S130中,如第2C圖所示,處理器120區分二維點雲圖M2之所有像素點P2為數個可靠點P21及數個不可靠點P22。所謂的「可靠點」指的是未受多路徑干擾或可忽略所受多路徑干擾所產生的像素點(屬於牆面的機率大),而「不可靠點」指的是受到多路徑干擾所產生的像素點(屬於牆面的機率小)。在一實施例中,處理器120可先從所有像素點P2中判斷出不可靠點,其餘像素點P2則可歸為可靠點。在一實施例中,攝像器110可發出二不同頻率的偵測光,並依據二偵測光自障礙物(如,牆面)反射之二反射光取得二張點雲圖,並比較二張點雲圖的對應之像素點,據以區分或判斷對應之像素點屬於可靠點或不可靠點。然,只要是能判斷及/或分析二維點雲圖M2之像素點P2受多路徑干擾程度即可,本發明實施例不限定區分可靠點及不可靠點的具體技術。各像素點P2除了具有座標值(如x及z的座標值)外,也具有一可靠度屬性,其記錄像素點P2屬於「不可靠度」或「可靠度」。In step S130 , as shown in FIG. 2C , the processor 120 distinguishes all pixel points P2 of the two-dimensional point cloud image M2 into several reliable points P21 and several unreliable points P22 . The so-called "reliable points" refer to pixels that are not affected by multipath interference or can be ignored (the probability of belonging to the wall is high), while "unreliable points" refer to pixels that are affected by multipath interference. The generated pixels (the probability of belonging to the wall is small). In one embodiment, the processor 120 may first determine unreliable points from all the pixel points P2, and the rest of the pixel points P2 may be classified as reliable points. In one embodiment, the camera 110 can emit two detection lights of different frequencies, and obtain two point cloud images according to the two reflection lights reflected by the two detection lights from obstacles (such as walls), and compare the two point cloud images. The corresponding pixel points of the cloud image are used to distinguish or judge whether the corresponding pixel points are reliable points or unreliable points. However, as long as it can determine and/or analyze the multipath interference degree of the pixel point P2 of the two-dimensional point cloud image M2, the embodiment of the present invention does not limit the specific technology for distinguishing reliable points and unreliable points. In addition to having coordinate values (such as coordinate values of x and z), each pixel point P2 also has a reliability attribute, and the recorded pixel point P2 belongs to "unreliability" or "reliability".

在步驟S140中,如第2C圖所示,從此些可靠點P21中,處理器120決定二維點雲圖M2之數條直線段L1,其中各直線段L1通過此些可靠點P21之至少二者。處理器120例如是以直線方程式表示直線段L1,因此第2C圖之直線段L1以無限延伸形式表示。在一實施例中,處理器120可採用如是霍夫變換(hough transform)技術,從此些可靠點P21中,決定數條直線段L1。In step S140, as shown in FIG. 2C, from these reliable points P21, the processor 120 determines several straight line segments L1 of the two-dimensional point cloud image M2, wherein each straight line segment L1 passes through at least two of these reliable points P21 . The processor 120 expresses the straight line segment L1 by, for example, a straight line equation, so the straight line segment L1 in FIG. 2C is expressed in an infinitely extended form. In one embodiment, the processor 120 may use the hough transform technique to determine several straight line segments L1 from the reliable points P21.

在步驟S150中,如第2C圖所示,處理器120以此些直線段L1之所選者做為一牆面線段。在本實施例中,處理器120以此些直線段L1之三個所選者做為三條牆面線段L21、L22及L23。本發明實施例不限制牆面線段的數量,視實際環境之牆面數而定,處理器120可從此些直線段L1中決定三個以下或三個以上的牆面線段。In step S150 , as shown in FIG. 2C , the processor 120 uses the selected one of the straight line segments L1 as a wall line segment. In this embodiment, the processor 120 uses three selected ones of the straight line segments L1 as three wall line segments L21 , L22 and L23 . The embodiment of the present invention does not limit the number of wall line segments. Depending on the number of wall surfaces in the actual environment, the processor 120 may determine less than three or more than three wall line segments from the straight line segments L1.

以下係說明選擇(或決定)牆面線段的數種方法之一。The following is one of several methods for selecting (or determining) wall line segments.

在一實施例中,如第2C圖所示,各直線段L1具有一長度S1。處理器120更用以:(1). 於判斷各直線段L1之長度S1是否大於一預設長度值;(2). 若長度S1大於預設長度值,以其長度大於預設長度值之直線段L1做為牆面線段。舉例來說,其中一直線段L1之長度S1大於預設長度值,則將此直線段L1設為牆面線段L21。其餘牆面線段L22~L23的決定方式同牆面線段L21的決定方式,容此不再贅述。各直線段L1之長度S1例如是其通過之至少二可靠點P21之間的長度S1,其中的二可靠點P21例如是直線段L1通過的所有可靠點P21中最二端的二可靠點,然本發明實施例不受此限。本發明實施例不限定「預設長度值」的數值範圍,其可以視電子裝置100所擷取之三維點雲圖M1的畫面內容而定。在一實施例中,「預設長度值」例如是可以被判斷為牆面的臨界數值,如10公分~2公尺之間的任意整數,然亦可小於10公分或大於2公尺。In one embodiment, as shown in FIG. 2C , each straight line segment L1 has a length S1 . The processor 120 is further used to: (1). Determine whether the length S1 of each straight line segment L1 is greater than a preset length value; (2). If the length S1 is greater than the preset length value, the The straight line segment L1 is used as the wall line segment. For example, where the length S1 of the straight line segment L1 is greater than the preset length value, the straight line segment L1 is set as the wall line segment L21. The determination method of the other wall line segments L22-L23 is the same as the determination method of the wall line segment L21, which will not be repeated here. The length S1 of each straight line segment L1 is, for example, the length S1 between at least two reliable points P21 that it passes through, and the two reliable points P21 are, for example, the two most reliable points at the two ends of all the reliable points P21 that the straight line segment L1 passes through. Embodiments of the invention are not limited thereto. The embodiment of the present invention does not limit the value range of the "preset length value", which may depend on the frame content of the 3D point cloud image M1 captured by the electronic device 100 . In one embodiment, the "preset length value" is, for example, a critical value that can be judged as a wall surface, such as any integer between 10 cm and 2 meters, but it can also be less than 10 cm or greater than 2 meters.

在步驟S160中,如第2D圖所示,處理器120將此些不可靠點P22移至牆面線段。例如,處理器120改寫不可靠點P22的座標值,使不可靠點P22的座標值符合牆面線段的方程式。In step S160 , as shown in FIG. 2D , the processor 120 moves the unreliable points P22 to the wall line segment. For example, the processor 120 rewrites the coordinate value of the unreliable point P22 so that the coordinate value of the unreliable point P22 conforms to the equation of the wall line segment.

在一實施例中,如第2D圖所示,處理器120更用以:(1). 取得此些不可靠點P22之一者與各牆面線段L21~L23之間的距離H1~H3;(2). 將此些不可靠點P22之此者移至此些距離H1~H3中之一最小者所對應之牆面線段。以不可靠點P22’ 舉例來說,不可靠點P22’ 與三個牆面線段L21~L23之間的距離分別距離H1~H3,其中距離H2為最小者,因此處理器120將不可靠點P22’ 移至該最小者(如,距離H2)所對應之牆面線段L22。不可靠點的移動路徑例如是沿前述距離的方向。然,只要不可靠點能移動至牆面線段即可,本發明實施例不限制不可靠點的移動路徑。In one embodiment, as shown in FIG. 2D, the processor 120 is further used to: (1). Obtain the distances H1-H3 between one of the unreliable points P22 and each wall line segment L21-L23; (2). Move this one of these unreliable points P22 to the wall line segment corresponding to the smallest one of these distances H1~H3. Taking the unreliable point P22' as an example, the distances between the unreliable point P22' and the three wall line segments L21-L23 are respectively H1-H3, wherein the distance H2 is the smallest, so the processor 120 will determine the unreliable point P22 'Move to the wall line segment L22 corresponding to the minimum (for example, distance H2). The moving path of the unreliable point is, for example, along the direction of the aforementioned distance. However, as long as the unreliable point can move to the wall line segment, the embodiment of the present invention does not limit the moving path of the unreliable point.

此外,各距離H1~H3例如是此些不可靠點P22之該者與對應之牆面線段的最短距離,如垂直距離。以不可靠點P22’舉例來說,距離H1為不可靠點P22’與牆面線段L21的最短距離,距離H2為不可靠點P22’與牆面線段L22的最短距離,而距離H3為不可靠點P22’與牆面線段L23的最短距離。In addition, each of the distances H1 - H3 is, for example, the shortest distance between one of the unreliable points P22 and the corresponding wall line segment, such as the vertical distance. Taking the unreliable point P22' as an example, the distance H1 is the shortest distance between the unreliable point P22' and the wall line segment L21, the distance H2 is the shortest distance between the unreliable point P22' and the wall line segment L22, and the distance H3 is the unreliable The shortest distance between point P22' and wall line segment L23.

此外,處理器120用以:此用前述相同方式(不可靠點P22’ 移至對應之牆面線段的方式),將所有不可靠點P22的至少一者移至對應之牆面線段。在一實施例中,當一不可靠點(如,不可靠點P22’’)相距數個牆面線段的數個距離的最小者仍大於一預設值時,表示此不可靠點不屬於任何牆面線段,處理器120可不將此不可靠點P22’’移至牆面線段。在另一實施例中,若牆面線段的數量只有一個,處理器120可將所有不可靠點P22的至少一者移至該一個牆面線段,可不需額外計算距離。另外,對於非位於牆面線段的可靠點P21(即,牆面線段未通過之可靠點P21),也可採用相同方法移至對應之牆面線段,然亦可不移至對應之牆面線段。In addition, the processor 120 is used to: move at least one of all the unreliable points P22 to the corresponding wall line segment in the same manner as described above (the method of moving the unreliable point P22' to the corresponding wall line segment). In one embodiment, when the minimum of several distances between an unreliable point (for example, unreliable point P22'') and several wall line segments is still greater than a preset value, it means that this unreliable point does not belong to any For the wall line segment, the processor 120 may not move the unreliable point P22 ″ to the wall line segment. In another embodiment, if there is only one wall line segment, the processor 120 may move at least one of all unreliable points P22 to the one wall line segment without additional distance calculation. In addition, for the reliable point P21 that is not located on the wall line segment (that is, the reliable point P21 that the wall line segment does not pass through), the same method can also be used to move to the corresponding wall line segment, but it is not necessary to move to the corresponding wall line segment.

如第2E圖所示,處理器120在將可靠點P21及不可靠點P22移至對應之牆面線段後,可取得二維點雲圖M2’,其包含牆面線段L21~L23及數個位於牆面線段L21~L23的像素點。此外,二維點雲圖M2’也可只包含(顯示)牆面線段L21~L23,而不包含(不顯示)所有可靠點P21與不可靠點P22的至少一者。As shown in FIG. 2E, after the processor 120 moves the reliable point P21 and the unreliable point P22 to the corresponding wall line segments, it can obtain a two-dimensional point cloud image M2', which includes wall line segments L21~L23 and several points located at The pixel points of the wall line segment L21~L23. In addition, the two-dimensional point cloud map M2' may also only include (display) the wall line segments L21~L23, but not include (not display) at least one of all reliable points P21 and unreliable points P22.

前述實施例之影像處理方法之步驟S130~S160係於二維點雲圖M2完成,然在另一實施例中,步驟S160亦可於三維點雲圖M1完成。以下係以第4A~4B圖舉例說明。Steps S130-S160 of the image processing method in the aforementioned embodiments are completed on the 2D point cloud image M2, but in another embodiment, step S160 can also be completed on the 3D point cloud image M1. The following is an example of Figures 4A~4B.

請參照第4A~4B及5圖,第4A圖繪示第2C圖之牆面線段L21~L23轉換成三維點雲圖M1之牆面平面W1~W3的示意圖,第4B圖繪示第4A圖之不可靠點P22移至對應之牆面平面W1~W3的示意圖,而第5圖繪示第1圖之電子裝置100之另一種影像處理方法的流程圖。Please refer to Figures 4A~4B and 5. Figure 4A shows the schematic diagram of the wall line segment L21~L23 in Figure 2C converted into the wall plane W1~W3 of the 3D point cloud image M1, and Figure 4B shows the schematic diagram of Figure 4A. A schematic diagram of moving the unreliable point P22 to the corresponding wall planes W1 - W3 , and FIG. 5 shows a flow chart of another image processing method of the electronic device 100 in FIG. 1 .

本實施例之電子裝置100的影像處理方法包含步驟S110~S150及S260~S280,其中步驟S110~S150已於前述,於此不再贅述,以下從步驟S260開始說明。The image processing method of the electronic device 100 in this embodiment includes steps S110-S150 and S260-S280, wherein the steps S110-S150 have been described above, and will not be repeated here, and the description starts from step S260.

在步驟S260中,如第4A圖所示,處理器120 將此些牆面線段L21~L23從二維點雲圖M2轉換成三維點雲圖M1之數個牆面平面W1~W3。牆面平面例如是垂直於二維點雲圖M2之數個像素點P2所座落的平面,即,第4A圖之牆面平面W1~W3垂直於二維點雲圖M2之x-z平面。In step S260 , as shown in FIG. 4A , the processor 120 converts the wall line segments L21 ˜ L23 from the 2D point cloud image M2 into several wall planes W1 ˜ W3 of the 3D point cloud image M1 . The wall plane is, for example, perpendicular to the plane where several pixels P2 of the two-dimensional point cloud image M2 are located, that is, the wall planes W1-W3 in FIG. 4A are perpendicular to the x-z plane of the two-dimensional point cloud image M2.

在步驟S270中,如第4B圖所示,處理器120取得此些不可靠點P22之一者與各牆面平面W1~W3之間的距離H1~H3。In step S270 , as shown in FIG. 4B , the processor 120 obtains the distances H1 - H3 between one of the unreliable points P22 and each wall plane W1 - W3 .

在步驟S280中,處理器120將此些不可靠點P22之此者移至此些距離H1~H3中之一最小者所對應之牆面平面。以不可靠點P22’ 舉例來說,不可靠點P22’與三個牆面平面W1~W3之間的距離分別距離H1~H3,其中距離H2為最小者,因此處理器120將不可靠點P22’ 移至最小者(如,距離H2)所對應之牆面平面W2。In step S280 , the processor 120 moves one of the unreliable points P22 to the wall plane corresponding to the smallest one of the distances H1 ˜ H3 . Taking the unreliable point P22' as an example, the distances between the unreliable point P22' and the three wall planes W1-W3 are respectively H1-H3, wherein the distance H2 is the smallest, so the processor 120 will determine the unreliable point P22 'Move to the wall plane W2 corresponding to the smallest one (for example, distance H2).

此外,處理器120用以:此用前述相同方式(不可靠點P22’ 移至對應之牆面線段的方式),將所有不可靠點P22的至少一者移至對應之牆面平面。在一實施例中,當一不可靠點(如,不可靠點P22’’)相距數個牆面平面的數個距離的最小者仍大於一預設值時,表示此不可靠點不屬於任何牆面平面,處理器120可不將此不可靠點P22’’移至牆面平面。在另一實施例中,若牆面平面的數量只有一個,處理器120可將所有不可靠點P22的至少一者移至該一個牆面平面,可不需額外計算距離。另外,對於非位於牆面平面的可靠點P21(即,牆面平面未通過之可靠點P21),也可採用相同方法移至對應之牆面平面,然亦可不移至對應之牆面平面。本發明實施例不限定「預設值」的數值範圍,其可以視電子裝置100所擷取之三維點雲圖M1的畫面內容而定。在一實施例中,「預設值」例如是可以被判斷為牆面特徵的臨界數值,如1公分~1公尺之間的任意整數,然亦可小於1公分或大於1公尺。In addition, the processor 120 is used to: move at least one of all the unreliable points P22 to the corresponding wall plane in the same manner as described above (the method of moving the unreliable point P22' to the corresponding wall line segment). In one embodiment, when the minimum of several distances between an unreliable point (for example, unreliable point P22'') and several wall planes is still greater than a preset value, it means that this unreliable point does not belong to any The processor 120 may not move the unreliable point P22 ″ to the wall plane. In another embodiment, if there is only one wall plane, the processor 120 may move at least one of all the unreliable points P22 to the one wall plane without additional distance calculation. In addition, for the reliable point P21 that is not located on the wall plane (ie, the reliable point P21 that the wall plane does not pass through), the same method can be used to move to the corresponding wall plane, but it is not necessary to move to the corresponding wall plane. The embodiment of the present invention does not limit the numerical range of the “preset value”, which may depend on the frame content of the 3D point cloud image M1 captured by the electronic device 100 . In one embodiment, the "preset value" is, for example, a critical value that can be judged as a feature of the wall, such as any integer between 1 cm and 1 meter, but it can also be smaller than 1 cm or larger than 1 meter.

此外,第4B圖之各距離H1~H3例如是此些不可靠點P22之該者與對應之牆面平面的最短距離,如垂直距離。以不可靠點P22’舉例來說,距離H1為不可靠點P22’與牆面平面W1的最短距離,距離H2為不可靠點P22’與牆面平面W2的最短距離,而距離H3為不可靠點P22’與牆面平面W3的最短距離。In addition, the distances H1-H3 in FIG. 4B are, for example, the shortest distances between the unreliable points P22 and the corresponding wall plane, such as vertical distances. Taking the unreliable point P22' as an example, the distance H1 is the shortest distance between the unreliable point P22' and the wall plane W1, the distance H2 is the shortest distance between the unreliable point P22' and the wall plane W2, and the distance H3 is the unreliable The shortest distance between point P22' and wall plane W3.

綜上,本發明實施例之影像處理方法及應用其之電子裝置,從三維點雲圖之數個可靠的像素點所連接的數個直線段中,挑選或決定可歸類於牆面的牆面線段,並將不可靠的像素點移至所選的牆面線段。如此,可改善多路徑干擾所造成的偵測不準的問題。To sum up, the image processing method of the embodiment of the present invention and the electronic device using it select or determine the wall surface that can be classified as the wall surface from several straight line segments connected by several reliable pixel points of the three-dimensional point cloud image. segment, and move unreliable pixels to the selected wall segment. In this way, the problem of inaccurate detection caused by multipath interference can be improved.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。To sum up, although the present invention has been disclosed by the above embodiments, it is not intended to limit the present invention. Those skilled in the art of the present invention can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be defined by the scope of the appended patent application.

100:電子裝置 110:攝像器 120:處理器 H1~H3:距離 L1:直線段 L21, L22, L23:牆面線段 M1:三維點雲圖 M2:二維點雲圖 P1:像素點 P21:可靠點 P22:不可靠點 P2:像素點 RT:轉換矩陣 S1:長度 S110~S160, S260~S280:步驟 W1~W3:牆面平面 100: Electronic device 110: camera 120: Processor H1~H3: Distance L1: straight line segment L21, L22, L23: wall line segment M1: 3D point cloud M2: 2D point cloud P1: pixel point P21: Reliable P22: Unreliable P2: pixel point RT: Transformation matrix S1: Length S110~S160, S260~S280: steps W1~W3: wall plane

第1圖繪示依照本發明一實施例之電子裝置的示意圖。 第2A圖繪示第1圖之電子裝置之攝像器所擷取之三維點雲圖的示意圖。 第2B~2E圖繪示第2A圖之三維點雲圖之二維點雲圖的示意圖。 第3圖繪示第1圖之電子裝置的影像處理方法的流程圖。 第4A圖繪示第2C圖之牆面線段轉換成三維點雲圖之牆面平面的示意圖。 第4B圖繪示第4A圖之不可靠點移至對應之牆面平面的示意圖。 第5圖繪示第1圖之電子裝置之另一種影像處理方法的流程圖。 FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention. FIG. 2A is a schematic diagram of a three-dimensional point cloud image captured by the camera of the electronic device in FIG. 1 . Figures 2B-2E show schematic diagrams of the two-dimensional point cloud image of the three-dimensional point cloud image in Figure 2A. FIG. 3 shows a flow chart of the image processing method of the electronic device in FIG. 1 . FIG. 4A shows a schematic diagram of converting the wall line segment in FIG. 2C into a wall plane of a three-dimensional point cloud image. Fig. 4B shows a schematic diagram of moving the unreliable points in Fig. 4A to the corresponding wall plane. FIG. 5 shows a flow chart of another image processing method of the electronic device in FIG. 1 .

S110~S160:步驟 S110~S160: steps

Claims (10)

一種影像處理方法,包括: 擷取一三維點雲圖,該三維點雲圖包含複數個像素點; 區分該些像素點為複數個可靠點及複數個不可靠點; 從該些可靠點中,決定複數條直線段,其中各該直線段通過該些可靠點之二者; 以該些直線段之一所選者做為一牆面線段;以及 將該些不可靠點移至該牆面線段。 An image processing method, comprising: Retrieving a 3D point cloud image, the 3D point cloud image includes a plurality of pixel points; Distinguishing these pixel points into a plurality of reliable points and a plurality of unreliable points; From the reliable points, determine a plurality of straight line segments, each of which passes through two of the reliable points; Take one of the straight line segments as a wall line segment; and Move those unreliable points to the wall segment. 如請求項1所述之影像處理方法,其中各該直線段具有一長度;於以該些線段之該所選者做為該牆面線段之步驟包括: 判斷各該直線段之該長度是否大於一預設長度值;以及 若該長度大於該預設長度值,以該長度大於該預設長度值之該直線段做為該牆面線段。 The image processing method as described in claim 1, wherein each of the straight line segments has a length; the step of using the selected one of the line segments as the wall line segment includes: judging whether the length of each straight line segment is greater than a preset length value; and If the length is greater than the preset length value, the straight line segment whose length is greater than the preset length value is used as the wall line segment. 如請求項1所述之影像處理方法,其中以該些直線段之該所選者做為該牆面線段之步驟包括:以該些直線段之複數個該所選者做為複數個該牆面線段; 其中,於將該些不可靠點移至該牆面線段之步驟包括: 取得該些不可靠點之一者與各該牆面線段之間的一距離;以及 將該些不可靠點之該者移至該些距離中之一最小者所對應之該牆面線段。 The image processing method as described in claim 1, wherein the step of using the selected one of the straight line segments as the wall line segment includes: using the plurality of the selected ones of the straight line segments as the plurality of the walls Surface segment; Among them, the steps of moving these unreliable points to the wall line segment include: obtain a distance between one of the unreliable points and each of the wall line segments; and Move the one of the unreliable points to the wall line segment corresponding to the smallest one of the distances. 如請求項3所述之影像處理方法,其中各該距離為該些不可靠點之該者與對應之該牆面線段的最短距離。The image processing method as described in claim 3, wherein each of the distances is the shortest distance between one of the unreliable points and the corresponding wall line segment. 如請求項1所述之影像處理方法,其中在擷取該三維點雲圖之步驟中,該影像處理方法更包括: 將該三維點雲圖的該些像素點轉換至一二維點雲圖; 其中,區分該些像素點之步驟、決定該些直線段之步驟、以該些直線段之該所選者做為該牆面線段之步驟與將該些不可靠點移至該牆面線段之步驟,係於該二維點雲圖完成。 The image processing method as described in Claim 1, wherein in the step of capturing the 3D point cloud image, the image processing method further includes: converting the pixels of the 3D point cloud image into a 2D point cloud image; Among them, the step of distinguishing these pixel points, the step of determining these straight line segments, the step of using the selected one of these straight line segments as the wall line segment, and the step of moving these unreliable points to the wall line segment The steps are completed based on the two-dimensional point cloud image. 如請求項1所述之影像處理方法,其中以該些直線段之該所選者做為該牆面線段之步驟包括:以該些直線段之複數個該所選者做為複數個該牆面線段; 其中於將該些不可靠點移至對應之該牆面線段之步驟包括: 將該些牆面線段從該二維點雲圖轉換成該三維點雲圖之複數個牆面平面; 取得該些不可靠點之一者與各該牆面平面之間的一距離;及 將該些不可靠點之該者移至該些距離中之一最小者所對應之該牆面平面。 The image processing method as described in claim 1, wherein the step of using the selected one of the straight line segments as the wall line segment includes: using the plurality of the selected ones of the straight line segments as the plurality of the walls Surface segment; The steps of moving these unreliable points to the corresponding wall line segment include: converting the wall line segments from the two-dimensional point cloud image into a plurality of wall planes of the three-dimensional point cloud image; a distance between one of the unreliable points and each of the wall planes; and Move the one of the unreliable points to the wall plane corresponding to the smallest one of the distances. 如請求項6所述之影像處理方法,其中各該距離為該些不可靠點之該者與對應之該牆面平面的最短距離。The image processing method as described in Claim 6, wherein each of the distances is the shortest distance between one of the unreliable points and the corresponding wall plane. 如請求項6所述之影像處理方法,各該牆面平面係垂直於該二維點雲圖之該些像素點所座落的平面。In the image processing method described in Claim 6, each wall plane is perpendicular to the plane where the pixels of the two-dimensional point cloud image are located. 如請求項1所述之影像處理方法,其中於擷取該三維點雲圖之步驟包括:採用飛時測距(Time of Flight, ToF)技術,取得該三維點雲圖。The image processing method as described in Claim 1, wherein the step of capturing the 3D point cloud image includes: using Time of Flight (ToF) technology to obtain the 3D point cloud image. 一種電子裝置,包括: 一攝像器,用以: 擷取一三維點雲圖,該三維點雲圖包含複數個像素點;以及 一處理器,用以: 區分該些像素點為複數個可靠點及複數個不可靠點; 從該些可靠點中,決定複數條直線段,其中各該直線段通過該些可靠點之二者; 以該些直線段之一所選者做為一牆面線段;及 將該些不可靠點移至該牆面線段。 An electronic device comprising: a camera for: Retrieving a 3D point cloud image, the 3D point cloud image includes a plurality of pixel points; and a processor for: Distinguish these pixel points as a plurality of reliable points and a plurality of unreliable points; From the reliable points, determine a plurality of straight line segments, each of which passes through two of the reliable points; take one of the straight line segments as a wall line segment; and Move those unreliable points to the wall segment.
TW110110837A 2021-03-25 2021-03-25 Image processing method and electronic device using the same TW202238530A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110110837A TW202238530A (en) 2021-03-25 2021-03-25 Image processing method and electronic device using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110110837A TW202238530A (en) 2021-03-25 2021-03-25 Image processing method and electronic device using the same

Publications (1)

Publication Number Publication Date
TW202238530A true TW202238530A (en) 2022-10-01

Family

ID=85460300

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110110837A TW202238530A (en) 2021-03-25 2021-03-25 Image processing method and electronic device using the same

Country Status (1)

Country Link
TW (1) TW202238530A (en)

Similar Documents

Publication Publication Date Title
TWI394087B (en) Method and apparatus for tracking target object
WO2020206666A1 (en) Depth estimation method and apparatus employing speckle image and face recognition system
US20220005214A1 (en) Method and apparatus for depth-map estimation of a scene
CN108470356B (en) Target object rapid ranging method based on binocular vision
JP2015524915A (en) 3D information processing apparatus and method
CN106406638B (en) Touch point contour generation method and equipment
US10074551B2 (en) Position detection apparatus, position detection method, information processing program, and storage medium
JP2019185664A (en) Control device, object detection system, object detection method, and program
TWI571099B (en) Device and method for depth estimation
JP2016136112A (en) Distance measurement device and distance measurement method
US20160063714A1 (en) Image location selection for use in depth photography system
JP2001266128A (en) Method and device for obtaining depth information and recording medium recording depth information obtaining program
WO2021193672A1 (en) Three-dimensional model generation method and three-dimensional model generation device
TW201605225A (en) Methods and systems for generating depth images and related computer products
TW202238530A (en) Image processing method and electronic device using the same
CN116542979B (en) Image measurement-based prediction correction method and terminal
US20150063637A1 (en) Image recognition method and robot
JP2961272B1 (en) Object recognition apparatus and method using feature vector
TWI658431B (en) Image processing method, image processing device and computer readable storage medium
CN115131763A (en) Image processing method and electronic device applying same
KR101178015B1 (en) Generating method for disparity map
CN113014899B (en) Binocular image parallax determination method, device and system
CN113065483A (en) Positioning method, positioning device, electronic equipment, medium and robot
KR101220003B1 (en) Generating method for disparity map
JP2012234431A (en) Boundary detection device, boundary detection method, and program