[go: up one dir, main page]

CN105225281B - A kind of vehicle checking method - Google Patents

A kind of vehicle checking method Download PDF

Info

Publication number
CN105225281B
CN105225281B CN201510531951.6A CN201510531951A CN105225281B CN 105225281 B CN105225281 B CN 105225281B CN 201510531951 A CN201510531951 A CN 201510531951A CN 105225281 B CN105225281 B CN 105225281B
Authority
CN
China
Prior art keywords
image
area
hash
target
target image
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201510531951.6A
Other languages
Chinese (zh)
Other versions
CN105225281A (en
Inventor
徐韶华
覃力更
陈志�
颜晓凤
李小勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangxi Jiaoke Group Co Ltd
Original Assignee
Guangxi Transportation Research Institute
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 Guangxi Transportation Research Institute filed Critical Guangxi Transportation Research Institute
Priority to CN201510531951.6A priority Critical patent/CN105225281B/en
Publication of CN105225281A publication Critical patent/CN105225281A/en
Application granted granted Critical
Publication of CN105225281B publication Critical patent/CN105225281B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

本发明涉车辆检测技术领域。一种车道车辆检测方法,通过图像采集模块采集目标区域的图像,处理模块通过哈希算法生成对应图像的哈希指纹,通过对哈希指纹比较判断开始时候的模板图像和目标图像,得到目标图像中是否有车。

The invention relates to the technical field of vehicle detection. A lane vehicle detection method, the image acquisition module collects the image of the target area, the processing module generates the hash fingerprint of the corresponding image through the hash algorithm, and compares and judges the template image and the target image at the beginning by comparing the hash fingerprint to obtain the target image Is there a car in .

Description

一种车辆检测方法A vehicle detection method

技术领域technical field

本发明涉车辆检测技术领域,特别是一种检测车道中车辆有无的检测方法。The invention relates to the technical field of vehicle detection, in particular to a detection method for detecting the presence or absence of vehicles in a lane.

背景技术Background technique

ETC车道是智能交通系统的重要应用领域,为了降低运营成本,提高运输效率,保障交通安全,缓解交通拥挤,减少环境污染,稳定、高效的ETC车道显得尤为重要,而大线圈检测又是ETC车道不可或缺的组成部分。目前使用地感线圈实现大线圈检测,而地感线圈存在灵敏度范围难确定、重压下容易变形、线圈过大会造成铺设困难、车辆来回辗压线圈会出现误检测等不足,进而对ETC车道的稳定、高效的运行带来致命的打击。ETC lanes are an important application field of intelligent transportation systems. In order to reduce operating costs, improve transportation efficiency, ensure traffic safety, alleviate traffic congestion, and reduce environmental pollution, stable and efficient ETC lanes are particularly important, and large coil detection is an important part of ETC lanes. Indispensable component. At present, the ground sense coil is used to realize the detection of large coils, but the ground sense coil has the disadvantages that the sensitivity range is difficult to determine, it is easy to deform under heavy pressure, the coil is too large to cause laying difficulties, and the vehicle will roll the coil back and forth to cause false detection. Stable and efficient operation brings a fatal blow.

发明内容Contents of the invention

本发明的发明目的是:针对上述技术问题,提供一种车道车辆检测方法,通过图像识别技术来确定车道中是否有车通过,相较传统的大线圈检测方案具备稳定性高、实时性好、抗干扰能力强的特点,可以满足ETC车道等车道中智能判断是否有无车的需要。The object of the present invention is: to solve the above technical problems, to provide a lane vehicle detection method, which uses image recognition technology to determine whether there is a vehicle passing in the lane. Compared with the traditional large coil detection scheme, it has high stability, good real-time performance, The strong anti-interference ability can meet the needs of intelligently judging whether there is a car or not in the ETC lane and other lanes.

本发明技术方案为:一种车道车辆检测方法,包括处理模块、图像采集模块和存储器模块;所述图像采集模块正对目标区域,所述目标区域为车道中车辆检测区域;所述存储器模块存储模板图像,所述图像采集模块采集目标区域的目标图像并发送到处理模块,处理模块对目标图像进行直方图均衡化处理并 在目标图像上按行车方向选取至少三个区域的区域图像,所述区域图像分别通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比,所述哈希指纹为以次序组合而成的图片描述字符串;若对比哈希指纹汉明距离均大于设定值,则目标区域中有车辆;若对比哈希指纹汉明距离均小于设定值,则目标区域中没有车辆,并将目标图像更新为模板图像。The technical solution of the present invention is: a vehicle detection method in a lane, including a processing module, an image acquisition module and a memory module; the image acquisition module faces a target area, and the target area is a vehicle detection area in a lane; the memory module stores Template image, the image acquisition module collects the target image of the target area and sends it to the processing module, the processing module performs histogram equalization processing on the target image and selects at least three regional images of the target image according to the driving direction, the said The area images generate corresponding hash fingerprints through the hash algorithm, and compare them with the hash fingerprints of the corresponding areas on the template image. The hash fingerprints are image description strings combined in order; if the hash fingerprints are compared If the Hamming distances are greater than the set value, there is a vehicle in the target area; if the Hamming distances of the comparative hash fingerprints are both smaller than the set value, then there is no vehicle in the target area, and the target image is updated to the template image.

这里基于图像的处理分析方法,具体是图像采集模块采集目标区域的图像,处理模块通过哈希算法生成对应图像的哈希指纹,通过对哈希指纹比较判断开始时候的模板图像和目标图像,得到目标图像中是否有车。具体是,通过在目标图像中截取区域图像,通过多个区域图像的进行详细分析判断,避免由于环境因素、或其他因素影响图像准确性,同时增强算法的抗干扰能力,进而提升算法的可靠性、稳定性。The image-based processing and analysis method here is specifically that the image acquisition module collects the image of the target area, and the processing module generates the hash fingerprint of the corresponding image through the hash algorithm, and compares and judges the template image and the target image at the beginning by comparing the hash fingerprint to obtain Whether there is a car in the target image. Specifically, by intercepting the regional image in the target image, through detailed analysis and judgment of multiple regional images, the accuracy of the image is avoided due to environmental factors or other factors, and the anti-interference ability of the algorithm is enhanced at the same time, thereby improving the reliability of the algorithm ,stability.

进一步优化,若目标区域中有车辆,则同时对目标图像中的区域图像通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比得到哈希指纹汉明距离;若哈希指纹汉明距离均小于设定值,则目标区域中车辆已离开,并将目标图像更新为模板图像,否则重复上述步骤。Further optimization, if there is a vehicle in the target area, the corresponding hash fingerprint is generated by the hash algorithm for the area image in the target image at the same time, and compared with the hash fingerprint of the corresponding area on the template image to obtain the hash fingerprint Hamming distance ; If the hash fingerprint Hamming distance is less than the set value, the vehicle in the target area has left, and the target image is updated to the template image, otherwise repeat the above steps.

这里提供了一种判断车辆离开的优选方案,具体是同时区域图像的进行详细分析判断,直至满足判定要求。Here is an optimal solution for judging the departure of the vehicle, specifically analyzing and judging the area image in detail at the same time until the judging requirements are met.

优选的,所述处理模块在目标图像上依次截取、按行车方向递进且部分叠加的第一区域图像、第二区域图像、第三区域图像,并按照以下步骤进行:Preferably, the first region image, the second region image, and the third region image that are sequentially intercepted by the processing module on the target image, advanced in the driving direction and partially superimposed, and carried out according to the following steps:

1)对第一区域图像通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比,得到哈希指纹汉明距离M1,若M1大于设定值,则进入步骤2),否则将目标图像更新为模板图像;1) Generate the corresponding hash fingerprint for the image of the first area through the hash algorithm, and compare it with the hash fingerprint of the corresponding area on the template image to obtain the hash fingerprint Hamming distance M1, if M1 is greater than the set value, enter Step 2), otherwise update the target image to the template image;

2)按1)步骤得到第二个区域对比的哈希指纹汉明距离M2,若M2大于设 定值,则进入步骤3),否则更新目标图像并重复本步骤;2) Obtain the hash fingerprint Hamming distance M2 of the second area contrast according to 1) step, if M2 is greater than the set value, then enter step 3), otherwise update the target image and repeat this step;

3)按1)步骤得到第三个区域对比的哈希指纹汉明距离M3,若M3大于设定值,则目标区域中有车辆并进入步骤4);否则更新目标图像并重复本步骤;3) According to step 1) to obtain the Hamming distance M3 of the hash fingerprint of the third area comparison, if M3 is greater than the set value, then there is a vehicle in the target area and enter step 4); otherwise update the target image and repeat this step;

4)对目标图像的第一区域图像、第二区域图像和第三区域图像同时通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比得到对应哈希指纹汉明距离M4、M5和M6;若M4、M5且M6均小于设定值,则车离开,所述存储器模块将目标图像更新为模板图像;否则,重复本步骤。4) Generate corresponding hash fingerprints for the first region image, the second region image and the third region image of the target image at the same time through the hash algorithm, and compare them with the hash fingerprints of the corresponding regions on the template image to obtain the corresponding hash fingerprints Hamming distances M4, M5 and M6; if M4, M5 and M6 are all smaller than the set value, the car leaves, and the memory module updates the target image to a template image; otherwise, repeat this step.

通过选取区域图像可以增加对目标图像处理的有效性、准确性,能够高效反映出目标图像中车辆有无的情况,同时可以减少由于环境因素或人为因素对目标图像造成失真等不良影响,增加本发明分析的准确性。通过逐一截取分析区域图像间的差异性,能够保证算法的合理性,能够增强算法的抗干扰能力,进而提升算法和系统的可靠性、稳定性。By selecting the area image, the effectiveness and accuracy of target image processing can be increased, and the presence or absence of vehicles in the target image can be efficiently reflected. Accuracy of Invention Analysis. By intercepting and analyzing the differences between regional images one by one, the rationality of the algorithm can be guaranteed, the anti-interference ability of the algorithm can be enhanced, and the reliability and stability of the algorithm and system can be improved.

优选的,所述M1、M2且M3设定值均为15,所述M4、M5且M6设定值均为10。Preferably, the set values of M1, M2 and M3 are all 15, and the set values of M4, M5 and M6 are all 10.

优选的,所述区域图像至少覆盖目标图像中车道三分之二以上。截取区域图像分析可以避免由于目标图像过大造成的干扰因素过多的不足,降低运算难度,增强系统分析判断的精度和速度。Preferably, the area image covers at least two-thirds of the lane in the target image. The image analysis of the intercepted area can avoid the problem of too many interference factors caused by too large target image, reduce the difficulty of calculation, and enhance the accuracy and speed of system analysis and judgment.

优选的,所述哈希算法为均值哈希算法,哈希指纹生成步骤为:Preferably, the hash algorithm is a mean value hash algorithm, and the hash fingerprint generation step is:

1)将目标图像缩小到8×8的尺寸,总共64个像素;1) Reduce the target image to a size of 8×8, a total of 64 pixels;

2)将8×8的目标图像转换成灰度图像,并转为64级灰度;2) Convert the 8×8 target image into a grayscale image, and convert it into a 64-level grayscale;

3)计算步骤2)所有64个像素的灰度平均值;3) Calculation step 2) grayscale mean of all 64 pixels;

4)将步骤2)中64级灰度和灰度平均值一一比较,若大于或等于平均值, 记为1;若小于平均值,记为0;将比较结果按次序组合在一起,构成64位哈希指纹。4) Compare the 64-level grayscale in step 2) with the grayscale average value one by one, if it is greater than or equal to the average value, record it as 1; if it is less than the average value, record it as 0; combine the comparison results in order to form 64-bit hash fingerprint.

这里公开了一种简化的均值哈希算法可以快速得到图像的描述字符串,即哈希指纹,不同目标图像的哈希指纹均不相同,有车和无车的目标图像哈希指纹表现差异性较大,这种差异可以通过两者汉明距离直观表示出来。A simplified mean value hash algorithm is disclosed here, which can quickly obtain the description string of the image, that is, the hash fingerprint. The hash fingerprints of different target images are different, and the hash fingerprints of target images with and without cars show differences. Larger, this difference can be intuitively expressed by the Hamming distance between the two.

优选的,所述直方图均衡化步骤为:Preferably, the histogram equalization step is:

1)统计所述目标图像各灰度级的像素数目ni,i=0,1,2,...,L-1,其中L为灰度总级数;1) counting the number of pixels n i of each gray level of the target image, i=0, 1, 2, ..., L-1, where L is the total number of gray levels;

2)计算原始直方图的概率密度Pi(ri)=ni/N,其中N为原始图像的总像素数目;2) Calculate the probability density P i (r i )=n i /N of the original histogram, where N is the total number of pixels of the original image;

3)计算累积分布函数,k=0,1,2,...,L-1;3) Calculate the cumulative distribution function, k=0,1,2,...,L-1;

4)计算最后的输出灰度级gk=int[(gmax-gmin)sk(rk)+0.5]/L-1 k=0,1,2,...,L-1,其中int[]为取整符号。4) Calculate the final output gray level g k =int[(g max -g min )s k (r k )+0.5]/L-1 k=0,1,2,...,L-1, Where int[] is the rounding symbol.

直方图均衡化的优点:能够增强图像的对比度,对于背景和前景都太亮或者太暗的图像非常有用,有效抑制车道光线变化的影响,为车辆检测的精度奠定基础。The advantages of histogram equalization: it can enhance the contrast of the image, which is very useful for images whose background and foreground are too bright or too dark, effectively suppress the influence of lane light changes, and lay the foundation for the accuracy of vehicle detection.

优选的,所述图像采集模块包括依次连接的CCD图像传感器和SAA7113视频解码芯片;所述处理模块采用DM642芯片;所述SAA7113视频解码芯片连接DM642芯片的VP1接口,所述DM642芯片通过I2C总线连接控制SAA7113视频解码芯片。Preferably, the image acquisition module includes a sequentially connected CCD image sensor and a SAA7113 video decoding chip; the processing module uses a DM642 chip; the SAA7113 video decoding chip is connected to the VP1 interface of the DM642 chip, and the DM642 chip is connected via I 2 C The bus connection controls the SAA7113 video decoder chip.

本发明有益效果是:The beneficial effects of the present invention are:

本发明哈希算法对图像进行处理,具有鲁棒性好、实时性好、稳定性高、 算法复杂度低和光照变化影响小的优点;能够有效判断车道只目标区域有车无车情况。The hash algorithm of the present invention processes images, and has the advantages of good robustness, good real-time performance, high stability, low algorithm complexity, and little influence of illumination changes; it can effectively judge whether there are cars in the target area of the lane or not.

本发明替代地感应线圈的应用,避免其在道路感应中存在的缺陷;通过对图像进行多重分析,能够保证算法的合理性,能够增强算法的抗干扰能力,进而提升算法和系统的可靠性、稳定性。The invention replaces the application of the induction coil to avoid its defects in road induction; through multiple analysis of the image, the rationality of the algorithm can be ensured, the anti-interference ability of the algorithm can be enhanced, and the reliability of the algorithm and the system can be improved. stability.

附图说明Description of drawings

图1是本发明功能模块示意图;Fig. 1 is a schematic diagram of functional modules of the present invention;

图2是本发明工作流程示意图;Fig. 2 is a schematic diagram of the workflow of the present invention;

图3是本发明哈希指纹示例。Fig. 3 is an example of the hash fingerprint of the present invention.

其中,1—图像采集模块、2—处理模块、3—存储器模块、4—上位机、5—道闸、6—电源。Among them, 1—image acquisition module, 2—processing module, 3—memory module, 4—host computer, 5—gate, 6—power supply.

具体实施方式detailed description

本发明公开了一种车道车辆检测方法,包括处理模块、图像采集模块和存储器模块;所述图像采集模块正对目标区域,所述目标区域为车道中车辆检测区域;所述存储器模块存储模板图像,所述图像采集模块采集目标区域的目标图像并发送到处理模块,处理模块对目标图像进行直方图均衡化处理并在目标图像上按行车方向选取至少三个区域的区域图像,所述区域图像分别通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比,所述哈希指纹为以次序组合而成的图片描述字符串;若对比哈希指纹汉明距离均大于设定值,则目标区域中有车辆;若对比哈希指纹汉明距离均小于设定值,则目标区域中没有车辆,并将目标图像更新为模板图像。The invention discloses a lane vehicle detection method, comprising a processing module, an image acquisition module and a memory module; the image acquisition module faces a target area, and the target area is a vehicle detection area in a lane; the memory module stores a template image , the image acquisition module collects the target image of the target area and sends it to the processing module, and the processing module performs histogram equalization processing on the target image and selects at least three regional images of the target image according to the driving direction, and the regional images The corresponding hash fingerprints are generated by the hash algorithm respectively, and compared with the hash fingerprints of the corresponding regions on the template image, the hash fingerprints are image description strings combined in order; if the hash fingerprints are compared with Hamming If the distances are greater than the set value, then there is a vehicle in the target area; if the comparison hash fingerprint Hamming distance is less than the set value, then there is no vehicle in the target area, and the target image is updated to the template image.

这里基于图像的处理分析方法,具体是图像采集模块采集目标区域的图像,处理模块通过哈希算法生成对应图像的哈希指纹,通过对哈希指纹比较判断开始时候的模板图像和目标图像,得到目标图像中是否有车。具体是,通过在目标图像中截取区域图像,通过多个区域图像的进行详细分析判断,避免由于环境因素、或其他因素影响图像准确性,同时增强算法的抗干扰能力,进而提升算法的可靠性、稳定性。The image-based processing and analysis method here is specifically that the image acquisition module collects the image of the target area, and the processing module generates the hash fingerprint of the corresponding image through the hash algorithm, and compares and judges the template image and the target image at the beginning by comparing the hash fingerprint to obtain Whether there is a car in the target image. Specifically, by intercepting the regional image in the target image, through detailed analysis and judgment of multiple regional images, the accuracy of the image is avoided due to environmental factors or other factors, and the anti-interference ability of the algorithm is enhanced at the same time, thereby improving the reliability of the algorithm ,stability.

以下结合附图对本发明实施进行说明。The implementation of the present invention will be described below in conjunction with the accompanying drawings.

如图1所示,为本发明功能模块示意图,包括图像采集模块1、处理模块2、存储器模块3、上位机4、和电源5。As shown in FIG. 1 , it is a schematic diagram of functional modules of the present invention, including an image acquisition module 1 , a processing module 2 , a memory module 3 , a host computer 4 , and a power supply 5 .

图像采集模块1,用于采集目标区域的图像信息,图像采集模块1包括CCD图像传感器和SAA7113视频解码芯片;SAA7113将CCD采集到的数据信号解码成标准的“VPO”数字信号并输出到处理模块2,相当于一种“A/D”器件。其中,处理模块2还通过I2C两线式串行总线连接控制SAA7113视频解码芯片。The image acquisition module 1 is used to acquire the image information of the target area. The image acquisition module 1 includes a CCD image sensor and a SAA7113 video decoding chip; the SAA7113 decodes the data signal collected by the CCD into a standard "VPO" digital signal and outputs it to the processing module 2, equivalent to an "A/D" device. Wherein, the processing module 2 is also connected to control the SAA7113 video decoding chip through an I 2 C two-wire serial bus.

处理模块2,用于对图像信号的分析,并连接控制道闸5栏杆状态。处理模块2采用TI公司C6000系列DSP中DM642(全名TMS320DM642),DM642核心是C6416型高性能数字信号处理器,具有极强的处理性能,高度的灵活性和可编程性,同时外围集成了非常完整的音频、视频和网络通信等设备及接口,能够满足本系统中对视频/图像处理,及完成对相关设备连接控制。The processing module 2 is used to analyze the image signal, and is connected to control the state of the railing of the barrier gate 5. Processing module 2 adopts DM642 (full name TMS320DM642) in TI's C6000 series DSP. The core of DM642 is C6416 high-performance digital signal processor, which has strong processing performance, high flexibility and programmability, and at the same time integrates very Complete audio, video and network communication equipment and interfaces can meet the video/image processing in this system and complete the connection control of related equipment.

存储器模块3,具体是外围存储器模块,通过外部总线与DM642的EMIF接口连接。存储器模块3包括SDRAM同步动态随机存储器和FLASH固态存储器。The memory module 3, specifically the peripheral memory module, is connected to the EMIF interface of the DM642 through an external bus. The memory module 3 includes SDRAM synchronous dynamic random access memory and FLASH solid state memory.

上位机4包括打开本地图片、IP地址设置、接收图像、选择目标区域、发送区域坐标、保存图像等功能。The upper computer 4 includes functions such as opening local pictures, setting IP addresses, receiving images, selecting target areas, sending area coordinates, and saving images.

电源5,为系统提供电力供应,具体可以使用独立的电源系统。The power supply 5 provides power supply for the system, specifically an independent power supply system can be used.

如图2所示,为系统工作流程示意图。系统工作步骤如下:As shown in Figure 2, it is a schematic diagram of the system workflow. The working steps of the system are as follows:

1.初始化系统,对存储在存储模块中的模板图像进行初始设置;1. Initialize the system to initially set the template image stored in the storage module;

2.图形采集模块采集目标区域的目标图像,并对目标图像进行直方图均衡化处理,具体步骤如下:2. The graphics acquisition module collects the target image of the target area, and performs histogram equalization processing on the target image. The specific steps are as follows:

1)统计所述目标图像各灰度级的像素数目ni,i=0,1,2,...,L-1,其中L为灰度总级数;1) counting the number of pixels n i of each gray level of the target image, i=0, 1, 2, ..., L-1, where L is the total number of gray levels;

2)计算原始直方图的概率密度Pi(ri)=ni/N,其中N为原始图像的总像素数目;2) Calculate the probability density P i (r i )=n i /N of the original histogram, where N is the total number of pixels of the original image;

3)计算累积分布函数,k=0,1,2,...,L-1;3) Calculate the cumulative distribution function, k=0,1,2,...,L-1;

4)计算最后的输出灰度级gk=int[(gmax-gmin)sk(rk)+0.5]/L-1 k=0,1,2,...,L-1,其中int[]为取整符号。4) Calculate the final output gray level g k =int[(g max -g min )s k (r k )+0.5]/L-1 k=0,1,2,...,L-1, Where int[] is the rounding symbol.

3.判定目标区域无车时,更新存储在存储模块中的模板图像;具体是将经过步骤2处理的目标图像更新为模板图像。3. When it is determined that there is no vehicle in the target area, the template image stored in the storage module is updated; specifically, the target image processed in step 2 is updated as the template image.

4.处理模块在目标图像上依次截取、按行车方向递进且部分叠加的第一区域图像、第二区域图像、第三区域图像,区域图像覆盖目标图像中车道三分之二。对区域图像进行哈希算法并得到区域图像的描述字符串,即哈希指纹,具体对区域图像进行均值哈希算法,均值哈希算法流程包括:4. The processing module sequentially intercepts the first area image, the second area image, and the third area image that are progressively superimposed according to the driving direction on the target image. The area images cover two-thirds of the lane in the target image. Perform a hash algorithm on the area image and obtain the description string of the area image, that is, the hash fingerprint. Specifically, perform the mean value hash algorithm on the area image. The process of the mean value hash algorithm includes:

1)缩小尺寸:将第一区域图像缩小到8×8的尺寸,总共64个像素。1) Reducing the size: reducing the image of the first region to a size of 8×8, with a total of 64 pixels.

2)简化色彩:将8×8的第一区域图像转换成灰度图像,并转为64级灰度。2) Color simplification: convert the 8×8 first region image into a grayscale image, and convert it into 64-level grayscale.

3)计算平均值:计算所有64个像素的灰度平均值;如3) Calculate the average value: calculate the gray level average value of all 64 pixels; as

4)比较像素的灰度:将每个像素的灰度与平均值进行比较,大于或等于平均值,记为1,小于平均值,记为0;如图3所示。4) Compare the grayscale of the pixel: compare the grayscale of each pixel with the average value, if it is greater than or equal to the average value, it will be recorded as 1, and if it is less than the average value, it will be recorded as 0; as shown in Figure 3.

5)生成哈希指纹:将4)的比较结果,按一定的次序组合在一起,就构成了一个64位的哈希指纹。如图3按照由上至下每行依次排列的的指纹是:1111111111111111110111111101101111000011110000111100001111100011。5) Generate a hash fingerprint: combine the comparison results of 4) in a certain order to form a 64-bit hash fingerprint. As shown in Figure 3, the fingerprints arranged in order from top to bottom in each row are: 111111111111111110111111101101111000011110000111100001111100011.

通过均值哈希算法可以得到图像的哈希指纹,图像间的不同可以通过哈希指纹直观表示出来。这样通过哈希指纹可以判断出目标区域中有车无车情况,优选步骤如下:The hash fingerprint of the image can be obtained through the mean value hash algorithm, and the difference between images can be visually expressed through the hash fingerprint. In this way, the hash fingerprint can be used to determine whether there are cars or no cars in the target area. The preferred steps are as follows:

A)第一区域图像哈希指纹和模板图像相同位置区域得到的哈希指纹进行对比,当哈希指纹的汉明距离M1大于15时,进行步骤B),否则将目标图像更新为模板图像;A) the hash fingerprint of the image hash fingerprint in the first area is compared with the hash fingerprint obtained in the same position area of the template image, and when the Hamming distance M1 of the hash fingerprint is greater than 15, proceed to step B), otherwise the target image is updated to the template image;

B)第二区域图像哈希指纹和模板图像相同位置区域得到的哈希指纹进行对比,当哈希指纹的汉明距离M2大于15时,进行步骤C);否则更新目标图像并重复本步骤;B) the hash fingerprint of the second area image is compared with the hash fingerprint obtained in the same position area of the template image, and when the Hamming distance M2 of the hash fingerprint is greater than 15, perform step C); otherwise update the target image and repeat this step;

C)第三区域图像哈希指纹和模板图像相同位置区域得到的哈希指纹进行对比,当哈希指纹的汉明距离M3大于15时,则目标区域中有车辆并进入步骤D);否则更新目标图像并重复本步骤;C) compare the hash fingerprint of the image hash fingerprint of the third area with the hash fingerprint obtained in the same position area of the template image, when the Hamming distance M3 of the hash fingerprint is greater than 15, then there is a vehicle in the target area and enter step D); otherwise update target image and repeat this step;

D)对目标图像的第一区域图像、第二区域图像和第三区域图像同时通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比得到对应哈希指纹汉明距离M4、M5和M6;若M4、M5且M6均小于10,则车 已离开,所述存储器模块将目标图像更新为模板图像;否则,重复本步骤。D) The first area image, the second area image and the third area image of the target image are simultaneously generated corresponding hash fingerprints through the hash algorithm, and compared with the hash fingerprints of the corresponding areas on the template image to obtain the corresponding hash fingerprints Hamming distances M4, M5 and M6; if M4, M5 and M6 are all less than 10, the car has left, and the memory module updates the target image to a template image; otherwise, repeat this step.

5.工作结束。5. End of work.

本发明可以替代地感应线圈的应用,避免其在道路感应中存在的缺陷;同时,本发明通过对图像进行多重分析,能够保证算法的合理性,能够增强算法的抗干扰能力,进而提升算法和系统的可靠性、稳定性。The present invention can replace the application of the induction coil to avoid its defects in road induction; at the same time, the present invention can ensure the rationality of the algorithm and enhance the anti-interference ability of the algorithm by performing multiple analyzes on the image, thereby improving the algorithm and System reliability and stability.

Claims (1)

1.一种车辆检测方法,包括处理模块、图像采集模块和存储器模块;所述图像采集模块正对目标区域,所述目标区域为车道中车辆检测区域;其特征在于:所述存储器模块存储模板图像,所述图像采集模块采集目标区域的目标图像并发送到处理模块,处理模块对目标图像进行直方图均衡化处理并在目标图像上按行车方向选取至少三个区域的区域图像,所述区域图像分别通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比,所述哈希指纹为以次序组合而成的图片描述字符串;若对比哈希指纹汉明距离均大于设定值,则目标区域中有车辆;若对比哈希指纹汉明距离均小于设定值,则目标区域中没有车辆,并将目标图像更新为模板图像;1. A vehicle detection method, comprising a processing module, an image acquisition module and a memory module; the image acquisition module is facing the target area, and the target area is the vehicle detection area in the lane; it is characterized in that: the memory module storage template image, the image acquisition module collects the target image of the target area and sends it to the processing module, and the processing module performs histogram equalization processing on the target image and selects at least three regional images of the target image according to the driving direction, and the said area The corresponding hash fingerprints of the images are generated through the hash algorithm, and compared with the hash fingerprints of the corresponding regions on the template image. The hash fingerprints are image description strings combined in sequence; If the Hamming distances are greater than the set value, there is a vehicle in the target area; if the comparison hash fingerprint Hamming distance is less than the set value, then there is no vehicle in the target area, and the target image is updated to the template image; 若目标区域中有车辆,则同时对目标图像中的区域图像通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比得到哈希指纹汉明距离;若哈希指纹汉明距离均小于设定值,则目标区域中车辆已离开,并将目标图像更新为模板图像,否则重复上述步骤;If there is a vehicle in the target area, the corresponding hash fingerprint is generated by the hash algorithm for the area image in the target image at the same time, and compared with the hash fingerprint of the corresponding area on the template image to obtain the hash fingerprint Hamming distance; If the Hamming distance of the fingerprints is less than the set value, the vehicle in the target area has left, and the target image is updated to the template image, otherwise repeat the above steps; 所述处理模块在目标图像上依次截取按行车方向递进且部分叠加的第一区域图像、第二区域图像、第三区域图像,并按照以下步骤进行:The processing module sequentially intercepts the first area image, the second area image, and the third area image progressively and partially superimposed by the driving direction on the target image, and proceeds according to the following steps: 1)对第一区域图像通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比,得到哈希指纹汉明距离M1,若M1大于设定值,则进入步骤2),否则将目标图像更新为模板图像;1) Generate the corresponding hash fingerprint for the image of the first area through the hash algorithm, and compare it with the hash fingerprint of the corresponding area on the template image to obtain the hash fingerprint Hamming distance M1, if M1 is greater than the set value, enter Step 2), otherwise update the target image to the template image; 2)按1)步骤得到第二个区域对比的哈希指纹汉明距离M2,若M2大于设定值,则进入步骤3),否则更新目标图像并重复本步骤;2) According to step 1) to obtain the Hamming distance M2 of the hash fingerprint of the second area comparison, if M2 is greater than the set value, then enter step 3), otherwise update the target image and repeat this step; 3)按1)步骤得到第三个区域对比的哈希指纹汉明距离M3,若M3大于设定值,则目标区域中有车辆并进入步骤4);否则更新目标图像并重复本步骤;3) According to step 1) to obtain the Hamming distance M3 of the hash fingerprint of the third area comparison, if M3 is greater than the set value, then there is a vehicle in the target area and enter step 4); otherwise update the target image and repeat this step; 4)对目标图像的第一区域图像、第二区域图像和第三区域图像同时通过哈希算法生成对应的哈希指纹,并和模板图像上对应区域的哈希指纹进行对比得到对应哈希指纹汉明距离M4、M5和M6;若M4、M5且M6均小于设定值,则车离开,所述存储器模块将目标图像更新为模板图像;否则,重复本步骤;4) Generate corresponding hash fingerprints for the first region image, the second region image and the third region image of the target image at the same time through the hash algorithm, and compare them with the hash fingerprints of the corresponding regions on the template image to obtain the corresponding hash fingerprints Hamming distances M4, M5 and M6; if M4, M5 and M6 are all less than the set value, the car leaves, and the memory module updates the target image to a template image; otherwise, repeat this step; 所述M1、M2且M3设定值均为15,所述M4、M5且M6设定值均为10;The set values of M1, M2 and M3 are all 15, and the set values of M4, M5 and M6 are all 10; 所述第一区域图像、第二区域图像和第三区域图像至少覆盖目标图像中车道三分之二以上;The first area image, the second area image and the third area image cover at least two-thirds of the lane in the target image; 所述直方图均衡化步骤为:The histogram equalization steps are: 1)统计所述目标图像各灰度级的像素数目ni,i=0,1,2,...,L-1,其中L为灰度总级数;1) counting the number of pixels n i of each gray level of the target image, i=0, 1, 2, ..., L-1, where L is the total number of gray levels; 2)计算原始直方图的概率密度Pi(ri)=ni/N,其中N为目标图像的总像素数目;2) Calculate the probability density P i (r i )=n i /N of the original histogram, where N is the total number of pixels of the target image; 3)计算累积分布函数, 3) Calculate the cumulative distribution function, 4)计算最后的输出灰度级gk=int[(gmax-gmin)sk(rk)+0.5]/L-14) Calculate the final output gray level g k =int[(g max -g min )s k (r k )+0.5]/L-1 k=0,1,2,...,L-1,其中int[]为取整符号;k=0,1,2,...,L-1, where int[] is rounding symbol; 所述图像采集模块包括依次连接的CCD图像传感器和SAA7113视频解码芯片;所述处理模块采用DM642芯片;所述SAA7113视频解码芯片连接DM642芯片的VP1接口,所述DM642芯片通过I2C总线连接控制SAA7113视频解码芯片。The image acquisition module includes a CCD image sensor and a SAA7113 video decoding chip connected in sequence; the processing module adopts a DM642 chip; the SAA7113 video decoding chip is connected to the VP1 interface of the DM642 chip, and the DM642 chip is connected to control the SAA7113 video through an I2C bus. decoding chip.
CN201510531951.6A 2015-08-27 2015-08-27 A kind of vehicle checking method Active CN105225281B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510531951.6A CN105225281B (en) 2015-08-27 2015-08-27 A kind of vehicle checking method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510531951.6A CN105225281B (en) 2015-08-27 2015-08-27 A kind of vehicle checking method

Publications (2)

Publication Number Publication Date
CN105225281A CN105225281A (en) 2016-01-06
CN105225281B true CN105225281B (en) 2017-09-29

Family

ID=54994228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510531951.6A Active CN105225281B (en) 2015-08-27 2015-08-27 A kind of vehicle checking method

Country Status (1)

Country Link
CN (1) CN105225281B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106403951A (en) * 2016-08-26 2017-02-15 观宇能源科技(上海)有限公司 Computer vision based positioning system and positioning method thereof
CN106682597A (en) * 2016-12-14 2017-05-17 四川长虹电器股份有限公司 Method for identifying traffic lights
CN108288012B (en) * 2017-01-09 2022-03-08 北京新知堂教育科技开发有限公司 Artwork filing verification method and system based on mobile phone
CN108494968A (en) * 2018-04-04 2018-09-04 Oppo广东移动通信有限公司 Intelligent reminding method and device, storage medium and intelligent terminal
CN110852301A (en) * 2019-11-20 2020-02-28 北京宜世通信息技术有限公司 Railway coal transportation dust suppression information monitoring method and system
CN114004781A (en) * 2020-07-28 2022-02-01 佛山喀视科技有限公司 Ceramic tile image input method and device
CN113808288B (en) * 2021-09-07 2023-06-27 重庆亿连信息科技有限公司 Real-time timing consumption deduction analysis method and system for parking lot
CN113762254B (en) * 2021-09-07 2022-11-11 重庆畅停智慧停车服务有限公司 License plate recognition method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2115905C (en) * 1993-02-19 2004-11-16 Sherman M. Chow Secure personal identification instrument and method for creating same
CN102663400A (en) * 2012-04-16 2012-09-12 北京博研新创数码科技有限公司 LBP (length between perpendiculars) characteristic extraction method combined with preprocessing
CN103780899A (en) * 2012-10-25 2014-05-07 华为技术有限公司 Method and device for detecting whether camera is interfered and video monitoring system
CN104268843A (en) * 2014-10-16 2015-01-07 桂林电子科技大学 Image self-adaptation enhancing method based on histogram modification
CN104680500A (en) * 2015-02-07 2015-06-03 江西科技学院 Image intensification algorithm based on histogram equalization

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7152786B2 (en) * 2002-02-12 2006-12-26 Digimarc Corporation Identification document including embedded data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2115905C (en) * 1993-02-19 2004-11-16 Sherman M. Chow Secure personal identification instrument and method for creating same
CN102663400A (en) * 2012-04-16 2012-09-12 北京博研新创数码科技有限公司 LBP (length between perpendiculars) characteristic extraction method combined with preprocessing
CN103780899A (en) * 2012-10-25 2014-05-07 华为技术有限公司 Method and device for detecting whether camera is interfered and video monitoring system
CN104268843A (en) * 2014-10-16 2015-01-07 桂林电子科技大学 Image self-adaptation enhancing method based on histogram modification
CN104680500A (en) * 2015-02-07 2015-06-03 江西科技学院 Image intensification algorithm based on histogram equalization

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于车辆视觉的车道闸杆防撞系统研究;李小勇,张文涛,熊显名;《微型机与应用》;20140131;第33卷(第1期);第40-45页 *

Also Published As

Publication number Publication date
CN105225281A (en) 2016-01-06

Similar Documents

Publication Publication Date Title
CN105225281B (en) A kind of vehicle checking method
TWI677826B (en) License plate recognition system and method
CN110097044B (en) One-stage license plate detection and recognition method based on deep learning
WO2024037408A1 (en) Underground coal mine pedestrian detection method based on image fusion and feature enhancement
CN106127137A (en) A kind of target detection recognizer based on 3D trajectory analysis
CN105469046B (en) Based on the cascade vehicle model recognizing method of PCA and SURF features
CN103065494B (en) Free parking space detection method based on computer vision
CN111461036B (en) A Real-time Pedestrian Detection Method Using Background Modeling Augmented Data
CN112926365B (en) Lane line detection method and system
CN114926456A (en) A semi-automatic labeling and improved deep learning method for foreign object detection on railway tracks
CN103914701A (en) Night vehicle detection method based on image
CN115439743A (en) Method for accurately extracting visual SLAM static characteristics in parking scene
Fregin et al. Three ways of using stereo vision for traffic light recognition
CN105825219A (en) Machine vision detection system
Zhu et al. Advanced driver assistance system based on machine vision
CN112528994A (en) Free-angle license plate detection method, license plate identification method and identification system
KR20220075999A (en) Pothole detection device and method based on deep learning
CN118411508A (en) Multi-scale target detection method and system based on roadside camera and millimeter wave radar
CN115131827B (en) Passenger flow human body detection method, device, storage medium and passenger flow counting camera
CN102842025B (en) The detection scene determination methods of video image and device
CN117078961A (en) Sunlight angle determination methods, devices, equipment and media applied to vehicles
CN105200938B (en) A Vision-Based Anti-Collision System for Lane Brake Lever
CN113449629A (en) Lane line false and true identification device, method, equipment and medium based on driving video
CN110853001B (en) Transformer substation foreign matter interference prevention image recognition method, system and medium
CN114494040A (en) Image data processing method and device based on multi-target detection

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Xu Shaohua

Inventor after: Qin Ligeng

Inventor after: Chen Zhi

Inventor after: Yan Xiaofeng

Inventor after: Li Xiaoyong

Inventor before: Qin Ligeng

Inventor before: Xu Shaohua

Inventor before: Li Xiaoyong

Inventor before: Chen Zhi

Inventor before: Chen Jing

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: No.6, Gaoxin 2nd Road, XiXiangTang District, Nanning City, Guangxi Zhuang Autonomous Region

Patentee after: Guangxi Jiaoke Group Co.,Ltd.

Country or region after: China

Address before: No. 6 Gaoxin 2nd Road, High tech Zone, Guangxi Zhuang Autonomous Region

Patentee before: GUANGXI TRANSPORTATION Research Institute

Country or region before: China

CP03 Change of name, title or address