Ask Your Question

GDAL driver and OpenCV

asked 2017-09-30 06:56:40 -0500

procton gravatar image

How I can set/enable GDAL driver support into OpenCV ? It seems a compile time setting, but I cannot find any source of documentation regarding this point.

edit retag flag offensive close merge delete


what is your OS and compiler?

sturkmen gravatar imagesturkmen ( 2017-09-30 07:46:13 -0500 )edit

I have Win 8.1 64bit. I am open to any compiler. Overall I use OpenCv 3.2 Java.

procton gravatar imageprocton ( 2017-09-30 08:01:04 -0500 )edit

did you compile OpenCV from source before?

sturkmen gravatar imagesturkmen ( 2017-09-30 08:05:32 -0500 )edit

I never compiled before. I just downloaded packages with Maven in my Java project and configured OpenCv DLL in my environment

procton gravatar imageprocton ( 2017-09-30 08:16:56 -0500 )edit

I am also wondering if there is a release/version already compiled with GDAL.

procton gravatar imageprocton ( 2017-09-30 12:18:34 -0500 )edit

i have just compiled OpenCV 3.3 with GDAL support. if you want to compile i can help you.

sturkmen gravatar imagesturkmen ( 2017-09-30 13:36:22 -0500 )edit

thank you, I will appreciate. If you have some instruction or if you could share your compiled open cv, it would be great.

procton gravatar imageprocton ( 2017-09-30 19:04:00 -0500 )edit

you can find my opencv_imgcodecs330.dll uploded here try to rename it opencv_imgcodecs320.dll and replace yours (backup yours first) i guess it may work (if you have opencv_imgcodecs320.dll already). otherways we will look another way.

sturkmen gravatar imagesturkmen ( 2017-09-30 22:43:13 -0500 )edit

Thank you, I just downloaded your dll. Later I will try, even if dll dimensions seem very different between mine (about 24 mb) and your dll. I will let you know asap.

procton gravatar imageprocton ( 2017-10-01 02:55:30 -0500 )edit

Or may be such dll has to be added to my opencv_java320.dll ?

procton gravatar imageprocton ( 2017-10-01 02:58:42 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-11-10 13:29:52 -0500

procton gravatar image

updated 2017-11-10 14:18:09 -0500

test java code for StructuredEdgeDetection

Mat image = Imgcodecs.imread("my_image_path", Imgcodecs.IMREAD_LOAD_GDAL | Imgcodecs.IMREAD_COLOR);
StructuredEdgeDetection p = Ximgproc.createStructuredEdgeDetection("model/model.yml.gz");
Mat fsrc = new Mat();
image.convertTo(fsrc, CvType.CV_32F, 1.0 / 255.0);
Mat edges = new Mat(fsrc.size(), fsrc.type());
p.detectEdges(fsrc, edges);
Core.multiply(edges, new Scalar(255), fsrc);
Imgcodecs.imwrite("my_path" + "edges.png", fsrc);
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-30 06:56:40 -0500

Seen: 259 times

Last updated: Nov 10 '17