Ask Your Question

VedMathai's profile - activity

2013-03-18 09:28:42 -0600 commented answer opencv cannot access my webcam

I did what you asked to do but it isn't accessing the camera still. It built fine but when running, it still showed a blank gray screen. I am using a lenevo thinkpad L420 and ubuntu 12.04

2013-01-22 09:50:39 -0600 commented question Camera is not working in OpenCV on Ubuntu 12.04 with version 2.3.1 or 2.4.2

Exactly the same problem I am facing- Cheese and Skype are able to recognize the camera but the sample code is not.

2013-01-22 08:52:00 -0600 received badge  Supporter (source)
2013-01-21 12:07:59 -0600 answered a question Error on building OpenCV-2.4.3 on ubuntu 12.04

I too have tried to build using what you have done, it didn't seem like it went anywhere, and I don't remember if by running cmake, as you did above, any good came of it. What I do now, though, is run cmake in individual folders on individual .cpp files as and when I need them. It is seems to be working well. But I have just started and don't know if the problem may amplify later. Any how I will describe what I do below.

Go the folder where the .cpp file is stored. Right click and open a new Document. Call it 'CMakeLists.txt'. It is very important that you call it precisely that. Open the document and paste this.

project( name_of_cpp )

find_package( OpenCV REQUIRED )

add_executable( name_of_cpp name_of_cpp )

target_link_libraries( name_of_cpp ${OpenCV_LIBS} )

Where you replace 'name_of_cpp ' with the name of your cpp file.

Next you open terminal and go the folder using cd. Once you are there type in 'cmake ." Note:there is a space between cmake and the '.' . After that type in 'make'. You should see an executable being formed. Some executables require you to parse it an image file from command line. If u have the image in the same folder then you can run the executable using

./name_of_file name_of_image.jpg

or else, you can pass the image using its relative position to the active folder by using /../../image.jpg I think it should lie somewhere in the parent folder for this to work. (correct me if wrong). and last way is to give the absolute address in relation to home.