Ask Your Question

krips89's profile - activity

2019-05-23 04:55:43 -0500 received badge  Taxonomist
2019-03-12 11:37:05 -0500 received badge  Notable Question (source)
2017-12-09 04:30:45 -0500 received badge  Popular Question (source)
2017-09-22 13:55:01 -0500 received badge  Famous Question (source)
2016-08-10 08:36:36 -0500 received badge  Notable Question (source)
2016-04-07 06:35:29 -0500 received badge  Teacher (source)
2016-01-25 08:11:04 -0500 received badge  Popular Question (source)
2015-04-27 04:32:26 -0500 commented question OpenCV3.0 WINDOWS_NORMAL flag not working

With QT it is working fine. But with vtk not.

2015-04-26 14:48:16 -0500 asked a question Error on cv::cuda::DescriptorMatcher::knnMatch

While trying to use the knnMatch function cuda::DescriptorMatcher using the documentation provided here: I am getting the following error:

OpenCV Error: The function/feature is not implemented (getGpuMat is available only for cuda::GpuMat and cuda::HostMem) in getGpuMat, file /home/sarkar/opencv/opencv/modules/core/src/matrix.cpp, line 1419
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/sarkar/opencv/opencv/modules/core/src/matrix.cpp:1419: error: (-213) getGpuMat is available only for cuda::GpuMat and cuda::HostMem in function getGpuMat

Any idea what it means? I am using a very simple code like the following:

matcher_gpu_->knnMatch(descriptors_frame, descriptors_model, matches, 2);

Where descriptor_frame, descriptor_model are cv::Mat; and matches is vector of vector of DMatch.

2015-04-23 10:43:59 -0500 asked a question Why cv::cuda::DescriptorMatcher not a subclass of cv::DescriptorMatcher

They both provide the same interface. In my opinion cuda::DescriptorMatcher is a specialized implementation of DescriptorMatcher and so should have been a subclass of DescriptorMatcher. It makes sense to provide one base class providing all the matching interface.

Because of this people cannot use the advantage of dynamic polymerphysm (will have to use ifs to distinguish, care and call objects of different types).

A beautiful analogy would be the class cv::cuda::ORB which is a sublcass cv::ORB and hence cv::FeatureDetector which provides the common interface like detect() and compute()

2015-04-22 09:42:39 -0500 asked a question Python binding for opencv 3.0, cv2.so link issue

After recently updating the code of OpenCV 3.0 trunk, I got the following error while trying to import cv2 in python.

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python2.7/dist-packages/cv2.so: undefined symbol: _ZTIN2cv12_OutputArrayE

So cv2.so actually exist, but some other library it is dependent on (with the symbol _ZTIN2cv12_OutputArrayE) is missing! This happened just after I pulled the latest code; it was working with the earlier version of 3.0 trunk.

2015-04-22 04:42:16 -0500 commented question OpenCV3.0 WINDOWS_NORMAL flag not working

It was working before, but does not work after the latest pull yesterday. I'll try compiling everything with OPENGL and share the info.

2015-04-22 03:52:44 -0500 commented question OpenCV3.0 WINDOWS_NORMAL flag not working

Hi break, any updates or comments?

2015-04-21 09:52:08 -0500 commented question OpenCV3.0 WINDOWS_NORMAL flag not working

@break, Ubuntu 14.04. I am not sure what gui toolkit is. Do you mean the GUI framework highgui uses in the background? I am not sure what it uses (how can I know?). But the cmake cache shows WITH_VTK to be true. And WITH_QT and WITH_OPENGL false.

2015-04-21 09:03:25 -0500 asked a question OpenCV3.0 WINDOWS_NORMAL flag not working

Hi, I just pulled the latest code from the trunk and now I observe that all the windows formed by cv::namedwindow is not resizable and is huge (probably as big as the input image which is huge as well). Following is the simple code for the reference:

void viewImage(cv::Mat image, vector<cv::KeyPoint> keypoints)
{
  cv::Mat outimage = image;
  cv::drawKeypoints(image, keypoints, outimage, cv::DrawMatchesFlags::DRAW_RICH_KEYPOINTS);

  cv::namedWindow( "Keypoints", cv::WINDOW_NORMAL ); // Create a window for display.
  cv::imshow("Keypoints", outimage);
  cv::waitKey(0);
}

What is wrong?

2015-04-20 14:13:04 -0500 commented question ‘AlgorithmInfo’ does not name a type while building opencv_contrib

It makes so much of sense! I could build on latest opencv_contrib module. Thank you!

2015-04-20 08:33:51 -0500 asked a question ‘AlgorithmInfo’ does not name a type while building opencv_contrib

I am getting the following error while trying to build opencv with the contrib module

/opencv/opencv_contrib/modules/tracking/include/opencv2/tracking/tracker.hpp:577:11: error: ‘AlgorithmInfo’ does not name a type

The code is latest and pulled just now. After adding a forward declaration class AlgorithmInfo; to the file tracker.hpp that particular error is gone but I am getting other '‘AlgorithmInfo’ does not name a type' errors in other files. Probably AlgorithmInfo is not getting included somehow. Any ideas?

EDIT: After grepping AlgorithmInfo I found that there is no defination of AlgorithmInfo at all!

EDIT2: Comparing to the previous version of code I found AlgorithmInfo is defined at opencv2/core.hpp line 3006. But in the latest code, it is not present there at all!

2015-04-17 10:16:27 -0500 commented question Behavior of CommandLineParser::has()

ah, known issue again. Should be a simple fix; how much time does it take to fix that?

2015-04-17 07:43:20 -0500 asked a question Behavior of CommandLineParser::has()

I suppose CommandLineParser::has("something") should be true when the command line has --something in it? The following code shows some contradictory behavior.

cout << "yo " << parser.get<int>("cam_id") << endl;
cout << "ya " << parser.has("cam_id") << endl;

When run with the input --cam_id=22 gives the following output:

yo 22
ya 0

I was expecting it to be ya 1as well. How would I detect if the input has has a certain parameter.

2015-04-15 03:13:53 -0500 asked a question Non-planar camera calibration input

Why is it mandatory to provide an initial guess when calibrating from a non-planer rig? Does the initial guess affect the output result considerably? Why (such difference between planer and non-planar case)?

I am trying to calibrate a camera using some 3D->2D correspondences (need not be non-planar) I found in some way. But the results I am getting is really bad with very high reprojection error. Any one successfully used opencv to calibrate their camera using non-planar rig and using something other than their provided chessboard methods?

Thanks!

2015-04-02 10:10:06 -0500 received badge  Enthusiast
2015-03-30 12:31:51 -0500 asked a question input arguments of python's cv2.calibrateCamera

I get the following error when I try to calibrate camera using cv2.calibrateCamera:

rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(pts3d, pts2d, self.imgsize, None, None)
cv2.error: /home/sarkar/opencv/opencv/modules/calib3d/src/calibration.cpp:2976: error: (-210) objectPoints should contain vector of vectors of points of type Point3f in function collectCalibrationData

I initially had nx3 and nx2 array for pts3d and pts2d. I then tried to reshape pts3d and pts2d in the following form as the function takes vectors of vector point3d (and correspondingly pts2d) as input:

[1 x n x 3] and [1 x n x 2]

[k x n' x 3] and [k x n' x 3], where k is some random value

[1 x n x 1 x 3] and [1 x n x 1 x 2]

nothing works and it always gives the same error.

I saw the code sample code of cameraclibration provided which runs fine, and their input is of [k x n x 3]. I really don't know what is wrong with my implementation. Following is my code to be precise:

   #data contains [n x 5] dim array which is the hstacked arrays of pts3d and pts2d correspondences I obtained elsewhere. 
    pts3d = data[:, 0:3] #first 3 column 
    pts2d = data[:, 3:5] #next 2 column.. I checked the values are coming correctly 
    pts3d = pts3d.reshape(1,-1, 3) #Here, I have experimented by resizing with different values. 
    pts2d = pts2d.reshape(1,-1, 2)

    rms, camera_matrix, dist_coefs, rvecs, tvecs = cv2.calibrateCamera(pts3d, pts2d, self.imgsize, None, None)

the error happens at the time of the function call. It would be nice to know what can be wrong here.

2015-02-26 08:50:02 -0500 received badge  Supporter (source)
2015-02-16 18:15:47 -0500 received badge  Scholar (source)
2015-02-16 18:11:22 -0500 commented question Opencv 3.0 dev python documentation

@StevenPuttemans, I can definitely post all the inconsistencies I find, and I will; but I believe that updating documentation/tutorial should be a part of the coding process. I understand that OpenCV is community dependent; most of the opensource libraries are. But when you are migrating heavily used classes over different modules, changing its signatures, you got to at least look at the repercussion of the changes in the pipeline and update tutorial. When I was an active developer at the library PCL, our strategy was to update the corresponding documentation and tutorials for any change you do to an existing class. The same should be done for OpenCV as well.

2015-02-16 08:02:18 -0500 commented question Persisting data between Opencv-Python and Opencv-C++

@berak Ah, so its a GSoC idea. It actually should not take much time, isn't it?

2015-02-16 06:47:21 -0500 received badge  Self-Learner (source)
2015-02-16 04:55:04 -0500 received badge  Editor (source)
2015-02-16 04:44:33 -0500 received badge  Student (source)
2015-02-16 04:41:15 -0500 asked a question Persisting data between Opencv-Python and Opencv-C++

Hello, is there any simple interface which can be used for persisting data between Opencv-Python and Opencv-C++? That is I want to write some data (metrices) from Opencv-Python and read it later with Opencv-C++ (and vice versa).

One way is to convert numpy arrays to cv::Mat manually which in my opinion is ugly. Also, I did not get any simple solution for doing that in the latest opencv. All the available solution I found dates back to 3 years which uses modules like cv and functions like cv.fromarray which are not available in the latest version (?).

2015-02-16 04:35:59 -0500 asked a question Opencv 3.0 dev python documentation

Hi,

After using the python binding for Opencv 3, I found quite a lot of features have been changed. For example the new drawKeypoints function is:

drawKeypoints(image, keypoints, outImage[, color[, flags]]) -> outImage

see the extra mandatory outImage argument (which does not make any sense) ? These extra changes are not really documented in the Opencv 3 python documentation.

Other than that the documentation in general is highly inconstant (for example they still use cv2.SIFT() instead of cv2.xfeatures2d.SIFT_create() and similarly cv2.ORB instead of cv2.ORB_create(). I was wondering when will they update the documentation? And why did they not update the documentation with the code changes?

2015-02-16 04:21:11 -0500 commented question cannot import xfeatures2d in OpenCV 3- Python binding

Hi, I traced everything and found the issue. The python module was not getting compiled (and hence pointing to the old installation) as cmake could not find PYTHON_INCLUDE_DIR (for some unknown reason, I have no idea, cmake could find PYTHON_LIBRARY and the interpreter but not the include directory) which is the reason though opencv_contrib was getting build, cv2.so was not. By doing some hit and trial in cmake, I could get Opencv 3 working in python, although Opencv 3 has issues on a very different level! Hope it helps.

2015-02-15 08:20:09 -0500 asked a question cannot import xfeatures2d in OpenCV 3- Python binding

I am trying to access SIFT and SURF features from opencv 3 in python. As suggested by other people, I followed the installation of opencv_contrib. Some of the logs of the installation are:

[ 82%] Built target opencv_xfeatures2d
...
Installing: /usr/local/lib/libopencv_xfeatures2d.so
-- Set runtime path of "/usr/local/lib/libopencv_xfeatures2d.so.3.0.0" to "/usr/local/lib"
-- Installing: /usr/local/include/opencv2/xfeatures2d.hpp
-- Installing: /usr/local/include/opencv2/xfeatures2d/cuda.hpp
-- Installing: /usr/local/include/opencv2/xfeatures2d/nonfree.hpp

After that I import cv2 in python but could not import xfeatures2d.

>>> import cv2
>>> cv2.xfeatures2d.SIFT_create()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'xfeatures2d'

Also, cv2.__version__ gives '2.4.8'! How can I fix this?