The "Halide Project" is a research project on building a data-driven Halide performance solution for image processing algorithms, which is carried out by our laboratory in collaboration with Huawei. The research mainly focused on the reimplementation and acceleration of commonly used digital image processing algorithms in OpenCV (Open Source Computer Vision Library, a cross platform open source computer vision library), using Halide (a domain-specified language embedded in C++ for fast, portable computation on images and tensors), to support the pre-processing and post-processing of images in fields such as mobile phones and smart cars. This research both enables the rapid implementation of related businesses and provides a feedback on research tasks in computer vision.
The image processing algorithms studied in this project include bilateral filtering, separable linear filtering, image resizing, affine and perspective transformation, color space convertion, corner detection, optical flow calculation and so on. In this project, we took the C++ source code of OpenCV as a reference, and used Halide to build a generator framework, where the interfaces of the original functions are preserved. The generator decouples the algorithms from schedules for high performance processing. We studied different settings of manual scheduling methods and data-driven automatic scheduling methods. Experiments show that the outputs of the reimplemented algorithms using Halide are the same with those of the original functions in OpenCV. And the overall performance of the reimplemented algorithms is successfully improved. Meanwhile, during this research project, we identified and summarized the existing problems in Halide, which includes the expression defects such as the lack of loop breaking and condition switching, providing a groundwork for future researches.