To fulfill the requirements of dividing image contour into several segment,and tracking one segment alone or tracking all segments simultaneously, a multi-segment image contour tracking algorithm based on Freeman chain code and multithreading is presented.The algorithm for image contour tracking based on Freeman chain code is improved to make it can be applied to the algorithm for multi-segment image contour tracking. The operation of contour tracking is encapsulated to a class by the concepts of OOP. So contour tracking of one segment is executed by one thread and one instance of contour following class. Application results show that the algorithm this paper presented is a practicable solution to the multi-segment image contour tracking. With this solution, the segements which concerned in whole contour can be tracked separately.the processing of one segment's contour tracking can communicates with another's. The algorithm also has the advantage of fast speed and high efficiency.%针对将图像轮廓分段,并对每段轮廓单独进行或对所有段轮廓同时进行轮廓跟踪的需求,提出了基于链码和多线程的图像分段轮廓跟踪方法.对基于链码的图像轮廓跟踪算法进行改进,使之能应用于基于多线程的图像分段轮廓跟踪方法中.以面向对象的观点,将轮廓跟踪操作封装成类.一段轮廓的跟踪对应一个线程和一个轮廓跟踪类的时象.应用表明,该方法很好的解决了图像分段轮廓跟踪的问题,不仅可以灵活的对整个轮廓中所关心的某几段或所有段进行跟踪,而且各段轮廓的跟踪过程能够相互通信,跟踪速度快、效率高.
展开▼