TW202238530A - Image processing method and electronic device using the same - Google Patents
Image processing method and electronic device using the same Download PDFInfo
- 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
Links
Images
Abstract
Description
本發明是有關於一種處理方法及應用其之電子裝置,且特別是有關於一種影像處理方法及應用其之電子裝置。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
電子裝置100例如是掃地機器人。電子裝置100可偵測前方障礙物(如,牆面)的邊界,以在移動過程中避開此障礙物。The
電子裝置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
攝像器110例如是ToF攝像器。三維點雲圖M1可採用ToF偵測技術取得。攝像器110可於不同數個時點或連續數個時點持續擷取數張三維點雲圖M1,攝像器110可對每一張點雲圖M1執行本文所述之影像處理流程。處理器120例如是採用半導體製程所形成的實體電路(circuit)。The
請參照第3圖,其繪示第1圖之電子裝置100的影像處理方法的流程圖。Please refer to FIG. 3 , which shows a flow chart of the image processing method of the
在步驟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
在步驟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
在步驟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
在步驟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
在步驟S150中,如第2C圖所示,處理器120以此些直線段L1之所選者做為一牆面線段。在本實施例中,處理器120以此些直線段L1之三個所選者做為三條牆面線段L21、L22及L23。本發明實施例不限制牆面線段的數量,視實際環境之牆面數而定,處理器120可從此些直線段L1中決定三個以下或三個以上的牆面線段。In step S150 , as shown in FIG. 2C , the
以下係說明選擇(或決定)牆面線段的數種方法之一。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
在步驟S160中,如第2D圖所示,處理器120將此些不可靠點P22移至牆面線段。例如,處理器120改寫不可靠點P22的座標值,使不可靠點P22的座標值符合牆面線段的方程式。In step S160 , as shown in FIG. 2D , the
在一實施例中,如第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
此外,各距離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
如第2E圖所示,處理器120在將可靠點P21及不可靠點P22移至對應之牆面線段後,可取得二維點雲圖M2’,其包含牆面線段L21~L23及數個位於牆面線段L21~L23的像素點。此外,二維點雲圖M2’也可只包含(顯示)牆面線段L21~L23,而不包含(不顯示)所有可靠點P21與不可靠點P22的至少一者。As shown in FIG. 2E, after the
前述實施例之影像處理方法之步驟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
本實施例之電子裝置100的影像處理方法包含步驟S110~S150及S260~S280,其中步驟S110~S150已於前述,於此不再贅述,以下從步驟S260開始說明。The image processing method of the
在步驟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
在步驟S270中,如第4B圖所示,處理器120取得此些不可靠點P22之一者與各牆面平面W1~W3之間的距離H1~H3。In step S270 , as shown in FIG. 4B , the
在步驟S280中,處理器120將此些不可靠點P22之此者移至此些距離H1~H3中之一最小者所對應之牆面平面。以不可靠點P22’ 舉例來說,不可靠點P22’與三個牆面平面W1~W3之間的距離分別距離H1~H3,其中距離H2為最小者,因此處理器120將不可靠點P22’ 移至最小者(如,距離H2)所對應之牆面平面W2。In step S280 , the
此外,處理器120用以:此用前述相同方式(不可靠點P22’ 移至對應之牆面線段的方式),將所有不可靠點P22的至少一者移至對應之牆面平面。在一實施例中,當一不可靠點(如,不可靠點P22’’)相距數個牆面平面的數個距離的最小者仍大於一預設值時,表示此不可靠點不屬於任何牆面平面,處理器120可不將此不可靠點P22’’移至牆面平面。在另一實施例中,若牆面平面的數量只有一個,處理器120可將所有不可靠點P22的至少一者移至該一個牆面平面,可不需額外計算距離。另外,對於非位於牆面平面的可靠點P21(即,牆面平面未通過之可靠點P21),也可採用相同方法移至對應之牆面平面,然亦可不移至對應之牆面平面。本發明實施例不限定「預設值」的數值範圍,其可以視電子裝置100所擷取之三維點雲圖M1的畫面內容而定。在一實施例中,「預設值」例如是可以被判斷為牆面特徵的臨界數值,如1公分~1公尺之間的任意整數,然亦可小於1公分或大於1公尺。In addition, the
此外,第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)
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) |
-
2021
- 2021-03-25 TW TW110110837A patent/TW202238530A/en unknown
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 |