Ask Your Question
0

OpenCV 3.4.1 breaks Imgproc.putText(Mat, String, Point, int, int, Scaler) [closed]

asked 2018-04-05 10:53:29 -0600

Marko5280 gravatar image

updated 2018-04-27 09:24:07 -0600

The method putText(Mat, String, Point, int, int, Scaler) is undefined for the type Imgproc

I have finally gotten my test snippet script to work.

http://answers.opencv.org/question/18...

Now it is broken again. I have upgraded to OpenCV 3.4.1 and Intelli-sense give the same old error message. It is a generic error message that does not point to the real problem. The script is proven. I do know that . . . It seems that putText is in the OpenCV Native library so, if the Native library in not installed properly this error message pops up. I have installed the Native library in Eclipse, the project and the script.

Anyone have a clue as to what I have not done or done wrong??

PS: This script has run in the past. The execution error does not provide any useful new information

The test script follows:

package openCV_340_PACKAGE;

import org.opencv.core.*;
import org.opencv.highgui.HighGui;
import org.opencv.imgproc.Imgproc;

public class Smoothing_Images_Test_Case {

    public static void main(String[] args) {
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
        Mat src;
        src = new Mat(400,400,16,Scalar.all(127));
        Imgproc.putText(src ,
                    "This Image" ,
                    new Point( src.cols()/4 , src.rows()/2 ) ,
                    Core.FONT_HERSHEY_COMPLEX ,
                    1 ,
                    new Scalar(255, 255, 255)) ;
        HighGui.imshow( "This Frame", src );
        HighGui.waitKey( 1500 );
        System.exit(0);
        }
}
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by LBerger
close date 2018-04-06 09:14:15.651693

Comments

sample runs all fine here, from ant.

(if i remove the package openCV_340_PACKAGE; line)

berak gravatar imageberak ( 2018-04-05 11:09:30 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-04-05 14:22:00 -0600

Marko5280 gravatar image

updated 2018-04-13 06:39:24 -0600

I am trying to use OpenCV on the LEGO EV3. If my PROJECT FILE includes the LEGO LeJOS library (LeJOS EV3 EV3 Runtime), there is a conflict with the OpenCV Native library, even if a script does not import the LeJOS Library.

import lejos.hardware.*;

Line 10 is

System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

and the associated error is:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java2411 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at openCV_341_PACKAGE.Smoothing_Images_Test_Case.main(Smoothing_Images_Test_Case.java:10)

My sample Java OpenCV script is valid. The problem is the conflict between the two libraries

EDIT 4/5/2018 ********************************************************************

I have contacted OpenCV at Github and get this response.

This is a configuration problem (different versions of OpenCV in single Java project). No chance to fix this in OpenCV (except whole library massive renaming including Java package names, C++ symbols, etc - won't fix).
Alexander Alekhin [email protected]

However, I am using OpenCV 3.4.1 exclusively and have deleted all prier versions. The results are the same. Perhaps it is not actually a conflict between OpenCV 3.4.1 and previas OpenCV versions but a conflict between OpenCV 3.4.1 and the LeJOS EV3 EV3 Runtime library.

Reference: (https: //mail.google.com/mail/u/0/#inbox/162976ede0335288)

https://mail.google.com/mail/u/0/#inb...

edit flag offensive delete link more

Comments

This thread was closed prematurely. The answer is farther down the chain of events.

Marko5280 gravatar imageMarko5280 ( 2018-04-13 06:40:09 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-04-05 10:53:29 -0600

Seen: 1,144 times

Last updated: Apr 27 '18