pub fn contours( data: &[u8], width: usize, height: usize, external: bool, ) -> Result<Vec<Vec<[i32; 2]>>, String>
八邻域边界追踪与直线简化;遍历语义对应公开参考实现。