Ask Your Question

Rafalsonn's profile - activity

2020-07-04 04:21:57 -0600 received badge  Famous Question (source)
2019-10-21 10:37:32 -0600 received badge  Student (source)
2017-07-10 02:01:23 -0600 received badge  Notable Question (source)
2017-01-04 06:10:13 -0600 received badge  Popular Question (source)
2015-09-16 11:34:01 -0600 asked a question OpenCV Run on Tomcat

Hello, I've made an application which uses OpenCV, and now I want to run it on Tomcat. I'm now trying to set Tomcat to Work, this is the simple code to check is it working on tomcat:

String libopencv_java = "C:\\eclipse\\workspace\\tomcat_try\\opencv_java300.dll";
        System.load(libopencv_java); 
        LOG.debug("OpenCV Loaded");

        System.out.println("Welcome to OpenCV " + Core.VERSION);
        Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
        System.out.println("OpenCV Mat: " + m);
        Mat mr1 = m.row(1);
        mr1.setTo(new Scalar(1));
        Mat mc5 = m.col(5);
        mc5.setTo(new Scalar(5));
        System.out.println("OpenCV Mat data:\n" + m.dump());

When I'm executing the code on tomcat the result is:

Caused by: java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_Mat(IIIDDDD)J at org.opencv.core.Mat.n_Mat(Native Method) at org.opencv.core.Mat.<init>(Mat.java:63)

Can somebody help me? I've added the opencv300.jar file to the build path,

2015-09-09 05:42:08 -0600 commented question OpenCV Java how to access or convert List<MatOfPoint> to a list of points (x,y)

You are great ! It worked, Thanks so much ! That's exactly what I've needed :) I was struggling with it 2 days

2015-09-09 05:32:05 -0600 commented question OpenCV Java how to access or convert List<MatOfPoint> to a list of points (x,y)

That would be a great solution, but I've got some weird errors when i try to convert that :

List<Point> lista = null;
Converters.Mat_to_vector_Point(aContours, lista);

The method Mat_to_vector_Point(Mat, List<point>) in the type Converters is not applicable for the arguments (List<matofpoint>, List<point>) Sorry If I make a noob mistakes, I'm a little new to OpenCV.

2015-09-09 05:08:09 -0600 commented question OpenCV Java how to access or convert List<MatOfPoint> to a list of points (x,y)

If it's possible I want to have a found points of contours in a list which can be later used to a program to draw those lines again, but for example like that Or just extract the contour points, I think it will be enough to do that.

2015-09-09 04:44:17 -0600 commented question OpenCV Java how to access or convert List<MatOfPoint> to a list of points (x,y)

With this function it's possible to convert the List of MatOfPoint to Vector? How to get the coordinates from Vector, or do something using Vectors?

2015-09-09 04:24:34 -0600 received badge  Supporter (source)
2015-09-09 04:06:08 -0600 asked a question OpenCV Java how to access or convert List<MatOfPoint> to a list of points (x,y)

What can I do with a List<matofpoint> to get a list for example with a coordinates of the contours?

So this is the photo I want to detect the lines from: image description

when I print the contour list it gives me a long text which i can't find out what to do with that like :

>  [Mat [ 2*1*CV_32SC2, isCont=true, isSubmat=false,nativeObj=0xd2095b0, dataAddr=0xd24d410 ],
>  Mat [ 3*1*CV_32SC2, isCont=true, isSubmat=false, nativeObj=0xd209620, dataAddr=0xd1c88e0 ]

Can I use it somehow or is there any other method to take the contours from the image and have the coordinates or something like that?

So I have an image of line, already processed through the filters like grayscale, canny edge detector and I'm doing a function findContours and a draw contours:

 Imgproc.findContours(mat, aContours,aHierarchy, Imgproc.RETR_LIST,Imgproc.CHAIN_APPROX_SIMPLE);` 
 Imgproc.drawContours(mat,aContours,-1, color,CONTOUR_LINE_THICKNESS);

and I want a coordinates of a found contours from the findcontours function. Could you help me?