实时检测图像中的文档。
docdetect1的Python项目详细描述
文档检测
利用canny边缘检测、hough变换和深度优先搜索对图像中的文档进行简单的实时检测。
安装
要安装,请使用pip
或easy_install
:
$ pip install --upgrade docdetect1
或
$ easy_install --upgrade docdetect1
说明
待定
示例
处理image
:
importdocdetectrects=docdetect.process(image)image=docdetect.draw(rects,image)
过程a video
:
importcv2importdocdetect1video=cv2.VideoCapture(video_path)cv2.startWindowThread()cv2.namedWindow('output')whilevideo.isOpened():ret,frame=video.read()ifret:rects=docdetect1.process(frame)frame=docdetect1.draw(rects,frame)cv2.imshow('output',frame)cv2.waitKey(1)video.release()