Commit ee270d1a authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1975 from magomimmo:clj-tut

parents ce503c64 00a18018
......@@ -11,4 +11,5 @@
.. |Author_EricCh| unicode:: Eric U+0020 Christiansen
.. |Author_AndreyP| unicode:: Andrey U+0020 Pavlenko
.. |Author_AlexS| unicode:: Alexander U+0020 Smorkalov
.. |Author_MimmoC| unicode:: Mimmo U+0020 Cosenza
.. |Author_BarisD| unicode:: Bar U+0131 U+015F U+0020 Evrim U+0020 Demir U+00F6 z
......@@ -156,6 +156,21 @@ world of the OpenCV.
:height: 90pt
:width: 90pt
================ =================================================
|ClojureLogo| **Title:** :ref:`clojure_dev_intro`
*Compatibility:* > OpenCV 2.4.4
*Author:* |Author_MimmoC|
A tutorial on how to interactively use OpenCV from the Clojure REPL.
================ =================================================
.. |ClojureLogo| image:: images/clojure-logo.png
:height: 90pt
:width: 90pt
* **Android**
.. tabularcolumns:: m{100pt} m{300pt}
......@@ -314,6 +329,7 @@ world of the OpenCV.
../windows_visual_studio_image_watch/windows_visual_studio_image_watch
../desktop_java/java_dev_intro
../java_eclipse/java_eclipse
../clojure_dev_intro/clojure_dev_intro
../android_binary_package/android_dev_intro
../android_binary_package/O4A_SDK
../android_binary_package/dev_with_OCV_on_Android
......
/target
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
(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 "BSD 3-Clause License"
:url "http://opensource.org/licenses/BSD-3-Clause"}
: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)])
;;; 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!")))
(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))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment