TW202349266A - Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium - Google Patents

Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium Download PDF

Info

Publication number
TW202349266A
TW202349266A TW111121117A TW111121117A TW202349266A TW 202349266 A TW202349266 A TW 202349266A TW 111121117 A TW111121117 A TW 111121117A TW 111121117 A TW111121117 A TW 111121117A TW 202349266 A TW202349266 A TW 202349266A
Authority
TW
Taiwan
Prior art keywords
vehicle
mask
image
target vehicle
moving
Prior art date
Application number
TW111121117A
Other languages
Chinese (zh)
Inventor
李潔
郭錦斌
Original Assignee
鴻海精密工業股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 鴻海精密工業股份有限公司 filed Critical 鴻海精密工業股份有限公司
Priority to TW111121117A priority Critical patent/TW202349266A/en
Publication of TW202349266A publication Critical patent/TW202349266A/en

Links

Abstract

The present application provides a method of recognizing a moving vehicle and vehicle-mounted device and computer-readable storage medium. The method is applied in a device carried on a vehicle. The method includes: capturing a first image of a target vehicle at a first moment and a second image of the target vehicle at a second moment; based on an instance segmentation algorithm, determining a first mask of the target vehicle in the first image and determining a second mask of the target vehicle in the second image; calculating an intersection over union (IoU) of the first mask and the second mask; determining whether an object mask in a dynamic class of the target vehicle is generated according to the IoU; in response that the object mask in the dynamic class of the target vehicle is generated, determining that the target vehicle is a moving vehicle. The present application can improve an accuracy of recognizing surrounding moving vehicles during driving a vehicle.

Description

移動車輛的識別方法及相關設備Identification methods and related equipment for moving vehicles

本發明涉及目標檢測技術領域,尤其涉及一種移動車輛的識別方法及相關設備。The present invention relates to the technical field of target detection, and in particular to a method for identifying moving vehicles and related equipment.

車輛在行駛的過程中,需要對周圍的環境做出正確的判斷,感知車輛周圍動態物體的情況,以防發生交通事故。可藉由對拍攝所得的圖像進行影像處理,以識別出圖像中的物體,例如,採用圖像分割的語義分割對車輛周邊的物體進行識別和分類,針對圖像中的每個圖元分配一個類別,比如,車輛與行人分別是兩個類別。然而,以上方法無法區分同一類別(比如,車輛)中的不同對象,容易造成在識別移動車輛時,同時將靜止車輛識別為移動車輛,影響識別移動車輛的精準度。When a vehicle is driving, it needs to make correct judgments about the surrounding environment and sense the dynamic objects around the vehicle to prevent traffic accidents. The objects in the image can be identified by performing image processing on the captured image. For example, semantic segmentation of image segmentation is used to identify and classify objects around the vehicle. For each primitive in the image, Assign a category, for example, vehicles and pedestrians are two categories respectively. However, the above methods cannot distinguish different objects in the same category (for example, vehicles), which may easily cause stationary vehicles to be recognized as moving vehicles at the same time when identifying moving vehicles, affecting the accuracy of identifying moving vehicles.

鑒於以上內容,有必要提供一種移動車輛的識別方法及相關設備,解決了對車輛周圍的移動車輛識別準確率低的問題。In view of the above, it is necessary to provide a moving vehicle identification method and related equipment, which solves the problem of low accuracy in identifying moving vehicles around the vehicle.

本申請提供一種移動車輛的識別方法,應用於車輛的車載裝置中,所述方法包括:拍攝目標車輛在第一時刻的第一圖像和第二時刻的第二圖像;基於實例分割演算法,根據所述第一圖像確定所述目標車輛的第一遮罩以及根據所述第二圖像確定所述目標車輛的第二遮罩;計算所述第一遮罩與所述第二遮罩的交集聯集比;根據所述交集聯集比判斷是否生成所述目標車輛的動態類對象遮罩;若生成所述目標車輛的動態類對象遮罩,確定所述目標車輛為移動車輛動態類對象遮罩。This application provides a method for identifying a moving vehicle, which is applied to an on-board device of the vehicle. The method includes: taking a first image of the target vehicle at a first moment and a second image at a second moment; based on an instance segmentation algorithm. , determine the first mask of the target vehicle according to the first image and determine the second mask of the target vehicle according to the second image; calculate the first mask and the second mask The intersection union ratio of the mask; determine whether to generate a dynamic class object mask of the target vehicle according to the intersection union ratio; if a dynamic class object mask of the target vehicle is generated, determine that the target vehicle is a moving vehicle dynamic Class object mask.

利用所述方法能夠藉由計算不同時刻目標車輛對應遮罩的交集聯集比,以確定目標車輛的動態類對象遮罩,提高了識別移動車輛的準確度。The method can calculate the intersection and union ratio of the corresponding masks of the target vehicle at different times to determine the dynamic object mask of the target vehicle, thereby improving the accuracy of identifying moving vehicles.

在一些可選的實施方式中,在所述根據所述第一圖像確定所述目標車輛的第一遮罩之前,所述方法還包括:確定所述目標車輛在所述第一圖像的第一位置以及所述目標車輛的標識。In some optional implementations, before determining the first mask of the target vehicle based on the first image, the method further includes: determining the location of the target vehicle in the first image. The first location and the identification of the target vehicle.

在一些可選的實施方式中,在所述根據所述第二圖像確定所述目標車輛的第二遮罩之前,所述方法還包括:基於所述目標車輛的標識,確定所述目標車輛在所述第二圖像中的第二位置。In some optional implementations, before determining the second mask of the target vehicle based on the second image, the method further includes: determining the target vehicle based on the identity of the target vehicle. at the second position in the second image.

在一些可選的實施方式中,所述基於實例分割演算法,根據所述第一圖像確定所述目標車輛的第一遮罩以及根據所述第二圖像確定所述目標車輛的第二遮罩,包括:分別將所述第一圖像和所述第二圖像輸入特徵提取網路,獲取所述第一圖像的第一特徵圖和所述第二圖像的第二特徵圖;分別對所述第一特徵圖和所述第二特徵圖進行二分類以及座標回歸,確定所述第一特徵圖中所述目標車輛的第一感興趣區域以及所述第二特徵圖中所述目標車輛的第二感興趣區域;提取所述第一感興趣區域的第一特徵子圖以及所述第二感興趣區域的第二特徵子圖;基於所述第一特徵子圖和所述第一位置生成所述第一遮罩;基於所述第二特徵子圖和所述第二位置生成所述第二遮罩。In some optional implementations, the instance-based segmentation algorithm determines a first mask of the target vehicle based on the first image and determines a second mask of the target vehicle based on the second image. Masking includes: inputting the first image and the second image into a feature extraction network respectively, and obtaining a first feature map of the first image and a second feature map of the second image. ; Perform binary classification and coordinate regression on the first feature map and the second feature map respectively, and determine the first area of interest of the target vehicle in the first feature map and the first area of interest in the second feature map. The second area of interest of the target vehicle; extracting the first feature sub-image of the first area of interest and the second feature sub-image of the second area of interest; based on the first feature sub-image and the The first mask is generated at a first location; the second mask is generated based on the second feature submap and the second location.

在一些可選的實施方式中,所述計算所述第一遮罩與所述第二遮罩的交集聯集比,包括:計算所述第一遮罩與所述第二遮罩的第一重合度;計算所述第一遮罩與所述第二遮罩的第二重合度;計算所述第一重合度與所述第二重合度的比值作為所述交集聯集比。In some optional implementations, calculating the intersection union ratio of the first mask and the second mask includes: calculating the first intersection ratio of the first mask and the second mask. The degree of coincidence; calculating the second degree of coincidence between the first mask and the second mask; calculating the ratio of the first degree of coincidence to the second degree of coincidence as the intersection union ratio.

在一些可選的實施方式中,所述根據所述交集聯集比判斷是否生成所述目標車輛的動態類對象遮罩,包括:若所述交集聯集比大於或等於預設閾值,確定生成所述目標車輛的動態類對象遮罩;若所述交集聯集比小於所述預設閾值,確定不生成所述目標車輛的動態類對象遮罩。In some optional implementations, determining whether to generate a dynamic class object mask for the target vehicle based on the intersection-to-union ratio includes: if the intersection-to-union ratio is greater than or equal to a preset threshold, determining to generate The dynamic object mask of the target vehicle; if the intersection and union ratio is less than the preset threshold, it is determined not to generate the dynamic object mask of the target vehicle.

在一些可選的實施方式中,在確定所述目標車輛為移動車輛後,所述方法還包括:建立車輛安全距離模型,基於所述車輛安全距離模型得到車輛間的安全制動距離;若判斷所述移動車輛與所述車輛的距離小於或等於所述安全制動距離,發出警報。In some optional implementations, after determining that the target vehicle is a moving vehicle, the method further includes: establishing a vehicle safe distance model, and obtaining a safe braking distance between vehicles based on the vehicle safe distance model; if it is determined that the If the distance between the moving vehicle and the vehicle is less than or equal to the safe braking distance, an alarm is issued.

在一些可選的實施方式中,所述警報包括第一警報以及第二警報,所述發出警報包括:若所述移動車輛與所述車輛的距離等於所述安全制動距離,以第一頻率發出所述第一警報;若所述移動車輛與所述車輛的距離小於所述安全制動距離,以第二頻率發出所述第二警報;其中,所述第一頻率小於所述第二頻率。In some optional implementations, the alarm includes a first alarm and a second alarm, and issuing the alarm includes: if the distance between the moving vehicle and the vehicle is equal to the safe braking distance, issuing the alarm at a first frequency. The first alarm; if the distance between the moving vehicle and the vehicle is less than the safe braking distance, the second alarm is issued at a second frequency; wherein the first frequency is less than the second frequency.

本申請還提供一種車載裝置,所述車載裝置包括處理器和儲存器,所述處理器用於執行所述儲存器中存儲的電腦程式時實現所述的移動車輛的識別方法。This application also provides a vehicle-mounted device. The vehicle-mounted device includes a processor and a storage. The processor is configured to implement the mobile vehicle identification method when executing a computer program stored in the storage.

本申請還提供一種電腦可讀存儲介質,所述電腦可讀存儲介質上存儲有電腦程式,所述電腦程式被處理器執行時實現所述的移動車輛的識別方法。This application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the mobile vehicle identification method is implemented.

相較於習知技術,本申請提供的移動車輛的識別方法及相關設備,能夠精確識別同一場景下多部車輛中的每一部車輛,並將每一部車輛作為目標車輛且計算每一目標車輛在不同時刻對應遮罩的交集聯集比,基於所述交集聯集比判斷所述目標車輛是否移動,提高了識別移動車輛的準確度,進而提高了車輛行駛的安全性。Compared with the prior art, the mobile vehicle identification method and related equipment provided by this application can accurately identify each vehicle among multiple vehicles in the same scene, regard each vehicle as a target vehicle, and calculate each target vehicle. The intersection and union ratios of the corresponding masks of the vehicle at different times are used to determine whether the target vehicle is moving based on the intersection and union ratio, which improves the accuracy of identifying moving vehicles and thereby improves the safety of vehicle driving.

為了便於理解,示例性的給出了部分與本申請實施例相關概念的說明以供參考。To facilitate understanding, some descriptions of concepts related to the embodiments of the present application are exemplarily provided for reference.

需要說明的是,本申請中“至少一個”是指一個或者多個,“多個”是指兩個或多於兩個。“和/或”,描述關聯物件的關聯關係,表示可以存在三種關係,例如,A和/或B可以表示:單獨存在A,同時存在A和B,單獨存在B的情況,其中A,B可以是單數或者複數。本申請的說明書和請求項書及附圖中的術語“第一”、“第二”、“第三”、“第四”等(如果存在)是用於區別類似的物件,而不是用於描述特定的順序或先後次序。It should be noted that “at least one” in this application refers to one or more, and “multiple” refers to two or more than two. "And/or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can Is singular or plural. The terms "first", "second", "third", "fourth", etc. (if present) in the description, claim and drawings of this application are used to distinguish similar objects, rather than to Describe a specific order or sequence.

為了更好地理解本申請實施例提供的移動車輛的識別方法及相關設備,下面首先對本申請移動車輛的識別方法的應用場景進行描述。In order to better understand the mobile vehicle identification method and related equipment provided by the embodiments of the present application, the application scenarios of the mobile vehicle identification method of the present application are first described below.

圖1為本申請實施例提供的車載裝置1的結構示意圖。參閱圖1所示,所述車載裝置1包括,但不限於,儲存器11和至少一個處理器12。儲存器11和處理器12之間可以藉由通訊匯流排13連接,也可以直接連接。所述車載裝置1設置在車輛上,所述車載裝置1可以是車載電腦,在一些實施例中,所述車載裝置1可包括拍攝裝置以拍攝車輛周邊的多個圖像或視頻,在其他實施例中,所述車載裝置1也可以不包括拍攝裝置,而是與車輛內部的一個或多個拍攝裝置建立通信匯流排連接,以直接從車輛的拍攝裝置中獲取多個圖像或視頻,例如,也可以與車輛中的行車記錄儀進行通信匯流排連接並獲取相應的圖像或視頻。Figure 1 is a schematic structural diagram of a vehicle-mounted device 1 provided by an embodiment of the present application. Referring to FIG. 1 , the vehicle-mounted device 1 includes, but is not limited to, a memory 11 and at least one processor 12 . The storage 11 and the processor 12 can be connected through the communication bus 13 or directly. The vehicle-mounted device 1 is disposed on a vehicle. The vehicle-mounted device 1 may be a vehicle-mounted computer. In some embodiments, the vehicle-mounted device 1 may include a shooting device to capture multiple images or videos around the vehicle. In other implementations, For example, the vehicle-mounted device 1 may not include a shooting device, but may establish a communication bus connection with one or more shooting devices inside the vehicle to directly obtain multiple images or videos from the shooting devices of the vehicle, for example , you can also connect to the communication bus with the driving recorder in the vehicle and obtain the corresponding images or videos.

本領域技術人員應該瞭解,圖1示出的車載裝置1的結構並不構成本發明實施例的限定,所述車載裝置1還可以包括比圖1更多或更少的其他硬體或者軟體,或者不同的部件設置。Those skilled in the art should understand that the structure of the vehicle-mounted device 1 shown in Figure 1 does not constitute a limitation of the embodiment of the present invention. The vehicle-mounted device 1 may also include more or less other hardware or software than in Figure 1 . Or different widget settings.

所述車載裝置1中的處理器12可以在執行電腦程式時,實現下文將詳細介紹的移動車輛的識別方法,所述電腦程式包括移動車輛的識別程式。The processor 12 in the vehicle-mounted device 1 can implement a moving vehicle identification method that will be described in detail below when executing a computer program. The computer program includes a moving vehicle identification program.

車輛在行駛的過程中,需要對周圍的環境做出正確的判斷,感知車輛周圍動態物體的情況,以防發生交通事故。可藉由拍攝所得的圖像進行影像處理,以識別出圖像中的物體,例如,採用圖像分割的語義分割對車輛周邊的物體進行識別和分類,針對圖像中的每個圖元分配一個類別,比如,車輛與行人分別是兩個類別。然而,以上方法無法區分同一類別(比如,車輛)中的不同物件,容易造成在識別移動車輛時,同時將靜止車輛識別為移動車輛,影響識別的精準度。When a vehicle is driving, it needs to make correct judgments about the surrounding environment and sense the dynamic objects around the vehicle to prevent traffic accidents. The captured images can be processed through image processing to identify objects in the image. For example, semantic segmentation of image segmentation is used to identify and classify objects around the vehicle, and each primitive in the image is assigned A category, for example, vehicles and pedestrians are two categories respectively. However, the above method cannot distinguish different objects in the same category (for example, vehicles), which may easily cause stationary vehicles to be recognized as moving vehicles at the same time when identifying moving vehicles, affecting the accuracy of identification.

為解決上述技術問題,本申請實施例提供一種移動車輛的識別方法,如圖2所示,是本申請實施例提供的移動車輛的識別方法的流程圖。所述移動車輛的識別方法應用在車載裝置1中,能夠提高識別移動車輛的準確度,保障車輛行駛的安全性。根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。在本實施方式中,所述移動車輛的識別方法包括以下步驟:In order to solve the above technical problems, an embodiment of the present application provides a method for identifying a moving vehicle. As shown in Figure 2, it is a flow chart of the method for identifying a moving vehicle provided by an embodiment of the present application. The identification method of moving vehicles is applied in the vehicle-mounted device 1, which can improve the accuracy of identifying moving vehicles and ensure the safety of vehicle driving. Depending on different needs, the order of steps in this flowchart can be changed and some steps can be omitted. In this embodiment, the identification method of a moving vehicle includes the following steps:

21,拍攝目標車輛在第一時刻的第一圖像和第二時刻的第二圖像。21. Capture a first image of the target vehicle at a first moment and a second image at a second moment.

在本申請的實施例中,利用車輛的拍攝裝置(例如,單目相機)可以拍攝車輛周圍不同時刻的多個圖像。具體地,可以拍攝包含多個目標對象的圖像,所述目標對象可以是不同類別的物件,比如目標車輛或人,將連續時刻拍攝的兩張圖像作為第一時刻的第一圖像和第二時刻的第二圖像。以目標車輛為例,拍攝所述目標車輛在第一時刻的第一圖像和在第二時刻的第二圖像。In embodiments of the present application, multiple images of the surroundings of the vehicle at different times can be captured using a vehicle's photography device (for example, a monocular camera). Specifically, images containing multiple target objects can be captured, and the target objects can be objects of different categories, such as target vehicles or people, and two images captured at consecutive times are used as the first image at the first moment and the A second image at a second moment. Taking the target vehicle as an example, a first image of the target vehicle at a first time and a second image at a second time are captured.

在藉由拍攝裝置拍攝到車輛外場景的圖像中,將拍攝到的RGB圖像作為單幅圖像,本申請實施例分別獲取第一時刻的第一圖像以及第二時刻的第二圖像。假設獲取一個場景中連續兩幅圖像 ,則 表示t時刻(即第一時刻)的第一圖像, 表示t+1時刻(即第二時刻)的第二圖像。 In the image of the scene outside the vehicle captured by the shooting device, the captured RGB image is used as a single image. The embodiment of the present application obtains the first image at the first time and the second image at the second time respectively. picture. Suppose we obtain two consecutive images in a scene , then Represents the first image at time t (i.e. the first moment), Represents the second image at time t+1 (ie, the second time).

22,基於實例分割演算法,根據所述第一圖像確定所述目標車輛的第一遮罩以及根據所述第二圖像確定所述目標車輛的第二遮罩。22. Based on the instance segmentation algorithm, determine the first mask of the target vehicle according to the first image and determine the second mask of the target vehicle according to the second image.

實例分割演算法(Instance Segmentation)既具備了語義分割的特點,也具備了目標檢測的特點,即,實例分割演算法能夠做到圖元層面上的分類也能定位出不同的實例,例如,既能區分多個相同類別的物體分別作為單個目標對象,也能將目標對象分類為車輛以及定位該車輛位置,在本申請的實施例中,將識別到的多部車輛進行區分,將每一部車輛作為一個單獨的實例物件,所述實例物件為目標車輛。The instance segmentation algorithm (Instance Segmentation) has the characteristics of both semantic segmentation and target detection. That is, the instance segmentation algorithm can classify at the primitive level and locate different instances. For example, both It can distinguish multiple objects of the same category as a single target object, and can also classify the target object into a vehicle and locate the vehicle location. In the embodiment of the present application, multiple identified vehicles are distinguished and each vehicle is identified. The vehicle is used as a separate instance object, and the instance object is the target vehicle.

遮罩(Mask)也稱為遮蔽,表示用選定的圖像、圖形或物體對待處理的圖像(全部或局部)進行遮擋,從而控制影像處理的區域或處理過程。比如,將一張待處理圖像中的某個物件進行遮擋,那麼這個被遮擋的區域就稱為遮罩。在本申請的實施例中,將識別到的每一部目標車輛都採用不同的遮罩進行處理,以區分在同一圖像中不同的目標車輛。Mask, also known as masking, means using a selected image, graphic or object to block the image to be processed (all or part of it), thereby controlling the area or process of image processing. For example, if an object in an image to be processed is blocked, the blocked area is called a mask. In the embodiment of the present application, each identified target vehicle is processed using different masks to distinguish different target vehicles in the same image.

在本申請的一個實施例中,將第一圖像和第二圖像分別輸入特徵提取網路中獲取特徵圖,具體為,將第一圖像輸入特徵提取網路獲取第一圖像的第一特徵圖,將第二圖像輸入特徵提取網路獲取第二圖像的第二特徵圖。分別將t時刻的第一圖像和t+1時刻的第二圖像作為單目深度估計殘差卷積神經網路模型的輸入,其中,單目深度估計殘差卷積神經網路模型包括一層輸入層、七層卷積層、七層反卷積層和四個殘差項,藉由單目深度估計殘差卷積神經網路模型計算得到t時刻的第一圖像經過卷積後對應的第一特徵圖,以及t+1時刻的第二圖像經過卷積後對應的第二特徵圖。In one embodiment of the present application, the first image and the second image are respectively input into the feature extraction network to obtain the feature map. Specifically, the first image is input into the feature extraction network to obtain the third image of the first image. A feature map, inputting the second image into the feature extraction network to obtain the second feature map of the second image. The first image at time t and the second image at time t+1 are respectively used as inputs of the monocular depth estimation residual convolutional neural network model, where the monocular depth estimation residual convolutional neural network model includes One input layer, seven convolution layers, seven deconvolution layers and four residual terms are calculated by using the monocular depth estimation residual convolutional neural network model to obtain the corresponding convolution of the first image at time t The first feature map, and the second feature map corresponding to the second image at time t+1 after convolution.

在本申請的一個實施例中,分別對第一特徵圖以及第二特徵圖進行二分類以及座標回歸,以判斷所述第一特徵圖是否存在所述目標車輛的第一感興趣區域(Region of Interest,ROI)以及判斷所述第二特徵圖是否存在所述目標車輛的第二感興趣區域(Region of Interest,ROI)。In one embodiment of the present application, binary classification and coordinate regression are performed on the first feature map and the second feature map respectively to determine whether the first feature map contains a first region of interest (Region of interest) of the target vehicle. Interest, ROI) and determine whether the second feature map contains a second region of interest (Region of Interest, ROI) of the target vehicle.

具體的,在卷積層輸出第一特徵圖之後,添加一個深度線性回歸函數,將第一特徵圖中的每一圖元點映射成對應的深度值。然後對第一特徵圖中的每一個圖元位置設定固定個數(默認15個)的第一感興趣區域,將這些第一感興趣區域輸入到區域選取網路(Region Proposal Network,RPN)中進行二分類以及座標回歸,獲取存在目標車輛的第一感興趣區域,採用同樣的方法獲取第二特徵圖的第二感興趣區域。在獲取存在目標車輛的第一感興趣區域以及第二感興趣區域以後,藉由區域特徵聚集的方法(ROIAlign)從每個第一感興趣區域中提取第一特徵子圖,將這些第一特徵子圖進行分類,對分類以後的第一特徵子圖進行候選框回歸和引入全卷積網路(Fully Convolutional Network,FCN)生成第一遮罩。同樣的,藉由ROIAlign從每個第二感興趣區域中提取第二特徵子圖,將這些第二特徵子圖進行分類,對分類以後的第二特徵子圖進行候選框回歸和引入全卷積網路(Fully Convolutional Network,FCN)生成第二遮罩。Specifically, after the convolution layer outputs the first feature map, a depth linear regression function is added to map each primitive point in the first feature map to the corresponding depth value. Then set a fixed number (default 15) of first regions of interest for each primitive position in the first feature map, and input these first regions of interest into the Region Proposal Network (RPN). Perform binary classification and coordinate regression to obtain the first area of interest where the target vehicle exists, and use the same method to obtain the second area of interest of the second feature map. After obtaining the first region of interest and the second region of interest in which the target vehicle exists, the first feature subgraph is extracted from each first region of interest through the regional feature aggregation method (ROIAlign), and these first features are The sub-pictures are classified, and candidate frame regression is performed on the first feature sub-picture after classification and a fully convolutional network (Fully Convolutional Network, FCN) is introduced to generate the first mask. Similarly, ROIAlign is used to extract the second feature sub-image from each second region of interest, classify these second feature sub-images, and perform candidate frame regression and introduce full convolution on the classified second feature sub-image. The network (Fully Convolutional Network, FCN) generates the second mask.

通常可採用感興趣區域池化(ROI-Pooling)的方式將不同大小的感興趣區域(ROI)轉化為固定大小的ROI,但是在轉化的過程中需要經過兩次取整量化,導致將特徵空間的ROI對應到原圖上面會出現很大的偏差,影響圖像分割的準確度。本申請實施例藉由採用在ROI-Pooling的基礎上提出的ROIAlign,解決了分割以後區域不準確的問題。ROIAlign藉由取消了取整操作,保留所有的浮點數,然後藉由雙線性插值的方法獲得多個採樣點的值,再將多個採樣點進行最大值的池化,即可得到該點最終的值,提升檢測模型的準確性。Region of interest pooling (ROI-Pooling) can usually be used to convert regions of interest (ROI) of different sizes into fixed-size ROIs. However, during the conversion process, two rounds of rounding and quantification are required, resulting in the feature space being transformed. There will be a large deviation when the ROI corresponds to the original image, affecting the accuracy of image segmentation. The embodiment of the present application solves the problem of inaccurate regions after segmentation by using ROIAlign proposed on the basis of ROI-Pooling. ROIAlign cancels the rounding operation, retains all floating point numbers, and then obtains the values of multiple sampling points through bilinear interpolation, and then performs maximum value pooling on multiple sampling points to obtain the Click the final value to improve the accuracy of the detection model.

在本申請的一個實施例中,在生成第一遮罩之前,還可採用實例分割演算法獲取到目標車輛在第一圖像中的第一位置以及所述目標車輛的標識,所訴標識為每一部車輛的標記。根據在第一時刻獲取到所述目標車輛的標識,在第二時刻獲取到第二圖像時,定位到所述目標車輛在所述第二圖像中的第二位置,再藉由實例分割演算法對第二圖像中的目標車輛進行分割處理生成第二位置的第二遮罩。In one embodiment of the present application, before generating the first mask, an instance segmentation algorithm may also be used to obtain the first position of the target vehicle in the first image and the identification of the target vehicle. The identification is Markings for each vehicle. According to the identification of the target vehicle obtained at the first moment, when the second image is obtained at the second moment, the second position of the target vehicle in the second image is located, and then through instance segmentation The algorithm performs segmentation processing on the target vehicle in the second image to generate a second mask at the second position.

23,計算所述第一遮罩與所述第二遮罩的交集聯集比。23. Calculate the intersection union ratio of the first mask and the second mask.

基於22獲取的目標車輛在第一圖像中的第一位置的第一遮罩以及在第二圖像中的第二位置的第二遮罩。採用交集聯集比(Intersection over Union,IoU)的計算方式描述同一場景下在第一位置的第一遮罩和在第二位置的第二遮罩的重合度,包括,計算第一遮罩和第二遮罩的第一重合度,以及第一遮罩和第二遮罩的第二重合度。例如針對同一場景下的目標車輛,基於t時刻處於第一位置的目標車輛的第一遮罩與t+1時刻處於第二位置的目標車輛的第二遮罩,計算目標車輛的位置移動程度。A first mask of a first position of the target vehicle in the first image and a second mask of a second position of the target vehicle in the second image are obtained based on 22 . The calculation method of Intersection over Union (IoU) is used to describe the coincidence degree of the first mask at the first position and the second mask at the second position in the same scene, including calculating the sum of the first mask and The first degree of coincidence of the second mask, and the second degree of coincidence of the first mask and the second mask. For example, for a target vehicle in the same scene, the positional movement degree of the target vehicle is calculated based on the first mask of the target vehicle at the first position at time t and the second mask of the target vehicle at the second position at time t+1.

請參閱圖3,圖3為計算目標車輛在不同時刻之間的交集聯集比的流程圖。Please refer to Figure 3, which is a flow chart for calculating the intersection and union ratio of the target vehicle at different times.

第一遮罩與第二遮罩的重合度包括第一遮罩與第二遮罩的交集(第一重合度)以及第一遮罩與第二遮罩的聯集(第二重合度)。The degree of overlap between the first mask and the second mask includes the intersection of the first mask and the second mask (the first degree of overlap) and the union of the first mask and the second mask (the second degree of overlap).

31,計算第一遮罩與第二遮罩的交集。31. Calculate the intersection of the first mask and the second mask.

將第一位置的第一遮罩以及第二位置的第二遮罩分別看作是一個圖元集合的區域,計算第一遮罩所代表的圖元集合的區域與第二遮罩所代表的圖元集合的區域的交集。The first mask at the first position and the second mask at the second position are respectively regarded as the area of a collection of primitives, and the area of the collection of primitives represented by the first mask and the area represented by the second mask are calculated. The intersection of regions of collections of primitives.

32,計算第一遮罩與第二遮罩的聯集。32. Calculate the union of the first mask and the second mask.

將第一位置的第一遮罩以及第二位置的第二遮罩分別看作是一個圖元集合的區域,計算第一遮罩所代表的圖元集合的區域與第二遮罩所代表的圖元集合的區域的聯集。The first mask at the first position and the second mask at the second position are respectively regarded as the area of a collection of primitives, and the area of the collection of primitives represented by the first mask and the area represented by the second mask are calculated. The union of regions of collections of primitives.

33,基於所述交集與所述聯集的比值確定所述交集聯集比。33. Determine the intersection-to-union ratio based on the ratio of the intersection to the union.

在本申請的一個實施例中,將第一遮罩和第二遮罩的交集與第一遮罩和第二遮罩的聯集的比值作為所述交集聯集比。In one embodiment of the present application, the ratio of the intersection of the first mask and the second mask to the union of the first mask and the second mask is used as the intersection-to-union ratio.

分別將第一圖像的第一遮罩和第二圖像中的第二遮罩看作是一個圖元集合的區域,將t時刻獲取的圖元集合區域作為第一區域,將t+1時刻獲取的圖元集合區域作為第二區域,計算第一區域和第二區域的交集聯集比,具體計算第一區域和第二區域重合部分(交集)的面積除以第一區域和第二區域合併部分(聯集)的面積。The first mask in the first image and the second mask in the second image are respectively regarded as the area of a primitive set, and the primitive collection area obtained at time t is regarded as the first area, and t+1 The collection area of primitives obtained at any time is used as the second area, and the intersection union ratio of the first area and the second area is calculated. Specifically, the area of the overlap (intersection) of the first area and the second area is divided by the area of the first area and the second area. The area of the combined portion (union) of the region.

示例性的,假設第一區域和第二區域在座標系中的位置分別表示為[ ]、[ ],其中,( )表示第一區域的左上角座標,( )表示第一區域的右下角座標,( )表示第二區域的左上角座標,( )表示第二區域的右下角座標,則計算第一區域和第二區域相交區域的左上角座標為: ,相交區域右下角座標為: For example, assume that the positions of the first region and the second region in the coordinate system are respectively expressed as [ ], [ ],in,( ) represents the coordinates of the upper left corner of the first area, ( ) represents the coordinates of the lower right corner of the first area, ( ) represents the coordinates of the upper left corner of the second area, ( ) represents the coordinates of the lower right corner of the second area, then the coordinates of the upper left corner of the intersection area between the first area and the second area are calculated as: , , the coordinates of the lower right corner of the intersection area are: , .

; ;

分別計算第一區域的面積S11和第二區域的面積S22,如下:Calculate the area S11 of the first region and the area S22 of the second region respectively, as follows:

; ;

; ;

計算第一區域面積與第二區域面積聯集部分的面積S2,如下:Calculate the area S2 of the union of the first area area and the second area area, as follows:

S2=S11+S22-S1;S2=S11+S22-S1;

根據上述的交集部分的面積S1與聯集部分的面積S2,計算第一區域與第二區域的交集聯集比,如下:According to the above area S1 of the intersection part and the area S2 of the union part, calculate the intersection union ratio of the first region and the second region, as follows:

IoU=S1/S2。IoU=S1/S2.

24,根據所述交集聯集比判斷是否生成所述目標車輛的動態類對象遮罩。24. Determine whether to generate a dynamic class object mask of the target vehicle according to the intersection union ratio.

動態類對象遮罩是指連接所述目標車輛在不同時刻的遮罩形成的遮罩。例如,一輛正在移動的車輛,在t時刻處於第一位置時形成第一遮罩,在t+1時刻移動到第二位置時形成第二遮罩,連接第一遮罩和第二遮罩形成的遮罩作為表示車輛正在移動的標記,即,動態類對象遮罩。The dynamic object mask refers to a mask formed by connecting the masks of the target vehicle at different times. For example, a moving vehicle forms a first mask when it is in the first position at time t, and forms a second mask when it moves to the second position at time t+1. The first mask and the second mask are connected. The mask formed serves as a marker indicating that the vehicle is moving, i.e., a dynamic class object mask.

基於23獲得的交集聯集比判定是否生成所述目標車輛的動態類對象遮罩,在判斷是否生成所述目標車輛的動態類對象遮罩之前,判斷所述目標車輛的狀態,所述狀態包括靜止狀態和移動狀態,如果判定目標車輛的狀態為移動狀態,則連接第一遮罩與第二遮罩生成目標車輛的動態類對象遮罩,如果判定目標車輛的狀態為靜止狀態,則不生成目標車輛的動態類對象遮罩。Determine whether to generate the dynamic object mask of the target vehicle based on the intersection union ratio obtained in step 23. Before determining whether to generate the dynamic object mask of the target vehicle, determine the state of the target vehicle, and the state includes Stationary state and moving state. If it is determined that the state of the target vehicle is in a moving state, then the first mask and the second mask are connected to generate a dynamic object mask of the target vehicle. If it is determined that the state of the target vehicle is in a stationary state, no generation will be performed. Dynamic class object mask of the target vehicle.

請參閱圖4,圖4為判斷是否生成所述目標車輛的動態類對象遮罩的流程圖。Please refer to Figure 4, which is a flow chart for determining whether to generate a dynamic class object mask of the target vehicle.

41,將第一遮罩與第二遮罩的交集聯集比與預設閾值進行比較。41. Compare the intersection union ratio of the first mask and the second mask with the preset threshold.

第一遮罩與第二遮罩的交集聯集比在0到1之間。如果第一遮罩與第二遮罩的重合度接近1,則第一遮罩與第二遮罩的重合度高,如果第一遮罩和第二遮罩的重合度接近0,則第一遮罩與第二遮罩的重合度低。以目標車輛為例,如果某一目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度接近1,則該目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度高。如果該目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度接近0,則該目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度低。在本申請的一個實施例中,預設閾值可以設置在0.5,可以允許有一定的誤差,例如,可藉由預設的誤差範圍結合預設閾值完成上述比較。The intersection union ratio of the first mask and the second mask is between 0 and 1. If the coincidence degree of the first mask and the second mask is close to 1, then the coincidence degree of the first mask and the second mask is high. If the coincidence degree of the first mask and the second mask is close to 0, then the coincidence degree of the first mask and the second mask is close to 0. The overlap between the mask and the second mask is low. Taking the target vehicle as an example, if the overlap between the first mask of a certain target vehicle at time t and the second mask at time t+1 is close to 1, then the first mask of the target vehicle at time t is consistent with the first mask at time t. The second mask at time t+1 has a high degree of overlap. If the overlap between the first mask of the target vehicle at time t and the second mask at time t+1 is close to 0, then the first mask of the target vehicle at time t and the second mask at time t+1 Mask overlap is low. In one embodiment of the present application, the preset threshold can be set at 0.5, and a certain error can be allowed. For example, the above comparison can be completed by using a preset error range combined with the preset threshold.

42,如果第一遮罩與第二遮罩的交集聯集比大於或等於預設閾值,確定生成目標車輛的動態類對象遮罩。42. If the intersection union ratio of the first mask and the second mask is greater than or equal to the preset threshold, determine to generate a dynamic class object mask of the target vehicle.

例如,如果某一目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度大於或等於0.5,則生成目標車輛的動態類對象遮罩。For example, if the coincidence degree between the first mask of a certain target vehicle at time t and the second mask at time t+1 is greater than or equal to 0.5, a dynamic class object mask of the target vehicle is generated.

43,如果第一遮罩與第二遮罩的交集聯集比小於預設閾值,確定不生成目標車輛的動態類對象遮罩。43. If the intersection union ratio of the first mask and the second mask is less than the preset threshold, determine not to generate a dynamic object mask of the target vehicle.

例如,如果某一目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度小於0.5,則不生成所述目標車輛的動態類對象遮罩。For example, if the coincidence degree between the first mask of a certain target vehicle at time t and the second mask at time t+1 is less than 0.5, no dynamic class object mask of the target vehicle is generated.

25,若生成目標車輛的動態類對象遮罩,確定目標車輛為移動車輛。25. If the dynamic class object mask of the target vehicle is generated, determine that the target vehicle is a moving vehicle.

如果某一目標車輛在t時刻的第一遮罩與在t+1時刻的第二遮罩的重合度大於或等於0.5,則生成目標車輛的動態類對象遮罩,即,連接所述目標車輛在不同時刻的遮罩形成的遮罩作為目標車輛的動態類對象遮罩,將生成動態類對象遮罩的車輛判定為移動車輛。If the coincidence degree between the first mask of a certain target vehicle at time t and the second mask at time t+1 is greater than or equal to 0.5, a dynamic class object mask of the target vehicle is generated, that is, the target vehicle is connected The mask formed by the masks at different times is used as the dynamic class object mask of the target vehicle, and the vehicle that generates the dynamic class object mask is determined to be a moving vehicle.

通常,場景是固定的,如果單目相機在拍攝的過程中存在移動的物體,例如車子和行人,會導致損失函數計算不精準,因為車子在動,損失函數會很大。例如,可以採用語義分割的方法,在計算損失函數的時候,把移動的物體都遮罩掉,由於語義分割只能劃分不同類物體,因此,在把移動的物體都採用遮罩處理掉的過程中,容易將停止的物體也一同遮罩掉,影響識別的準確度。Usually, the scene is fixed. If there are moving objects, such as cars and pedestrians, during the shooting process of the monocular camera, the calculation of the loss function will be inaccurate. Because the car is moving, the loss function will be very large. For example, you can use the method of semantic segmentation to mask out all moving objects when calculating the loss function. Since semantic segmentation can only divide different types of objects, therefore, in the process of masking out all moving objects, , it is easy to mask the stopped objects together, affecting the accuracy of recognition.

在車輛行駛的過程中,需要對周圍的車輛以及行人狀態做出精準的判斷,本申請實施例在識別物體的過程中,採用實例分割技術對靶心圖表像進行分割,精確的識別到每一個物件,比如,在識別到多個車輛的時候,能識別到有多少輛車,以及能識別到移動的車輛以及靜止的車輛。When a vehicle is driving, it is necessary to make accurate judgments on the status of surrounding vehicles and pedestrians. In the process of identifying objects, the embodiment of the present application uses instance segmentation technology to segment the bullseye chart image, and accurately identifies each object. , for example, when multiple vehicles are identified, how many vehicles can be identified, and moving vehicles and stationary vehicles can be identified.

在本申請的一個實施例中,在確定目標車輛為移動車輛之後,建立車輛安全距離模型,基於車輛安全距離模型得到車輛間的安全制動距離,若判斷所述移動車輛與所述車輛的距離小於或等於所述安全制動距離,發出警報。所述警報包括第一警報以及第二警報,若所述移動車輛與所述車輛的距離等於所述安全制動距離,以第一頻率發出所述第一警報;若所述移動車輛與所述車輛的距離小於所述安全制動距離,以第二頻率發出所述第二警報;其中,所述第一頻率小於所述第二頻率。In one embodiment of the present application, after determining that the target vehicle is a moving vehicle, a vehicle safety distance model is established, and a safe braking distance between vehicles is obtained based on the vehicle safety distance model. If it is determined that the distance between the moving vehicle and the vehicle is less than Or equal to the safe braking distance, an alarm will sound. The alarm includes a first alarm and a second alarm. If the distance between the moving vehicle and the vehicle is equal to the safe braking distance, the first alarm is issued at a first frequency; if the distance between the moving vehicle and the vehicle is the distance is less than the safe braking distance, the second alarm is issued at a second frequency; wherein the first frequency is less than the second frequency.

在實際的應用中,計算移動車輛的遮罩是為了更加精確的判斷自身車輛與周圍車輛/行人的距離,以確保安全行駛。In practical applications, the purpose of calculating the mask of a moving vehicle is to more accurately determine the distance between the own vehicle and surrounding vehicles/pedestrians to ensure safe driving.

具體的,藉由確定周圍的目標車輛為移動車輛之後,建立周圍的移動車輛跟自身車輛之間的車輛安全距離模型。Specifically, by determining that the surrounding target vehicles are moving vehicles, a vehicle safety distance model between the surrounding moving vehicles and the own vehicle is established.

根據計算t時刻車輛的速度v1與周圍車輛(即,目標車輛)的速度v2、車輛與周圍車輛之間的距離預警距離d構建車輛安全距離模型,基於車輛安全距離模型得到車輛間的安全制動距離。A vehicle safety distance model is constructed based on the calculation of the speed v1 of the vehicle at time t, the speed v2 of the surrounding vehicles (i.e., the target vehicle), and the distance warning distance d between the vehicle and the surrounding vehicles. Based on the vehicle safety distance model, the safe braking distance between vehicles is obtained. .

如果兩車的距離大於安全制動距離,則車輛可以正常行駛,不需要發出警報。如果兩車的距離小於或等於安全制動距離,則發出警報提醒駕駛員與周圍車輛距離太近。所述警報包括第一警報和第二警報,如果移動車輛與車輛的距離等於安全制動距離,以第一頻率發出第一警報,如果移動車輛與車輛的距離小於安全制動距離,以第二頻率發出第二警報,第一頻率小於第二頻率。例如,當確定移動車輛與車輛的距離等於安全制動距離,以每分鐘5次的頻率發出第一警報,當移動車輛與車輛的距離小於安全制動距離,以每分鐘10次的頻率發出第二警報,並且,當發出第二警報的時間超出預設時間時,例如,在2分鐘內駕駛員沒有作出任何避免發生危險的操作時,啟動自動緊急制動系統,以保證車輛的安全。If the distance between the two vehicles is greater than the safe braking distance, the vehicle can drive normally and no alarm is required. If the distance between the two vehicles is less than or equal to the safe braking distance, an alarm will sound to remind the driver that he is too close to the surrounding vehicles. The alarm includes a first alarm and a second alarm. If the distance between the moving vehicle and the vehicle is equal to the safe braking distance, the first alarm is issued at a first frequency. If the distance between the moving vehicle and the vehicle is less than the safe braking distance, the first alarm is issued at the second frequency. For the second alarm, the first frequency is less than the second frequency. For example, when it is determined that the distance between the moving vehicle and the vehicle is equal to the safe braking distance, a first alarm is issued at a frequency of 5 times per minute, and when the distance between the moving vehicle and the vehicle is less than the safe braking distance, a second alarm is issued at a frequency of 10 times per minute. , and when the time for issuing the second alarm exceeds the preset time, for example, when the driver does not make any operation to avoid danger within 2 minutes, the automatic emergency braking system is activated to ensure the safety of the vehicle.

在本實施例中,還可以藉由對安全制動距離d進行劃分,依據不同的安全預警形式,將安全制動距離d劃分為三種不同的臨界距離,臨界安全距離、臨界危險距離以及臨界無限小距離。根據判定車輛處於什麼距離來作出不同的安全預警措施。In this embodiment, the safe braking distance d can also be divided into three different critical distances according to different safety warning forms: the critical safety distance, the critical dangerous distance and the critical infinitesimal distance. . Different safety warning measures are taken based on the distance between the vehicle and the vehicle.

本申請藉由實例分割演算法,提高了識別周圍移動車輛的準確度,並進一步確保了車輛在行駛過程中對車輛安全距離的監測。This application uses an instance segmentation algorithm to improve the accuracy of identifying surrounding moving vehicles, and further ensures the monitoring of vehicle safety distances while the vehicle is driving.

請繼續參閱圖1,本實施例中,所述儲存器11可以是車載裝置1的內部儲存器,即內置於所述車載裝置1的儲存器。在其他實施例中,所述儲存器11也可以是車載裝置1的外部儲存器,即外接於所述車載裝置1的儲存器。Please continue to refer to FIG. 1 . In this embodiment, the memory 11 may be an internal memory of the vehicle-mounted device 1 , that is, a memory built into the vehicle-mounted device 1 . In other embodiments, the storage 11 may also be an external storage of the vehicle-mounted device 1 , that is, a storage external to the vehicle-mounted device 1 .

在一些實施例中,所述儲存器11用於存儲程式碼和各種資料,並在車載裝置1的運行過程中實現高速、自動地完成程式或資料的存取。In some embodiments, the memory 11 is used to store program codes and various data, and realize high-speed and automatic access to programs or data during the operation of the vehicle-mounted device 1 .

所述儲存器11可以包括隨機存取儲存器,還可以包括非易失性儲存器,例如硬碟、儲存器、插接式硬碟、智慧存儲卡(Smart Media Card,SMC)、安全數位(Secure Digital,SD)卡、快閃儲存器卡(Flash Card)、至少一個磁碟儲存器件、快閃儲存器器件、或其他易失性固態儲存器件。The storage 11 may include random access memory, and may also include non-volatile storage, such as a hard disk, a storage device, a plug-in hard disk, a Smart Media Card (SMC), a secure digital ( Secure Digital (SD) card, flash memory card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.

在一實施例中,所述處理器12可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器 (Digital Signal Processor,DSP)、專用積體電路 (Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA) 或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可以是微處理器或者所述處理器也可以是其它任何常規的處理器等。In one embodiment, the processor 12 may be a central processing unit (CPU), or other general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), or an application specific integrated circuit (Application Processor). Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any other conventional processor, etc.

所述儲存器11中的程式碼和各種資料如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以存儲在一個電腦可讀取存儲介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,例如移動車輛的識別方法,也可以藉由電腦程式來指令相關的硬體來完成,所述的電腦程式可存儲於電腦可讀存儲介質中,所述電腦程式在被處理器執行時,可實現上述各個方法實施例的步驟。其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可執行檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀儲存器(ROM,Read-Only Memory)等。If the program codes and various data in the storage 11 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above embodiment methods, such as the identification method of moving vehicles, which can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in the computer. In the readable storage medium, when the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in the form of original program code, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer storage, and a read-only memory (ROM, Read- Only Memory) etc.

可以理解的是,以上所描述的模組劃分,為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。另外,在本申請各個實施例中的各功能模組可以集成在相同處理單元中,也可以是各個模組單獨物理存在,也可以兩個或兩個以上模組集成在相同單元中。上述集成的模組既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。It can be understood that the module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application can be integrated in the same processing unit, or each module can exist physically alone, or two or more modules can be integrated in the same unit. The above integrated modules can be implemented in the form of hardware or in the form of hardware plus software function modules.

最後應說明的是,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神和範圍。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limiting. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be modified. Modifications or equivalent substitutions may be made without departing from the spirit and scope of the technical solution of the present application.

1:車載裝置 11:儲存器 12:處理器 13:通訊匯流排 21~25:步驟 31~33:步驟 41~43:步驟 1: Vehicle-mounted device 11:Storage 12: Processor 13: Communication bus 21~25: Steps 31~33: Steps 41~43: Steps

圖1是本發明較佳實施例的車載裝置的結構示意圖。Figure 1 is a schematic structural diagram of a vehicle-mounted device according to a preferred embodiment of the present invention.

圖2是本發明較佳實施例提供的移動車輛的識別方法的流程圖。Figure 2 is a flow chart of a moving vehicle identification method provided by a preferred embodiment of the present invention.

圖3是計算目標車輛在不同時刻之間的交集聯集比的流程圖。Figure 3 is a flow chart for calculating the intersection union ratio of the target vehicle at different times.

圖4是判斷是否生成所述目標車輛的動態類對象遮罩的流程圖。Figure 4 is a flow chart for determining whether to generate a dynamic class object mask of the target vehicle.

21~25:步驟 21~25: Steps

Claims (10)

一種移動車輛的識別方法,應用於車輛的車載裝置中,其中,該方法包括: 拍攝目標車輛在第一時刻的第一圖像和第二時刻的第二圖像; 基於實例分割演算法,根據所述第一圖像確定所述目標車輛的第一遮罩以及根據所述第二圖像確定所述目標車輛的第二遮罩; 計算所述第一遮罩與所述第二遮罩的交集聯集比; 根據所述交集聯集比判斷是否生成所述目標車輛的動態類對象遮罩; 若生成所述目標車輛的動態類對象遮罩,確定所述目標車輛為移動車輛。 A method for identifying a moving vehicle, applied to an on-board device of the vehicle, wherein the method includes: Capture a first image of the target vehicle at a first moment and a second image at a second moment; Based on an instance segmentation algorithm, determine a first mask of the target vehicle based on the first image and determine a second mask of the target vehicle based on the second image; Calculate the intersection union ratio of the first mask and the second mask; Determine whether to generate a dynamic class object mask of the target vehicle according to the intersection union ratio; If a dynamic object mask of the target vehicle is generated, it is determined that the target vehicle is a moving vehicle. 如請求項1所述的移動車輛的識別方法,其中,在所述根據所述第一圖像確定所述目標車輛的第一遮罩之前,該方法還包括: 確定所述目標車輛在所述第一圖像的第一位置以及所述目標車輛的標識。 The method for identifying a moving vehicle as claimed in claim 1, wherein before determining the first mask of the target vehicle based on the first image, the method further includes: A first position of the target vehicle in the first image and an identity of the target vehicle are determined. 如請求項2所述的移動車輛的識別方法,其中,在所述根據所述第二圖像確定所述目標車輛的第二遮罩之前,該方法還包括: 基於所述目標車輛的標識,確定所述目標車輛在所述第二圖像中的第二位置。 The method for identifying a moving vehicle according to claim 2, wherein before determining the second mask of the target vehicle based on the second image, the method further includes: Based on the identification of the target vehicle, a second location of the target vehicle in the second image is determined. 如請求項3所述的移動車輛的識別方法,其中,所述基於實例分割演算法,根據所述第一圖像確定所述目標車輛的第一遮罩以及根據所述第二圖像確定所述目標車輛的第二遮罩,包括: 分別將所述第一圖像和所述第二圖像輸入特徵提取網路,獲取所述第一圖像的第一特徵圖和所述第二圖像的第二特徵圖; 分別對所述第一特徵圖和所述第二特徵圖進行二分類以及座標回歸,確定所述第一特徵圖中所述目標車輛的第一感興趣區域以及所述第二特徵圖中所述目標車輛的第二感興趣區域; 提取所述第一感興趣區域的第一特徵子圖以及所述第二感興趣區域的第二特徵子圖; 基於所述第一特徵子圖和所述第一位置生成所述第一遮罩; 基於所述第二特徵子圖和所述第二位置生成所述第二遮罩。 The method for identifying a moving vehicle according to claim 3, wherein the instance-based segmentation algorithm determines the first mask of the target vehicle based on the first image and determines the target vehicle based on the second image. The second mask of the target vehicle includes: Input the first image and the second image into a feature extraction network respectively, and obtain the first feature map of the first image and the second feature map of the second image; Perform binary classification and coordinate regression on the first feature map and the second feature map respectively to determine the first area of interest of the target vehicle in the first feature map and the first area of interest in the second feature map. a second region of interest for the target vehicle; extracting a first feature sub-image of the first region of interest and a second feature sub-image of the second region of interest; generating the first mask based on the first feature submap and the first location; The second mask is generated based on the second feature submap and the second location. 如請求項1至4中任一項所述的移動車輛的識別方法,其中,所述計算所述第一遮罩與所述第二遮罩的交集聯集比,包括: 計算所述第一遮罩與所述第二遮罩的第一重合度; 計算所述第一遮罩與所述第二遮罩的第二重合度; 計算所述第一重合度與所述第二重合度的比值作為所述交集聯集比。 The identification method of a moving vehicle according to any one of claims 1 to 4, wherein the calculation of the intersection and union ratio of the first mask and the second mask includes: Calculate a first degree of coincidence between the first mask and the second mask; Calculate a second degree of coincidence between the first mask and the second mask; The ratio of the first degree of coincidence to the second degree of coincidence is calculated as the intersection union ratio. 如請求項1所述的移動車輛的識別方法,其中,所述根據所述交集聯集比判斷是否生成所述目標車輛的動態類對象遮罩,包括:若所述交集聯集比大於或等於預設閾值,確定生成所述目標車輛的動態類對象遮罩;若所述交集聯集比小於所述預設閾值,確定不生成所述目標車輛的動態類對象遮罩。The identification method of a moving vehicle as described in claim 1, wherein the determining whether to generate a dynamic class object mask of the target vehicle based on the intersection union ratio includes: if the intersection union ratio is greater than or equal to A preset threshold is used to determine to generate a dynamic object mask for the target vehicle; if the intersection and union ratio is less than the preset threshold, it is determined not to generate a dynamic object mask for the target vehicle. 如請求項1所述的移動車輛的識別方法,其中,在確定所述目標車輛為移動車輛後,所述方法還包括: 建立車輛安全距離模型,基於所述車輛安全距離模型得到車輛間的安全制動距離; 若判斷所述移動車輛與所述車輛的距離小於或等於所述安全制動距離,發出警報。 The method for identifying a moving vehicle as claimed in claim 1, wherein after determining that the target vehicle is a moving vehicle, the method further includes: Establish a vehicle safety distance model, and obtain the safe braking distance between vehicles based on the vehicle safety distance model; If it is determined that the distance between the moving vehicle and the vehicle is less than or equal to the safe braking distance, an alarm is issued. 如請求項7所述的移動車輛的識別方法,其中,所述警報包括第一警報以及第二警報,所述發出警報包括: 若所述移動車輛與所述車輛的距離等於所述安全制動距離,以第一頻率發出所述第一警報; 若所述移動車輛與所述車輛的距離小於所述安全制動距離,以第二頻率發出所述第二警報; 其中,所述第一頻率小於所述第二頻率。 The method for identifying a moving vehicle according to claim 7, wherein the alarm includes a first alarm and a second alarm, and the issuing of the alarm includes: If the distance between the moving vehicle and the vehicle is equal to the safe braking distance, send the first alarm at the first frequency; If the distance between the moving vehicle and the vehicle is less than the safe braking distance, send the second alarm at a second frequency; Wherein, the first frequency is smaller than the second frequency. 一種車載裝置,其中,所述車載裝置包括處理器和儲存器,所述處理器用於執行儲存器中存儲的電腦程式以實現如請求項1至8中任意一項的所述移動車輛的識別方法。A vehicle-mounted device, wherein the vehicle-mounted device includes a processor and a storage, and the processor is used to execute a computer program stored in the storage to implement the identification method of a moving vehicle according to any one of claims 1 to 8. . 一種電腦可讀存儲介質,其中,所述電腦可讀存儲介質存儲有至少一個指令,所述至少一個指令被處理器執行時實現如請求項1至8中任意一項所述的移動車輛的識別方法。A computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction. When the at least one instruction is executed by a processor, the identification of a moving vehicle as described in any one of claims 1 to 8 is achieved. method.
TW111121117A 2022-06-07 2022-06-07 Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium TW202349266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW111121117A TW202349266A (en) 2022-06-07 2022-06-07 Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111121117A TW202349266A (en) 2022-06-07 2022-06-07 Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
TW202349266A true TW202349266A (en) 2023-12-16

Family

ID=90039145

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111121117A TW202349266A (en) 2022-06-07 2022-06-07 Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium

Country Status (1)

Country Link
TW (1) TW202349266A (en)

Similar Documents

Publication Publication Date Title
US11080539B2 (en) Traffic light state recognizing method and apparatus, computer device and readable medium
WO2022126377A1 (en) Traffic lane line detection method and apparatus, and terminal device and readable storage medium
JP2020501281A (en) Obstacle detection method and device
KR20190026116A (en) Method and apparatus of recognizing object
CN112967283B (en) Target identification method, system, equipment and storage medium based on binocular camera
Li et al. Lane detection based on connection of various feature extraction methods
WO2023016271A1 (en) Attitude determining method, electronic device, and readable storage medium
WO2020098506A1 (en) Intersection state detection method and apparatus, electronic device and vehicle
US20210117700A1 (en) Lane line attribute detection
WO2020181426A1 (en) Lane line detection method and device, mobile platform, and storage medium
JP2020052647A (en) Object detection device, object detection method, computer program for object detection, and vehicle control system
CN115147328A (en) Three-dimensional target detection method and device
CN117218622A (en) Road condition detection method, electronic equipment and storage medium
CN108090455A (en) Parking stall line vertex localization method, system, terminal and medium based on cascade mechanism
JP2018073275A (en) Image recognition device
JP6631691B2 (en) Image processing device, device control system, imaging device, image processing method, and program
Al Mamun et al. Efficient lane marking detection using deep learning technique with differential and cross-entropy loss.
CN115147809B (en) Obstacle detection method, device, equipment and storage medium
CN115035492B (en) Vehicle identification method, device, equipment and storage medium
TW202349266A (en) Method of recognizing moving vehicle and vehicle-mounted device and computer-readable storage medium
EP4113377A1 (en) Use of dbscan for lane detection
JP2023156963A (en) Object tracking integration method and integration apparatus
WO2022052853A1 (en) Object tracking method and apparatus, device, and a computer-readable storage medium
US20230394843A1 (en) Method for identifying moving vehicles and in-vehicle device
JP2019191691A (en) Image processing apparatus, mobile apparatus and method, and program