节点文献
基于实时Linux的视觉子系统设计
Design of Visual System Based on Real-time Linux
【作者】 胡强;
【导师】 蔡自兴;
【作者基本信息】 中南大学 , 控制科学与工程, 2009, 硕士
【摘要】 一个实时高效的视觉系统对提高机器人的感知能力有非常重要的作用,但目前的视觉系统大多建立在通用操作系统上,缺乏优化的视觉传感器驱动,而且图像处理软件冗余度高,缺乏统一的编程接口,这就造成了系统的效率低下,软件移植性很差。本文在设计视觉系统的过程中,主要在以下三个方面作了深入研究:1.对通用Linux进行实时化改造。目前,“主动抢占”和“抢占式内核”这两种实时化方案已经被标准Linux 2.6内核所支持,本文深入分析了两者的实现方式,并且引入了一种“完全内核抢占”的实时策略,使Linux内核几乎处处均可抢占,从而更加有效地降低了系统的调度延时。2.设计了一种高精度定时器。增强Linux实时能力一个至关重要的方面就是提高内核定时器的定时精度,原有的定时器只有毫秒精度,本文设计了一种基于GTOD的具有微秒级精度的定时器,它采用红黑树来进行组织,并直接使用纳秒作为定时单位。3.设计了一个基于V4L2的摄像头驱动程序。V4L2是Linux音视频驱动的最新标准,比V4L1的功能更强。目前Linux开源社区最流行的,支持摄像头最广泛的驱动程序GSPCA是基于V4L1的,为了提高视频的采集效率,本文依据V4L2,对GSPCA进行了改进。4.设计了一个颜色分割库。为适应机器人视觉处理的需要,本文采用快速颜色分割算法设计了一种彩色图像分割库。分割库具有实时的处理速度,而且提供了丰富的目标信息接口,通过该库的使用,可以大大简化上层的图像处理编程,使开发人员更专注于上层处理,忽略底层的细节。实验证明,本文设计的视觉系统具有较低的响应延迟,较快的采集帧速和较强的图像处理能力,其中设计的颜色分割库可以为不同的图像处理研究提供底层接口。总之,本文设计的视觉系统是较为成功的。
【Abstract】 Vision sensors are good choices for their advanced theory and their own superiorities. So a real-time, efficient visual system is essential to improve robots’ perceptual ability. However, for basing mainly on general operation system, visual system lacks optimized visual sensor driver, and for their image-processing software highly redundant and lack of unified programming interface, the system is of low efficiency and bad portable ability.This thesis focuses on the following three aspects during the design of visual system:1. Real-time transformation of general Linux. Low-Latency Patch and Preemptible kernel patch had been accepted by standard Linux 2.6 kernel now, which had greatly reduced the latency in the kernel. This thesis makes a deep research on the two realizations, and introduce a fully preemptible kernel patch to enhance the preemptability of the Linux kernel, making the kernel almost preemtible everywhere to reduce latency more efficiently.2. Design a high precise timer. In order to improve real-time capacity of Linux system, it is crucial to improve the resolution of kernel timer. Since the original timers only have MS resolution, this thesis designs aμS resolution timer based on GTOD, which is organised by red-black-tree and adopts nanosecond as its timing unit.3. Design a USB camera driver based on V4L2. For the time being, as for USB camera drivers, GSPCA, based on V4L1, is the most popular one among Linux open source community and surppots the widest scope of cameras. To promote the gathering efficiency of videos and make a full use of V4L2, it is essential to redesign V4L2-based camera driver.4. Design a color segmentation library. To meet robots’ visual processing demands, this paper designs a color image segmentation library by adopting real-time segmenting algorithm. The segmentation library, with real-time process and abundant target message interfaces, can greatly simplify high-level image processing program, so developers can concentrate more on high-level process and ignore low-level details.It is proved that, the visual system designed in this paper have the characteristics of low response latency, fast image-gathering speed, comparatively strong image-processing ability and color segmentation library which can provide low-level interfaces for different image-processing research. In one word, this design of visual system is a success.
【Key words】 Linux; Real Time; V4L; USB camera driver; color segmentation;