I finally got OpenCV installed and running after many frustrating hours of hacking at terminal commands and tracking down libraries. Turns out it ended up being a lot simpler than I was making it, thanks to the PET package directory on the Puppy Official Site.

This is a HOW TO guide on how to get OpenCV up and running in Puppy:

First, we must install many prerequisites to even have the slighest chance at getting this thing to compile. Here are a list of all the packages that I installed before compiling. They can mostly all be downloaded from HERE

NOTE: It should be noted that before you start installing anything but the devx file, that you should verify that you have a recent version of gtk+-2.x (with the dev packages too). There should be some PETs in the same directory that the link above points to.

As noted by swindler, there may be an issue with the gtk+-2.18 PETs, but the gtk+-2.14 PETs work

The pets that are links are not in the folder mentioned above can be downloaded from the link when you click on them.

Now that the source has been compiled and installed, we must make some adjustments to the library path and pkg-config path in order for the libraries to be referenced from any source file on your file system.

With computer vision, you can do all kinds of image processing. To list a few:

- Face recognition
- People recognition
- Find a specific letter, shape, image, etc in a larger image or video
- Movement tracking
- Reconstruct a digital version of the real world

How is all of this useful? Well, for instance, I am currently doing research in the field of autonomous construction. We use computer vision to detect all the construction equipment and payloads in the environment. The computer that is doing the computer vision issues commands to the equipment to tell them where to move, how to move, as well as what operation to carry out (pick up a payload, drop a payload, wait for the crane to move a payload, etc).

Hope this gives you a little insight on computer vision and OpenCV. If you have any further questions, feel free to ask.

I am currently working on the video camera support on Puppy. I think the problem is in the V4L install. I'm not sure the exact problem, however.

As a sanity check when I was tracking down the dependencies, I did the same proceedures on my Ubuntu machine. Using apt makes tracking down libraries much simpler . On my Ubuntu install, I do indeed have camera support, and I did not include any of the gstreamer stuff. Actually, the OpenCV guides never mention the need for gstreamer as a needed pre-req, just all the ffmpeg libraries.

I was originally going to include the gstreamer stuff, but was getting lots of problems from doing so. After the Ubuntu success without them, I just neglected to care about the gstreamer libraries.

If you do wish to compile with gstreamer, you will need to track down and install at least the following libraries:

The only problem in finding those that I had was the dev package. I don't remember seeing the source code on the gstreamer site. This happens to be the package that has the gstreamer-app and gstreamer-video libraries. Without these, cmake will always configure gstreamer as off. I did find the dev package in Ubuntu once before, using apt I beleive...

Looking back over the differences between my Ubuntu install and my Puppy install, it seems that the main difference between the cmake outputs is on the v4l/v4l2 list item.

On Ubuntu I get: V4L/V4L2: 1/1
On Puppy I get: V4L/V4L2: /

This seems to support my theory in that the V4L stuff wasn't done correctly. Maybe the cmake didn't actually find the v4l library...I may try to download the source and compile it myself to see if there is a difference or if something missing...It is possible that both libraries may be needed as well (V4L and V4L2).

I have attached a screen shot from my Ubuntu install showing a working camera program, as well as the cmake output from Ubuntu.

I will be working on the camera stuff off and on throughout the day, so I will make note of any progress or problems to this forum page. If you get anything going or have any ideas, please let me know so I can add it.

I believe the problem is indeed related to V4L/videodev/camera drivers, where:

V4L: video for linux libraries
videodev: video development library module
drivers: I have been trying to use the uvc drivers

What I have found is that I can get a videofeed when I run ucview. However, when I try to use xawtv or other programs/methods (including OpenCV), there is a failure to grab images from the camera.

The errors are all IOCTL errors.

I am pretty sure that the OpenCV library isn't opening the video feed because of the same IOCTL errors. The curious part is that when Cmale runs to configure the install, it does not detect the videodev.h/videodev2.h, even though they are present at the directory where Cmake is looking. My guess is that there are some hidden dependencies that OpenCV needs in addition to just the library.

I am looking more into this now.

Btw, I have added a couple more libraries, and it is recognizing that I have V4L, but not V4L2. The camera I have might be a V4L2 device, which could be the real issue. I am going to be looking for every possible library that deals with the V4L and install them and see where I get. I will make PETs of each of these libraries so that it will be easier to replicate later.

So, I was looking in the cmake output and noticed that there were the lines:
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - not found

When in my Ubuntu Install, they were found...hints why I was wondering about the videodev stuff in the first place.

I tracked went to the appropriate directory, and there they were...seems odd that they exist in the correct directory, ucview uses them, cmake reported them missing, and opencv had no video support...certainly odd. But, the videodev libraries do exist, so I figured, let's get hacking.

After running cmake with the appropriate switches, there is a CMakeCache.txt file that is generated. This file has all the switches for what cmake found and didn't find, which is then used in the make/make install process. I went to the lines regarding the videodev files and modified them as shown below:

This basically tells the install scripts that those really do exist and to go ahead and to build the support.

After I installed, I built the samples that use a video camera, and they worked!!!!

I did, however, install a few libraries in the process, so I will add those as optional/unknown dependency in the tutorial (first post). I don't really think that any of them made a difference, so it would be nice if someone could verify. I will also add the CMakeCache hack into the tutorial as well.

Enjoy, and here is a screen shot of opencv's motion tracking sample working in puppy. (screen shot from same program as the Ubuntu post)

after much monkeying around, (copying libs, trying various pets, etc.), I think I almost had it working but something made puppy freeze up on me. So I'm starting over with a fresh frugal install of 431, gonna flesh out this howto.

using all the pets above, with the CMakeCache.txt edits, 'make' stops at:

Posted: Fri 26 Nov 2010, 03:06 Post subject:
Not able to use cross compiled OpenCV with all webcam device

Hi,

I cross compiled the OpenCV library with arm-linux-gnueabi. and its working fine with microsoft webcam. But its giving error with T-Link webcam.
Error is "HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV Unable to stop the stream.: Bad file descriptor"

What can be the reson? Or i did some mistake while cross compiling the lib and need to do some changes in CMakeCache.cmake file?and how to rectify it?

I disabled the ffmpeg as i need to capture the image only not the videos.
//Include FFMPEG support
WITH_FFMPEG:BOOL=OFF

astha.aggarwal...which version of Puppy are you using? If you are not using Puppy, then I will still try to answer your question, even though this forum is specifically for Puppy Linux users...

I personally have not seen the error you are getting, but it seems to be some incompatibility with the V4L2 drivers and that specific camera. Do you know what drivers the camera that does not work uses on Linux systems? The Microsoft cams use the UVC drivers, which I know work with OpenCV and Linux. Also, does that camera work with other applications like ucview, mplayer, any vlc application, skype, etc?

I do not think it is the OpenCV install since it worked with the one camera.[/quote]

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum