由於人口集中導致市區內車流量日益升高,造成在都市內行車有較多的不便與危險。在本研究中,我們針對以下情況做安全偵測。在都市行駛車輛時會有不少的時間是在等待交通號誌的變換或是在走走停停的擁擠車陣中,而在等待交通號誌或是塞車的這段時間,駕駛人可能會分心或做其他事情,若此時前方車輛已往前駛離或是停止,駕駛者若沒注意可能就會造成不便或碰撞。在本研究中,我們提出前車停止與啟動偵測的方法,可幫助駕駛者了解前車的動向,在發生危險之前告知駕駛人,使駕駛更為方便及安全。在前車停止與啟動偵測的方法中,先偵測角點,利用角點做光流向量的估計,根據光流向量長度以及方向做分區域篩選光流的動作,並將物體在同一平面上的光流向量調整成為大小差不多的向量,得到動態資訊後,整合動靜態資訊將光流向量分群得到移動區塊,最後將移動區塊加入追蹤的技巧判斷前車是否啟動或停止。前車停止啟動偵測的方法中,能避免己車前方與側方各方向汽機車與行人之影響、行駛在彎區道路、夜間側後方來車大燈造成前方車亮度變化、夜間各種燈光造成的明暗變化、雨天之雨刷擺動、陰晴變化等因素所造成的誤判,給予駕駛人正確的警示。前車停止與啟動偵測的方法在Intel Pentium Core2 Duo 1.86GHz及2GB RAM的個人電腦上執行,可達每秒150至160張畫面,正確率可達95%。Due to the concentration of population in cities, the traffic flow of the urban area is progressively growing and then more collision and accidents are raised. In this study, we design a safty detection which is focused on the following cases. When driving in cities, drivers will spend much time waiting for the transformation of the traffic signal or sticking in traffic jam. During the transformation of the traffic signal or sticking in traffic jam, if the front of the vehicle forward to leave or stop, the driver do not pay attention may cause inconvenience or collision. For the safety of drivers, the stop-and-go detection method is proposed in this study. In the stop-and-go detection method, corners are used as features to calculate optical flow. According to length and direction of the optical flow, we use different methods to filter optical flow in different regions and adjust the length of optical flow. After obtaining the dynamic information, integrating static information into dynamic information for clustering optical flows to get moving blocks. Finally, we use these moving blocks by the tracking skill to judge whether the front vehicle is stopping or going. This detection method can also avoid the effects of vehicles in different direction, variant weather, and the light at nighttime.The proposed methods are evaluated in several variant environments. The detection rate of stop-and-go method is 95% and the frame rate is 150 to 160 frames per second.