Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Move "split img to base + detail" logic to img module
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnovation committed Aug 19, 2017
1 parent aebbbfe commit 63280ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions derain
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import argparse
import img
from scipy.misc import imread, imsave
from cv2.ximgproc import guidedFilter
from guided_filter.core.filters import FastGuidedFilter
Expand All @@ -20,11 +21,7 @@ parser.add_argument(

args = parser.parse_args()

img = imread(args.input)

gf = FastGuidedFilter(img,16,2,4)
img_base = gf.filter(img)
img_detail = img / 255.0 - img_base
img_base, img_detail = img.split(imread(args.input))

img_combine = img_base + img_detail

Expand Down
7 changes: 7 additions & 0 deletions img.py
@@ -0,0 +1,7 @@
from guided_filter.core.filters import FastGuidedFilter

def split(img):
gf = FastGuidedFilter(img, 16, 2, 4)
base = gf.filter(img)
detail = img / 255.0 - base
return (base, detail)

0 comments on commit 63280ea

Please sign in to comment.