去扭曲测试
This commit is contained in:
BIN
PH20240813000294_3_081442_1.jpg
Normal file
BIN
PH20240813000294_3_081442_1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
12
dewarp_test.py
Normal file
12
dewarp_test.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import cv2
|
||||||
|
|
||||||
|
from doc_dewarp import dewarp
|
||||||
|
from object_detection import doc_detect
|
||||||
|
from util import image_util
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
image = image_util.read("PH20240813000294_3_081442_1.jpg")
|
||||||
|
target_images = []
|
||||||
|
target_images += doc_detect.capture_target_area(image) # 识别文档区域并裁剪
|
||||||
|
dewarped_image = dewarp.dewarp_image(target_images[0]) # 去扭曲
|
||||||
|
cv2.imwrite("dewarped_image.jpg", dewarped_image)
|
||||||
23
docker-compose-dewarp.yml
Normal file
23
docker-compose-dewarp.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
x-env:
|
||||||
|
&template
|
||||||
|
image: fcb_photo_review:2.0.0
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
services:
|
||||||
|
photo_dewarp:
|
||||||
|
<<: *template
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
container_name: photo_dewarp
|
||||||
|
hostname: photo_dewarp
|
||||||
|
volumes:
|
||||||
|
- ./log:/app/log
|
||||||
|
- ./model:/app/model
|
||||||
|
command: [ "dewarp_test.py" ]
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
reservations:
|
||||||
|
devices:
|
||||||
|
- device_ids: [ "1" ]
|
||||||
|
capabilities: [ "gpu" ]
|
||||||
|
driver: "nvidia"
|
||||||
Reference in New Issue
Block a user