init - 初始化项目
This commit is contained in:
14
samples/java/clojure/simple-sample/project.clj
Normal file
14
samples/java/clojure/simple-sample/project.clj
Normal file
@@ -0,0 +1,14 @@
|
||||
(defproject simple-sample "0.1.0-SNAPSHOT"
|
||||
:pom-addition [:developers [:developer {:id "magomimmo"}
|
||||
[:name "Mimmo Cosenza"]
|
||||
[:url "https://github.com/magomimmoo"]]]
|
||||
|
||||
:description "A simple project to start REPLing with OpenCV"
|
||||
:url "http://example.com/FIXME"
|
||||
:license {:name "Apache 2.0 License"
|
||||
:url "https://www.apache.org/licenses/LICENSE-2.0"}
|
||||
:dependencies [[org.clojure/clojure "1.5.1"]
|
||||
[opencv/opencv "2.4.7"]
|
||||
[opencv/opencv-native "2.4.7"]]
|
||||
:main simple-sample.core
|
||||
:injections [(clojure.lang.RT/loadLibrary org.opencv.core.Core/NATIVE_LIBRARY_NAME)])
|
||||
BIN
samples/java/clojure/simple-sample/resources/images/lena.png
Normal file
BIN
samples/java/clojure/simple-sample/resources/images/lena.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 606 KiB |
@@ -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.imgcodecs.Imgcodecs
|
||||
org.opencv.imgproc.Imgproc))
|
||||
|
||||
(defn -main [& args]
|
||||
(let [lena (Imgcodecs/imread "resources/images/lena.png")
|
||||
blurred (Mat. 512 512 CvType/CV_8UC3)]
|
||||
(print "Blurring...")
|
||||
(Imgproc/GaussianBlur lena blurred (Size. 5 5) 3 3)
|
||||
(Imgcodecs/imwrite "resources/images/blurred.png" blurred)
|
||||
(println "done!")))
|
||||
@@ -0,0 +1,7 @@
|
||||
(ns simple-sample.core-test
|
||||
(:require [clojure.test :refer :all]
|
||||
[simple-sample.core :refer :all]))
|
||||
|
||||
(deftest a-test
|
||||
(testing "FIXME, I fail."
|
||||
(is (= 0 1))))
|
||||
Reference in New Issue
Block a user