Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Java configuration method of OpenCV

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "the Java configuration method of OpenCV". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "OpenCV Java configuration method" bar!

Download opencv2.4.4.exe

Unzipped and installed it in the DRV / root directory. I named it D:/opencv244, which contains folders such as build.

Create a new project helloCV in eclipse

(you can see the steps on the official website.)

Http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html)

I am a little different from the official website configuration. I'm counting down two steps.

The specific steps are as follows:

Right-click the project-- build path--configure build path

Select user library after selecting add library.

Next, follow the illustration to operate user libraries.

Select new

Select the red circle option below

Then select native library location and select edit to edit

Next, select D:/opencv244/build\ java\ x86

Note that the path here must be careful, it is x86 in java in build. When my classmate saw the x86 below the build, they chose it and always reported it wrong.

Note that if it is a 64-bit machine, select x64, that is, D:/opencv244/build\ java\ x64

My machine is 64-bit, and the x86 I chose at the beginning was wrong.

And then ok ok ok..

Then create a new test file main.java

Package opencv

Import org.opencv.core.*

Public class Main {

Public static void main (String [] args) {

System.out.println ("Welcome to OpenCV" + Core.VERSION)

System.loadLibrary (Core.NATIVE_LIBRARY_NAME)

Mat m = Mat.eye (3,3, CvType.CV_8UC1)

System.out.println ("m =" + m.dump ())

}

}

You can see the output by running it.

It proved to be successful.

At this point, I believe you have a deeper understanding of the "Java configuration method of OpenCV". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report