1

I am new to OpenCV and am using it from Clojure. Clojure is a “hosted language” on the JVM so this is related to using OpenCV from Java. I started with Giacomo (Mimmo) Cosenza's helpful tutorial “Introduction to OpenCV Development with Clojure” (http://docs.opencv.org/2.4/doc/tutorials/introduction/clojure_dev_intro/clojure_dev_intro.html). It shows how to do some simple image processing using OpenCV from Clojure.

Now I want to do other kinds of image processing, but do not understand how to translate from documented OpenCV API to Java-style class names that I can import into Clojure. The issue is analogous to a Java programmer beginning to use OpenCV.

For example, I would like to use addweighted (http://docs.opencv.org/modules/core/doc/operations_on_arrays.html#addweighted) but it is not obvious to me what Java class wraps this functionality. Is there some way to infer that from the OpenCV documentation, or is there doc of the Java wrapping where I could look it up?

Craig Reynolds
  • 675
  • 7
  • 16
  • 1
    there's [javadocs](http://docs.opencv.org/java/) for a start – berak Sep 20 '14 at 07:28
  • 1
    The one in your example is in org.opencv.core.Core: http://docs.opencv.org/java/org/opencv/core/Core.html – Diego Basch Sep 20 '14 at 17:20
  • Thanks! So given a name from the API (eg addweighted) I can web search for "opencv java addweighted" which gets me to the doc page for the relevant Java class (org.opencv.core.Core). Then to use it in Clojure, I add a new import clause to my namespace definition, with the final component of the class name broken off: (ns ... (:import (org.opencv.core Core))) and then call the function as (Core/addweighted ...). That allowed me to write and test a Clojure function for unsharp masking as described in: http://stackoverflow.com/questions/4993082/how-to-sharpen-an-image-in-opencv/4993701 – Craig Reynolds Sep 21 '14 at 00:20

0 Answers0