TWI820430B - Device and method for detecting movement of objects in images - Google Patents

Device and method for detecting movement of objects in images Download PDF

Info

Publication number
TWI820430B
TWI820430B TW110120646A TW110120646A TWI820430B TW I820430 B TWI820430 B TW I820430B TW 110120646 A TW110120646 A TW 110120646A TW 110120646 A TW110120646 A TW 110120646A TW I820430 B TWI820430 B TW I820430B
Authority
TW
Taiwan
Prior art keywords
weight
circuit
background image
image
threshold
Prior art date
Application number
TW110120646A
Other languages
Chinese (zh)
Other versions
TW202249474A (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 TW110120646A priority Critical patent/TWI820430B/en
Publication of TW202249474A publication Critical patent/TW202249474A/en
Application granted granted Critical
Publication of TWI820430B publication Critical patent/TWI820430B/en

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

A device and a method for detecting the movement of an object in an image are provided. The device for detecting the movement of an object in an image includes a weight determination circuit, an image blending circuit, and an object movement detection circuit. The weight determination circuit is used to determine a plurality of weights according to an input image and a background image, each weight corresponding to a pixel position. The image blending circuit is configured to blend the input image and the background image based on the weights to generate an updated background image. The object movement detection circuit is configured to perform a sum of absolute difference (SAD) operation, block by block, on the input image and the background image or updated background image, and generate a moving object indication data, and to generate an object movement signal according to the moving object indication data and at least one threshold. Wherein, each block contains multiple pixels.

Description

偵測影像中物件移動的裝置與方法Device and method for detecting movement of objects in images

本發明是關於影像處理,尤其是關於影像中物件移動的偵測方法與裝置。The present invention relates to image processing, and in particular to methods and devices for detecting movement of objects in images.

以安防監控系統來說,能夠準確偵測判斷影像中是否有物件移動是非常重要的功能。由於安防監控系統通常藉由比對目前的影像與先前的影像來找出移動物件,所以先前的影像的產生方式及移動物件的判斷方法大大地影響安防監控系統的效能及靈敏度。習知的安防監控系統常常因為未能對先前的影像做適當的處理,或是移動物件的判斷方法不夠準確,而造成誤判(誤發警報或漏發警報)。因此,有需要提出一種偵測影像中物件移動的方法與裝置,來提升安防監控系統的可靠度。For security surveillance systems, it is a very important function to accurately detect and determine whether objects in the image are moving. Since security surveillance systems usually find moving objects by comparing the current image with previous images, the way the previous images are generated and the method of judging moving objects greatly affect the performance and sensitivity of the security surveillance system. Conventional security monitoring systems often cause misjudgments (false alarms or missed alarms) because they fail to properly process previous images or the judgment method of moving objects is not accurate enough. Therefore, it is necessary to propose a method and device for detecting the movement of objects in images to improve the reliability of the security monitoring system.

本發明之一目的在於提供一種偵測影像中物件移動的裝置與方法,以改善先前技術的不足。One purpose of the present invention is to provide a device and method for detecting movement of objects in images to improve the deficiencies of the prior art.

本發明之一實施例提供一種偵測影像中物件移動的裝置,包含一權重決定電路、一影像混合電路以及一物件移動偵測電路。權重決定電路用來根據一輸入影像及一背景影像決定複數個權重,每一權重對應於一像素位置。影像混合電路耦接該權重決定電路,用來基於該些權重混合該輸入影像與該背景影像以產生一更新後的背景影像。物件移動偵測電路耦接該影像混合電路,用來逐區塊對該輸入影像與該背景影像或該更新後的背景影像進行一絕對偏差總和運算,並產生一移動物件指示資料,以及根據該移動物件指示資料及至少一閥值產生一物件移動訊號。每一區塊包含複數個像素。An embodiment of the present invention provides a device for detecting movement of objects in an image, including a weighting circuit, an image mixing circuit and an object movement detection circuit. The weight determination circuit is used to determine a plurality of weights based on an input image and a background image, and each weight corresponds to a pixel position. The image mixing circuit is coupled to the weight determination circuit and used to mix the input image and the background image based on the weights to generate an updated background image. The object motion detection circuit is coupled to the image mixing circuit and is used to perform an absolute deviation sum calculation on the input image and the background image or the updated background image block by block, and generate a moving object indication data, and according to the The moving object indication data and at least one threshold generate an object moving signal. Each block contains a plurality of pixels.

本發明之另一實施例提供一種偵測影像中物件移動的方法,包含:根據一輸入影像及一背景影像決定複數個權重,每一權重對應於一像素位置;基於該些權重混合該輸入影像與該背景影像以產生一更新後的背景影像;逐區塊對該輸入影像與該背景影像或該更新後的背景影像進行一絕對偏差總和運算,並產生一移動物件指示資料;以及根據該移動物件指示資料及至少一閥值產生一物件移動訊號。每一區塊包含複數個像素。Another embodiment of the present invention provides a method for detecting movement of objects in an image, including: determining a plurality of weights based on an input image and a background image, each weight corresponding to a pixel position; and mixing the input image based on the weights. and the background image to generate an updated background image; perform an absolute deviation sum calculation on the input image and the background image or the updated background image block by block, and generate a moving object indication data; and based on the movement The object indication data and at least one threshold generate an object movement signal. Each block contains a plurality of pixels.

有關本發明的特徵、實作與功效,茲配合圖式作實施例詳細說明如下。The features, implementation and effects of the present invention are described in detail below with reference to the drawings and examples.

以下說明內容之技術用語係參照本技術領域之習慣用語,如本說明書對部分用語有加以說明或定義,該部分用語之解釋係以本說明書之說明或定義為準。The technical terms used in the following description refer to the idioms in the technical field. If some terms are explained or defined in this specification, the explanation or definition of these terms shall prevail.

本發明之揭露內容包含偵測影像中物件移動的裝置與方法。由於本發明之偵測影像中物件移動的裝置所包含之部分元件單獨而言可能為已知元件,因此在不影響該裝置發明之充分揭露及可實施性的前提下,以下說明對於已知元件的細節將予以節略。此外,本發明之偵測影像中物件移動的方法的部分或全部流程可以是軟體及/或韌體之形式,並且可藉由本發明之偵測影像中物件移動的裝置或其等效裝置來執行,在不影響該方法發明之充分揭露及可實施性的前提下,以下方法發明之說明將著重於步驟內容而非硬體。The disclosure of the present invention includes an apparatus and method for detecting movement of objects in an image. Since some of the components included in the device for detecting movement of objects in images of the present invention may be known components individually, the following description of the known components will not affect the full disclosure and implementability of the device invention. details will be omitted. In addition, part or all of the process of the method for detecting movement of objects in images of the present invention may be in the form of software and/or firmware, and may be executed by the device for detecting movement of objects in images of the present invention or its equivalent device. , without affecting the full disclosure and implementability of the method invention, the following description of the method invention will focus on the step content rather than the hardware.

圖1為本發明偵測影像中物件移動的裝置之一實施例的功能方塊圖。偵測影像中物件移動的裝置100包含背景影像更新電路110、物件移動偵測電路120及儲存電路130。儲存電路130可以包含暫存器、隨機存取記憶體及/或緩衝器。背景影像更新電路110包含權重決定電路112及影像混合電路116。圖2是本發明偵測影像中物件移動的方法之一實施例的流程圖,包含以下步驟。FIG. 1 is a functional block diagram of an embodiment of a device for detecting movement of objects in an image according to the present invention. The device 100 for detecting movement of objects in an image includes a background image update circuit 110, an object movement detection circuit 120 and a storage circuit 130. The storage circuit 130 may include a register, a random access memory, and/or a buffer. The background image update circuit 110 includes a weight determination circuit 112 and an image mixing circuit 116 . FIG. 2 is a flow chart of an embodiment of a method for detecting movement of objects in an image according to the present invention, which includes the following steps.

步驟S210:權重決定電路112根據輸入影像IM及背景影像BG決定複數個權重w(x,y)(「(x,y)」代表像素的坐標),每一權重對應於一像素位置。步驟S210的細節將在圖5詳細說明。Step S210: The weight determination circuit 112 determines a plurality of weights w(x,y) ("(x,y)" represents the coordinates of the pixel) based on the input image IM and the background image BG, and each weight corresponds to a pixel position. The details of step S210 will be explained in detail in FIG. 5 .

步驟S220:影像混合電路116逐像素基於該些權重混合背景影像BG與輸入影像IM以產生更新後的背景影像BG'。所產生的更新後的背景影像BG'存入儲存電路130中,將作為下一回合(當有新進的輸入影像IM時)的背景影像BG。更明確地說,影像混合電路116根據下式來產生更新後的背景影像BG'( ): (1) Step S220: The image mixing circuit 116 mixes the background image BG and the input image IM based on the weights pixel by pixel to generate an updated background image BG'. The generated updated background image BG' is stored in the storage circuit 130 and will be used as the background image BG for the next round (when there is a new input image IM). More specifically, the image mixing circuit 116 generates the updated background image BG' according to the following equation ( ): (1)

其中,IM(x,y)是輸入影像IM在像素位置(x,y)的像素值,BG(x,y)是背景影像BG在像素位置(x,y)的像素值。在實作中,如果每個像素值以8位元表示,則IM(x,y)、BG(x,y)、w(x,y)及BG'(x,y)的數值皆介於0~255,且方程式(1)可以調整成方程式(2): (2) Among them, IM(x,y) is the pixel value of the input image IM at the pixel position (x,y), and BG(x,y) is the pixel value of the background image BG at the pixel position (x,y). In practice, if each pixel value is represented by 8 bits, the values of IM(x,y), BG(x,y), w(x,y) and BG'(x,y) are all between 0~255, and equation (1) can be adjusted to equation (2): (2)

其中,加上 再位移8個位元代表四捨五入運算。本技術領域具有通常知識者可以了解方程式(2)的實作細節,以及了解如何將方程式(1)應用於像素值不等於8位元的情況中,故不再贅述。 Among them, plus Shifting by another 8 bits represents the rounding operation. A person with ordinary knowledge in the art can understand the implementation details of equation (2) and how to apply equation (1) to the case where the pixel value is not equal to 8 bits, so the details will not be described again.

步驟S230:物件移動偵測電路120逐區塊對輸入影像及背景影像(可以是背景影像BG或更新後的背景影像BG')進行絕對偏差總和(sum of absolute difference, SAD)運算,並產生一移動物件指示資料。此步驟是以區塊為單位進行運算。請參閱圖3,圖3顯示輸入影像IM及背景影像BG(或更新後的背景影像BG')的示意圖。一個影像可以是一個畫面(picture)或一張圖幀(frame)。在圖3的例子中,一個影像包含64個像素((x,y), )及16個區塊((m,n), ),一個區塊包含4個像素。也就是說,物件移動偵測電路120根據方程式(3)(背景影像為背景影像BG)或方程式(4)(背景影像為更新後的背景影像BG')對每一區塊進行SAD運算,因此共產生16個SAD值(SAD(m,n), )。 (3) (4) Step S230: The object motion detection circuit 120 performs a sum of absolute difference (SAD) calculation on the input image and the background image (which can be the background image BG or the updated background image BG') block by block, and generates a Move object instruction data. This step is performed in blocks. Please refer to Figure 3, which shows a schematic diagram of the input image IM and the background image BG (or the updated background image BG'). An image can be a picture or a frame. In the example in Figure 3, an image contains 64 pixels ((x, y), , ) and 16 blocks ((m,n), , ), a block contains 4 pixels. That is to say, the object motion detection circuit 120 performs the SAD operation on each block according to equation (3) (the background image is the background image BG) or equation (4) (the background image is the updated background image BG'). Therefore, A total of 16 SAD values (SAD(m,n), , ). (3) (4)

其中,bs_x代表一個區塊在x軸上的像素個數,bs_y代表一個區塊在y軸上的像素個數,也就是說,一個區塊的大小為bs_x*bs_y。在圖3的例子中,bs_x=bs_y=2。Among them, bs_x represents the number of pixels of a block on the x-axis, and bs_y represents the number of pixels of a block on the y-axis. That is to say, the size of a block is bs_x*bs_y. In the example of Figure 3, bs_x=bs_y=2.

接著,物件移動偵測電路120根據影像中的所有SAD值與第一閥值sad_thd產生移動物件指示資料MOI。更明確地說,物件移動偵測電路120根據方程式(5)逐區塊比對SAD(m,n)及第一閥值sad_thd,來得到比較結果CR,所有區塊的比較結果CR形成移動物件指示資料MOI。 (5) Then, the object motion detection circuit 120 generates moving object indication data MOI according to all SAD values in the image and the first threshold sad_thd. More specifically, the object motion detection circuit 120 compares SAD(m,n) and the first threshold sad_thd block by block according to equation (5) to obtain the comparison result CR. The comparison results CR of all blocks form a moving object. Indicates the data MOI. (5)

請參閱圖4A,圖4A顯示移動物件指示資料MOI的一個例子,其中區塊(2,1)、(3,1)、(2,2)、(3,2)及(2,3)的比較結果CR為1,代表影像中的該區域可能有移動物件。Please refer to Figure 4A. Figure 4A shows an example of the moving object indication data MOI, in which blocks (2,1), (3,1), (2,2), (3,2) and (2,3) The comparison result CR is 1, which means there may be moving objects in this area of the image.

步驟S240:物件移動偵測電路120根據移動物件指示資料MOI及至少一閥值產生一物件移動訊號Sig_alm。舉例來說,物件移動偵測電路120可以根據方程式(6)或方程式(7)來決定物件移動訊號Sig_alm的值。 (6) (7) Step S240: The object motion detection circuit 120 generates an object motion signal Sig_alm according to the moving object indication data MOI and at least one threshold. For example, the object motion detection circuit 120 can determine the value of the object motion signal Sig_alm according to Equation (6) or Equation (7). (6) (7)

其中,N_moi是比較結果CR為1的區塊個數(在圖4A的例子中,N_moi=5),alm_thd1及alm_thd2為閥值。在此,使用者可以利用設定閥值alm_thd1的大小來代表比較結果是具有顯著差異,這樣才代表有移動物件發生,而可以避免只是雜訊造成的偽陽性。進一步地,使用者可以利用設定閥值alm_thd2的大小來排除可能因為開關燈產生亮度大幅度變化而造成的錯誤訊息,以避免誤判。物件移動訊號Sig_alm為1代表物件移動偵測電路120偵測到輸入影像IM中有移動物件,且移動物件的特性(例如大小)符合使用者的設定條件。Among them, N_moi is the number of blocks with a comparison result CR of 1 (in the example of Figure 4A, N_moi=5), and alm_thd1 and alm_thd2 are thresholds. Here, the user can use the size of the set threshold alm_thd1 to indicate that the comparison results are significantly different. This means that a moving object has occurred, and false positives caused by noise can be avoided. Furthermore, the user can use the value of the set threshold alm_thd2 to exclude error messages that may be caused by large changes in brightness caused by switching lights to avoid misjudgments. The object movement signal Sig_alm is 1, which means that the object movement detection circuit 120 has detected a moving object in the input image IM, and the characteristics (such as size) of the moving object meet the user's setting conditions.

圖5是步驟S210的一實施例的流程圖,包含步驟S510~S590。權重決定電路112計算對應於一個目標像素位置的兩個像素(一者為目標輸入像素,另一者為目標背景像素)的像素值絕對偏差(步驟S580),並且根據像素值絕對偏差及權重閥值w_thd來將該目標像素位置分類為A類(其權重w(x,y)為A類權重w_a)或B類(其權重w(x,y)為B類權重w_b)(步驟S590)。權重決定電路112根據其本身是否操作於權重調整模式(步驟S520)以及輸入影像IM是否更新(步驟S510)來決定是否調整A類權重w_a(步驟S530~S570)。請參閱圖3,目標像素位置是指一組(x,y)值(例如,圖3中黑色標記之像素位置(4,1)),目標輸入像素是輸入影像IM在該位置的像素(其像素值為IM(x,y),圖3所示之例子為IM(4,1)),而目標背景像素是背景影像BG在該位置的像素(其像素值為BG(x,y),圖3所示之例子為BG(4,1))。Figure 5 is a flowchart of an embodiment of step S210, including steps S510~S590. The weight determination circuit 112 calculates the absolute deviation of the pixel values of the two pixels (one is the target input pixel and the other is the target background pixel) corresponding to a target pixel position (step S580), and calculates the absolute deviation of the pixel value according to the absolute deviation of the pixel value and the weight valve. The value w_thd is used to classify the target pixel position into class A (its weight w (x, y) is the weight w_a of class A) or class B (its weight w (x, y) is the weight w_b of class B) (step S590). The weight determination circuit 112 determines whether to adjust the type A weight w_a (steps S530 to S570) according to whether it operates in the weight adjustment mode (step S520) and whether the input image IM is updated (step S510). Please refer to Figure 3. The target pixel position refers to a set of (x, y) values (for example, the pixel position (4,1) marked in black in Figure 3), and the target input pixel is the pixel of the input image IM at that position (its The pixel value is IM(x,y), the example shown in Figure 3 is IM(4,1)), and the target background pixel is the pixel of the background image BG at that position (its pixel value is BG(x,y), The example shown in Figure 3 is BG(4,1)).

步驟S510~S590的細節如下。The details of steps S510~S590 are as follows.

步驟S510:權重決定電路112判斷輸入影像IM是否為新進的輸入影像。詳細來說,權重決定電路112藉由判斷當前輸入的像素資料是否屬於一新進的輸入影像,進而判斷當前輸入的像素資料是否對應到輸入影像IM的第一個像素。在一些實施例中,權重決定電路112藉由計數像素個數來得知是否已達前一個輸入影像IM的結尾及/或新的輸入影像IM的起始。如果步驟S510的結果為是(即,輸入影像已更新),權重決定電路112執行步驟S520;否則,權重決定電路112執行步驟S580。Step S510: The weight determination circuit 112 determines whether the input image IM is a new input image. Specifically, the weight determination circuit 112 determines whether the currently input pixel data belongs to a new input image, and then determines whether the currently input pixel data corresponds to the first pixel of the input image IM. In some embodiments, the weight determination circuit 112 determines whether the end of the previous input image IM and/or the beginning of the new input image IM has been reached by counting the number of pixels. If the result of step S510 is yes (ie, the input image has been updated), the weight determination circuit 112 executes step S520; otherwise, the weight determination circuit 112 executes step S580.

步驟S520:權重決定電路112判斷背景影像更新電路110或其本身是否操作於權重調整模式。如果步驟S520的結果為是(即,在權重調整模式下),權重決定電路112根據預設值w_a_dft以及是否收到重置訊號w_rst來調整A類權重w_a(步驟S530~S570);否則,權重決定電路112執行步驟S570。Step S520: The weight determination circuit 112 determines whether the background image update circuit 110 or itself operates in the weight adjustment mode. If the result of step S520 is yes (ie, in the weight adjustment mode), the weight determination circuit 112 adjusts the class A weight w_a according to the default value w_a_dft and whether the reset signal w_rst is received (steps S530 to S570); otherwise, the weight The decision circuit 112 executes step S570.

步驟S530:權重決定電路112判斷是否收到重置訊號w_rst。如果步驟S530的結果為是,權重決定電路112執行步驟S540;否則,權重決定電路112執行步驟S550。何時以及如何產生重置訊號w_rst將於下方配合圖10詳述。Step S530: The weight determination circuit 112 determines whether the reset signal w_rst is received. If the result of step S530 is yes, the weight determination circuit 112 executes step S540; otherwise, the weight determination circuit 112 executes step S550. When and how to generate the reset signal w_rst will be detailed below in conjunction with Figure 10.

步驟S540:權重決定電路112重置A類權重w_a為初始值w_a_ini,然後執行步驟S580。Step S540: The weight determination circuit 112 resets the type A weight w_a to the initial value w_a_ini, and then executes step S580.

步驟S550:權重決定電路112調整A類權重。例如,權重決定電路112每次執行步驟S550時,將A類權重w_a減去一個步進值(step value)。Step S550: The weight determination circuit 112 adjusts the Class A weight. For example, the weight determination circuit 112 subtracts a step value (step value) from the Class A weight w_a each time step S550 is executed.

步驟S560:權重決定電路112判斷調整後的A類權重w_a是否小於預設值w_a_dft。預設值w_a_dft可以儲存於儲存電路130。如果步驟S560的結果為是,則權重決定電路112執行步驟S570;否則,權重決定電路112執行步驟S580。Step S560: The weight determination circuit 112 determines whether the adjusted Class A weight w_a is less than the preset value w_a_dft. The default value w_a_dft can be stored in the storage circuit 130 . If the result of step S560 is yes, the weight determination circuit 112 executes step S570; otherwise, the weight determination circuit 112 executes step S580.

步驟S570:權重決定電路112以預設值w_a_dft作為A類權重w_a。Step S570: The weight determination circuit 112 uses the preset value w_a_dft as the type A weight w_a.

步驟S580:權重決定電路112計算目標輸入像素與目標背景像素之間的像素值絕對偏差Px_d( )。 Step S580: The weight determination circuit 112 calculates the absolute deviation Px_d of pixel values between the target input pixel and the target background pixel ( ).

步驟S590:權重決定電路112根據像素值絕對偏差Px_d及權重閥值w_thd選擇A類權重w_a或B類權重w_b作為對應於該目標像素位置之該權重w(x,y)。在一些實施例中,當像素值絕對偏差Px_d大於權重閥值w_thd時,目標像素位置被歸為A類,代表輸入影像IM及背景影像BG之間在目標像素位置的變化相對較大(可能是由移動物件造成);當像素值絕對偏差Px_d不大於權重閥值w_thd時,目標像素位置被歸為B類,代表輸入影像IM及背景影像BG之間在目標像素位置的變化相對較小。Step S590: The weight determination circuit 112 selects the A-type weight w_a or the B-type weight w_b as the weight w(x, y) corresponding to the target pixel position according to the pixel value absolute deviation Px_d and the weight threshold w_thd. In some embodiments, when the absolute deviation Px_d of the pixel value is greater than the weight threshold w_thd, the target pixel position is classified into category A, which means that the change in the target pixel position between the input image IM and the background image BG is relatively large (possibly Caused by moving objects); when the absolute deviation of the pixel value Px_d is not greater than the weight threshold w_thd, the target pixel position is classified as category B, which means that the change in the target pixel position between the input image IM and the background image BG is relatively small.

在一些實施例中,預設值w_a_dft小於B類權重w_b。舉例來說,預設值w_a_dft可以是0.25(或是64,當像素值以8位元表示時),而B類權重w_b可以是0.5(或是128,當像素值以8位元表示時)。In some embodiments, the preset value w_a_dft is smaller than the class B weight w_b. For example, the default value w_a_dft can be 0.25 (or 64, when the pixel value is expressed in 8 bits), and the type B weight w_b can be 0.5 (or 128, when the pixel value is expressed in 8 bits) .

在一些情況中,當偵測影像中物件移動的裝置100啟動後的第一張輸入影像IM(將成為第一張背景影像BG)包含移動物件時,該第一張輸入影像IM在背景中的權重應該設為較低(即,新進的輸入影像IM的權重應該設為較高),以避免移動物件一直留存在背景中(可能會造成偵測影像中物件移動的裝置100誤判)。權重調整模式(即步驟S530~S570)的目的便是在處理上述的情況。步驟S540的初始值w_a_ini大於步驟S560及S570的預設值w_a_dft。舉例來說,初始值w_a_ini可以是128,而預設值w_a_dft可以是32;在此情況下,於偵測影像中物件移動的裝置100啟動或權重決定電路112收到重置訊號w_rst之後,權重決定電路112指定給A類像素位置的權重(即,A類權重w_a)最初會等於128(即初始值w_a_ini),然後漸漸變小,直到等於32(即預設值w_a_dft)。在另一實施例中,在權重調整模式開啟的情況下,對於裝置100啟動後的第一張輸入影像IM或收到重置訊號w_rst後的第一張輸入影像IM,A類權重w_a可以設定為初始值w_a_ini,之後每當更新一張輸入影像IM(即新進一張輸入影像IM),係以當前A類權重w_a扣除一固定數值(例如16)做為調整後的A類權重w_a,經過特定次數(例如6次)的調整後,A類權重w_a即維持固定不變。前面實施例中係以A類權重w_a逐漸變小來說明權重調整模式的操作,實施上亦可以逐漸增大B類權重w_b來達成相近的效果。整體而言,於偵測影像中物件移動的裝置100啟動或權重決定電路112收到重置訊號w_rst之後,在權重調整模式開啟的情況下,會具有一段時間由權重決定電路112調整A類權重w_a或B類權重w_b。In some cases, when the first input image IM (which will become the first background image BG) after the device 100 for detecting movement of objects in an image is started contains moving objects, the first input image IM in the background The weight should be set lower (that is, the weight of the new input image IM should be set higher) to avoid moving objects remaining in the background (which may cause misjudgment by the device 100 that detects the movement of objects in the image). The purpose of the weight adjustment mode (ie, steps S530~S570) is to handle the above situation. The initial value w_a_ini in step S540 is greater than the preset value w_a_dft in steps S560 and S570. For example, the initial value w_a_ini can be 128, and the default value w_a_dft can be 32; in this case, after the device 100 for detecting the movement of objects in the image is started or the weight determination circuit 112 receives the reset signal w_rst, the weight The weight assigned by the decision circuit 112 to the Class A pixel position (ie, the Class A weight w_a) will initially be equal to 128 (ie, the initial value w_a_ini), and then gradually become smaller until it is equal to 32 (ie, the default value w_a_dft). In another embodiment, when the weight adjustment mode is turned on, for the first input image IM after the device 100 is started or the first input image IM after receiving the reset signal w_rst, the type A weight w_a can be set is the initial value w_a_ini. After that, every time an input image IM is updated (that is, a new input image IM), a fixed value (for example, 16) is deducted from the current Class A weight w_a as the adjusted Class A weight w_a. After a specific number of adjustments (such as 6 times), the weight w_a of type A remains fixed. In the previous embodiment, the operation of the weight adjustment mode is explained by using the weight w_a of type A to gradually become smaller. In implementation, the weight w_b of type B can also be gradually increased to achieve a similar effect. Generally speaking, after the device 100 for detecting the movement of objects in the image is activated or the weight determination circuit 112 receives the reset signal w_rst, when the weight adjustment mode is turned on, there will be a period of time for the weight determination circuit 112 to adjust the Class A weight. w_a or class B weight w_b.

圖6為物件移動偵測電路120之一實施例的功能方塊圖。物件移動偵測電路120包含計算電路610、比較電路620以及判斷電路630。圖7顯示步驟S230的子步驟S710及S720,以及顯示步驟S240的子步驟S730。FIG. 6 is a functional block diagram of an embodiment of the object motion detection circuit 120. The object motion detection circuit 120 includes a calculation circuit 610, a comparison circuit 620 and a judgment circuit 630. FIG. 7 shows sub-steps S710 and S720 of step S230, and shows sub-step S730 of step S240.

步驟S710:計算電路610逐區塊計算輸入影像IM與背景影像之間的絕對偏差總和SAD(m,n)。請參考方程式(3)或(4)以及步驟S230的說明。Step S710: The calculation circuit 610 calculates the sum of absolute deviations SAD(m,n) between the input image IM and the background image block by block. Please refer to equation (3) or (4) and the description of step S230.

步驟S720:比較電路620根據絕對偏差總和與第一閥值sad_thd產生移動物件指示資料MOI。請參考方程式(5)、圖4A以及相關的說明。Step S720: The comparison circuit 620 generates the moving object indication data MOI according to the absolute deviation sum and the first threshold sad_thd. Please refer to Equation (5), Figure 4A, and related descriptions.

步驟S730:判斷電路630處理該移動物件指示資料以產生一統計值,並基於該統計值與第二閥值alm_thd1及/或第三閥值alm_thd2之比較結果產生物件移動訊號Sig_alm。更明確地說,判斷電路630統計移動物件指示資料MOI中比較結果CR為1的區塊個數。以圖4A為例,判斷電路630得到統計值為5。接著,判斷電路630將統計值與第二閥值alm_thd1做比較,或是將統計值與第二閥值alm_thd1及第三閥值alm_thd2做比較,細節請參考方程式(6)或(7)以及步驟S240的說明。Step S730: The judgment circuit 630 processes the moving object indication data to generate a statistical value, and generates an object moving signal Sig_alm based on the comparison result between the statistical value and the second threshold alm_thd1 and/or the third threshold alm_thd2. More specifically, the judgment circuit 630 counts the number of blocks in the moving object indication data MOI for which the comparison result CR is 1. Taking FIG. 4A as an example, the judgment circuit 630 obtains a statistical value of 5. Next, the judgment circuit 630 compares the statistical value with the second threshold alm_thd1, or compares the statistical value with the second threshold alm_thd1 and the third threshold alm_thd2. For details, please refer to equation (6) or (7) and steps Instructions for S240.

圖8為物件移動偵測電路120之另一實施例的功能方塊圖。物件移動偵測電路120包含計算電路610、比較電路620、判斷電路630、運算電路810、區域選取電路820以及燈光切換偵測電路830。圖9顯示步驟S240的子步驟S910~S930。FIG. 8 is a functional block diagram of another embodiment of the object motion detection circuit 120. The object motion detection circuit 120 includes a calculation circuit 610, a comparison circuit 620, a judgment circuit 630, an operation circuit 810, an area selection circuit 820 and a light switching detection circuit 830. Figure 9 shows the sub-steps S910~S930 of step S240.

步驟S910:運算電路810對移動物件指示資料MOI進行形態學開啟運算(morphology opening operation)。形態學開啟運算除了可以使移動物件指示資料MOI的邊緣部分變得較為平滑之外,也可以去除移動物件指示資料MOI中較小的移動物件及/或使移動物件與移動物件之間的邊界更為明確。Step S910: The computing circuit 810 performs a morphology opening operation on the moving object indication data MOI. In addition to making the edges of the moving object indication data MOI smoother, the morphological turning on operation can also remove smaller moving objects in the moving object indication data MOI and/or make the boundaries between moving objects clearer. for clarity.

步驟S920:區域選取電路820基於一感興趣的區域(Region Of Interest, ROI)選取移動物件指示資料MOI的一部分。更明確地說,區域選取電路820使用一遮罩來與移動物件指示資料MOI做交集,來取得移動物件指示資料MOI的一部分。舉例來說,請參閱圖4B,圖4B顯示遮罩的一實施例的示意圖。如圖4B所示,感興趣的區域以1表示(即,區塊(1,1)、區塊(2,1)、區塊(1,2)及區塊(2,2)的值為1,其他區塊的值為0);換言之,感興趣的區域為影像的中間部分。如圖4A及4B所示,區域選取電路820是以區塊為單位對移動物件指示資料MOI進行處理。Step S920: The region selection circuit 820 selects a part of the moving object indication data MOI based on a Region Of Interest (ROI). More specifically, the region selection circuit 820 uses a mask to intersect with the moving object indication data MOI to obtain a portion of the moving object indication data MOI. For example, please refer to FIG. 4B , which shows a schematic diagram of a mask according to an embodiment. As shown in Figure 4B, the region of interest is represented by 1 (i.e., the values of block(1,1), block(2,1), block(1,2), and block(2,2) are 1, the value of other blocks is 0); in other words, the area of interest is the middle part of the image. As shown in FIGS. 4A and 4B , the area selection circuit 820 processes the moving object indication data MOI in units of blocks.

步驟S930:判斷電路630處理移動物件指示資料的該部分以產生一統計值,並基於該統計值與第二閥值alm_thd1及/或第三閥值alm_thd2之比較結果產生物件移動訊號Sig_alm。此步驟與步驟S730類似,差別在於判斷電路630在步驟S930中只處理移動物件指示資料MOI中對應於感興趣的區域的部分。Step S930: The judgment circuit 630 processes the part of the moving object indication data to generate a statistical value, and generates the object moving signal Sig_alm based on the comparison result between the statistical value and the second threshold alm_thd1 and/or the third threshold alm_thd2. This step is similar to step S730, except that the judgment circuit 630 only processes the part of the moving object indication data MOI corresponding to the area of interest in step S930.

燈光切換偵測電路830將配合圖10做說明。圖10為本發明偵測影像之燈光切換之一實施例的流程圖,包含以下步驟。The light switching detection circuit 830 will be explained with reference to FIG. 10 . Figure 10 is a flow chart of one embodiment of light switching for image detection according to the present invention, including the following steps.

步驟S1010:燈光切換偵測電路830基於該些絕對偏差總和(即,SAD(m,n))計算當前的燈光切換指示值LSD(LSD(q)),如方程式(8)所示。 (8) Step S1010: The light switching detection circuit 830 calculates the current light switching indication value LSD (LSD(q)) based on the sum of absolute deviations (ie, SAD(m,n)), as shown in equation (8). (8)

其中,bn_x為x軸上的區塊個數,bn_y為y軸上的區塊個數。對圖4A的例子而言,bn_x=bn_y=4。在一些實施例中,k=1代表區塊(0,0)、k=2代表區塊(1,0)、k=3代表區塊(2,0)、k=4代表區塊(3,0)、k=5代表區塊(0,1),以此類推。Among them, bn_x is the number of blocks on the x-axis, and bn_y is the number of blocks on the y-axis. For the example of Figure 4A, bn_x=bn_y=4. In some embodiments, k=1 represents block (0,0), k=2 represents block (1,0), k=3 represents block (2,0), and k=4 represents block (3 ,0), k=5 represents block (0,1), and so on.

步驟S1020:於產生LSD(q)之後,燈光切換偵測電路830將LSD(q)儲存至儲存電路130。Step S1020: After generating LSD(q), the light switching detection circuit 830 stores LSD(q) into the storage circuit 130.

步驟S1030:燈光切換偵測電路830比較當前的燈光切換指示值(LSD(q))與前次的燈光切換指示值(LSD(q-1),儲存於儲存電路130中)來產生燈光切換指示訊號L_ind。更明確地說,燈光切換偵測電路830根據方程式(9)來決定燈光切換指示訊號L_ind,其中lsd_thd為閥值。 (9) Step S1030: The light switching detection circuit 830 compares the current light switching indication value (LSD(q)) with the previous light switching indication value (LSD(q-1), stored in the storage circuit 130) to generate a light switching indication. Signal L_ind. More specifically, the light switching detection circuit 830 determines the light switching indication signal L_ind according to equation (9), where lsd_thd is the threshold. (9)

由方程式(8)可知,燈光切換指示值LSD代表一個影像的全域(即,整個影像)SAD。當影像中的燈光突然發生明顯的變化時(例如,受監控區域的燈光開啟/關閉),LSD(q)與LSD(q-1)之間會有較大的差異。換言之,燈光切換指示訊號L_ind的其中一種用途是指示燈光的開啟/關閉。It can be seen from equation (8) that the light switching indication value LSD represents the global SAD of an image (ie, the entire image). When the light in the image suddenly changes significantly (for example, the lights in the monitored area are turned on/off), there will be a large difference between LSD(q) and LSD(q-1). In other words, one of the uses of the light switching indication signal L_ind is to indicate the on/off of the light.

請參閱圖8,判斷電路630可以更依據燈光切換指示訊號L_ind來決定是否發出物件移動訊號Sig_alm。在一些實施例中,當燈光切換指示訊號L_ind為1時,判斷電路630不發出物件移動訊號Sig_alm或是使物件移動訊號Sig_alm等於0,以避免將燈光切換誤認為有移動物件。Referring to FIG. 8 , the judgment circuit 630 may further determine whether to issue the object movement signal Sig_alm based on the light switching indication signal L_ind. In some embodiments, when the light switching indication signal L_ind is 1, the judgment circuit 630 does not send the object movement signal Sig_alm or sets the object movement signal Sig_alm equal to 0 to avoid mistaking the light switching as a moving object.

在一些實施例中,燈光切換指示訊號L_ind可以作為或是用以產生前述的重置訊號w_rst。也就是說,當燈光切換時,權重決定電路112重置A類權重w_a(步驟S540)。In some embodiments, the light switching indication signal L_ind can be used as or used to generate the aforementioned reset signal w_rst. That is, when the light is switched, the weight determination circuit 112 resets the type A weight w_a (step S540).

在一些實施例中,燈光切換指示訊號L_ind亦可用以重設背景影像BG。詳細來說,當燈光切換時,裝置100基於燈光切換偵測電路830所產生的燈光切換指示訊號L_ind刪除儲存電路130中的背景影像BG(即,刪除歷史背景影像),並可重置系統中對應輸入影像IM的計數值,以使裝置100以目前的輸入影像IM作為第一張背景影像BG(即,類似於重新啟動)。刪除歷史背景影像可以避免裝置100因為燈光切換而造成誤判。In some embodiments, the light switching indication signal L_ind can also be used to reset the background image BG. Specifically, when the light is switched, the device 100 deletes the background image BG in the storage circuit 130 (ie, deletes the historical background image) based on the light switching instruction signal L_ind generated by the light switching detection circuit 830, and can reset the system. The count value corresponding to the input image IM causes the device 100 to use the current input image IM as the first background image BG (that is, similar to restarting). Deleting historical background images can prevent the device 100 from causing misjudgments due to light switching.

在一些實施例中,前述的方程式(8)可以修飾為方程式(10),以減小數據量(降低儲存電路130的用量),其中 (10) In some embodiments, the aforementioned equation (8) can be modified into equation (10) to reduce the amount of data (reduce the usage of the storage circuit 130), where . (10)

本技術領域具有通常知識者可以根據以上的揭露內容來設計判斷電路630、運算電路810及燈光切換偵測電路830,也就是說,判斷電路630、運算電路810及燈光切換偵測電路830可以是特殊應用積體電路(Application Specific Integrated Circuit, ASIC)或是由可程式化邏輯裝置(Programmable Logic Device, PLD)等電路或硬體實作。Those with ordinary skill in the art can design the judgment circuit 630, the operation circuit 810 and the light switching detection circuit 830 based on the above disclosure. That is to say, the judgment circuit 630, the operation circuit 810 and the light switching detection circuit 830 can be Application Specific Integrated Circuit (ASIC) may be implemented by circuits or hardware such as Programmable Logic Device (PLD).

本發明之偵測影像中物件移動的裝置與方法對影像做逐像素的運算來更新背景影像,以及對影像做逐區塊的運算來判斷是否有移動物件。相較於傳統技術,本發明較不會造成誤判。此外,隨著時間調整權重可以使實作本發明之安防監控系統有更高的可靠度。The device and method for detecting movement of objects in an image of the present invention perform pixel-by-pixel operations on the image to update the background image, and perform block-by-block operations on the image to determine whether there are moving objects. Compared with traditional technology, the present invention is less likely to cause misjudgment. In addition, adjusting the weights over time can make the security monitoring system implementing the present invention have higher reliability.

在一些實施例中,前揭的流程圖中所提及的步驟可依實際操作調整其前後順序,甚至可同時或部分同時執行。In some embodiments, the order of the steps mentioned in the above-mentioned flow chart can be adjusted according to the actual operation, and can even be executed simultaneously or partially simultaneously.

雖然本發明之實施例如上所述,然而該些實施例並非用來限定本發明,本技術領域具有通常知識者可依據本發明之明示或隱含之內容對本發明之技術特徵施以變化,凡此種種變化均可能屬於本發明所尋求之專利保護範疇,換言之,本發明之專利保護範圍須視本說明書之申請專利範圍所界定者為準。Although the embodiments of the present invention are described above, these embodiments are not intended to limit the present invention. Those skilled in the art may make changes to the technical features of the present invention based on the explicit or implicit contents of the present invention. All these changes may fall within the scope of patent protection sought by the present invention. In other words, the patent protection scope of the present invention must be determined by the patent application scope of this specification.

100:偵測影像中物件移動的裝置 110:背景影像更新電路 112:權重決定電路 116:影像混合電路 120:物件移動偵測電路 130:儲存電路 IM:輸入影像 BG:背景影像 BG':更新後的背景影像 SAD(m,n):SAD值 sad_thd:第一閥值 MOI:移動物件指示資料 CR:比較結果 Sig_alm:物件移動訊號 w_thd:權重閥值 w_a:A類權重 w_a_dft:預設值 w_a_ini:初始值 w_b:B類權重 w_rst:重置訊號 610:計算電路 620:比較電路 630:判斷電路 alm_thd1:第二閥值 alm_thd2:第三閥值 810:運算電路 820:區域選取電路 830:燈光切換偵測電路 LSD(q),LSD(q-1):燈光切換指示值 lsd_thd:閥值 L_ind:燈光切換指示訊號 S210,S220,S230,S240,S510,S520,S530,S540,S550,S560,S570,S580,S590,S710,S720,S730,S910,S920,S930,S1010,S1020,S1030:步驟 100: Device for detecting movement of objects in images 110: Background image update circuit 112: Weight decision circuit 116:Image hybrid circuit 120: Object motion detection circuit 130:Storage circuit IM: input image BG: background image BG':Updated background image SAD(m,n):SAD value sad_thd: first threshold MOI: moving object indication data CR: comparison result Sig_alm: object movement signal w_thd: weight threshold w_a: Class A weight w_a_dft:Default value w_a_ini: initial value w_b: Class B weight w_rst: reset signal 610: Calculation circuit 620: Comparison circuit 630: Judgment circuit alm_thd1: second threshold alm_thd2: third threshold 810: Arithmetic circuit 820: Area selection circuit 830: Light switching detection circuit LSD(q), LSD(q-1): light switching indication value lsd_thd:threshold L_ind: light switching indicator signal step

圖1為本發明偵測影像中物件移動的裝置之一實施例的功能方塊圖; 圖2是本發明偵測影像中物件移動的方法之一實施例的流程圖; 圖3顯示輸入影像IM及背景影像BG(或更新後的背景影像BG')的示意圖; 圖4A顯示移動物件指示資料MOI的一個例子; 圖4B顯示遮罩的一實施例的示意圖; 圖5是圖2之步驟S210的一實施例的流程圖; 圖6為物件移動偵測電路120之一實施例的功能方塊圖; 圖7顯示步驟S230的子步驟,以及步驟S240的子步驟; 圖8為物件移動偵測電路120之另一實施例的功能方塊圖; 圖9顯示步驟S240的子步驟;以及 圖10為本發明偵測影像之燈光切換之一實施例的流程圖。 Figure 1 is a functional block diagram of an embodiment of a device for detecting movement of objects in an image according to the present invention; Figure 2 is a flow chart of one embodiment of a method for detecting movement of objects in an image according to the present invention; Figure 3 shows a schematic diagram of the input image IM and the background image BG (or the updated background image BG'); Figure 4A shows an example of moving object indication data MOI; Figure 4B shows a schematic diagram of an embodiment of the mask; Figure 5 is a flow chart of an embodiment of step S210 in Figure 2; Figure 6 is a functional block diagram of an embodiment of the object motion detection circuit 120; Figure 7 shows the sub-steps of step S230 and the sub-steps of step S240; Figure 8 is a functional block diagram of another embodiment of the object motion detection circuit 120; Figure 9 shows the sub-steps of step S240; and FIG. 10 is a flow chart of one embodiment of light switching for image detection according to the present invention.

100:偵測影像中物件移動的裝置 100: Device for detecting movement of objects in images

110:背景影像更新電路 110: Background image update circuit

112:權重決定電路 112: Weight determination circuit

116:影像混合電路 116:Image hybrid circuit

120:物件移動偵測電路 120: Object motion detection circuit

130:儲存電路 130:Storage circuit

BG:背景影像 BG: background image

BG':更新後的背景影像 BG':Updated background image

IM:輸入影像 IM: input image

Sig_alm:物件移動訊號 Sig_alm: object movement signal

w_a_dft:預設值 w_a_dft:Default value

w_a_ini:初始值 w_a_ini: initial value

w_b:B類權重 w_b: Class B weight

w_rst:重置訊號 w_rst: reset signal

w_thd:權重閥值 w_thd: weight threshold

Claims (18)

一種偵測影像中物件移動的裝置,包含:一權重決定電路,用來根據一輸入影像及一背景影像決定複數個權重,每一權重對應於一像素位置;一影像混合電路,用來基於該些權重混合該輸入影像與該背景影像以產生一更新後的背景影像;以及一物件移動偵測電路,用來逐區塊對該輸入影像與該背景影像或該更新後的背景影像進行一絕對偏差總和運算,並產生一移動物件指示資料,以及根據該移動物件指示資料及至少一閥值產生一物件移動訊號;其中,每一區塊包含複數個像素;其中,該輸入影像包含位於一目標像素位置之一目標輸入像素,該背景影像包含位於該目標像素位置之一目標背景像素,該權重決定電路根據一權重閥值及該目標輸入像素與該目標背景像素間之一像素值絕對偏差決定以一第一權重作為對應於該目標像素位置之該權重,該權重決定電路更於該輸入影像更新時調整該第一權重。 A device for detecting movement of objects in an image, including: a weight determination circuit for determining a plurality of weights based on an input image and a background image, each weight corresponding to a pixel position; an image mixing circuit for determining based on the Mixing the input image and the background image with these weights to generate an updated background image; and an object motion detection circuit for performing an absolute block-by-block comparison between the input image and the background image or the updated background image. Deviation summation operation, and generating a moving object indication data, and generating an object movement signal according to the moving object indication data and at least one threshold; wherein each block includes a plurality of pixels; wherein the input image includes a target located at A target input pixel at a pixel position. The background image includes a target background pixel at the target pixel position. The weight determination circuit determines based on a weight threshold and an absolute deviation of pixel values between the target input pixel and the target background pixel. Using a first weight as the weight corresponding to the target pixel position, the weight determination circuit further adjusts the first weight when the input image is updated. 如請求項1之裝置,其中該物件移動偵測電路包含:一計算電路,用來逐區塊計算該輸入影像與該背景影像或該更新後的背景影像之間的複數個絕對偏差總和;一比較電路,用來根據該些絕對偏差總和與一第一閥值產生該移動物件指示資料;以及 一判斷電路,用來處理該移動物件指示資料以產生一統計值,並基於該統計值與一第二閥值之一比較結果產生該物件移動訊號。 The device of claim 1, wherein the object motion detection circuit includes: a calculation circuit for calculating the sum of a plurality of absolute deviations between the input image and the background image or the updated background image block by block; a A comparison circuit used to generate the moving object indication data based on the sum of the absolute deviations and a first threshold; and A judgment circuit is used to process the moving object indication data to generate a statistical value, and generate the object moving signal based on a comparison result between the statistical value and a second threshold. 如請求項2之裝置,其中該判斷電路係基於該統計值大於該第二閥值並小於一第三閥值之一比較結果產生該物件移動訊號。 The device of claim 2, wherein the judgment circuit generates the object movement signal based on a comparison result of the statistical value being greater than the second threshold and less than a third threshold. 如請求項1之裝置,其中該物件移動偵測電路包含:一計算電路,用來逐區塊計算該輸入影像與該背景影像或該更新後的背景影像之間的複數個絕對偏差總和;一比較電路,用來根據該些絕對偏差總和與一第一閥值產生該移動物件指示資料;一運算電路,用來對該移動物件指示資料進行一形態學開啟運算;以及一判斷電路,用來處理該形態學開啟運算後的移動物件指示資料以產生一統計值,並基於該統計值與一第二閥值之一比較結果產生該物件移動訊號。 The device of claim 1, wherein the object motion detection circuit includes: a calculation circuit for calculating the sum of a plurality of absolute deviations between the input image and the background image or the updated background image block by block; a A comparison circuit used to generate the moving object indication data based on the sum of the absolute deviations and a first threshold; an arithmetic circuit used to perform a morphological opening operation on the moving object indication data; and a judgment circuit used to Process the moving object indication data after the morphology is turned on to generate a statistical value, and generate the object moving signal based on a comparison result between the statistical value and a second threshold. 如請求項1之裝置,其中該物件移動偵測電路包含:一計算電路,用來逐區塊計算該輸入影像與該背景影像或該更新後的背景影像之間的複數個絕對偏差總和;一比較電路,用來根據該些絕對偏差總和與一第一閥值產生該移動物件指示資料;一區域選取電路,用來基於一感興趣的區域選取該移動物件指示資料的一部分;以及 一判斷電路,用來處理被選取的該移動物件指示資料的該部分以產生一統計值,並基於該統計值與一第二閥值之一比較結果產生該物件移動訊號。 The device of claim 1, wherein the object motion detection circuit includes: a calculation circuit for calculating the sum of a plurality of absolute deviations between the input image and the background image or the updated background image block by block; a a comparison circuit for generating the moving object indication data based on the sum of the absolute deviations and a first threshold; a region selection circuit for selecting a part of the moving object indication data based on a region of interest; and A judgment circuit is used to process the selected part of the moving object indication data to generate a statistical value, and generate the object moving signal based on a comparison result between the statistical value and a second threshold. 如請求項1之裝置,其中該權重決定電路於收到一重置訊號後具有一段時間調整該第一權重。 The device of claim 1, wherein the weight determination circuit has a period of time to adjust the first weight after receiving a reset signal. 如請求項6之裝置,其中當調整後的該第一權重小於一預設值時,該權重決定電路以該預設值作為該第一權重。 The device of claim 6, wherein when the adjusted first weight is less than a preset value, the weight determination circuit uses the preset value as the first weight. 如請求項1之裝置,其中該物件移動偵測電路基於該絕對偏差總和運算產生一燈光切換指示訊號,該權重決定電路根據該燈光切換指示訊號重置該第一權重。 The device of claim 1, wherein the object motion detection circuit generates a light switching instruction signal based on the absolute deviation sum operation, and the weight determination circuit resets the first weight according to the light switching instruction signal. 如請求項1之裝置,其中該物件移動偵測電路執行該絕對偏差總和運算時產生複數個絕對偏差總和,該物件移動偵測電路基於該些絕對偏差總和計算一當前的燈光切換指示值,該物件移動偵測電路更基於該當前的燈光切換指示值及一前次的燈光切換指示值產生一燈光切換指示訊號。 The device of claim 1, wherein the object motion detection circuit generates a plurality of absolute deviation sums when performing the absolute deviation sum calculation, and the object motion detection circuit calculates a current light switching indication value based on the absolute deviation sums, the The object motion detection circuit further generates a light switching indication signal based on the current light switching indication value and a previous light switching indication value. 一種偵測影像中物件移動的方法,包含:(A)根據一輸入影像及一背景影像決定複數個權重,每一權重對應於一像素位置;(B)基於該些權重混合該輸入影像與該背景影像以產生一更新後的背景影像; (C)逐區塊對該輸入影像與該背景影像或該更新後的背景影像進行一絕對偏差總和運算,並產生一移動物件指示資料;以及(D)根據該移動物件指示資料及至少一閥值產生一物件移動訊號;其中,每一區塊包含複數個像素;其中,該輸入影像包含位於一目標像素位置之一目標輸入像素,該背景影像包含位於該目標像素位置之一目標背景像素,步驟(A)包含:(A1)根據一權重閥值及該目標輸入像素與該目標背景像素間之一像素值絕對偏差決定以一第一權重作為對應於該目標像素位置之該權重;以及(A2)於該輸入影像更新時調整該第一權重。 A method for detecting movement of objects in an image, including: (A) determining a plurality of weights based on an input image and a background image, each weight corresponding to a pixel position; (B) mixing the input image and the input image based on the weights background image to generate an updated background image; (C) perform an absolute deviation sum calculation on the input image and the background image or the updated background image block by block, and generate a moving object indication data; and (D) based on the moving object indication data and at least one valve The value generates an object movement signal; wherein each block includes a plurality of pixels; wherein the input image includes a target input pixel located at a target pixel position, and the background image includes a target background pixel located at the target pixel position, Step (A) includes: (A1) determining a first weight as the weight corresponding to the target pixel position based on a weight threshold and an absolute deviation of pixel values between the target input pixel and the target background pixel; and ( A2) Adjust the first weight when the input image is updated. 如請求項10之方法,其中步驟(C)包含:逐區塊計算該輸入影像與該背景影像或該更新後的背景影像之間的複數個絕對偏差總和;以及根據該些絕對偏差總和與一第一閥值產生該移動物件指示資料。 Such as the method of claim 10, wherein step (C) includes: calculating a plurality of absolute deviation sums between the input image and the background image or the updated background image block by block; and based on the absolute deviation sums and a The first threshold generates the moving object indication data. 如請求項11之方法,其中步驟(D)包含:(D1)處理該移動物件指示資料以產生一統計值;以及(D2)基於該統計值與一第二閥值之一比較結果產生該物件移動訊號。 The method of claim 11, wherein step (D) includes: (D1) processing the moving object indication data to generate a statistical value; and (D2) generating the object based on a comparison result between the statistical value and a second threshold mobile signal. 如請求項12之方法,其中步驟(D2)包含基於該統計值大於該第二閥值並小於一第三閥值之一比較結果產生該物件移動訊號。 The method of claim 12, wherein step (D2) includes generating the object movement signal based on a comparison result of the statistical value being greater than the second threshold and less than a third threshold. 如請求項11之方法,其中步驟(D)包含:基於一感興趣的區域選取該移動物件指示資料的一部分; 處理被選取的該移動物件指示資料的該部分以產生一統計值;以及基於該統計值與一第二閥值之一比較結果產生該物件移動訊號。 The method of claim 11, wherein step (D) includes: selecting a portion of the moving object indication data based on a region of interest; Processing the selected part of the moving object indication data to generate a statistical value; and generating the object moving signal based on a comparison result between the statistical value and a second threshold. 如請求項10之方法,其中該步驟(A2)包含於收到一重置訊號後具有一段時間調整該第一權重。 The method of claim 10, wherein the step (A2) includes adjusting the first weight within a period of time after receiving a reset signal. 如請求項10之方法,更包含:基於該絕對偏差總和運算產生一燈光切換指示訊號;以及根據該燈光切換指示訊號重置該第一權重。 The method of claim 10 further includes: generating a light switching indication signal based on the absolute deviation sum operation; and resetting the first weight according to the light switching indication signal. 如請求項10之方法,其中步驟(C)係產生複數個絕對偏差總和,該方法更包含:基於該些絕對偏差總和計算一當前的燈光切換指示值;以及基於該當前的燈光切換指示值及一前次的燈光切換指示值產生一燈光切換指示訊號。 Such as the method of claim 10, wherein step (C) is to generate a plurality of absolute deviation sums, and the method further includes: calculating a current light switching indication value based on the absolute deviation sums; and based on the current light switching indication value and A previous light switching indication value generates a light switching indication signal. 如請求項10之方法,更包含:根據一燈光切換指示訊號重置該背景影像。 The method of claim 10 further includes: resetting the background image according to a light switching instruction signal.
TW110120646A 2021-06-07 2021-06-07 Device and method for detecting movement of objects in images TWI820430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110120646A TWI820430B (en) 2021-06-07 2021-06-07 Device and method for detecting movement of objects in images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110120646A TWI820430B (en) 2021-06-07 2021-06-07 Device and method for detecting movement of objects in images

Publications (2)

Publication Number Publication Date
TW202249474A TW202249474A (en) 2022-12-16
TWI820430B true TWI820430B (en) 2023-11-01

Family

ID=85793628

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110120646A TWI820430B (en) 2021-06-07 2021-06-07 Device and method for detecting movement of objects in images

Country Status (1)

Country Link
TW (1) TWI820430B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090161911A1 (en) * 2007-12-21 2009-06-25 Ming-Yu Shih Moving Object Detection Apparatus And Method
US20120093361A1 (en) * 2010-10-13 2012-04-19 Industrial Technology Research Institute Tracking system and method for regions of interest and computer program product thereof
TW201416644A (en) * 2012-10-31 2014-05-01 Pixart Imaging Inc Detection system
TW201521425A (en) * 2013-11-27 2015-06-01 Taiwan Secom Co Ltd Detecting method for abnormal camera images
US20200250836A1 (en) * 2019-02-01 2020-08-06 Sony Corporation Moving object detection in image frames based on optical flow maps

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090161911A1 (en) * 2007-12-21 2009-06-25 Ming-Yu Shih Moving Object Detection Apparatus And Method
US20120093361A1 (en) * 2010-10-13 2012-04-19 Industrial Technology Research Institute Tracking system and method for regions of interest and computer program product thereof
TW201416644A (en) * 2012-10-31 2014-05-01 Pixart Imaging Inc Detection system
TW201521425A (en) * 2013-11-27 2015-06-01 Taiwan Secom Co Ltd Detecting method for abnormal camera images
US20200250836A1 (en) * 2019-02-01 2020-08-06 Sony Corporation Moving object detection in image frames based on optical flow maps

Also Published As

Publication number Publication date
TW202249474A (en) 2022-12-16

Similar Documents

Publication Publication Date Title
TWI504248B (en) Image processing apparatus and image processing method
US8270756B2 (en) Method for estimating noise
US20080118163A1 (en) Methods and apparatuses for motion detection
US20120019667A1 (en) Method and device for adaptive noise measurement of a video signal
WO2017206444A1 (en) Method and device for detecting imaging difference, and computer storage medium
TWI323605B (en) Apparatus and method for reducing temporal noise
TWI557691B (en) Monitoring Camera Device and Related Region-based Motion Detection Method
JP5676956B2 (en) Image processing apparatus, image processing method, and program
CN107784281B (en) Method for detecting human face, device, equipment and computer-readable medium
US10469812B2 (en) Projection display system, information processing apparatus, information processing method, and storage medium therefor
WO2019120018A1 (en) Photograph processing method and apparatus, and storage medium and electronic device
KR20100026499A (en) Digital photographing apparatus, method for controlling the same, and recording medium storing program to implement the method
JP4732068B2 (en) Pull-down detection apparatus and pull-down detection method
TWI820430B (en) Device and method for detecting movement of objects in images
US10965858B2 (en) Image processing apparatus, control method thereof, and non-transitory computer-readable storage medium for detecting moving object in captured image
JP2006237695A (en) Pull-down detection apparatus and pull-down detection method
CN113542531B (en) Device and method for detecting object movement in image
WO2024001345A1 (en) Image processing method, electronic device, and computer storage medium
JP7251425B2 (en) Attached matter detection device and attached matter detection method
CN112351271A (en) Camera shielding detection method and device, storage medium and electronic equipment
TWI404408B (en) Image processing apparatus and image processing method
US20190098216A1 (en) Image processing method, image processing apparatus, imaging apparatus, and storage medium
TWI441516B (en) Image processing apparatus and method thereof
CN111754410B (en) Image processing method and device, electronic equipment and readable storage medium
US10015521B2 (en) Error detection in a motion estimation system