官术网_书友最值得收藏!

The Java OpenCV project in Eclipse

Using OpenCV in any IDE is pretty simple. It is as simple as adding OpenCV JAR, that is, opencv-300.jar to your classpath. But, as it relies on the native code, you need to point out the dynamic link libraries—so for Linux, .dll for Windows, and dylib for MacOsX.

  1. In Eclipse, go to File | New | Java Project.
  2. Give the new project a descriptive name, such as SimpleSample. Select the project in the Package Explorer, go to the Project menu and click on Properties. On the Java Build Path tab, go to the Libraries tab, and click on the Add Library… button on the right-hand side, as shown in the following screenshot:
  3. Select User Library in the Add Library dialog, and then click Next.
  4. Now, click on the User Libraries… button.
  5. Click on New…. Name your library appropriately, for example, opencv-3.0.0. It's time to reference the JAR files.
  6. Click on Add JARs….
  7. Select the opencv-300.jar file in your filesystem; it should be in the opencv\build\java folder. Then, point to the native library location expanding your JAR as in the following screenshot:
  8. Now, select Native library location by clicking on the Edit… button on the right-hand side of the window and set your native libraries' location folder, for example, opencv\build\java\x64\.
  9. Now that OpenCV is properly configured, just select it in your Add library dialog by pressing Finish.

Notice that your project now points to the OpenCV JAR. You can also browse the main classes from the Package Explorer, as seen in the following screenshot:

After the The NetBeans configuration section, a source code to create a simple OpenCV application can be found.

主站蜘蛛池模板: 社会| 方山县| 白城市| 怀安县| 澄城县| 宜兴市| 金昌市| 曲周县| 涟源市| 滁州市| 嵊泗县| 嘉祥县| 茌平县| 邵东县| 遂平县| 上高县| 阜阳市| 侯马市| 长垣县| 东乌珠穆沁旗| 株洲市| 洪湖市| 兴城市| 博湖县| 永泰县| 石屏县| 吉隆县| 抚松县| 浦东新区| 阳原县| 黄冈市| 兴海县| 大宁县| 阳江市| 镶黄旗| 额济纳旗| 建阳市| 北流市| 武功县| 崇文区| 资溪县|