feat: 切换后端至PaddleOCR-NCNN,切换工程为CMake
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
This commit is contained in:
60
3rdparty/opencv-4.5.4/samples/python/inpaint.py
vendored
Executable file
60
3rdparty/opencv-4.5.4/samples/python/inpaint.py
vendored
Executable file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
'''
|
||||
Inpainting sample.
|
||||
|
||||
Inpainting repairs damage to images by floodfilling
|
||||
the damage with surrounding image areas.
|
||||
|
||||
Usage:
|
||||
inpaint.py [<image>]
|
||||
|
||||
Keys:
|
||||
SPACE - inpaint
|
||||
r - reset the inpainting mask
|
||||
ESC - exit
|
||||
'''
|
||||
|
||||
# Python 2/3 compatibility
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
import cv2 as cv
|
||||
|
||||
from common import Sketcher
|
||||
|
||||
def main():
|
||||
import sys
|
||||
try:
|
||||
fn = sys.argv[1]
|
||||
except:
|
||||
fn = 'fruits.jpg'
|
||||
|
||||
img = cv.imread(cv.samples.findFile(fn))
|
||||
if img is None:
|
||||
print('Failed to load image file:', fn)
|
||||
sys.exit(1)
|
||||
|
||||
img_mark = img.copy()
|
||||
mark = np.zeros(img.shape[:2], np.uint8)
|
||||
sketch = Sketcher('img', [img_mark, mark], lambda : ((255, 255, 255), 255))
|
||||
|
||||
while True:
|
||||
ch = cv.waitKey()
|
||||
if ch == 27:
|
||||
break
|
||||
if ch == ord(' '):
|
||||
res = cv.inpaint(img_mark, mark, 3, cv.INPAINT_TELEA)
|
||||
cv.imshow('inpaint', res)
|
||||
if ch == ord('r'):
|
||||
img_mark[:] = img
|
||||
mark[:] = 0
|
||||
sketch.show()
|
||||
|
||||
print('Done')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(__doc__)
|
||||
main()
|
||||
cv.destroyAllWindows()
|
Reference in New Issue
Block a user