Last active
August 29, 2015 14:02
-
-
Save sekimura/629b1b1fc15a8914a560 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/core/core.hpp> | |
#include <opencv2/imgproc/imgproc.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
int | |
main(int argc, char *argv[]) | |
{ | |
cv::Mat src_img = cv::imread("./960x460.jpg", 1); | |
if(!src_img.data) return -1; | |
cv::Mat dst_img; | |
cv::GaussianBlur(src_img, dst_img, cv::Size(11,11), 10, 10); | |
cv::imwrite("./blurred.jpg", dst_img); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import argparse | |
import cv2 | |
def blurr(src, dst, sigma=48.0): | |
size = int(sigma) | |
if (size % 2 == 0): | |
size = size + 1 | |
src_img = cv2.imread(src, 1) | |
dst_img = cv2.GaussianBlur(src_img, (size, size), sigma, sigma) | |
cv2.imwrite(dst, dst_img) | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--src', help='') | |
parser.add_argument('--dst', help='') | |
parser.add_argument('--sigma', type=float, help='') | |
args = parser.parse_args() | |
blurr(args.src, args.dst, args.sigma) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment