"OPENCV" JAVA+ECLIPSE+OPENCV Environment Construction Helloword Introduction Demo

Source: Internet
Author: User

The article for Bo Master original, purely personal understanding, if there is a mistake to welcome the point.

If you want to reprint, please indicate the source.

Introducing JAR Packages

Introducing a configuration file

To this environment configuration complete!!!

Problems that may occur: 1. An exception occurred because of inconsistent JDK versions.

After the build path has been modified, you can.

Getting Started Code 01:
1  Packagecom.lw.test;2 ImportOrg.opencv.core.Core;3 ImportOrg.opencv.core.CvType;4 ImportOrg.opencv.core.Mat;5 6  Public classOpencvtest {7      Public Static voidMain (string[] args) {8System.out.println ("Welcome to OpenCV" +core.version); 9 system.loadlibrary (core.native_library_name); TenMat m = Mat.eye (3, 3, CVTYPE.CV_8UC1);  OneSystem.out.println ("m =" +m.dump ());  A     } -}
Getting Started Code 02:
1  Packagecom.lw.test;2 3 ImportOrg.opencv.core.Core;4 ImportOrg.opencv.core.Mat;5 ImportOrg.opencv.imgproc.Imgproc;6 ImportOrg.opencv.imgcodecs.Imgcodecs;7 8  Public classOpencvtest {9      Public Static voidMain (string[] args) {Ten system.loadlibrary (core.native_library_name);  OneMat img = imgcodecs.imread ("G:\\opencv01.png");  A imgproc.cvtcolor (IMG, IMG, imgproc.color_rgb2gray);  -Imgproc.adaptivethreshold (IMG, IMG, 255, Imgproc.adaptive_thresh_mean_c, IMGPROC.THRESH_BINARY_INV, 25, 10);  -Imgcodecs.imwrite ("G:\\opencv01_new.png", IMG);  the     } -}

Welcome to OpenCV's pit, hahaha.

"OPENCV" JAVA+ECLIPSE+OPENCV Environment Construction Helloword Introduction Demo

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.