Hough Circles in OpenCV3.0 vs OpenCV 2.3.1 - c++

I have an input image with 4 circles and I want to use HoughCircles function in OpenCV to identify the circles. I'm using C++ version of OpenCV on a Windows x64 machine. Below is the pseudo-code that I used for circle detection:
Read input image
Convert it from RGB to Gray scale
Gaussian blur
HoughCircles
I tried the above pseudo-code in OpenCV 2.3.1 and OpenCV 3.0. Even though I used the same parameters for Gaussian blur and HoughCircles, OpenCV version2.3.1 identified only 3 circles while version3.0 correctly identified 4 circles. I understand from the changelog that version 3.0 has a new algorithm for HoughCircles but I don't know enough about the method to understand what has changed.
Is the behavior am seeing an expected one? Is HoughCircle detection in OpenCV2.3.1 inferior to that of OpenCV3.0?

Related

Problem stiching images from a drone with OpenCV due to a poor quality of the images

I am working with OpenCV and a quad ArDrone Parrot 2.0.
I'm capturing the images from the bottom camera of the quad and I wish to stitch them in order to get a larger image. I'm trying to detect the squares marked in the images.
I tried to perform keypoint detection with ORB, SIFT, SURF and BRISK and changing their parameters to different values and there weren't good results from that.
I am unsure about the quality of the images, so maybe a preprocessing would help?
IMAGES:
1 2 3 4 5

Warping : Opencv for image display to curved screen with visual studio

I'm trying to use opencv APIs to warp image so that to dispaly it to a curved screen.
I have gone through the warping apis provided in opencv here.
But all APIS require the camera calibration matrix(K) and the rotation matrix(R).
But my images does not depend on a camera as im not correcting any distortion.
So can someone help me how achieve this kind of warping so that image can be better displayed on a curved screen.
I am using visual studio with opencv library in C++.
My input image will be like this
and output needs to like this
And i have to use opencv apis.
The above shape I have achieved through the code from here
Please give some suggestions.....

Unexpected camera calibration results with OpenCV over JPEG images and EXIF orientation

I am exploiting OpenCV to calibrate a set of images. I am using the standard function cv::calibrateCamera offered by OpenCV, nothing special here. The images are in JPEG format, and the EXIF Orientation flag is set (and it can be != 1).
I have noticed that if the images are not all top-left oriented (Orientation == 1) the calibration result is wrong, usually resulting in a very high RMS error. On the contrary, if I manually correct the orientation (using mogrify or exiftool, for instance), the result is as expected.
Have you ever encountered this kind of behavior? Can you please explain me why this is happening?
As a side note, I am using OpenCV 3.1 on a Mac OSX El Capitan, installed via Homebrew. Code is in C++.
are you using imread or cvLoadImage? imread for opencv 3.1 seems to handle exif correctly, but cvLoadImage not. See the following opencv bug https://github.com/opencv/opencv/issues/6673

Isn't there a OpenCV Cuda function similar to findContours?

There are several OpenCV CPU functions which have a direct CUDA counterpart like cv::cvtColor & cv::cuda::cvtColor.
But I found no direct or indirect (GPU) Cuda counterpart for cv::findContours CPU.
Isn't there a OpenCV Cuda function similar to findContours? Or does findContours work on both cv::Mat and cv::cuda::GpuMat?
Unfortunately, not. Not even in the latest OpenCV 3.2.0 version. But they have this update, as shown here: https://github.com/opencv/opencv/wiki/ChangeLog
findContours can now find contours on a 32-bit integer image of labels (not only on a black-and-white 8-bit image). This is a step towards more convenient connected component analysis.
No. OpenCV 4.6.0 does not have it.
Nobody has dared to implement this with CUDA for years.

Comparing two face opencv

I am new in opencv. I am trying to make a program which capture video from webcam and show the face on the video is exist in the directory or not. I already complete face detect from webcam. Now i jast need to compare the similarity of detected face with the directory image face. Please help me some one...
I am using
C++
MSVC 2010
OpenCV 2.1
You can use OpenCV's face detection methods. They have a very good tutorial in their website.
http://opencv.willowgarage.com/wiki/FaceDetection/
You can see to libface. It can detect and recognise faces.