Ask Your Question

jakir's profile - activity

2017-12-31 17:36:33 -0600 received badge  Student (source)
2016-11-27 15:06:29 -0600 asked a question OpenCL with ClAmdBlas/ClAmdFft

Hi,

I am trying to build opencv head with opencl support including CLAMDBLAS/CLAMDFFT support. Where do I locate these libraries and which versions are required?

I found a note on the AMD website about the libraries being open sourced - I assume these are the ones

https://github.com/clMathLibraries/clFFT

https://github.com/clMathLibraries/cl...

The opencv build/install is happy and it seems to work (include files are found), but during runtime both cv::ocl::haveAmdBlas and cv::ocl::haveAmdFft returns false. I noticed a mismatch in the expected dll names also (clAmdFft.Runtime.dll vs clFFT.dll). Is this supposed to work?

I am evaluating cuda and opencl for dft (among other things). For DFT on 25 Mpix images Cuda gives me a speedup about 6x, OCL (without blas/fft libs) gives me a slowdown about 0.8x compared to CPU.

-- Best regards, Jakob

2016-11-02 17:11:06 -0600 asked a question Optimizing split/merge for clahe

Hi,

I am trying to squeeze the last ms from a tracking loop. One of the time consuminig parts is doing adaptive contrast enhancement (clahe), which is a necessary part. The results are great, but I am wondering whether I could avoid some copying/splitting/merge or apply other optimizations.

Basically I do the following in tight loop:

cv::cvtColor(rgb, hsv, cv::COLOR_BGR2HSV);
std::vector<cv::Mat> hsvChannels;
cv::split(hsv, hsvChannels);
m_clahe->apply(hsvChannels[2], hsvChannels[2]); /* m_clahe constructed outside loop */
cv::merge(hsvChannels, hsvOut);
cv::cvtColor(hsvOut, rgbOut, cv::COLOR_HSV2BGR);

On the test machine, the above snippet takes about 8ms (on 1Mpix images), The actual clahe part takes only 1-2 ms.

2016-02-22 08:01:04 -0600 asked a question Handling unknown scale in structure from motion initialization

I am trying to establish a structure from motion pipeline, and am struggling a bit regarding the initialization/bootstrapping of such a system, more specifically how to handle ambiguous scale differences between image pairs.

My goal is to generate input information for e.g. cvsba (http://www.uco.es/investiga/grupos/av...), for further refinement. Required input is the following:

  • Initial intrinsic/extrinsic calibrations for all cameras.
  • Image positions and corresponding initial 3D locations.

For simplicity say I have 3 overlapping images of an object. I know the intrinsic calibration (roughly). Image #1 overlaps Image #2, Image #2 overlaps Image #3. Camera undergoes general motion.

To initialize the system, I have done the following:

  1. Find (sparse) correspondences between #1 and #2 using keypoint matching.
  2. Compute essential matrix between #1 and #2 (using findEssentialMatrix(...)).
  3. Recover extrinsic calibration of camera 2 (assuming camera 1 is at origo using recoverPose(...) ).
  4. Triangulate all the correspondences using projective matrices of camera #1 and camera #2 (using triangulatePoints(...)

Then I repeat the procedure for the correspondences between #2 and #3. The problem is step 3 as the extrinsic camera translation is only recovered up-to an unknown scale, meaning that the triangulated points from step 4 are not comparable to the 3D points i triangulated in the first iteration. It seems I need to apply a scaling somewhere, but am unsure how approach this.

2016-02-22 03:57:31 -0600 commented question Unwarp images of planar object

Thanks - the house facade is just an example. For this specific example I think I would need to know the aspect ratio of the (physical) window rectangle for it to work.

2016-02-22 03:35:06 -0600 received badge  Editor (source)
2016-02-22 03:18:53 -0600 asked a question Unwarp images of planar object

I have two images viewing the same planar object. I can compute a homography (findHomography) or the fundamental matrix (findFundamentalMatrix). I can warp one image to the other or vice versa (using the inverse homography). This all works fine.

What I want to do is to rectify each image (not warp one to the other), based on the given information. For example like the house facade here:

""

Source http://users.cecs.anu.edu.au/~hartley... , page 6

The problem is that I don't have any information about point positions on the plane - only a lot of correspondences between two images of an object known to be planar. Can this be done from just the homography between the two images?