Ask Your Question

Hello, there! I am a beginner I was wondering if there is any documentation that explain the method on openCV for java. For instance: "get()" method from "Mat" class.

asked 2017-08-15 10:17:52 -0500

I Cannot find a description about what the methods do. I only find the methods declaration, like in:



edit retag flag offensive close merge delete


take a look at this question if you find it useful please upvote the question and the best answer to help others to find useful information

sturkmen gravatar imagesturkmen ( 2017-08-15 10:30:36 -0500 )edit

Hi, please check out OpenCV 3.0 Computer Vision with Java book from packtpub - has low reviews but I believe it contains 80% of knowledge for basic usage of OpenCV in Java. It comes with examples in java in resources (you can download them from the book site). Usually you can just take any c++/python code and use Java opencv doc to verify what is the implementation of the method in Java. At least that how I am managing it.

PiMac gravatar imagePiMac ( 2017-08-15 15:22:04 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-08-15 11:14:10 -0500

updated 2017-08-15 11:21:01 -0500

I stand to be corrected since I haven't used OpenCV's Java wrapper before. In order to find documentation, I'd recommend the following means:

1. Official Documentation Backtrace

Kudos for referring to the official site for help. Sometimes back-tracing documentations can be helpful. Rarely do you see changes to the core components of a framework so chances are methods do the same thing. Since Mat is core, if you look at documentation <=2.4.11, you'll notice that most of the Mat methods are documented.

2. Language Cross Referencing

Frameworks supporting multiple languages tend to maintain some sort of consistency. The C++ API is well documented so why not look there instead? It might be called Mat.get() in Java and<type>() in C++ but they both do the same thing. And looking at their parameters, they are similar as well. All you need to know is how they work. How to call them, what it's called in another language, etc is just syntactic sugar.

3. Common Sense/Hunch

No pun/brag/harm intended

Some methods are obvious no wonder they don't really have any form of documentation. Assuming you know what a matrix is, then you know its a 2D container hence it has rows and columns. From OOP, we know about data encapsulation. Due to this, we have _getters_ and _setters_ which are commonly titled set and get. Putting two and two together, your first hunch of Mat.get() should be:

I need to give it the row and column in which it'd give me back the element at that position.

From there, you can refer to the documentation to see what datatype is returned and what other parameters it might take.

If none of this made sense to you, I'd recommend you stop and read up OOP first.

edit flag offensive delete link more


Thanks Eshirima. I think back-tracking documentation may work for me.

hugo lima chaves gravatar imagehugo lima chaves ( 2017-08-15 11:41:06 -0500 )edit

You're welcome.. It'd come in handy in the future for sure..Don't forget to mark as answer if it helped resolve your issue.. Happy coding, cheers mate ;)

eshirima gravatar imageeshirima ( 2017-08-15 11:48:10 -0500 )edit

Question Tools

1 follower


Asked: 2017-08-15 10:17:52 -0500

Seen: 301 times

Last updated: Aug 15 '17