add clojure sample

This commit is contained in:
Mimmmo Cosenza
2013-12-11 13:26:47 +01:00
parent 2784fd7b27
commit f07e9e7c5f
5 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
;;; to run this code from the terminal: "$ lein run". It will save a
;;; blurred image version of resources/images/lena.png as
;;; resources/images/blurred.png
(ns simple-sample.core
(:import [org.opencv.core Point Rect Mat CvType Size Scalar]
org.opencv.highgui.Highgui
org.opencv.imgproc.Imgproc))
(defn -main [& args]
(let [lena (Highgui/imread "resources/images/lena.png")
blurred (Mat. 512 512 CvType/CV_8UC3)]
(print "Blurring...")
(Imgproc/GaussianBlur lena blurred (Size. 5 5) 3 3)
(Highgui/imwrite "resources/images/blurred.png" blurred)
(println "done!")))