HighGUI is missing from OpenCV 3.0.0 JAR

Migrating from OpenCV 2.x to 3.0.0 (Java) Highgui.imread(fileName, Highgui.CV_LOAD_IMAGE_GRAYSCALE) Highgui.imread(fileName) become resp: Imgcodecs.imread(fileName, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE) Imgcodecs.imread(fileName) Also, drawing functions such as: Core.circle(..), Core.line(..), etc.. Have been moved to: Imgproc.circle(..), Imgproc.line(..) Note Moments, HuMoments missing in 3.0.0. Will be fixed in 3.1 See bug

OpenCV / SURF How to generate a image hash / fingerprint / signature out of the descriptors?

The feature data you mention (position, laplacian, size, orientation, hessian) is insufficient for your purpose (these are actually the less relevant parts of the descriptor if you want to do matching). The data you want to look at are the “descriptors” (the 4th argument): void cvExtractSURF(const CvArr* image, const CvArr* mask, CvSeq** keypoints, CvSeq** descriptors, …

Read more

Install OpenCV in a Docker container

Fixed with a slightly different set-up FROM python:2.7 MAINTAINER Ewan Valentine <[email protected]> RUN mkdir -p /usr/src/app WORKDIR /usr/src/app # Various Python and C/build deps RUN apt-get update && apt-get install -y \ wget \ build-essential \ cmake \ git \ unzip \ pkg-config \ python-dev \ python-opencv \ libopencv-dev \ libav-tools \ libjpeg-dev \ libpng-dev \ …

Read more

Differences of using “const cv::Mat &”, “cv::Mat &”, “cv::Mat” or “const cv::Mat” as function parameters?

It’s all because OpenCV uses Automatic Memory Management. OpenCV handles all the memory automatically. First of all, std::vector, Mat, and other data structures used by the functions and methods have destructors that deallocate the underlying memory buffers when needed. This means that the destructors do not always deallocate the buffers as in case of Mat. …

Read more

Convert uchar Mat to float Mat in OpenCV?

If you meant c++ then you have #include<opencv2/opencv.hpp> using namespace cv; Mat img; img.create(2,2,CV_8UC1); Mat img2; img.convertTo(img2, CV_32FC1); // or CV_32F works (too) details in opencv2refman.pdf. UPDATE: CV_32FC1 is for 1-channel (C1, i.e. grey image) float valued (32F) pixels CV_8UC1 is for 1-channel (C1, i.e. grey image) unsigned char (8UC) valued ones. UPDATE 2: According …

Read more

OpenCV template matching and transparency

It doesn’t seem like OpenCV handles alpha the way you want it to. You have two options: Write your own cross-correlation method that will use the alpha channel Transform your images so your alpha channel becomes irrelevant Since the first option is straightforward, I will explore the second option here. I’m going to re-use the …

Read more