TW201812718A - Method and equipment for testing vehicles - Google Patents

Method and equipment for testing vehicles Download PDF

Info

Publication number
TW201812718A
TW201812718A TW106128491A TW106128491A TW201812718A TW 201812718 A TW201812718 A TW 201812718A TW 106128491 A TW106128491 A TW 106128491A TW 106128491 A TW106128491 A TW 106128491A TW 201812718 A TW201812718 A TW 201812718A
Authority
TW
Taiwan
Prior art keywords
vehicle
training
model
area
level
Prior art date
Application number
TW106128491A
Other languages
Chinese (zh)
Other versions
TWI635467B (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 平安科技(深圳)有限公司
Publication of TW201812718A publication Critical patent/TW201812718A/en
Application granted granted Critical
Publication of TWI635467B publication Critical patent/TWI635467B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles

Abstract

A method and equipment for testing vehicles are provided. The method includes: retrieving basic character data from an image of a vehicle; inputting the basic character data into a pre-trained and-or model, obtaining nodes of each layer of the and-or model as key nodes; correlating the key nodes as optimized calculating branches; transforming the key nodes to location parameters of the image of the vehicle, and determining a graph model of each layer's key nodes of the calculating branches according to a preset relationship between each layer's key nodes and the graph models; and determining location information and layout of the vehicle according to the location parameters and the graph model of each layer's key nodes of the calculating branches.

Description

車輛檢測的方法及裝置  Vehicle detection method and device  

本發明關於影像處理技術領域,特別是關於一種車輛檢測的方法及裝置。 The invention relates to the technical field of image processing, and in particular to a method and a device for detecting a vehicle.

目前,對車輛訊號的識別一般是藉由自動化的監管系統對車輛訊號圖片中的目標物體進行檢測來實現的,例如檢測車輛訊號圖片中的車牌等。 At present, the identification of vehicle signals is generally realized by an automated supervisory system detecting target objects in a vehicle signal picture, such as detecting a license plate in a vehicle signal picture.

然而,由於現實車輛場景存在多樣性、以及車輛間遮擋關係的無規則或可見部位比例的不可控等因素,現行的車輛訊號的識別工作往往會遇到較多干擾,識別效果不佳。 However, due to the diversity of realistic vehicle scenes and the uncontrollable or uncontrollable proportion of the occlusion relationship between vehicles, the identification of current vehicle signals often encounters more interference and the recognition effect is not good.

此外,傳統的車輛訊號的識別工作往往是採用簡單的人工設定特徵的模式來進行的,在處理一些複雜場景時,識別工作的效率較低。 In addition, the identification of traditional vehicle signals is often carried out using a simple manual setting of features, and the efficiency of the identification work is low when dealing with some complex scenes.

本發明的目的是提供一種車輛檢測的方法及裝置。 It is an object of the present invention to provide a method and apparatus for vehicle detection.

本發明之車輛檢測的方法,其步驟包括:S1,在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號;S2,將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的該各層級節點作為關鍵節點輸出;S3,將輸出的該關鍵節點進行關聯,以將關聯 的該各層級關鍵節點作為較佳的演算分支;S4,將該演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的該各層級關鍵節點對應的該圖形範本;S5,根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。 The method for detecting a vehicle of the present invention includes the following steps: S1, after receiving the to-be-detected picture including the vehicle signal, extracting a basic characteristic signal of the to-be-detected picture by using a predetermined algorithm; S2, inputting the basic characteristic signal to In the And-Or model generated by the pre-training, the hierarchical nodes are obtained by using the And-Or model generated by the pre-training, and the acquired hierarchical nodes are output as key nodes; S3, the key nodes of the output are associated, Taking the associated key nodes of the hierarchy as a preferred calculation branch; S4, converting the key nodes of the hierarchy in the calculation branch into position parameters in the image to be detected, and according to the predetermined key nodes of the hierarchy The association relationship of the graphic template determines the graphic template corresponding to the key nodes of each level in the calculation branch; S5, acquiring the image to be detected according to the position parameter corresponding to the key nodes of the hierarchical level in the calculation branch and the graphic template The vehicle position signal and the vehicle layout relationship are output and output.

在一較佳實施例中,層級至少包括以下三個:車輛連通區域層級、每一輛車的分佈位置區域層級及車輛內部的各局部部件組成區域層級。 In a preferred embodiment, the hierarchy includes at least three of the following: a level of vehicle communication area, a level of distribution location area of each vehicle, and a level of each component component area within the vehicle.

在一較佳實施例中,該步驟S2包括:S21,將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點;S22,在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示;S23,在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,每一輛車對應的區域以Or節點表示;S24,在該車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用And節點表示並進行組織;S25,將各Or節點及各And節點作為關鍵節點輸出。 In a preferred embodiment, the step S2 includes: S21, inputting the basic feature signal into the pre-trained And-Or model, and acquiring a vehicle global area, the vehicle global area being represented by the Or node and serving as the And a root node of the -Or model; S22, at the level of the connected area of the vehicle, each vehicle connected area is decomposed based on the root node, the respective vehicle connected areas are respectively represented by different And nodes; S23, the distribution of each of the vehicles At a location area level, an area corresponding to each vehicle is extracted from the respective vehicle communication areas, and an area corresponding to each vehicle is represented by an Or node; and S24, each local part in the vehicle forms an area level, for each Each local component area of the vehicle is represented by the And node and organized; and in S25, each Or node and each And node are output as key nodes.

在一較佳實施例中,該步驟S2之前,該方法還包括:S01,獲取預設數量的帶有車輛訊號的車輛圖片作為And-Or模型的訓練樣本圖片;S02,提取出預設比例的該訓練樣本圖片作為訓練集,並將剩餘的該訓練樣本圖片作為測試集,並對該訓練集中的每張訓練樣本圖片框定出車輛 連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域;S03,利用通過框定處理後的該訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的該And-Or模型;S04,將測試集中的每張訓練樣本圖片輸入到訓練生成的該And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。 In a preferred embodiment, before the step S2, the method further includes: S01, acquiring a preset number of vehicle images with vehicle signals as training sample pictures of the And-Or model; S02, extracting a preset ratio The training sample picture is used as a training set, and the remaining training sample picture is used as a test set, and each training sample picture frame in the training set defines a vehicle connection area, a distribution location area of each vehicle, and each interior of the vehicle. The local component constitutes an area; S03, training the And-Or model by using the training sample picture after the frame processing, to train and generate the And-Or model for performing image detection; and S04, taking each training sample picture in the test set The test is input into the And-Or model generated by the training, and if the accuracy of the test is greater than or equal to the preset threshold, the training ends.

在一較佳實施例中,該步驟S04之後,該方法還包括:若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量。 In a preferred embodiment, after the step S04, the method further includes: if the accuracy of the test is less than the preset threshold, prompting to increase the number of the training sample pictures.

本發明之車輛檢測的裝置,包括:一提取模組,用於在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號;一訓練模組,用於將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的該各層級節點作為關鍵節點輸出;一關聯模組,用於將輸出的該關鍵節點進行關聯,以將關聯的該各層級關鍵節點作為較佳的演算分支;一轉化模組,用於將該演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的該各層級關鍵節點對應的該圖形範本;一輸出模組,用於根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。 The device for detecting a vehicle of the present invention includes: an extraction module, configured to extract a basic feature signal of the image to be detected by a predetermined algorithm after receiving the image to be detected including the vehicle signal; The basic feature signal is input into the pre-trained And-Or model to acquire each hierarchical node through the pre-trained And-Or model, and the obtained hierarchical nodes are output as key nodes; a group, configured to associate the key nodes of the output to use the associated hierarchical key nodes as a preferred calculation branch; a transformation module, configured to convert the hierarchical key nodes in the calculation branch into the a location parameter in the picture to be detected, and determining, according to the predetermined association relationship between the key nodes of the hierarchy and the graphic template, the graphic template corresponding to the key nodes of each level in the calculation branch; an output module, according to the The position parameter corresponding to the key nodes of each level in the calculation branch and the graphic template obtain the vehicle position signal in the image to be detected and Vehicle distribution relationships and output.

在一較佳實施例中,該層級至少包括以下三個:車輛連通區域層級、每一輛車的分佈位置區域層級及車輛內部的各局部部件組成區域層級。 In a preferred embodiment, the hierarchy includes at least three of the following: a level of vehicle communication area, a level of distribution location area of each vehicle, and a level of each component component area within the vehicle.

在一較佳實施例中,該訓練模組包括:一獲取單元,用於將 該基本特徵訊號輸入到該預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點;一分解單元,用於在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示;一抽取單元,用於在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,該每一輛車對應的區域以Or節點表示;一組織單元,用於在該車輛內部的各局部部件組成區域層級,對於該每一輛車的各個局部部件區域分別用And節點表示並進行組織;一輸出單元,用於將該各Or節點及該各And節點作為關鍵節點輸出。 In a preferred embodiment, the training module includes: an obtaining unit, configured to input the basic feature signal into the pre-trained And-Or model, and obtain a vehicle global area, where the vehicle global area is Or The node represents and serves as a root node of the And-Or model; a decomposition unit is configured to, at the level of the vehicle communication area, decompose each vehicle communication area based on the root node, and the respective vehicle communication areas are respectively represented by different And nodes; An extraction unit is configured to extract an area corresponding to each vehicle from each of the vehicle communication areas at a level of the distribution location area of each of the vehicles, wherein the area corresponding to each vehicle is represented by an Or node; a unit for forming a regional level in each part of the vehicle, and each local component area of each vehicle is represented and organized by an And node; an output unit is used for the Or nodes and the respective The And node is output as a key node.

在一較佳實施例中,該車輛檢測的裝置還包括:一獲取模組,用於獲取預設數量的帶有車輛訊號的車輛圖片作為And-Or模型的訓練樣本圖片;一框定模組,用於提取出預設比例的該訓練樣本圖片作為訓練集,並將剩餘的該訓練樣本圖片作為測試集,並對訓練集中的每張訓練樣本圖片框定出車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域;一生成模組,用於利用通過框定處理後的該訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的And-Or模型;一測試模組,用於將測試集中的每張訓練樣本圖片輸入到訓練生成的And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。 In a preferred embodiment, the device for detecting a vehicle further includes: an acquisition module, configured to acquire a preset number of vehicle images with vehicle signals as training sample images of the And-Or model; The training sample picture is extracted as a training set, and the remaining training sample picture is used as a test set, and the vehicle connected area and the distribution of each vehicle are determined for each training sample picture frame in the training set. a location area and each partial component component area of the vehicle; a generating module, configured to train the And-Or model by using the training sample picture after the frame processing, to train and generate an And-Or model for performing image detection; A test module is configured to input each training sample image in the test set into the training-generated And-Or model for testing. If the accuracy of the test is greater than or equal to a preset threshold, the training ends.

在一較佳實施例中,該車輛檢測的裝置還包括:一增加模組,用於若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量,觸發該框定模組以繼續訓練生成用於進行圖片檢測的And-Or模型。 In a preferred embodiment, the device for detecting a vehicle further includes: an adding module, if the accuracy of the test is less than a preset threshold, prompting to increase the number of the training sample picture, triggering the frame module to continue Training generates an And-Or model for image detection.

本發明的有益效果是:本發明首先將包含車輛訊號的待檢測 圖片進行初步處理得到基本特徵訊號,然後將其輸入到預先訓練生成的And-Or模型中以獲取各層級關鍵節點,將各層級關鍵節點關聯後作為一較佳的演算分支,對於每一演算分支,在獲取其各層級關鍵節點的圖形範本及轉化各層級的關鍵節點的位置參數後,可以根據各層級關鍵節點對應的位置參數和圖形範本得到車輛位置訊號以及車輛佈局關係,本實施例利用And-Or模型對車輛進行檢測識別,能夠處理具有複雜場景的圖片,並對圖片中的車輛訊號進行有效的識別、識別效率高。 The invention has the beneficial effects that the present invention firstly performs preliminary processing on the to-be-detected picture including the vehicle signal to obtain a basic feature signal, and then inputs it into the pre-trained And-Or model to obtain key nodes of each level, and each level is After the key nodes are associated, as a better calculation branch, for each calculation branch, after obtaining the graphic templates of the key nodes of each level and transforming the position parameters of the key nodes of each level, the position parameters corresponding to the key nodes of each level can be selected. And the graphic template obtains the vehicle position signal and the vehicle layout relationship. In this embodiment, the And-Or model is used to detect and identify the vehicle, and the picture with complex scene can be processed, and the vehicle signal in the picture is effectively recognized and recognized efficiently.

S1~S5‧‧‧步驟 S1~S5‧‧‧Steps

S21~S25‧‧‧步驟 S21~S25‧‧‧Steps

S01~S04‧‧‧步驟 S01~S04‧‧‧Steps

101‧‧‧提取模組 101‧‧‧ extraction module

102‧‧‧訓練模組 102‧‧‧ training module

103‧‧‧關聯模組 103‧‧‧Association module

104‧‧‧轉化模組 104‧‧‧Transformation module

105‧‧‧輸出模組 105‧‧‧Output module

201‧‧‧獲取模組 201‧‧‧Getting module

202‧‧‧框定模組 202‧‧‧framed module

203‧‧‧生成模組 203‧‧‧Generation module

204‧‧‧測試模組 204‧‧‧Test module

第1圖係本發明車輛檢測的方法之第一實施例的流程示意圖;第2圖係第1圖所示步驟S2的流程示意圖;第3圖係本發明車輛檢測的方法之第二實施例的流程示意圖;第4圖係本發明車輛檢測的裝置之第一實施例的結構示意圖;第5圖係本發明車輛檢測的裝置之第二實施例的結構示意圖。 1 is a schematic flow chart of a first embodiment of a method for detecting a vehicle according to the present invention; FIG. 2 is a schematic flowchart of a step S2 shown in FIG. 1; and FIG. 3 is a second embodiment of a method for detecting a vehicle according to the present invention. 4 is a schematic structural view of a first embodiment of a device for detecting a vehicle according to the present invention; and FIG. 5 is a schematic structural view of a second embodiment of a device for detecting a vehicle according to the present invention.

以下結合附圖對本發明的原理和特徵進行描述,所舉實施例只用於解釋本發明,並非用於限定本發明的範圍。 The principles and features of the present invention are described below in conjunction with the accompanying drawings, which are intended to illustrate the invention and not to limit the scope of the invention.

請參閱第1圖,係本發明車輛檢測的方法一實施例的流程示意圖,該車輛檢測的方法包括以下步驟。 Please refer to FIG. 1 , which is a schematic flowchart of an embodiment of a method for detecting a vehicle according to the present invention. The method for detecting the vehicle includes the following steps.

步驟S1,在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號。 Step S1: After receiving the to-be-detected picture including the vehicle signal, extract the basic feature signal of the to-be-detected picture by using a predetermined algorithm.

本實施例的車輛檢測的方法可以應用於具有複雜場景下的交通安全監控、汽車生產及汽車保險等領域,利用具有圖片拍攝功能的車 輛檢測的裝置在這些場景下捕獲圖片,當捕獲到包含車輛訊號的圖片後,以該圖片作為待檢測圖片,並通過一些預定的演算法來提取其基本特徵訊號。 The method of vehicle detection of the present embodiment can be applied to areas such as traffic safety monitoring, automobile production, and automobile insurance in a complicated scene, and a vehicle detecting device having a picture capturing function captures pictures in these scenes, and when the vehicle is captured After the picture of the signal, the picture is taken as the picture to be detected, and the basic feature signals are extracted by some predetermined algorithms.

於本實施例中,該預定的演算法為影像處理的一些基本演算法,例如為圖像邊緣檢測演算法等,該基本特徵訊號為可以直接輸入至And-Or模型的圖片訊號,例如為圖片中各部分的位置或相互關係等。在一較佳實施例中,本實施例可以利用方向梯度長條圖(Histogram of Oriented Gradient,HOG)演算法獲取該待檢測圖片的梯度邊緣訊號,然後再採用K-means聚類演算法獲取各經梯度邊緣後的圖片的聚類中心或者採用DPM(Deformable Parts Model)演算法獲取各經梯度邊緣後的圖片各部分的相互位置關係等。 In this embodiment, the predetermined algorithm is some basic algorithms of image processing, such as an image edge detection algorithm, and the basic feature signal is a picture signal that can be directly input to the And-Or model, such as an image. The location or relationship of each part. In a preferred embodiment, the Histogram of Oriented Gradient (HOG) algorithm is used to obtain the gradient edge signal of the image to be detected, and then the K-means clustering algorithm is used to obtain each The clustering center of the image after the gradient edge or the DPM (Deformable Parts Model) algorithm is used to obtain the mutual positional relationship of each part of the image after the gradient edge.

步驟S2,將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的該各層級節點作為關鍵節點輸出。 In step S2, the basic feature signal is input into the pre-trained And-Or model to acquire each hierarchical node through the pre-trained And-Or model, and the obtained hierarchical nodes are output as key nodes.

於本實施例中,該And-Or模型為預先採用大量的該包含車輛訊號的圖片進行訓練得到的,將上述提取得到的該基本特徵訊號輸入至該預先訓練生成的And-Or模型,通過該預先訓練生成的And-Or模型對輸入的該基本特徵訊號進行學習,在學習過程中,首先得到根節點,然後基於該根節點可以得到該各個層級對應的節點,然後將該各個層級對應的節點作為關鍵節點輸出。 In this embodiment, the And-Or model is obtained by training a plurality of pictures containing the vehicle signal in advance, and inputting the extracted basic feature signal into the pre-trained And-Or model. The pre-trained And-Or model learns the input basic feature signal. In the learning process, the root node is first obtained, and then the nodes corresponding to the respective levels are obtained based on the root node, and then the nodes corresponding to the respective levels are obtained. Output as a key node.

本實施例的該預先訓練生成的And-Or模型中,較佳的層級至少包括三個,即為車輛連通區域層級、每一輛車的分佈位置區域層級及 車輛內部的各局部部件組成區域層級。當然層級也可以少於三個或者多於三個。 In the And-Or model generated by the pre-training in this embodiment, the preferred level includes at least three, that is, the level of the vehicle communication area, the distribution level of each vehicle, and the regional level of each part of the vehicle. . Of course, the level can also be less than three or more than three.

步驟S3,將輸出的該關鍵節點進行關聯,以將關聯的該各層級關鍵節點作為較優的演算分支。 In step S3, the outputted key nodes are associated to use the associated key nodes of the hierarchy as a preferred calculation branch.

於本實施例中,在該關鍵節點輸出後,將輸出的該關鍵節點進行關聯。其中,可以以上述的根節點為基礎將該關鍵節點進行關聯,具體地,可以先將每一層級中的該關鍵節點進行關聯,例如將同一層級中的關鍵節點的依據位置關係進行關聯,以確定同一層級中的各關鍵節點的相對位置;然後,將該各層級的關鍵節點依據位置關係進行關聯,例如將不同層級中的關鍵節點的位置進行關聯,以確定不同層級中的各關鍵節點的相對位置,該關鍵節點進行關聯後,可以勾勒出該待檢測圖片各部分的架構,然後將關聯的該各層級關鍵節點作為上述預先訓練生成的And-Or模型在學習過程中的較佳的演算分支,以進行下一步操作。 In this embodiment, after the key node is output, the output key node is associated. The key nodes may be associated with each other according to the root node. Specifically, the key nodes in each level may be associated first, for example, the key nodes in the same level are associated with each other according to the location relationship. Determining the relative positions of the key nodes in the same level; then, associating the key nodes of the respective levels according to the positional relationship, for example, associating the positions of the key nodes in different levels to determine the key nodes in the different levels Relative position, after the key nodes are associated, the architecture of each part of the image to be detected can be outlined, and then the associated key nodes of each level are used as a better calculation in the learning process of the pre-trained And-Or model. Branch for the next step.

步驟S4,將該演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的各層級關鍵節點對應的該圖形範本。 Step S4, converting the key nodes in the calculation branch into position parameters in the to-be-detected picture, and determining the key levels in the calculation branch according to the predetermined relationship between the key nodes of the hierarchy and the graphic template. The graphic template corresponding to the node.

於本實施例中,將較佳的演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,以得到該待檢測圖片中各部分的具體位置。 In this embodiment, the key nodes in the preferred calculation branch are converted into position parameters in the to-be-detected picture to obtain a specific location of each part in the to-be-detected picture.

另外,對於每一較優的演算分支中的各個層級,可以根據預定的該各層級關鍵節點與該圖形範本的關聯關係確定出每個層級關鍵節點對應的該圖形範本,例如某一層級的關鍵節點為橢圓形,則所關聯的圖形 範本為橢圓。該圖形範本為通過對不同車輛從不同角度觀看時各部分所形成的線條或者圖形,通過提取這些線條或圖形以形成大量的圖形範本,該圖形範本具有一個或者多個節點,即該圖形範本與該節點相關聯。 In addition, for each level in each of the better calculation branches, the graphic template corresponding to each level key node may be determined according to a predetermined association relationship between the hierarchical key nodes and the graphic template, for example, a key of a certain level If the node is elliptical, the associated graphic template is an ellipse. The graphic template is a line or a figure formed by different parts when viewed from different angles of different vehicles, and by extracting the lines or figures to form a large number of graphic templates, the graphic template has one or more nodes, that is, the graphic template and This node is associated.

步驟S5,根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。 Step S5: Acquire and output the vehicle position signal and the vehicle layout relationship in the to-be-detected picture according to the position parameter corresponding to the hierarchical key nodes in the calculation branch and the graphic template.

於本實施例中,如果已經得到該各層級關鍵節點對應的該位置參數(即得到待檢測圖片中各部分的具體位置)以及對應的圖形範本,則可以將該各層級關鍵節點對應的該圖形範本置於與該位置參數對應的位置,最終得到該待檢測圖片中該車輛位置訊號以及該車輛佈局關係,即得到每一輛的具體位置及多輛車(對於待檢測圖片有多輛車時而言)之間的佈局關係。 In this embodiment, if the location parameter corresponding to the key nodes of each level (that is, the specific location of each part in the picture to be detected) and the corresponding graphic template are obtained, the graphic corresponding to the key nodes of each level may be obtained. The template is placed at a position corresponding to the position parameter, and finally the vehicle position signal and the vehicle layout relationship in the image to be detected are obtained, that is, the specific position of each vehicle and multiple vehicles are obtained (when there are multiple vehicles for the picture to be detected) Talk about the layout relationship between.

與習知技術相比,本實施例首先將包含車輛訊號的待檢測圖片進行初步處理得到基本特徵訊號,然後將其輸入到預先訓練生成的And-Or模型中以獲取各層級關鍵節點,將各層級關鍵節點關聯後作為一較佳的演算分支,對於每一演算分支,在獲取其各層級關鍵節點的圖形範本及轉化各層級的關鍵節點的位置參數後,可以根據各層級關鍵節點對應的位置參數和圖形範本得到車輛位置訊號以及車輛佈局關係,本實施例利用And-Or模型對車輛進行檢測識別,能夠處理具有複雜場景的圖片,並對圖片中的車輛訊號進行有效的識別、識別效率高。 Compared with the prior art, the first embodiment of the present invention firstly processes the to-be-detected picture containing the vehicle signal to obtain a basic feature signal, and then inputs it into the pre-trained And-Or model to obtain key nodes at each level, and each will be After the hierarchical key nodes are associated, as a better calculation branch, for each calculation branch, after obtaining the graphic templates of the key nodes of each level and transforming the position parameters of the key nodes of each level, the positions corresponding to the key nodes of each level can be selected. The parameter and graphic template obtain the vehicle position signal and the vehicle layout relationship. In this embodiment, the And-Or model is used to detect and identify the vehicle, and the picture with complex scene can be processed, and the vehicle signal in the picture is effectively recognized and recognized efficiently. .

在一較佳的實施例中,請同時參閱第1圖及第2圖所示,在上述第1圖之實施例的基礎上,上述步驟S2包括以下步驟。 In a preferred embodiment, please refer to FIG. 1 and FIG. 2 simultaneously. In addition to the embodiment of FIG. 1 above, the above step S2 includes the following steps.

步驟S21,將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點。 Step S21: input the basic feature signal into the And-Or model generated by the pre-training, and acquire a vehicle global area, where the vehicle global area is represented by the Or node and is the root node of the And-Or model.

步驟S22,在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示。 Step S22: At the vehicle communication area level, each vehicle communication area is decomposed based on the root node, and the respective vehicle communication areas are respectively represented by different And nodes.

步驟S23,在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,該每一輛車對應的區域以Or節點表示。 In step S23, at the level of the distribution location area of each of the vehicles, the area corresponding to each vehicle is extracted from the respective vehicle communication areas, and the area corresponding to each vehicle is represented by an Or node.

步驟S24,在該車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用And節點表示並進行組織。 In step S24, the local components in the interior of the vehicle form an area level, and each partial component area of each vehicle is represented by an And node and organized.

步驟S25,將各Or節點及各And節點作為關鍵節點輸出。 In step S25, each Or node and each And node are output as key nodes.

本實施例中,上述層級至少包括車輛連通區域層級、每一輛車的分佈位置區域層級及車輛內部的各局部部件組成區域層級為例進行說明。在將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中可以獲取到該車輛全域區域,即對應於待檢測圖片中包含所有車輛的區域所形成的區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點。 In this embodiment, the above-mentioned hierarchy includes at least a vehicle communication area level, a distribution position area level of each vehicle, and a partial level of each part component in the vehicle as an example for description. Entering the basic feature signal into the pre-trained And-Or model may obtain the vehicle global area, that is, an area formed by an area corresponding to all vehicles in the picture to be detected, and the vehicle global area is an Or node. Represents and acts as the root node of the And-Or model.

在該車輛連通區域層級,基於根節點對各個車輛連通區域進行分解,例如分解出第一輛車與第二輛車的連通區域,直至將所有的車輛的車輛連通區域分解出來,各個車輛連通區域分別以不同的And節點表示。 At the level of the vehicle communication area, the respective vehicle communication areas are decomposed based on the root node, for example, the communication area between the first vehicle and the second vehicle is decomposed until the vehicle communication areas of all the vehicles are decomposed, and the vehicle communication areas are separated. Represented by different And nodes respectively.

在該每一輛車的分佈位置區域層級,通過上述的車輛連通區域層級分解出來的車輛連通區域,對每一輛車對應的區域進行抽取,以抽取得到每一輛車所在的區域,每一輛車對應的區域以Or節點表示。 At the level of the distribution location of each vehicle, the area corresponding to each vehicle is extracted through the above-mentioned vehicle communication area decomposed at the level of the communication area of the vehicle, so as to extract the area where each vehicle is located, each The area corresponding to the car is represented by the Or node.

在抽取出每一輛車對應的區域後,在車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用And節點表示並進行組織。最後,將各Or節點及各And節點作為關鍵節點輸出。 After extracting the area corresponding to each vehicle, the local parts in the vehicle form an area level, and each part area of each vehicle is represented and organized by And nodes. Finally, each Or node and each And node are output as key nodes.

在一較佳的實施例中,請同時參閱第1圖及第3圖所示,在上述第1圖的實施例的基礎上,該步驟S2之前,該方法還包括以下步驟: In a preferred embodiment, please refer to FIG. 1 and FIG. 3 simultaneously. On the basis of the embodiment of FIG. 1 above, before the step S2, the method further includes the following steps:

步驟S01,獲取預設數量的帶有車輛訊號的車輛圖片作為And-Or模型的訓練樣本圖片; Step S01, acquiring a preset number of vehicle images with vehicle signals as training sample pictures of the And-Or model;

步驟S02,提取出預設比例的該訓練樣本圖片作為訓練集,並將剩餘的該訓練樣本圖片作為測試集,並對該訓練集中的每張訓練樣本圖片框定出車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域; Step S02, extracting a preset proportion of the training sample picture as a training set, and using the remaining training sample picture as a test set, and setting a vehicle connection area and each vehicle for each training sample picture frame in the training set. a distribution location area and a partial component area of the interior of the vehicle;

步驟S03,利用通過框定處理後的訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的And-Or模型。 Step S03, training the And-Or model by using the training sample picture after the frame processing, to train and generate an And-Or model for performing picture detection.

步驟S04,將該測試集中的每張訓練樣本圖片輸入到訓練生成的該And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。 In step S04, each training sample picture in the test set is input into the And-Or model generated by the training to perform testing. If the accuracy of the test is greater than or equal to a preset threshold, the training ends.

於本實施例中,在訓練生成And-Or模型前,獲取預設數量的帶有車輛訊號的車輛圖片作為該And-Or模型的訓練樣本圖片,例如訓練樣本圖片為50萬張。提取訓練樣本圖片中預設比例的訓練樣本圖片作為該訓練集,例如提取其中的70%的訓練樣本圖片作為該訓練集,剩餘的30%作為該測試集。在訓練時,首先對該訓練集中的每張訓練樣本圖片框定出該車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區 域,然後,利用通過框定處理後的該訓練樣本圖片訓練And-Or模型,在該過程中,And-Or模型主要是從三個方面獲取和學習車輛訊號:第一是根據框定訊號學習車輛空間佈局的上下文關係,第二是根據框定訊號學習車輛的遮擋關係,第三是根據框定訊號對車輛可視部分進行學習。在訓練生成And-Or模型後,將該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中以進行測試,以測試準確率。如果測試的準確率大於等於預設閾值,例如大於等於0.95,則訓練成功,訓練操作結束,該訓練生成的And-Or模型可以作為後續使用。 In this embodiment, before training to generate the And-Or model, a preset number of vehicle images with vehicle signals are acquired as training sample pictures of the And-Or model, for example, 500,000 training sample pictures. A training sample picture of a preset proportion in the training sample picture is extracted as the training set, for example, 70% of the training sample pictures are extracted as the training set, and the remaining 30% is used as the test set. In the training, firstly, each training sample picture frame of the training set defines the communication area of the vehicle, the distribution position area of each vehicle, and the partial component composition areas inside the vehicle, and then the training after the frame processing is used. The sample picture trains the And-Or model. In the process, the And-Or model mainly acquires and learns the vehicle signal from three aspects: the first is to learn the context of the vehicle space layout according to the framed signal, and the second is to learn according to the framed signal. The occlusion relationship of the vehicle, and the third is to learn the visible part of the vehicle according to the framed signal. After training to generate the And-Or model, each training sample picture in the test set is input into the training-generated And-Or model for testing to test the accuracy. If the accuracy of the test is greater than or equal to a preset threshold, for example, greater than or equal to 0.95, the training is successful, and the training operation ends, and the And-Or model generated by the training can be used as a follow-up.

較佳的,在上述第3圖所示的實施例的基礎上,該步驟S04之後,該方法還包括:若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量,返回至步驟S02並迴圈。 Preferably, on the basis of the embodiment shown in FIG. 3, after the step S04, the method further includes: if the accuracy of the test is less than the preset threshold, prompting to increase the number of the training sample picture, and returning to Step S02 and loop back.

於本實施例中,如果該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中後,其測試的準確率大於預設閾值,例如小於0.95,則需要增加該訓練樣本圖片的數量,即增加該訓練集及該測試集的該訓練樣本圖片,例如可以通過向預定終端發送提示訊號,以提示增加該訓練樣本圖片的數量,返回至步驟S02,重新進行訓練,直至測試的準確率大於等於預設閾值。 In this embodiment, if each training sample picture in the test set is input into the And-Or model generated by the training, and the accuracy of the test is greater than a preset threshold, for example, less than 0.95, the training sample picture needs to be added. The number of the training samples, that is, the training sample and the training sample picture of the test set, for example, may be sent to the predetermined terminal to prompt the increase of the number of the training sample pictures, returning to step S02, and re-training until the test The accuracy rate is greater than or equal to the preset threshold.

請參閱第4圖所示,第4圖係本發明車輛檢測的裝置一實施例的結構示意圖,該車輛檢測的裝置包括有以下結構。 Referring to FIG. 4, FIG. 4 is a schematic structural view of an embodiment of a device for detecting a vehicle according to the present invention. The device for detecting the vehicle includes the following structure.

一提取模組101,用於在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號。 An extraction module 101 is configured to extract a basic feature signal of the to-be-detected image by using a predetermined algorithm after receiving the to-be-detected picture including the vehicle signal.

於本實施例的車輛檢測的裝置可以應用於具有複雜場景下 的交通安全監控、汽車生產及汽車保險等領域,利用具有圖片拍攝功能的車輛檢測的裝置在這些場景下捕獲圖片,當捕獲到包含車輛訊號的圖片後,以該圖片作為待檢測圖片,並通過一些預定的演算法來提取其基本特徵訊號。 The device for detecting a vehicle of the present embodiment can be applied to fields such as traffic safety monitoring, automobile production, and automobile insurance in a complicated scene, and a device for detecting a vehicle having a picture capturing function captures a picture in these scenes when captured. After the picture of the vehicle signal, the picture is taken as the picture to be detected, and the basic feature signals are extracted by some predetermined algorithms.

於本實施例中,該預定的演算法為影像處理的一些基本演算法,例如為圖像邊緣檢測演算法等,該基本特徵訊號為可以直接輸入至And-Or模型的圖片訊號,例如為圖片中各部分的位置或相互關係等。較佳地,本實施例可以利用方向梯度長條圖(Histogram of Oriented Gradient,HOG)演算法獲取待檢測圖片的梯度邊緣訊號,然後再採用K-means聚類演算法獲取各經梯度邊緣後的圖片的聚類中心或者採用DPM(Deformable Parts Model)演算法獲取各經梯度邊緣後的圖片各部分的相互位置關係等。 In this embodiment, the predetermined algorithm is some basic algorithms of image processing, such as an image edge detection algorithm, and the basic feature signal is a picture signal that can be directly input to the And-Or model, such as an image. The location or relationship of each part. Preferably, the present embodiment can obtain a gradient edge signal of the image to be detected by using a Histogram of Oriented Gradient (HOG) algorithm, and then use a K-means clustering algorithm to obtain each gradient edge. The clustering center of the image or the DPM (Deformable Parts Model) algorithm is used to obtain the mutual positional relationship of each part of the image after the gradient edge.

一訓練模組102,用於將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的各層級節點作為關鍵節點輸出。 A training module 102 is configured to input the basic feature signal into the pre-trained And-Or model to acquire each hierarchical node through the pre-trained And-Or model, and use the acquired hierarchical nodes as a key Node output.

於本實施例中,該And-Or模型為預先採用大量的該包含車輛訊號的圖片進行訓練得到的,將上述提取得到的基本特徵訊號輸入至該預先訓練生成的And-Or模型,通過該預先訓練生成的And-Or模型對輸入的該基本特徵訊號進行學習,在學習過程中,首先得到根節點,然後基於該根節點可以得到各個層級對應的節點,然後將該各個層級對應的節點作為關鍵節點輸出。 In the embodiment, the And-Or model is obtained by training a plurality of pictures containing the vehicle signal in advance, and inputting the extracted basic feature signals into the pre-trained And-Or model, and adopting the advance The And-Or model generated by the training learns the input basic feature signal. In the learning process, the root node is first obtained, and then the nodes corresponding to the respective levels can be obtained based on the root node, and then the nodes corresponding to the respective levels are used as the key. Node output.

於本實施例的該預先訓練生成的And-Or模型中,較佳地上述層級至少包括三個,即為車輛連通區域層級、每一輛車的分佈位置區域 層級及車輛內部的各局部部件組成區域層級。當然層級也可以少於三個或者多於三個。 In the And-Or model generated by the pre-training in this embodiment, preferably, the above-mentioned hierarchy includes at least three, that is, a level of a vehicle communication area, a distribution level of each vehicle, and a part of a vehicle interior. Regional level. Of course, the level can also be less than three or more than three.

一關聯模組103,用於將輸出的該關鍵節點進行關聯,以將關聯的該各層級關鍵節點作為較佳的演算分支。 An association module 103 is configured to associate the output key nodes to use the associated hierarchical key nodes as a preferred calculation branch.

於本實施例中,在該關鍵節點輸出後,將輸出的該關鍵節點進行關聯。其中,可以以上述的根節點為基礎將該關鍵節點進行關聯,具體地,可以先將每一層級中的該關鍵節點進行關聯,例如將同一層級中的該關鍵節點的依據位置關係進行關聯,以確定同一層級中的該各關鍵節點的相對位置;然後,將各層級的該關鍵節點依據位置關係進行關聯,例如將不同層級中的該關鍵節點的位置進行關聯,以確定不同層級中的該各關鍵節點的相對位置,該關鍵節點進行關聯後,可以勾勒出待檢測圖片各部分的架構,然後將關聯的該各層級關鍵節點作為上述預先訓練生成的And-Or模型在學習過程中的較佳的演算分支,以進行下一步操作。 In this embodiment, after the key node is output, the output key node is associated. The key nodes may be associated with each other according to the root node. Specifically, the key nodes in each level may be associated first, for example, the location relationships of the key nodes in the same level are associated. Determining the relative positions of the key nodes in the same level; then, associating the key nodes of each level according to the positional relationship, for example, associating the positions of the key nodes in different levels to determine the different levels in the hierarchy The relative position of each key node, after the key nodes are associated, the architecture of each part of the image to be detected can be outlined, and then the associated key nodes of each level are used as the pre-trained And-Or model in the learning process. A good calculation branch for the next step.

一轉化模組104,用於將該演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的該各層級關鍵節點對應的該圖形範本。 a conversion module 104 is configured to convert the hierarchical key nodes in the calculation branch into position parameters in the to-be-detected picture, and determine the calculation branch according to the predetermined association relationship between the hierarchical key nodes and the graphic template. The graphic template corresponding to the key nodes in the hierarchy.

於本實施例中,將較佳的演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,以得到該待檢測圖片中各部分的具體位置。 In this embodiment, the key nodes in the preferred calculation branch are converted into position parameters in the to-be-detected picture to obtain a specific location of each part in the to-be-detected picture.

另外,對於每一較佳的演算分支中的各個層級,可以根據該預定的各層級關鍵節點與該圖形範本的關聯關係確定出每個層級關鍵節點 對應的圖形範本,例如某一層級的關鍵節點為橢圓形,則所關聯的圖形範本為橢圓。該圖形範本為通過對不同車輛從不同角度觀看時各部分所形成的線條或者圖形,通過提取這些線條或圖形以形成大量的圖形範本,該圖形範本具有一個或者多個節點,即圖形範本與節點相關聯。 In addition, for each level in each of the preferred calculation branches, a graphic template corresponding to each of the hierarchical key nodes may be determined according to the relationship between the predetermined hierarchical key nodes and the graphic template, for example, a key node of a certain level If it is an ellipse, the associated graphic template is an ellipse. The graphic template is a line or a figure formed by different parts when viewed from different angles of different vehicles, and the drawing pattern has a plurality of graphic templates by extracting the lines or graphics, and the graphic template has one or more nodes, that is, a graphic template and a node. Associated.

一輸出模組105,用於根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。 An output module 105 is configured to acquire and output a vehicle position signal and a vehicle layout relationship in the image to be detected according to the position parameter corresponding to the hierarchical key nodes in the calculation branch and the graphic template.

於本實施例中,如果已經得到該各層級關鍵節點對應的該位置參數(即得到待檢測圖片中各部分的具體位置)以及對應的該圖形範本,則可以將該各層級關鍵節點對應的該圖形範本置於與該位置參數對應的位置,最終得到該待檢測圖片中車輛位置訊號以及車輛佈局關係,即得到每一輛的具體位置及多輛車(對於待檢測圖片有多輛車時而言)之間的佈局關係。 In this embodiment, if the location parameter corresponding to the key nodes of each level is obtained (that is, the specific location of each part in the picture to be detected is obtained) and the corresponding graphic template, the corresponding key node of each level may be The graphic template is placed at a position corresponding to the position parameter, and finally the vehicle position signal and the vehicle layout relationship in the image to be detected are obtained, that is, the specific position of each vehicle and multiple vehicles are obtained (for when there are multiple vehicles for the image to be detected) The relationship between the layout.

在一較佳的實施例中,在上述第4圖的實施例的基礎上,上述訓練模組102包括以下結構。 In a preferred embodiment, based on the embodiment of FIG. 4 above, the training module 102 includes the following structure.

一獲取單元,用於將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點。 An acquiring unit is configured to input the basic feature signal into the pre-trained And-Or model, and acquire a vehicle global area, where the vehicle global area is represented by an Or node and is a root node of the And-Or model.

一分解單元,用於在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示。 A decomposing unit is configured to decompose each vehicle communication area based on the root node at the vehicle communication area level, and the respective vehicle communication areas are respectively represented by different And nodes.

一抽取單元,用於在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,每一輛車對應的區域以 Or節點表示。 An extraction unit is configured to extract an area corresponding to each vehicle from the communication area of each vehicle at a level of the distribution location area of each of the vehicles, and an area corresponding to each vehicle is represented by an Or node.

一組織單元,用於在該車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用And節點表示並進行組織。 An organization unit for each regional component in the interior of the vehicle constitutes a regional level, and each local component region of each vehicle is represented and organized by an And node.

一輸出單元,用於將各Or節點及各And節點作為關鍵節點輸出。 An output unit is configured to output each Or node and each And node as a key node.

於本實施例中,上述層級至少包括車輛連通區域層級、每一輛車的分佈位置區域層級及車輛內部的各局部部件組成區域層級為例進行說明。在將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中可以獲取到車輛全域區域,即對應於該待檢測圖片中包含所有車輛的區域所形成的區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點。 In the embodiment, the above-mentioned hierarchy includes at least a vehicle communication area level, a distribution position area level of each vehicle, and each local component composition area level inside the vehicle as an example for description. Entering the basic feature signal into the pre-trained And-Or model may acquire a vehicle global area, that is, an area formed by an area including all the vehicles in the to-be-detected picture, and the vehicle global area is an Or node. Represents and acts as the root node of the And-Or model.

在該車輛連通區域層級,基於該根節點對各個車輛連通區域進行分解,例如分解出第一輛車與第二輛車的連通區域,直至將所有的車輛的車輛連通區域分解出來,各個車輛連通區域分別以不同的And節點表示。 At the level of the vehicle communication area, the respective vehicle communication areas are decomposed based on the root node, for example, the communication area between the first vehicle and the second vehicle is decomposed, until the vehicle communication areas of all the vehicles are decomposed, and the vehicles are connected. The regions are represented by different And nodes.

在該每一輛車的分佈位置區域層級,通過上述的車輛連通區域層級分解出來的車輛連通區域,對每一輛車對應的區域進行抽取,以抽取得到每一輛車所在的區域,該每一輛車對應的區域以Or節點表示。 At the level of the distribution location area of each of the vehicles, the area corresponding to each vehicle is extracted through the above-mentioned vehicle communication area decomposed at the level of the communication area of the vehicle, so as to extract the area where each vehicle is located, each of which is located The area corresponding to a car is represented by an Or node.

在抽取出每一輛車對應的區域後,在車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用And節點表示並進行組織。最後,將各Or節點及各And節點作為關鍵節點輸出。 After extracting the area corresponding to each vehicle, the local parts in the vehicle form an area level, and each part area of each vehicle is represented and organized by And nodes. Finally, each Or node and each And node are output as key nodes.

在一較佳的實施例中,請同時參閱第4圖及第5圖所示,在上述第4圖的實施例的基礎上,該車輛檢測的裝置還包括以下結構。 In a preferred embodiment, please refer to FIG. 4 and FIG. 5 simultaneously. Based on the embodiment of FIG. 4 above, the device for detecting a vehicle further includes the following structure.

一獲取模組201,用於獲取預設數量的帶有車輛訊號的車輛圖片作為And-Or模型的訓練樣本圖片;一框定模組202,用於提取出預設比例的該訓練樣本圖片作為訓練集,並將剩餘的該訓練樣本圖片作為測試集,並對該訓練集中的每張訓練樣本圖片框定出車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域。 An acquisition module 201 is configured to acquire a preset number of vehicle images with vehicle signals as training sample images of the And-Or model, and a frame module 202 for extracting a preset proportion of the training sample images as training The set is taken as the test set, and each training sample picture frame in the training set defines a vehicle communication area, a distribution position area of each vehicle, and a partial component composition area inside the vehicle.

一生成模組203,用於利用通過框定處理後的該訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的And-Or模型;一測試模組204,用於將該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。 a generating module 203 is configured to train the And-Or model by using the training sample picture after the frame processing, to generate an And-Or model for performing image detection, and a test module 204 for testing the test Each training sample picture in the set is input into the And-Or model generated by the training for testing, and if the accuracy of the test is greater than or equal to a preset threshold, the training ends.

於本實施例中,在該訓練生成And-Or模型前,獲取預設數量的帶有車輛訊號的車輛圖片作為And-Or模型的訓練樣本圖片,例如訓練樣本圖片為50萬張。提取該訓練樣本圖片中預設比例的訓練樣本圖片作為該訓練集,例如提取其中的70%的訓練樣本圖片作為該訓練集,剩餘的30%作為該測試集。在訓練時,首先對該訓練集中的每張訓練樣本圖片框定出該車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域,然後,利用通過框定處理後的該訓練樣本圖片訓練And-Or模型,在該過程中,該And-Or模型主要是從三個方面獲取和學習車輛訊號:第一是根據框定訊號學習車輛空間佈局的上下文關係,第二是根據框定訊號學習車輛的遮擋關係,第三是根據框定訊號對車輛可視部分進行學習。在訓練生成And-Or模型後,將該測試集中的每張訓練樣本圖片輸入到該訓練生成 的And-Or模型中以進行測試,以測試準確率。如果測試的準確率大於等於預設閾值,例如大於等於0.95,則訓練成功,訓練操作結束,該訓練生成的And-Or模型可以作為後續使用。 In this embodiment, before the training generates the And-Or model, a preset number of vehicle images with vehicle signals are acquired as training sample images of the And-Or model, for example, 500,000 training sample pictures. A training sample picture of a preset proportion in the training sample picture is extracted as the training set, for example, 70% of the training sample pictures are extracted as the training set, and the remaining 30% is used as the test set. In the training, firstly, each training sample picture frame of the training set defines the communication area of the vehicle, the distribution position area of each vehicle, and the partial component composition areas inside the vehicle, and then the training after the frame processing is used. The sample picture trains the And-Or model. In the process, the And-Or model mainly acquires and learns the vehicle signal from three aspects: the first is to learn the context of the vehicle space layout according to the framed signal, and the second is to frame the signal according to the frame. Learning the occlusion relationship of the vehicle, the third is to learn the visible part of the vehicle according to the framed signal. After training to generate the And-Or model, each training sample image in the test set is input into the training-generated And-Or model for testing to test the accuracy. If the accuracy of the test is greater than or equal to a preset threshold, for example, greater than or equal to 0.95, the training is successful, and the training operation ends, and the And-Or model generated by the training can be used as a follow-up.

較佳地,在上述第5圖的實施例的基礎上,該車輛檢測的裝置還包括:一增加模組,用於若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量,例如可以通過向預定終端發送提示訊號,以提示增加該訓練樣本圖片的數量,觸發該框定模組202以繼續訓練生成用於進行圖片檢測的And-Or模型。 Preferably, the apparatus for detecting a vehicle further includes: an adding module, if the accuracy of the test is less than a preset threshold, prompting to increase the number of the training sample picture. For example, by sending a prompt signal to the predetermined terminal to prompt to increase the number of the training sample picture, the frame module 202 is triggered to continue training to generate an And-Or model for performing picture detection.

於本實施例中,如果該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中後,其測試的準確率小於預設閾值,例如小於0.95,則需要增加該訓練樣本圖片的數量,即增加該訓練集及該測試集的訓練樣本圖片,再觸發上述的框定模組202,以重新進行訓練,直至測試的準確率大於等於預設閾值。 In this embodiment, if each training sample picture in the test set is input into the And-Or model generated by the training, and the accuracy of the test is less than a preset threshold, for example, less than 0.95, the training sample picture needs to be added. The number of the training set and the training sample picture of the test set are added, and then the frame module 202 is triggered to re-train until the accuracy of the test is greater than or equal to a preset threshold.

以上所述僅為本發明的較佳實施例之揭露,並不用以此限制本發明,凡在本發明的精神和原則之內,所作的任何修改、等同替換、改進等,均應包含在本發明的保護範圍之內。 The above is only the disclosure of the preferred embodiments of the present invention, and is not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are included in the spirit and scope of the present invention, should be included in the present invention. Within the scope of protection of the invention.

Claims (10)

一種車輛檢測的方法,包括:S1,在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號;S2,將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的該各層級節點作為關鍵節點輸出;S3,將輸出的該關鍵節點進行關聯,以將關聯的該各層級關鍵節點作為較佳的演算分支;S4,將該演算分支中的該各層級關鍵節點轉化為該待檢測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的該各層級關鍵節點對應的該圖形範本;以及S5,根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。  A method for detecting a vehicle, comprising: S1, after receiving a to-be-detected picture including a vehicle signal, extracting a basic characteristic signal of the to-be-detected picture by using a predetermined algorithm; S2, inputting the basic characteristic signal into a pre-trained generated image In the And-Or model, each hierarchical node is obtained by using the And-Or model generated by the pre-training, and the obtained hierarchical nodes are output as key nodes; and S3, the outputted key nodes are associated to associate the selected nodes. The key nodes of each level are used as a better calculation branch; S4, the key nodes of the hierarchy in the calculation branch are converted into position parameters in the image to be detected, and according to the predetermined association between the key nodes of the hierarchy and the graphic template The relationship determines the graphic template corresponding to the key nodes of each level in the calculation branch; and S5, acquiring the vehicle in the image to be detected according to the position parameter corresponding to the key nodes of the hierarchical level in the calculation branch and the graphic template Position signal and vehicle layout relationship and output.   根據申請專利範圍第1項所述之車輛檢測的方法,其中該層級至少包括以下三個:車輛連通區域層級、每一輛車的分佈位置區域層級、及車輛內部的各局部部件組成區域層級。  The method of vehicle detection according to claim 1, wherein the hierarchy comprises at least three of: a vehicle communication area level, a distribution position area level of each vehicle, and a partial level of each part of the vehicle.   根據申請專利範圍第2項所述之車輛檢測的方法,其中該步驟S2包括:S21,將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點;S22,在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示;S23,在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,每一輛車對應的區域以Or節點表示; S24,在該車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用該And節點表示並進行組織;以及S25,將各Or節點及各And節點作為關鍵節點輸出。  The method of vehicle detection according to claim 2, wherein the step S2 comprises: S21, inputting the basic feature signal into the pre-trained And-Or model, and acquiring a vehicle global area, the vehicle global domain The area is represented by the Or node and serves as the root node of the And-Or model; S22, at the level of the vehicle communication area, the respective vehicle communication areas are decomposed based on the root node, and the respective vehicle communication areas are respectively represented by different And nodes; S23 At the level of the distribution location of each of the vehicles, the area corresponding to each vehicle is extracted from the communication area of each vehicle, and the area corresponding to each vehicle is represented by an Or node; S24, each inside the vehicle The local components constitute an area hierarchy, and the respective local component areas of each vehicle are respectively represented and organized by the And node; and S25, each Or node and each And node are output as key nodes.   根據申請專利範圍第1至3項中任一項之車輛檢測的方法,其中該步驟S2之前,該方法還包括:S01,獲取預設數量的帶有車輛訊號的車輛圖片作為該And-Or模型的訓練樣本圖片;S02,提取出預設比例的該訓練樣本圖片作為訓練集,並將剩餘的該訓練樣本圖片作為測試集,並對該訓練集中的每張訓練樣本圖片框定出車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域;S03,利用通過框定處理後的該訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的And-Or模型;以及S04,將該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。  The method of vehicle detection according to any one of claims 1 to 3, wherein before the step S2, the method further comprises: S01, acquiring a preset number of vehicle images with vehicle signals as the And-Or model a training sample picture; S02, extracting a preset ratio of the training sample picture as a training set, and using the remaining training sample picture as a test set, and determining a vehicle connected area for each training sample picture frame in the training set, The distribution location area of each vehicle and each local component of the vehicle constitute an area; S03, training the And-Or model by using the training sample picture after the frame processing, to train and generate an And-Or model for image detection And S04, each training sample picture in the test set is input into the training-generated And-Or model for testing, and if the accuracy of the test is greater than or equal to a preset threshold, the training ends.   根據申請專利範圍第4項所述之車輛檢測的方法,其中該步驟S04之後,該方法還包括:若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量。  The method of vehicle detection according to claim 4, wherein after the step S04, the method further comprises: if the accuracy of the test is less than a preset threshold, prompting to increase the number of the training sample pictures.   一種車輛檢測的裝置,包括:一提取模組,用於在接收到包含車輛訊號的待檢測圖片後,通過預定的演算法提取該待檢測圖片的基本特徵訊號;一訓練模組,用於將該基本特徵訊號輸入到預先訓練生成的And-Or模型中,以通過該預先訓練生成的And-Or模型獲取各層級節點,並將獲取的該各層級節點作為關鍵節點輸出;一關聯模組,用於將輸出的該關鍵節點進行關聯,以將關聯的該各層級關鍵節點作為較佳的演算分支;一轉化模組,用於將該演算分支中的該各層級關鍵節點轉化為該待檢 測圖片中的位置參數,並根據預定的該各層級關鍵節點與圖形範本的關聯關係確定出該演算分支中的該各層級關鍵節點對應的該圖形範本;以及一輸出模組,用於根據該演算分支中的該各層級關鍵節點對應的該位置參數和該圖形範本獲取該待檢測圖片中的車輛位置訊號以及車輛佈局關係並輸出。  The device for detecting a vehicle includes: an extraction module, configured to: after receiving a to-be-detected image including a vehicle signal, extract a basic feature signal of the image to be detected by using a predetermined algorithm; a training module is configured to The basic feature signal is input into the And-Or model generated by the pre-training to acquire each hierarchical node through the pre-trained And-Or model, and the acquired hierarchical nodes are output as key nodes; an associated module, The function is used to associate the key nodes of the output to use the associated hierarchical key nodes as a preferred calculation branch; a conversion module is configured to convert the hierarchical key nodes in the calculation branch into the to-be-detected a position parameter in the picture, and determining, according to the predetermined association relationship between the key nodes of each level and the graphic template, the graphic template corresponding to the key nodes of each level in the calculation branch; and an output module for using the calculation according to the calculation The position parameter corresponding to the key nodes of each level in the branch and the graphic template obtain the vehicle position signal in the image to be detected and Vehicle layout relationship and output.   根據申請專利範圍第6項所述之車輛檢測的裝置,其中該層級至少包括以下三個:車輛連通區域層級、每一輛車的分佈位置區域層級及車輛內部的各局部部件組成區域層級。  The apparatus for vehicle detection according to claim 6, wherein the hierarchy includes at least three of: a vehicle communication area level, a distribution position area level of each vehicle, and a partial level of each part of the vehicle.   根據申請專利範圍第7項所述之車輛檢測的裝置,其中該訓練模組包括:一獲取單元,用於將該基本特徵訊號輸入到該預先訓練生成的And-Or模型中,並獲取車輛全域區域,該車輛全域區域以Or節點表示並作為該And-Or模型的根節點;一分解單元,用於在該車輛連通區域層級,基於該根節點分解出各個車輛連通區域,該各個車輛連通區域分別以不同的And節點表示;一抽取單元,用於在該每一輛車的分佈位置區域層級,從該各個車輛連通區域中抽取出每一輛車對應的區域,該每一輛車對應的區域以該Or節點表示;一組織單元,用於在該車輛內部的各局部部件組成區域層級,對於每一輛車的各個局部部件區域分別用該And節點表示並進行組織;以及一輸出單元,用於將該各Or節點及該各And節點作為關鍵節點輸出。  The device for detecting a vehicle according to claim 7 , wherein the training module comprises: an acquiring unit, configured to input the basic feature signal into the pre-trained And-Or model, and acquire a vehicle global domain a region, the vehicle global region is represented by an Or node and serves as a root node of the And-Or model; a decomposition unit is configured to, at the vehicle communication region level, decompose each vehicle communication region based on the root node, the respective vehicle connectivity regions Respectively represented by different And nodes; an extraction unit for extracting the area corresponding to each vehicle from the respective vehicle communication areas at each of the distribution location areas of each vehicle, corresponding to each vehicle The area is represented by the Or node; an organization unit for each regional component inside the vehicle to form an area level, each local component area of each vehicle is represented and organized by the And node; and an output unit, It is used to output each Or node and the And nodes as key nodes.   根據申請專利範圍第6至8項中任一項之車輛檢測的裝置,該裝置還包括:一獲取模組,用於獲取預設數量的帶有車輛訊號的車輛圖片作為該And-Or模型的該訓練樣本圖片;一框定模組,用於提取出預設比例的該訓練樣本圖片作為訓練集,並 將剩餘的該訓練樣本圖片作為測試集,並對該訓練集中的每張訓練樣本圖片框定出車輛連通區域、每一輛車的分佈位置區域及車輛內部的各局部部件組成區域;一生成模組,用於利用通過框定處理後的該訓練樣本圖片訓練該And-Or模型,以訓練生成用於進行圖片檢測的該And-Or模型;以及一測試模組,用於將該測試集中的每張訓練樣本圖片輸入到該訓練生成的And-Or模型中以進行測試,若測試的準確率大於等於預設閾值,則訓練結束。  The device for detecting a vehicle according to any one of claims 6 to 8, further comprising: an acquisition module, configured to acquire a preset number of vehicle images with vehicle signals as the And-Or model The training sample picture; a frame setting module, configured to extract a preset proportion of the training sample picture as a training set, and use the remaining training sample picture as a test set, and frame each training sample picture in the training set a communication area of the vehicle, a distribution location area of each vehicle, and a partial component area of the interior of the vehicle; a generation module for training the And-Or model by using the training sample picture after the frame processing, to generate the training The And-Or model for performing image detection; and a test module for inputting each training sample image in the test set into the training-generated And-Or model for testing, if the accuracy of the test If the threshold is greater than or equal to the preset threshold, the training ends.   根據申請專利範圍第9項所述之車輛檢測的裝置,該裝置還包括:一增加模組,用於若測試的準確率小於預設閾值,則提示增加該訓練樣本圖片的數量,觸發該框定模組以繼續訓練生成用於進行圖片檢測的該And-Or模型。  The device for detecting a vehicle according to claim 9 , wherein the device further comprises: an adding module, if the accuracy of the test is less than a preset threshold, prompting to increase the number of the training sample picture, triggering the frame setting The module continues training to generate the And-Or model for image detection.  
TW106128491A 2016-08-22 2017-08-22 Method and equipment for testing vehicles TWI635467B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610702626.6A CN106355140B (en) 2016-08-22 2016-08-22 The method and device of vehicle detection
??201610702626.6 2016-08-22

Publications (2)

Publication Number Publication Date
TW201812718A true TW201812718A (en) 2018-04-01
TWI635467B TWI635467B (en) 2018-09-11

Family

ID=57843768

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106128491A TWI635467B (en) 2016-08-22 2017-08-22 Method and equipment for testing vehicles

Country Status (3)

Country Link
CN (1) CN106355140B (en)
TW (1) TWI635467B (en)
WO (1) WO2018036277A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106355140B (en) * 2016-08-22 2018-03-02 平安科技(深圳)有限公司 The method and device of vehicle detection
CN107766929B (en) * 2017-05-05 2019-05-24 平安科技(深圳)有限公司 Model analysis method and device
CN108647680B (en) * 2018-04-28 2021-11-12 北京盒子鱼教育科技有限公司 Image positioning frame detection method and device
CN110570388A (en) * 2018-08-31 2019-12-13 阿里巴巴集团控股有限公司 Method, device and equipment for detecting components of vehicle
CN110091342B (en) * 2019-05-20 2024-04-26 金瓜子科技发展(北京)有限公司 Vehicle condition detection method and device and detection robot
CN110135517B (en) * 2019-05-24 2023-04-07 北京百度网讯科技有限公司 Method and device for obtaining vehicle similarity
CN110991337B (en) * 2019-12-02 2023-08-25 山东浪潮科学研究院有限公司 Vehicle detection method based on self-adaptive two-way detection network
CN111144372A (en) * 2019-12-31 2020-05-12 上海眼控科技股份有限公司 Vehicle detection method, device, computer equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8385971B2 (en) * 2008-08-19 2013-02-26 Digimarc Corporation Methods and systems for content processing
US8548231B2 (en) * 2009-04-02 2013-10-01 Siemens Corporation Predicate logic based image grammars for complex visual pattern recognition
US8692826B2 (en) * 2009-06-19 2014-04-08 Brian C. Beckman Solver-based visualization framework
CN101645036B (en) * 2009-09-11 2011-06-01 兰雨晴 Method for automatically distributing test tasks based on capability level of test executor
CN101770571B (en) * 2009-12-29 2013-02-13 北京世纪高通科技有限公司 Method and device for detecting vehicle at night
US9916538B2 (en) * 2012-09-15 2018-03-13 Z Advanced Computing, Inc. Method and system for feature detection
US20130201316A1 (en) * 2012-01-09 2013-08-08 May Patents Ltd. System and method for server based control
CN103295021A (en) * 2012-02-24 2013-09-11 北京明日时尚信息技术有限公司 Method and system for detecting and recognizing feature of vehicle in static image
CN104346833A (en) * 2014-10-28 2015-02-11 燕山大学 Vehicle restructing algorithm based on monocular vision
CN106355140B (en) * 2016-08-22 2018-03-02 平安科技(深圳)有限公司 The method and device of vehicle detection

Also Published As

Publication number Publication date
TWI635467B (en) 2018-09-11
WO2018036277A1 (en) 2018-03-01
CN106355140B (en) 2018-03-02
CN106355140A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
TWI635467B (en) Method and equipment for testing vehicles
CN106407981B (en) A kind of licence plate recognition method, apparatus and system
Tao et al. End-to-end audiovisual speech recognition system with multitask learning
US10445602B2 (en) Apparatus and method for recognizing traffic signs
CN107992819B (en) Method and device for determining vehicle attribute structural features
CN102915432B (en) A kind of vehicle-mounted microcomputer image/video data extraction method and device
CN101908153B (en) Method for estimating head postures in low-resolution image treatment
JP6773829B2 (en) Object recognition device, object recognition method, and object recognition program
CN111008576B (en) Pedestrian detection and model training method, device and readable storage medium
US9355641B2 (en) Monitoring device using selective attention model and method for monitoring same
JP2017116403A (en) Attitude estimation device, attitude estimation method, and program
CN113870356A (en) Gate passing behavior identification and control method combining target detection and binocular vision
AG Development of portable automatic number plate recognition (ANPR) system on Raspberry Pi
CN114870384A (en) Taijiquan training method and system based on dynamic recognition
Gupta et al. Number Plate extraction using Template matching technique
CN111680640B (en) Vehicle type identification method and system based on domain migration
CN112417974A (en) Public health monitoring method
CN109785386A (en) Object identification localization method and device
CN111199050B (en) System for automatically desensitizing medical records and application
CN105005757B (en) A kind of license plate character recognition method popular based on Grassmann
CN116580232A (en) Automatic image labeling method and system and electronic equipment
Amin et al. An automatic number plate recognition of Bangladeshi vehicles
CN116259021A (en) Lane line detection method, storage medium and electronic equipment
CN115601818A (en) Lightweight visible light living body detection method and device
CN110222622B (en) Environment soil detection method and device