TW202230286A - Method and computer program product for filtering an object - Google Patents

Method and computer program product for filtering an object Download PDF

Info

Publication number
TW202230286A
TW202230286A TW110102665A TW110102665A TW202230286A TW 202230286 A TW202230286 A TW 202230286A TW 110102665 A TW110102665 A TW 110102665A TW 110102665 A TW110102665 A TW 110102665A TW 202230286 A TW202230286 A TW 202230286A
Authority
TW
Taiwan
Prior art keywords
interest
feature
filter
video
objects
Prior art date
Application number
TW110102665A
Other languages
Chinese (zh)
Other versions
TWI811618B (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 TW110102665A priority Critical patent/TWI811618B/en
Publication of TW202230286A publication Critical patent/TW202230286A/en
Application granted granted Critical
Publication of TWI811618B publication Critical patent/TWI811618B/en

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method for filtering an object, which has: detecting an area of an existing object from a video; establishing a sampling space based on a detecting result of the area; capturing a color feature from the sampling space; adding the color feature to a filtering condition; and filtering an interest object from the video based on the filtering condition.

Description

篩選物件的方法以及電腦程式產品Method for screening objects and computer program product

本發明是關於一種影像處理的方法,特別是關於影片中篩選物件的方法。The present invention relates to a method of image processing, in particular to a method of screening objects in a video.

既有的影像處理方法中,在一場所隨處移動的物件可能是我們的關注物件,舉例來說,如道路中的某車輛、商店內的某顧客等特定目標。當場所面積達到一定的程度時,既有的作法是設置人力駐點或架設攝影機,利用人工的方式在場所中,或是多個攝影機的影片中查找關注對象。然而,這種作法會產生耗費人力、且篩選關注物件效率不佳的問題。In the existing image processing methods, objects moving around in a place may be our attention objects, for example, a specific target such as a vehicle on the road or a customer in a store. When the area of the venue reaches a certain level, the existing practice is to set up human stagnation points or set up cameras, and use manual methods to find objects of interest in the venue or in the videos of multiple cameras. However, this approach creates problems of labor-intensive and inefficient screening of objects of interest.

本發明有鑑於上述既有的問題點,提供一種篩選物件的方法,能夠讓使用者更有效率地從影片中篩選出欲篩選的關注物件。In view of the above-mentioned existing problems, the present invention provides a method for screening objects, which enables a user to more efficiently screen out objects of interest to be screened from a video.

關於本發明的篩選物件的方法,包含:從一影片偵測一物件存在的區域;根據該區域的偵測結果建立一取樣空間;從該取樣空間擷取一顏色特徵;將該顏色特徵納入一篩選條件;以及根據該篩選條件,對該影片中的一關注物件進行篩選。The method for screening objects of the present invention includes: detecting a region where an object exists from a video; establishing a sampling space according to the detection result of the region; extracting a color feature from the sampling space; incorporating the color feature into a filtering conditions; and filtering an object of interest in the video according to the filtering conditions.

某實施方式中,從該取樣空間擷取該顏色特徵之步驟更包含:從該取樣空間擷取至少一特徵點;根據該至少一特徵點產生一多邊形;以及從該多邊形構成的區域擷取該顏色特徵。In an embodiment, the step of extracting the color feature from the sampling space further includes: extracting at least one feature point from the sampling space; generating a polygon according to the at least one feature point; and extracting the polygon from an area formed by the polygon. color characteristics.

某實施方式中,該關注物件為人物,該特徵點包含人類的四肢、以及關節等任何一者。In one embodiment, the object of interest is a person, and the feature point includes any one of human limbs and joints.

某實施方式中,篩選物件的方法更包含:從該取樣空間擷取一屬性特徵;將該屬性特徵納入該篩選條件;以及根據該篩選條件,對該影片中的該關注物件進行篩選。In one embodiment, the method for screening objects further includes: extracting an attribute feature from the sampling space; incorporating the attribute feature into the screening condition; and screening the object of interest in the video according to the screening condition.

某實施方式中,該關注物件為人物,該屬性特徵包含人類的性別、年齡、以及服飾等任何一者。In a certain embodiment, the object of interest is a character, and the attribute feature includes any one of human gender, age, and clothing.

某實施方式中,篩選物件的方法更包含:對該物件對應的該取樣空間進行一重辨識模型轉換,以取得一特徵向量;對該關注物件對應的一關注物件取樣空間,進行該重辨識模型轉換,以取得一關注物件特徵向量;計算該特徵向量與該關注物件特徵向量在多維空間的一距離;以及將該特徵向量納入該篩選條件時,藉由將該距離與一臨界值進行比較,以判斷該關注物件是否符合該篩選條件。In a certain embodiment, the method for screening objects further includes: performing a re-identification model transformation on the sampling space corresponding to the object to obtain a feature vector; performing the re-identification model transformation in a sampling space of the object of interest corresponding to the object of interest , to obtain a feature vector of the object of interest; calculate a distance between the feature vector and the feature vector of the object of interest in a multi-dimensional space; and when the feature vector is included in the screening condition, by comparing the distance with a critical value to obtain Determine whether the object of interest meets the filtering condition.

某實施方式中,該重辨識模型轉換為一矩陣運算。In one embodiment, the re-identification model is converted into a matrix operation.

某實施方式中,篩選物件的方法更包含:根據該篩選條件,篩選出一第2影片中的一第2關注物件;以及比對該關注物件與該第2關注物件被偵測到的複數個時間、複數個地點、以及複數個速度等任何一者,以過濾該第2關注物件。In a certain embodiment, the method for screening objects further comprises: according to the screening conditions, screening out a second object of interest in a second video; and comparing a plurality of detected objects of interest and the second object of interest Any one of time, a plurality of locations, and a plurality of speeds to filter the second object of interest.

關於本發明的電腦程式產品,經由電腦載入該程式,使該電腦的處理器執行前述任何一種篩選物件的方法。Regarding the computer program product of the present invention, the program is loaded through a computer, so that the processor of the computer executes any one of the aforementioned methods for screening objects.

某實施方式中,該處理器更執行:根據該篩選條件,篩選出該第2影片中的該第2關注物件;以及比對該關注物件與該第2關注物件被偵測到的複數個時間、複數個地點、以及複數個速度等任何一者,以過濾該第2關注物件。In a certain embodiment, the processor further executes: according to the screening condition, filtering out the second object of interest in the second video; and comparing a plurality of times when the object of interest and the second object of interest were detected , a plurality of locations, and a plurality of speeds to filter the second object of interest.

根據本發明,讓使用者更有效率地從影片中篩選出欲篩選的關注物件。According to the present invention, the user can more efficiently select the object of interest to be selected from the video.

本發明之上述及其他目的及優點,在參考後面描述的詳細說明並搭配所附的圖式之後,將能更加明顯易懂。The above and other objects and advantages of the present invention will become more apparent upon reference to the detailed description hereinafter described in conjunction with the accompanying drawings.

第1圖為一流程圖,說明關於本發明實施例1~4的篩選物件的方法。FIG. 1 is a flow chart illustrating a method for screening objects according to Embodiments 1 to 4 of the present invention.

[實施例1] 首先,針對本發明的實施例1進行說明。本發明實施例1對應的步驟為步驟ST01、ST02、ST03、ST04、ST09。 [Example 1] First, Embodiment 1 of the present invention will be described. The steps corresponding to Embodiment 1 of the present invention are steps ST01, ST02, ST03, ST04, and ST09.

首先,在步驟ST01,從影片20偵測物件21存在的區域。其中,影片20為攝影機對某一環境所拍攝。該環境中可能存在各種靜態或動態的人、車等(以下通稱為「物件21」)。物件偵測的方法可以利用既有的物件偵測技術來實現。舉例來說,可以事先利用大量的數據給類神經網路進行機器學習而成。First, in step ST01 , the region where the object 21 exists is detected from the video 20 . Among them, the video 20 is shot by a camera in a certain environment. There may be various static or dynamic people, cars, etc. (hereinafter referred to as "objects 21") in the environment. The method of object detection can be implemented by using existing object detection technology. For example, it is possible to use a large amount of data to perform machine learning on a neural network in advance.

接著,在步驟ST02,當偵測到影片20的某個區域存在物件21時,根據區域的偵測結果建立取樣空間22。Next, in step ST02, when an object 21 is detected in a certain area of the video 20, a sampling space 22 is created according to the detection result of the area.

請參照第2圖。第2圖為一示意圖,示意步驟ST02根據區域的偵測結果建立取樣空間22之一例。如同圖所示,取樣空間22可以是位於物件21(圖式中為人類)約略左上以及右下的兩個座標點所圍成的框選區域。然而,雖然圖式中的取樣空間22為矩形,但在其他實施例中並不以此為限;意即,取樣空間22也可以是其他的多邊形。Please refer to Figure 2. FIG. 2 is a schematic diagram illustrating an example of creating a sampling space 22 according to the detection result of the area in step ST02 . As shown in the figure, the sampling space 22 may be a frame selection area surrounded by two coordinate points located approximately at the upper left and lower right of the object 21 (human in the figure). However, although the sampling space 22 in the drawings is a rectangle, it is not limited to this in other embodiments; that is, the sampling space 22 may also be other polygons.

回到第1圖。在步驟ST03,建立取樣空間22之後,從取樣空間22擷取顏色特徵。以下說明從取樣空間22擷取顏色特徵的詳細運作流程。Back to Figure 1. In step ST03 , after the sampling space 22 is established, color features are extracted from the sampling space 22 . The detailed operation flow of extracting color features from the sampling space 22 is described below.

第3圖為一流程圖,說明步驟ST03從取樣空間22擷取顏色特徵的詳細運作流程。如同圖所示,步驟ST03更包含步驟ST31~ST33。以下分別對步驟ST31~ST33進行說明。FIG. 3 is a flowchart illustrating the detailed operation process of extracting color features from the sampling space 22 in step ST03 . As shown in the figure, step ST03 further includes steps ST31 to ST33. Steps ST31 to ST33 will be described below, respectively.

首先,在步驟ST31,從取樣空間22擷取特徵點。具體而言,若物件21的偵測結果為人物,則擷取的特徵點可以是人類的四肢以及關節等,例如:身體的左右肩、軸、掌、臀、膝、腳掌、脖子等。如第4A圖所示,從取樣空間22中擷取10個特徵點A~J。特徵點A、B對應左右肩,特徵點C、D對應肘關節,特徵點E、F對應左右手掌,特徵點G、H對應臀部的左右兩側,特徵點I、J對應左右腳掌。若物件21的偵測結果為汽車,則擷取的特徵點可以是車牌、車輪、車頂、車窗等。First, in step ST31 , feature points are extracted from the sampling space 22 . Specifically, if the detection result of the object 21 is a person, the extracted feature points may be human limbs and joints, such as left and right shoulders, shafts, palms, hips, knees, soles, necks, etc. of the body. As shown in FIG. 4A , 10 feature points A to J are extracted from the sampling space 22 . Feature points A and B correspond to the left and right shoulders, feature points C and D correspond to the elbow joint, feature points E and F correspond to the left and right palms, feature points G and H correspond to the left and right sides of the buttocks, and feature points I and J correspond to the left and right soles of the feet. If the detection result of the object 21 is a car, the extracted feature points may be a license plate, a wheel, a car roof, a car window, and the like.

接著,在步驟ST32,擷取到特徵點之後,根據擷取的特徵點產生多邊形。如第4B圖所示,假設物件21的偵測結果為人物,則產生的多邊形可以是人物的上半身,也就是由4個特徵點A、B、G、H所圍成的斜線區域。另外,也可以因應擷取到的特徵點的數量,來產生各種形狀的多邊形。Next, in step ST32, after the feature points are extracted, a polygon is generated according to the extracted feature points. As shown in FIG. 4B , assuming that the detection result of the object 21 is a person, the generated polygon can be the upper body of the person, that is, the oblique line area surrounded by the four feature points A, B, G, and H. In addition, polygons of various shapes can also be generated according to the number of extracted feature points.

請參照第5A圖、第5B圖。第5A圖、第5B圖為一示意圖,說明第3圖中的步驟ST32根據特徵點產生多邊形之一例。舉例來說,假如擷取到1個特徵點40,其在影片20中的座標為(x, y),則特徵點40所產生的多邊形可以如第5A圖所示,為(x+h, y+h)、(x-h, y+h)、(x-h, y-h)、(x+h, y-h)上述4個座標點所圍成的正方形。換言之,正方形的邊長為2h,而特徵點40位於正方形的中心位置。需注意的是,h的數值不宜過大,實施時以小於5(像素)較佳。Please refer to Figure 5A and Figure 5B. 5A and 5B are schematic diagrams illustrating an example of generating a polygon based on feature points in step ST32 in FIG. 3 . For example, if a feature point 40 is captured and its coordinates in the video 20 are (x, y), then the polygon generated by the feature point 40 can be (x+h, y+h) as shown in Fig. 5A , (x-h, y+h), (x-h, y-h), (x+h, y-h) are the squares enclosed by the above four coordinate points. In other words, the side length of the square is 2h, and the feature point 40 is located at the center of the square. It should be noted that the value of h should not be too large, and it is better to be less than 5 (pixels) in implementation.

另一方面,假如擷取到2個特徵點41、42,其在影片20中的座標分別為(x 1, y 1)、(x 2, y 2),則特徵點41、42所產生的多邊形可以如第5B圖所示,為(x 1+hcosθ, y 1+hsinθ)、(x 1-hcosθ, y 1-hsinθ)、(x 2+hcosθ, y 2+hsinθ)、(x 2-hcosθ, y 2-hsinθ)上述4個座標點所圍成的矩形。其中,θ為特徵點41、42所連成的線段與y軸方向的夾角,且矩形其中一邊的邊長為2h。h的數值如前述所說不宜過大,以小於5(像素)較佳。 On the other hand, if two feature points 41 and 42 are captured and their coordinates in the video 20 are (x 1 , y 1 ) and (x 2 , y 2 ), respectively, then the feature points 41 and 42 generate The polygons can be as shown in Fig. 5B as (x 1 +hcosθ, y 1 +hsinθ), (x 1 -hcosθ, y 1 -hsinθ), (x 2 +hcosθ, y 2 +hsinθ), (x 2 -hcosθ, y 2 -hsinθ) The rectangle enclosed by the above four coordinate points. Wherein, θ is the angle between the line segment formed by the feature points 41 and 42 and the y-axis direction, and the length of one side of the rectangle is 2h. As mentioned above, the value of h should not be too large, preferably less than 5 (pixels).

另外,上述根據至少1個特徵點建立多邊形的規則僅為其中一種範例,但實施時並不以此為限。In addition, the above-mentioned rule for establishing a polygon based on at least one feature point is only one example, but the implementation is not limited thereto.

回到第3圖,在步驟ST33,從多邊形構成的區域擷取顏色特徵。具體而言,在步驟ST32所產成的多邊形中包含複數個像素。每一個像素都可以用RGB(紅、綠、藍)、HSL(色相、飽和度、亮度)、HSV(色相、飽和度、明度)等色彩空間定義其顏色。為方便說明,以下以HSL色彩空間為例,來說明從多邊形當中的複數個像素擷取一代表顏色,作為取樣空間22的顏色特徵之範例。Returning to Fig. 3, in step ST33, color features are extracted from the polygonal region. Specifically, the polygon generated in step ST32 includes a plurality of pixels. Each pixel can define its color using color spaces such as RGB (red, green, blue), HSL (hue, saturation, lightness), HSV (hue, saturation, lightness). For the convenience of description, the following takes the HSL color space as an example to describe the extraction of a representative color from a plurality of pixels in a polygon as an example of the color feature of the sampling space 22 .

首先,從多邊形當中的複數個像素中,計算所有像素於H分量的中位數h’。其次,從取樣空間22的複數個像素中取出H分量介於[h’-20, h’+20]的像素,並計算該等像素於S分量的中位數s’。最後,從前一步驟取出的複數個像素中,再取出S分量介於[s’-20, s’+20]的像素,並計算該等像素於L分量的中位數l’。如上所述,就可以得到一代表顏色(h’, s’, l’),作為取樣空間22的顏色特徵。步驟ST31~ST33執行完畢後,即完成第1圖步驟ST03的完整流程。First, from a plurality of pixels in the polygon, calculate the median h' of all pixels in the H component. Next, from the plurality of pixels in the sampling space 22, take out the pixels whose H component is between [h'-20, h'+20], and calculate the median s' of these pixels in the S component. Finally, from the plurality of pixels taken out in the previous step, take out the pixels whose S component is between [s'-20, s'+20], and calculate the median l' of these pixels in the L component. As described above, a representative color (h', s', l') can be obtained as the color feature of the sampling space 22. After steps ST31 to ST33 are executed, the complete flow of step ST03 in FIG. 1 is completed.

回到第1圖,在步驟ST04,從取樣空間22擷取顏色特徵之後,將顏色特徵納入篩選條件。取樣空間22的顏色特徵納入篩選條件之後,在步驟ST09,就可以針對影片20其他已經被偵測出的物件進行篩選,以篩選出關注物件。此處所謂的「關注物件」,是指準備篩選出與物件21在某個特徵上相同或相似的物件。Returning to FIG. 1, in step ST04, after the color features are extracted from the sampling space 22, the color features are included in the screening conditions. After the color feature of the sampling space 22 is included in the filtering conditions, in step ST09, other detected objects in the video 20 can be screened to filter out the object of interest. The so-called "objects of interest" here refers to preparing to filter out objects that are identical or similar to the object 21 in a certain characteristic.

具體而言,若以取樣空間22的顏色特徵納入篩選條件時,步驟ST09是藉由比較取樣空間22的代表顏色(h’, s’, l’)以及關注物件所對應的代表顏色,以判定影片20當中的其他關注物件是否與物件21相似,而必須被篩選出來。舉例來說,可以事先規定兩個代表顏色若H分量相差小於等於10、且S分量相差小於等於10、且L分量相差小於等於20時,則判定關注物件的代表顏色與取樣空間22的代表顏色(h’, s’, l’)相似,而必須被篩選出來。反過來說,若兩個代表顏色之間並不滿足上述任一條件,則判定關注物件的代表顏色與取樣空間22的代表顏色(h’, s’, l’)不相似,而無須被篩選出來。Specifically, if the color feature of the sampling space 22 is included in the screening condition, step ST09 is to compare the representative color (h', s', l') of the sampling space 22 and the representative color corresponding to the object of interest to determine Whether other objects of interest in the video 20 are similar to the object 21 must be screened out. For example, it can be specified in advance that if the difference between the H components is less than or equal to 10, the difference between the S components is less than or equal to 10, and the difference between the L components is less than or equal to 20, the representative color of the object of interest and the representative color of the sampling space 22 are determined. (h', s', l') are similar and must be filtered out. Conversely, if either of the above conditions is not satisfied between the two representative colors, it is determined that the representative color of the object of interest is not similar to the representative color (h', s', l') of the sampling space 22, and no need to be screened come out.

另外,雖然上述是以兩個代表顏色的H分量相差小於等於10、且S分量相差小於等於10、且L分量相差小於等於20為條件進行判定並篩選,但前述判定條件亦可以視情況調整。至此,已詳細說明本發明實施例1的步驟ST01、ST02、ST03、ST04、ST09的流程。In addition, although the above is based on the condition that the difference between the H components of the two representative colors is less than or equal to 10, the difference between the S components is less than or equal to 10, and the difference between the L components is less than or equal to 20, the above judgment conditions can also be adjusted according to the situation. So far, the flow of steps ST01 , ST02 , ST03 , ST04 , and ST09 in Embodiment 1 of the present invention has been described in detail.

[實施例2] 接著,針對本發明的實施例2進行說明。本發明實施例2對應的步驟為步驟ST01、ST02、ST05、ST06、ST09。由於步驟ST01、ST02已於實施例1說明,故此處省略說明。 [Example 2] Next, Example 2 of this invention is demonstrated. The steps corresponding to Embodiment 2 of the present invention are steps ST01, ST02, ST05, ST06, and ST09. Since steps ST01 and ST02 have been described in Embodiment 1, the description is omitted here.

首先,在步驟ST05,建立取樣空間22之後,從取樣空間22擷取屬性特徵。以下說明從取樣空間22擷取屬性特徵的詳細運作流程。First, in step ST05 , after the sampling space 22 is established, the attribute features are extracted from the sampling space 22 . The detailed operation flow of extracting attribute features from the sampling space 22 is described below.

舉例來說,若物件21的偵測結果為人物,則可以從取樣空間22擷取人類的性別、年齡、以及服飾等屬性特徵,例如:衣服款式、背負物件、手提物件、穿戴物件等可以描述人類的特徵。上述性別、年齡、以及服飾等屬性特徵亦可以使用既有的物件偵測技術來實現。For example, if the detection result of the object 21 is a person, the attribute characteristics such as gender, age, and clothing of the human can be extracted from the sampling space 22 , for example, the style of clothing, the object to be carried, the object to carry, the object to wear, etc. can be described human characteristics. The above attribute features such as gender, age, and clothing can also be implemented using existing object detection technology.

上述屬性特徵的偵測結果通常會用百分比來表示。具體來說,若對取樣空間22中的人物A進行屬性特徵的偵測,則偵測的結果舉例來說,性別為「男性」的機率為92%、「女性」的機率為8%;穿著為「洋裝」的機率為3%、「長褲」的機率為97%;配戴帽子為「是」的機率為6%、「否」的機率為94%…以此類推。因此,可以從取樣空間22中擷取人物A的屬性特徵為「性別男性」、「穿著長褲」、「未戴帽子」。The detection results of the above attribute features are usually expressed as percentages. Specifically, if the attribute feature of the character A in the sampling space 22 is detected, the detection result, for example, the probability of the gender being "male" is 92%, and the probability of "female" is 8%; The probability of wearing a "dress" is 3%, the probability of "trousers" is 97%; the probability of wearing a hat is "yes" 6%, the probability of "no" is 94%, and so on. Therefore, the attribute features of person A can be extracted from the sampling space 22 as "gender male", "wearing trousers", and "not wearing a hat".

然後,在步驟ST06,從取樣空間22擷取屬性特徵之後,將屬性特徵納入篩選條件。取樣空間的屬性特徵納入篩選條件之後,在步驟ST09,就可以針對影片20其他已經被偵測出的物件進行篩選,以篩選出關注物件。舉例來說,如果以「性別男性」、「穿著長褲」為篩選對象,則可以篩選出符合屬性特徵為「性別男性」、「穿著長褲」的所有關注物件。Then, in step ST06, after the attribute features are extracted from the sampling space 22, the attribute features are included in the filtering conditions. After the attributes of the sampling space are included in the filtering conditions, in step ST09, other detected objects in the video 20 can be screened to filter out the objects of interest. For example, if "gender male" and "wearing trousers" are selected as the filtering objects, all concerned objects that match the attribute characteristics of "gender male" and "wearing trousers" can be filtered out.

需注意的是,雖然實施例2的步驟ST09是在步驟ST06從取樣空間22擷取屬性特徵之後,將屬性特徵納入篩選條件。然而,實施例2的步驟ST09也可以同時以顏色特徵(步驟ST04)與屬性特徵(步驟ST06)兩者為篩選條件,一併對影片中的關注物件進行篩選。換言之,實施例1與實施例2彼此並沒有嚴格的執行先後順序,實施例1的步驟ST03~ST04以及實施例2的步驟ST05~ST06也可以分別執行,或是同步進行。It should be noted that, although step ST09 in the second embodiment is to include the attribute feature in the filter condition after the attribute feature is extracted from the sampling space 22 in step ST06. However, in step ST09 of the second embodiment, both the color feature (step ST04 ) and the attribute feature (step ST06 ) can be used as filter conditions to filter the objects of interest in the video at the same time. In other words, Embodiment 1 and Embodiment 2 do not have a strict execution sequence. Steps ST03 to ST04 of Embodiment 1 and steps ST05 to ST06 of Embodiment 2 may also be executed separately or simultaneously.

[實施例3] 接著,針對本發明的實施例3進行說明。本發明實施例3對應的步驟為步驟ST01、ST02、ST07、ST08、ST09。由於步驟ST01、ST02已於實施例1說明,故此處省略說明。 [Example 3] Next, Example 3 of this invention is demonstrated. The steps corresponding to Embodiment 3 of the present invention are steps ST01, ST02, ST07, ST08, and ST09. Since steps ST01 and ST02 have been described in Embodiment 1, the description is omitted here.

首先,在步驟ST07,建立取樣空間22之後,對取樣空間進行重辨識模型轉換,以取得特徵向量。First, in step ST07, after the sampling space 22 is established, the re-identification model conversion is performed on the sampling space to obtain the feature vector.

具體而言,在步驟ST07,重辨識模型轉換是使用一矩陣運算,將2維的取樣空間22影像轉換成256維空間(或其他多維空間)的特徵向量。也就是說,該特徵向量可以視為對應256維空間當中的原點指向某個座標點的方向。由於重辨識模型轉換可運用既有的演算法來實現,故此處省略詳細的說明。Specifically, in step ST07, the re-identification model conversion uses a matrix operation to convert the 22-dimensional image in the 2-dimensional sampling space into the feature vector in the 256-dimensional space (or other multi-dimensional space). That is to say, the feature vector can be regarded as the direction corresponding to the origin in the 256-dimensional space pointing to a certain coordinate point. Since the re-identification model conversion can be implemented by using an existing algorithm, the detailed description is omitted here.

除此之外,在步驟ST07當中,針對影片20當中的其他關注物件,同樣也要進行該重辨識模型轉換,以取得其他每個關注物件的關注物件特徵向量。In addition, in step ST07, the re-identification model conversion is also performed for other objects of interest in the video 20 to obtain the object feature vector of each other object of interest.

然後,在步驟ST08,取得該特徵向量之後,將該特徵向量納入篩選條件。由取樣空間22轉換而得到的該特徵向量納入篩選條件之後,在步驟ST09,就可以針對影片20其他已經被偵測出的物件進行篩選,以篩選出關注物件。Then, in step ST08, after the feature vector is acquired, the feature vector is included in the filter condition. After the feature vector converted from the sampling space 22 is included in the filtering condition, in step ST09, other detected objects in the video 20 can be screened to filter out the object of interest.

具體而言,在步驟ST09判斷其他關注物件是否與物件21相同或相似的方式,是計算該特徵向量與關注物件特徵向量在256維空間(或其他多維空間)的距離。如前述說明,由於該特徵向量可以視為對應256維空間當中的原點指向某個座標點的方向,因此算出兩個向量的距離,就相當於兩個座標點算出距離。然後,將距離與一臨界值進行比較。若距離小於等於臨界值,則判定關注物件與物件21相似,符合篩選條件,而必須被篩選出來。反過來說,若距離大於臨界值,則判定關注物件與物件21不相似,不符合篩選條件,而無須被篩選出來。Specifically, in step ST09, the method of judging whether the other object of interest is the same as or similar to object 21 is to calculate the distance between the feature vector and the feature vector of the object of interest in the 256-dimensional space (or other multi-dimensional space). As described above, since the feature vector can be regarded as the direction corresponding to the origin in the 256-dimensional space pointing to a certain coordinate point, calculating the distance between two vectors is equivalent to calculating the distance between two coordinate points. Then, the distance is compared with a critical value. If the distance is less than or equal to the threshold value, it is determined that the object of interest is similar to the object 21 and meets the screening conditions and must be screened out. Conversely, if the distance is greater than the critical value, it is determined that the object of interest is not similar to the object 21 and does not meet the screening conditions, and does not need to be screened out.

需注意的是,雖然實施例3的步驟ST09是在步驟ST08取得特徵向量之後,將特徵向量納入篩選條件。然而,實施例3的步驟ST09也可以同時以顏色特徵(步驟ST04)、屬性特徵(步驟ST06)、以及特徵向量(步驟ST08)三者為篩選條件,一併對影片中的關注物件進行篩選。換言之,實施例1~實施例3彼此並沒有嚴格的執行先後順序,實施例1的步驟ST03~ST04、實施例2的步驟ST05~ST06、以及實施例3的步驟ST07~ST08也可以分別執行,或是同步進行。It should be noted that although step ST09 of the third embodiment is to include the feature vector in the screening condition after the feature vector is obtained in step ST08. However, in step ST09 of the third embodiment, the color feature (step ST04), the attribute feature (step ST06), and the feature vector (step ST08) can be used as filter conditions simultaneously, and the objects of interest in the movie can be screened together. In other words, Embodiment 1 to Embodiment 3 do not have a strict order of execution. Steps ST03 to ST04 of Embodiment 1, steps ST05 to ST06 of Embodiment 2, and steps ST07 to ST08 of Embodiment 3 can also be executed separately. or synchronously.

[實施例4] 接著,針對本發明的實施例4進行說明。本發明實施例4對應的步驟為步驟ST09、ST10、ST11、ST12。 [Example 4] Next, Example 4 of the present invention will be described. Steps corresponding to Embodiment 4 of the present invention are steps ST09, ST10, ST11, and ST12.

在本發明實施例4中,是在關注物件已經篩選過的情況下,再針對篩選後的關注物件進行過濾。因此在實施例4中,先預設第1圖中的步驟ST04、ST06、ST08的任何一者已經執行完成,並根據顏色特徵(步驟ST04)、屬性特徵(步驟ST06)以及特徵向量(步驟ST08)的任何一者從影片20中篩選出關注物件(即執行完步驟ST09)。另外,實施例4還同時使用前述步驟的任何一者,從有別於影片20的另一「第2影片」當中,篩選出有別於關注物件的另一「第2關注物件」,影片20和第2影片,例如是由不同的攝影機分別擷取而得。篩選出第2關注物件之步驟,在第1圖中標示為步驟ST10。In Embodiment 4 of the present invention, when the object of interest has been screened, the filtered object of interest is then filtered. Therefore, in Embodiment 4, it is assumed that any one of steps ST04, ST06, and ST08 in the first figure has been executed, and according to the color feature (step ST04), the attribute feature (step ST06) and the feature vector (step ST08) ) to filter out the object of interest from the video 20 (ie, step ST09 is executed). In addition, Embodiment 4 also uses any one of the aforementioned steps at the same time to filter out another "second object of interest" that is different from the object of interest from another "second video" that is different from the video 20. The video 20 and the second video, for example, are captured by different cameras. The step of filtering out the second object of interest is marked as step ST10 in FIG. 1 .

然而,雖然在第1圖中,示意步驟ST10的執行順序在步驟ST09之後,但是步驟ST10的執行順序也可以在步驟ST09之前,亦包含兩步驟同時發生的可能性。However, although the execution sequence of step ST10 is shown after step ST09 in FIG. 1, the execution sequence of step ST10 may also be executed before step ST09, including the possibility of two steps occurring simultaneously.

然後,在步驟ST11,針對已經篩選的關注物件以及第2關注物件,比對關注物件以及第2關注物件的時間、地點、以及移動速度等。Then, in step ST11, the time, place, moving speed, etc. of the object of interest and the second object of interest are compared for the object of interest and the second object of interest that have been screened.

然後,在步驟ST12,根據關注物件以及第2關注物件的時間、地點、以及移動速度的比對結果,對第2關注物件進行過濾。Then, in step ST12, the second object of interest is filtered according to the comparison result of the time, place, and moving speed of the object of interest and the second object of interest.

根據本發明實施例4,可以考慮到關注物件以及第2關注物件分別被兩台攝影機所偵測的時間、地點、以及移動速度,以排除第2關注物件被誤判為關注物件的可能性。舉例來說,在本發明實施例1~3的方法的篩選下,已經從影片20篩選出關注物件,並從第2影片篩選出與關注物件相似的第2關注物件。但根據本發明實施例4的實施結果,對關注物件以及第2關注物件的時間、地點、以及移動速度進行比對,發現關注物件與第2關注物件是在同一時間被偵測,且關注物件與第2關注物件分別在影片20以及第2影片中為靜止狀態,但偵測到關注物件以及第2關注物件的兩台攝影機彼此距離100公里之遠。考慮到兩台攝影機的相對距離,相同的物件不可能在短時間內同時出現在影片20以及第2影片中。因此在步驟ST12中,就可以另外對第2關注物件進行過濾,以排除第2關注物件就是關注物件的可能性。According to Embodiment 4 of the present invention, the time, location, and movement speed of the object of interest and the second object of interest detected by the two cameras can be taken into consideration, so as to eliminate the possibility that the second object of interest is mistakenly identified as the object of interest. For example, under the screening of the methods of Embodiments 1 to 3 of the present invention, the object of interest has been screened out from the video 20, and the second object of interest similar to the object of interest has been screened out from the second video. However, according to the implementation results of Embodiment 4 of the present invention, the time, location, and moving speed of the object of interest and the second object of interest are compared, and it is found that the object of interest and the second object of interest are detected at the same time, and the object of interest is detected at the same time. The two cameras that detect the object of interest and the second object of interest are in a stationary state in the video 20 and the second video respectively, but the two cameras that detect the object of interest and the second object of interest are 100 kilometers away from each other. Considering the relative distance between the two cameras, it is impossible for the same object to appear in both film 20 and film 2 in a short period of time. Therefore, in step ST12, the second object of interest may be additionally filtered to exclude the possibility that the second object of interest is the object of interest.

綜上說明,根據本發明實施例1~3,利用影片20的樣本空間22的顏色特徵、屬性特徵、以及特徵向量,對影片20的其他關注物件進行篩選,能夠讓使用者更有效率地從影片中篩選出欲篩選的關注物件。To sum up, according to Embodiments 1 to 3 of the present invention, using the color features, attribute features, and feature vectors of the sample space 22 of the video 20 to screen other objects of interest in the video 20 can allow users to more efficiently Screen out the objects of interest to be screened in the video.

另外,在實施例1~3其中任何一者執行之後,根據本發明實施例4,可以從已篩選出的關注物件再進行過濾,以進一步降低搜尋的範圍。基於實施例4之態樣,可以適用於對多部攝影機所擷取之影像(或標的)作一次性之篩選。因此,能夠讓使用者更有效率地從影片中篩選出欲篩選的關注物件。In addition, after any one of Embodiments 1 to 3 is executed, according to Embodiment 4 of the present invention, filtering can be performed from the already screened objects of interest to further reduce the search scope. Based on the aspect of Embodiment 4, it can be applied to one-time screening of images (or objects) captured by multiple cameras. Therefore, the user can more efficiently select the object of interest to be selected from the video.

另外,如本發明實施例1~4描述的各項方法步驟,均可以用硬體、軟體、或是硬體與軟體的組合來實現。In addition, each method step described in Embodiments 1 to 4 of the present invention may be implemented by hardware, software, or a combination of hardware and software.

當本發明實施例1~4以硬體來實現時,第1圖的步驟ST01~ST12、第3圖的步驟ST31~33、以及第5A圖、第5B圖的演算法,可以是由專用的硬體來實現,但是並非限定於此。專用的硬體舉例來說,相當於單一電路、複合電路、程式化處理器、平行程式化處理器、應用特定積體電路、場式可程式閘陣列、或該等的組合。When Embodiments 1 to 4 of the present invention are implemented in hardware, steps ST01 to ST12 in FIG. 1, steps ST31 to ST33 in FIG. 3, and algorithms in FIGS. 5A and 5B may be performed by dedicated It can be realized by hardware, but it is not limited to this. Dedicated hardware, for example, corresponds to a single circuit, a composite circuit, a programmable processor, a parallel programmable processor, an application specific integrated circuit, a field programmable gate array, or a combination of these.

當本發明實施例1~4以軟體來實現時,是以軟體作為程式,儲存於電腦的記憶體中。當電腦的處理器讀取儲存於記憶體的程式時,使電腦執行第1圖的步驟ST01~ST12、第3圖的步驟ST31~33、以及第5A圖、第5B圖的演算法。電腦舉例來說,相當於中央處理器、中央處理裝置、處理裝置、演算裝置、微處理器、微電腦、處理器、或是數位訊號處理器等。When the embodiments 1 to 4 of the present invention are implemented by software, the software is used as a program and stored in the memory of the computer. When the processor of the computer reads the program stored in the memory, the computer is caused to execute steps ST01 to ST12 in FIG. 1, steps ST31 to ST33 in FIG. 3, and algorithms in FIGS. 5A and 5B. For example, a computer is equivalent to a central processing unit, a central processing unit, a processing unit, an arithmetic unit, a microprocessor, a microcomputer, a processor, or a digital signal processor.

以上已詳述本發明實施例1~4。需注意的是,上述的實施例1~4僅為例示性說明本發明的原理及其功效,而並非用於限制本發明的範圍。本領域具通常知識者在不違背本發明的技術原理及精神下,均可以對實施例進行修改與變更。因此,本發明的權利保護範圍,應以後面的申請專利範圍的描述為準。Embodiments 1 to 4 of the present invention have been described in detail above. It should be noted that the above-mentioned Embodiments 1 to 4 are only illustrative to illustrate the principles and effects of the present invention, and are not intended to limit the scope of the present invention. Those skilled in the art can modify and change the embodiments without departing from the technical principles and spirit of the present invention. Therefore, the protection scope of the right of the present invention should be based on the description of the following patent application scope.

20:影片 21:物件 22:取樣空間 40~42:特徵點 A~J:特徵點 ST01~ST12:步驟 ST31~ST33:步驟 20: Videos 21: Objects 22: Sampling space 40~42: Feature points A~J: Feature points ST01~ST12: Steps ST31~ST33: Steps

第1圖為一流程圖,說明關於本發明實施例1~4的篩選物件的方法。 第2圖為一示意圖,示意第1圖中的步驟ST02根據區域的偵測結果建立取樣空間22之一例。 第3圖為一流程圖,說明第1圖中的步驟ST03的詳細運作流程。 第4A圖為一示意圖,示意從取樣空間22的物件21當中擷取10個特徵點A~J之一例。第4B圖為一示意圖,示意以4個特徵點產生多邊形之一例。 第5A圖、第5B圖為一示意圖,說明第3圖中的步驟ST32根據特徵點產生多邊形之一例。 FIG. 1 is a flow chart illustrating a method for screening objects according to Embodiments 1 to 4 of the present invention. FIG. 2 is a schematic diagram illustrating an example of creating a sampling space 22 according to the detection result of the area in step ST02 in FIG. 1 . FIG. 3 is a flowchart illustrating the detailed operation flow of step ST03 in FIG. 1 . FIG. 4A is a schematic diagram illustrating an example of 10 feature points A to J extracted from the object 21 in the sampling space 22 . FIG. 4B is a schematic diagram illustrating an example of generating a polygon with four feature points. 5A and 5B are schematic diagrams illustrating an example of generating a polygon based on feature points in step ST32 in FIG. 3 .

ST01~ST12:步驟 ST01~ST12: Steps

Claims (10)

一種篩選物件的方法,包含: 從一影片偵測一物件存在的區域; 根據該區域的偵測結果建立一取樣空間; 從該取樣空間擷取一顏色特徵; 將該顏色特徵納入一篩選條件;以及 根據該篩選條件,對該影片中的一關注物件進行篩選。 A method of filtering objects, including: Detecting an area where an object is present from a video; Create a sampling space according to the detection result of the area; extracting a color feature from the sampling space; include the color feature in a filter; and According to the filter condition, filter an object of interest in the video. 如請求項1之篩選物件的方法, 其中,從該取樣空間擷取該顏色特徵之步驟更包含: 從該取樣空間擷取至少一特徵點; 根據該至少一特徵點產生一多邊形;以及 從該多邊形構成的區域擷取該顏色特徵。 Such as the method of filtering objects of claim 1, Wherein, the step of extracting the color feature from the sampling space further includes: extracting at least one feature point from the sampling space; generating a polygon according to the at least one feature point; and The color feature is extracted from the area formed by the polygon. 如請求項2之篩選物件的方法, 其中,該關注物件為人物,該特徵點包含人類的四肢、以及關節等任何一者。 As in the method of filtering objects of claim 2, Wherein, the object of interest is a person, and the feature point includes any one of human limbs, joints, and the like. 如請求項1之篩選物件的方法,更包含: 從該取樣空間擷取一屬性特徵; 將該屬性特徵納入該篩選條件;以及 根據該篩選條件,對該影片中的該關注物件進行篩選。 For example, the method for filtering objects in request item 1, further includes: extracting an attribute feature from the sampling space; include the attribute characteristic in the filter; and According to the filter condition, filter the object of interest in the video. 如請求項4之篩選物件的方法, 其中,該關注物件為人物,該屬性特徵包含人類的性別、年齡、以及服飾等任何一者。 As in the method of filtering objects of claim 4, Wherein, the object of interest is a character, and the attribute feature includes any one of human gender, age, and clothing. 如請求項1之篩選物件的方法,更包含: 對該物件對應的該取樣空間進行一重辨識模型轉換,以取得一特徵向量; 對該關注物件對應的一關注物件取樣空間,進行該重辨識模型轉換,以取得一關注物件特徵向量; 計算該特徵向量與該關注物件特徵向量在多維空間的一距離;以及 將該特徵向量納入該篩選條件時,藉由將該距離與一臨界值進行比較,以判斷該關注物件是否符合該篩選條件。 For example, the method for filtering objects in request item 1, further includes: performing a double identification model transformation on the sampling space corresponding to the object to obtain a feature vector; Performing the re-identification model transformation in a sample space of the object of interest corresponding to the object of interest to obtain a feature vector of the object of interest; calculating a distance between the feature vector and the feature vector of the object of interest in a multi-dimensional space; and When the feature vector is included in the filtering condition, it is determined whether the object of interest meets the filtering condition by comparing the distance with a threshold. 如請求項6之篩選物件的方法, 其中,該重辨識模型轉換為一矩陣運算。 As in the method of filtering objects of claim 6, Wherein, the re-identification model is converted into a matrix operation. 如請求項1至7任何一項之篩選物件的方法,更包含: 根據該篩選條件,篩選出一第2影片中的一第2關注物件;以及 比對該關注物件與該第2關注物件被偵測到的複數個時間、複數個地點、以及複數個速度等任何一者,以過濾該第2關注物件。 If the method for filtering objects in any one of the requirements 1 to 7, it also includes: According to the filter condition, filter out a second object of interest in a second video; and Compare any one of a plurality of times, a plurality of locations, and a plurality of speeds at which the object of interest and the second object of interest are detected to filter the second object of interest. 一種電腦程式產品,經由電腦載入該程式,使該電腦的處理器執行如請求項1至7任何一項之篩選物件的方法。A computer program product, the program is loaded through a computer, so that the processor of the computer executes the method of screening objects according to any one of claims 1 to 7. 如請求項9之電腦程式產品, 其中,該處理器更執行: 根據該篩選條件,篩選出該第2影片中的該第2關注物件;以及 比對該關注物件與該第2關注物件被偵測到的複數個時間、複數個地點、以及複數個速度等任何一者,以過濾該第2關注物件。 For the computer program product of claim 9, Among them, the processor more executes: According to the filter condition, filter out the second object of interest in the second video; and Compare any one of a plurality of times, a plurality of locations, and a plurality of speeds at which the object of interest and the second object of interest are detected to filter the second object of interest.
TW110102665A 2021-01-25 2021-01-25 Method and computer program product for filtering an object TWI811618B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110102665A TWI811618B (en) 2021-01-25 2021-01-25 Method and computer program product for filtering an object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110102665A TWI811618B (en) 2021-01-25 2021-01-25 Method and computer program product for filtering an object

Publications (2)

Publication Number Publication Date
TW202230286A true TW202230286A (en) 2022-08-01
TWI811618B TWI811618B (en) 2023-08-11

Family

ID=83782406

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110102665A TWI811618B (en) 2021-01-25 2021-01-25 Method and computer program product for filtering an object

Country Status (1)

Country Link
TW (1) TWI811618B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201001338A (en) * 2008-06-16 2010-01-01 Huper Lab Co Ltd Method of detecting moving objects
CN109510946B (en) * 2017-09-15 2020-07-17 展讯通信(上海)有限公司 HDR scene detection method and system

Also Published As

Publication number Publication date
TWI811618B (en) 2023-08-11

Similar Documents

Publication Publication Date Title
CN107578418B (en) Indoor scene contour detection method fusing color and depth information
Li et al. Multi-angle head pose classification when wearing the mask for face recognition under the COVID-19 coronavirus epidemic
US10872262B2 (en) Information processing apparatus and information processing method for detecting position of object
TWI554951B (en) Apparatus and method for rendering virtual try-on
JP7094702B2 (en) Image processing device and its method, program
JP6445775B2 (en) Image processing apparatus and image processing method
JP5925557B2 (en) Image matching device
US10489640B2 (en) Determination device and determination method of persons included in imaging data
CN105869217B (en) A kind of virtual real fit method
CN106952292B (en) 3D moving object detection method based on 6-degree-of-freedom scene stream clustering
JP2967086B1 (en) Estimation of 3D pose of a person by multi-view image processing
CN114842033A (en) Image processing method for intelligent AR equipment
TWI811618B (en) Method and computer program product for filtering an object
JP2019133433A (en) Image processing device, image processing method, and program
CN110111368B (en) Human body posture recognition-based similar moving target detection and tracking method
CN111179281A (en) Human body image extraction method and human body action video extraction method
CN114860993A (en) Method for screening objects and computer program product
WO2018113259A1 (en) Method and device for acquiring target object, and robot
CN111696063B (en) Repairing method and system for clothing multi-angle shot pictures
Shemshaki et al. Lip segmentation using geometrical model of color distribution
CN114170317A (en) Method and device for judging position of drowning-proof human head of swimming pool, computer equipment and storage medium thereof
US20090169059A1 (en) Motion Analysis in Digital Image Sequences
Cheng et al. Improving sampling criterion for alpha matting
Xie et al. Hand posture recognition using kinect
JP2000268180A (en) Image processing device and method and provided medium