Ask Your Question

desri's profile - activity

2020-05-17 00:04:50 -0600 received badge  Popular Question (source)
2017-04-20 13:41:32 -0600 received badge  Famous Question (source)
2016-09-20 03:16:55 -0600 received badge  Notable Question (source)
2016-06-14 04:08:27 -0600 received badge  Popular Question (source)
2016-03-10 22:01:56 -0600 received badge  Editor (source)
2016-03-10 22:01:03 -0600 asked a question question regarding the resize function of OpenCV

Does resize function of Opencv first filters the high spatial frequency before downsizing to prevent image-aliasing?

2016-02-05 14:30:25 -0600 asked a question Where can I find Horn-Schunk Optical Flow method in Opencv-3.0+

Hi,

I am using Opencv-3.1.0 on Ubuntu 14.04.3 LTS. I don't see where I can find Horn-Schunk Optical Flow Method. It seems Opencv-2.4.10-12 used to contain it. Any inputs would be very helpful

Regards

2015-09-28 12:14:44 -0600 asked a question cv2.CalcOpticalFlowBM() does not exist in Opencv-3.0.0

Hi,

I used to use cv2.CalcOpticalFlowBM() a long time back. Now I upgraded to Opencv-3.0.0 and could not find it. I went to an earlier version of Opencv 2.4.9, and I still could not find it. It seems this function is deprecated. is there a way to get Python bindings to that function?

2015-09-25 09:54:58 -0600 commented question the findTransformECC function in Opencv-3.0.0 returns a NaN as the ECC value

Hi,

Thanks for your interest. I share your same opinion that some kind of divide by zero is occurring. However, the occurrence of nan is not systematic. It occurs randomly between a pair of images but not consistently. I am calling the findTransformECC to correct video motion/shake. I am curious when we thread the findTransformECC, the function picks wrong images to compare than what I want to compare.

Unforturnately, I cannot share images with you, as I am working with a confidential material.

Thanks.

2015-09-24 21:26:55 -0600 asked a question the findTransformECC function in Opencv-3.0.0 returns a NaN as the ECC value

Hi,

I am using findTransformECC function (ecc.cpp) from Opencv-3.0.0 beta version. I have build the libraries with Intel's Integrated Performance Primitives (IPP) libraries. I am using this for image stabilization from a series of frames of a video. Occasionally, the ecc.cpp function returns a nan. It is surprising that when I see the code, there is no where a NaN is returned. I can only see an exception raised, but no where I see the function returns a NaN.

Could some please let me know if they have experienced this behavior before? Is the findTransformECC function thread safe? Are multiple threads manipulating data between them?

Thanks is advance.

2015-09-15 10:46:23 -0600 commented question pointPolygonTest

I was wondering if there is solution in the Opencv-Python bindings.

2015-09-15 10:13:02 -0600 asked a question pointPolygonTest

Hi,

I want to find the closest point on a contour to a given point in an image. I know cv2.pointPolygonTest gives the distance from a point to the closest contour edge. How to retrieve that point (coordinates) on the contour?

I am using Opencv-3.0.0 on Python 2.7.x, Ubuntu 14.04.2 LTS.

Your help is much appreciated.

2015-09-09 19:52:46 -0600 asked a question What is the best Opencv utility to compute and compensate for camera motions

Hi,

I am trying to compensate camera shakes/motion. I am therefore looking at Opencv utilities that can compute mainly translation shifts between a series of images with respect to a reference frame. I am currently using 'findTransformECC.' I am not so satisfied with it, as it is overly sensitive to the initial conditions of the parameters set. Also, if I use the estimated shifts between a frame and a reference frame as initial estimates for the next frame, I see an accumulation of errors in estimation.

Is there a better, robust method for estimating mainly translation shifts between two images? How about BFMatcher etc?

Your inputs are highly welcome.

2015-09-05 22:13:47 -0600 commented question A clarification with BFMatcher.knnMatch

I am sorry I did the following:

matches = bf.knnMatch(des1,des2, k=10);

2015-09-04 11:26:09 -0600 commented question A clarification with BFMatcher.knnMatch

I tried that and it still didn't work. It gave another error: cv2.error: /home/s0r2637/Downloads/opencv/modules/core/src/stat.cpp:3731: error: (-215) K == 1 && update == 0 && mask.empty() in function batchDistance

2015-09-03 10:35:09 -0600 asked a question A clarification with BFMatcher.knnMatch

Hi,

I am using Opencv-3.0.0 beta through Python 2.7.x , under Ubuntu 14.04 LTS. I am using the descriptor matching between two images through BFMatcher.knnMatch. I am doing the following commands:

orb = cv2.ORB_create(nfeatures=60);
kp1, des1 = orb.detectAndCompute(img1, None);
kp2, des2 = orb.detectAndCompute(img2, None);
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True);

Now when I issue the following command:

matches = bf.knnMatch(des1,des2); I get the following error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: only length-1 arrays can be converted to Python scalars

Can someone explain to me what does this mean? is it possible that ORB descriptors and keypoints are not compatible with knnMatch method?

Thanks

2015-08-26 17:39:52 -0600 commented question Peculiar observations with Opencv BackGroundSubtractorMOG2 module — Opencv-3.0.0, Python-2.7.X, Ubuntu-14.04

Hi, Thanks for your insight. While I agree that my take on the issue of initialization was a little harsh, I am not entirely wrong in my opinion. If it is hard for the algorithm to figure out the mask beginning from the first frame, then instead of setting all pixels equal to 255, it should, in fact, set the first mask pixels to be equal to zero. Don't you think that makes more sense?

2015-08-25 14:24:48 -0600 asked a question Peculiar observations with Opencv BackGroundSubtractorMOG2 module — Opencv-3.0.0, Python-2.7.X, Ubuntu-14.04

I am using the BackGroundSubtractionMOG2() from Opencv-3.0.0 inside Python-2.7.x. I am observing something peculiar. That is, when I create the BackGroundSubtraction object and apply it to the first frame of a video feed, the mask that I get has 255 (uint8) at all pixels. This implies that the algorithm thinks the entire image is moving. I find that nonsensical, if it is an initialization issue, then by default the mask should have 0 value at all pixels. Does anyone experience this issue.

Any help would be much appreciated.

2015-08-12 09:35:28 -0600 commented question How do I access Opencv-3.0.0's expectation maximization algorithm through Python

Yes, that's what I have. I only get a list of constants. Should clone Opencv-3.0.0 beta or alpha version for this? Thanks for your help in advance.

2015-08-12 09:21:58 -0600 commented question How do I access Opencv-3.0.0's expectation maximization algorithm through Python

cv2.ml.EM_create() doesn't exist in my Python API. Does that mean I need to download an updated source and reinstall all over again? Please confirm.

2015-08-12 09:06:36 -0600 asked a question How do I access Opencv-3.0.0's expectation maximization algorithm through Python

Hi,

I am using Opencv-3.0.0 through Python 2.7.x on Ubuntu 14.04 LTS. I wanted to use the expectation maximization algorithm of Opencv. In Opencv-2.4.x the expectation maximization algorithm used to be accessed as cv2.EM. However, that doesn't exist anymore. I looked into cv2.ml, but did not find the EM class there.

Could anyone please help me out in that? The transition from Opencv-2.4.x to Opencv-3.0.0 is pretty arcane to me.

2015-07-21 16:47:30 -0600 asked a question How to maintain two different Open cv versions in Python under two different namespaces

Hi,

I am interested in maintaining 2 different Open-cv versions 2.4.x and 3.0.0 under two different namespaces in Python-2.7.x. Is that even possible? If so, could someone please provide some hints?

2015-07-18 23:27:18 -0600 commented question There seems to be no Python API for the Open CV stitcher class

Thanks! If only Open-CV for Python documentation had mentioned about how to use the Stitcher class.

2015-07-18 22:08:32 -0600 asked a question There seems to be no Python API for the Open CV stitcher class

Hi,

I am using OpenCV-3.0.0 with Python 2.7x in Ubuntu 14.04 LTS. I can't find Python bindings for the OpenCV stitcher class. Could someone tell me how to generate those bindings? Btw, I built OpenCV-3.0.0 beta version and created the Python bindings.

2015-07-17 14:20:55 -0600 commented answer Problems with the video writer in OpenCV-3.0.0

Hi,

Thanks for your reply. I am working from Ubuntu 14.04, the "FFDShow MPEG-4 Video Decoder" seems to be an .EXE file. How do I obtain a Linux version for the decoder. Btw, the I use the slashes ("/"). correctly. When I put fourcc = -1, I get the following error: " cv2.error: /home/s0r2637/Downloads/opencv-3.0.0-beta/modules/videoio/src/cap_gstreamer.cpp:1304: error: (-210) Gstreamer Opencv backend does not support this codec. in function CvVideoWriter_GStreamer::open"

2015-07-17 09:11:08 -0600 asked a question Problems with the video writer in OpenCV-3.0.0

Hi,

I asked this question last week about the video writer in OpenCV-3.0.0 with Python 2.7 not working properly, but didn't get any answers. I am surprised nobody else is facing similar problems.

I am using Opencv-3.0.0 through Python 2.7. I am not able to create video from image arrays, using the cv2.VideoWriter(). The process of inserting and encoding image frames into the video stream does not yield any errors, but the resulting video is only 7 KB in size and when opening through VLC, I get the error that "could not demultiplex stream."

**The following are my commands:

fourcc = cv2.VideoWriter_fourcc('M','J','P','G') video_out = cv2.VideoWriter('Motion_correction.avi', fourcc, 60, (640, 480))**

When I use video_out.write(frame_array), nothing gets written in the buffer. I really need help in this regard. The documentation is not helpful at all.

2015-07-14 11:42:45 -0600 received badge  Enthusiast
2015-07-12 18:32:28 -0600 commented question Having problem is creating video from image arrays

No, actually it still doesn't work. The following are my commands: fourcc = cv2.VideoWriter_fourcc('M','J','P','G') video_out = cv2.VideoWriter('Motion_correction.avi', fourcc, 60, (640, 480))

Could you please let me know what is that I am doing wrong?

2015-07-10 17:26:42 -0600 asked a question Having problem is creating video from image arrays

Hi,

I am using Opencv-3.0.0 through Python 2.7. I am not able to create video from image arrays, using the cv2.VideoWriter(). The process of inserting and encoding image frames into the video stream does not yield any errors, but the resulting video is only 7 KB in size and when opening through VLC, I get the error that "could not demultiplex stream."

I appreciate any help in getting over this problem.

2015-07-10 16:38:30 -0600 commented question Problem in create a video output

I am facing the same problem. Did you find any answers?

2015-06-08 11:49:09 -0600 asked a question Used of BackgroundSubtractorMOG2::operator() in OpenCV-3.0.0

Hi,

I need a clarification about the use of BackgroundSubtractorMOG2::operator() in OpenCV-3.0.0. What is the data type of the input image that this operatorworks on? Is is 32F or UINT8? When I used BackgroundSubtractorMOG::operator(), it required the input image to be UINT8. In BackgroundSubtractorMOG2::operator(), I sent the input image as 32F and it didn't give me an error. However, I was wondering if inside the code, it truncates a 32F data into UINT8. This worries me, as it would reduce the resolution of the image inside.

Your help is appreciated.

2015-06-08 09:47:55 -0600 commented question Cannot find BackGroundSubtractorMOG2() in OpenCV 3.0.0 Beta in Python 2.x and 3.x

Thanks! I had already figured that out just a while back. As an aside, I wanted to know how can I modify the Python API to call createBackgroundSubtractorMOG2, so that I can modify all the attributes of this function. In the C++ code, I see the following attributes that can be changed:

a) history, b) varThreshold, c) detectShadows, and d) Backgroundratio

However, Python only gives access to changing the first three parameters. Could anybody please help me in controlling all those parameters?

2015-06-07 00:25:52 -0600 asked a question Cannot find BackGroundSubtractorMOG2() in OpenCV 3.0.0 Beta in Python 2.x and 3.x

Hi,

I used to work with OpenCV-2.4.11 in Python 2.7.6 in Ubuntu. I was heavily using the BackGroundSubtractorMOG2() function of the cv2 module. Recently, I upgraded to OpenCV 3.0.0 beta (built from source obtained through GitHub), and now I don't find the BackGroundSubtractorMOG2() function under the cv2 module.

Is the BackGroundSubtractorMOG2() function disabled in the OpenCV 3.0.0 version or are the Python bindings not available? I looked into the /modules/video/src and the C++ files bgfg_gaussmix2.cpp exists in the bundle. What could I be missing? Your help is highly appreciated.