2017-03-14 04:24:38 -0600 | commented question | image.data won't load Have you tied using a hardcoded static path to your image? What's your input for argv? |
2017-03-13 08:13:15 -0600 | asked a question | Multiple calls to cv::ogl::Texture2D.copyFrom() results in cv::Exception (-219) I am rendering two views per frame on an HMD and it's kind of complicated right now because I use OpenCV to load images and process intermediary results and the rest is OpenGL, but I still want it to work. I am using OpenCV 3.1 and any help would be greatly appreciated, even if you have just some advice. Application details: Per view (left and right eye) I take four images as cv::Mat and copy them into four cv::ogl::Texture2D objects. Then I bind these textures to active OpenGL textures to configure my shader and draw to a framebuffer. I read the pixels of the frame buffer again (glReadPixels()) as a cv::Mat and do some postprocessing. This cv::Mat ("synthView") is getting copied to another cv::ogl::Texture2D which is rendered on a 2D screenspace quad for the view. Here's some console output I logged for each call to the cv::ogl::Texture2D objects. No actual code! The code was working when I catched the exceptions and used the Oculus DK2 instead of the CV1. As you can see, I can run through one rendered view, but trying to render the second view will throw an exception in the copyFrom method at gl::Buffer::unbind(ogl::Buffer::PIXEL_UNPACK_BUFFER). The exception occurs after all ogl::Texture2D objects have been used once and the first one gets "reused", which means that it will not call ogl::Texture2D::create(...) in the copyFrom() function! Details of the cv::Exception: Call stack details: gets called from my calls, which invokes In that, there is an OpenGL call to with a direct call to CV_CheckGlError(); afterwards, which throws the cv::exception. HAVE_OPENGL is apparently not defined in my code. The GL error is a GL_INVALID_OPERATION. According to the specification of glBindBuffer: (more) |
2016-11-29 03:22:22 -0600 | received badge | ● Editor (source) |
2016-11-29 02:14:09 -0600 | asked a question | cv::Mat to DirectX11 Texture (OpenCV 3.1.0) Let's say I'm trying to display my webcam image in a game in DirectX11. I am using the prebuilt 3.1.0 libraries and I seem to be having difficulties with OpenCL while converting a Mat to a DirectX texture. I am using VS2013 Update 5 under Win10 and I am building a x64 windows application. The machine uses 2 x Nvidia Geforce GTX1080. initializeContextFromD3D11Device is troubling me. Even all the samples are not working for me because of this line, but the OpenGL one does. Here's the config log: http://pastebin.com/8i34sSRM Update Edit 2: After reinstalling my graphics drivers and CUDA 7.5, haveOpenCL() returns 1 suddenly. Also, I don't jump to the code anymore when I get a cv::Exception(). What's up with that? OLD! (EDIT1: Added cv::ocl::Context code and new exception (-222).) EDIT2: Problem shifted to the cv::ocl::Context initialization after updating drivers. EDIT3: Tried out the official DirectX11 sample code (EXAMPLE_DIRECTX d3d11_interop) and I get the same exception at the same place. EDIT4:
|
2016-09-01 02:06:46 -0600 | received badge | ● Enthusiast |
2016-08-24 01:08:22 -0600 | received badge | ● Scholar (source) |
2016-08-23 02:48:12 -0600 | commented answer | Which cameras do you recommend for stereo with a larger baseline in OpenCV? Basically I want to make a see-through AR application. Imagine three cameras (A,B,C) mounted outside to a wall ("#") with windows ("__"): A#__#B#__#C The distance between the cameras is 1 m, so I cannot make it smaller. In the wall part, I want to render the outside from my virtual viewpoint. Hm, I think a depth range starting at 0.5 m seems good. A large baseline makes my stereo very far-sighted, right? With z=(f*b)/d, assuming a 50 mm focal length and a baseline of 1 m, we get for a disparity of 0.1 m (or is it pixels?) a depth of 0.5 m. |
2016-08-22 02:34:31 -0600 | commented answer | Which cameras do you recommend for stereo with a larger baseline in OpenCV? Thank you for your great reply. My final goal baseline is 1 m (depends on some other structure), which is huge, I think. Also, I think it's not possible right now to have that high FPS even with GPU algorithms at the moment. All your points are valid and I will keep them in mind, so thanks again! I think I will start with some good webcams and fix them to a rig. |
2016-08-22 02:21:04 -0600 | received badge | ● Supporter (source) |
2016-08-19 17:07:01 -0600 | received badge | ● Student (source) |
2016-08-19 04:58:35 -0600 | asked a question | Which cameras do you recommend for stereo with a larger baseline in OpenCV? I want to have a pair of cameras for a stereo research project (disparity maps etc.) with OpenCV from live feed video. I am thinking of some modern USB HD webcams, but I am not entirely sure because of codec or other issues with OpenCV. I also want to have a larger baseline compared to stereo cams, so I need to have two separate cameras instead of a stereo camera. The optimal case would be a simultaneous lag-free full HD video capture of both cameras in OpenCV with high FPS and a way to fix the cameras in place. 1) Which issues could present themselves with OpenCV? What should I pay attention to when I buy? 2) What kind of cameras do you recommend? Do you have a specific camera in mind? |