I just got started with of and want to do poin tracking. (It seems like a daunting task…)
I’m trying to use the opencv library available through ofxOpencv. The question I have is, to what extent does that limit the opencv library. I find some of the opencv functions are not supported. I am wondering if I should use the actual opencv library, or if the ofxOpenCv already has all the functions, and I just can’t figure out how to call them?
ofxOpencv includes “cv.h” this should give you access to anything opencv.
To be more precise it is included in ofxCvConstants.h
wouldn’t it be enought to call the addons with
or do I need to add cv.h separately?
I can’t find things like
I’m just trying to get the camshiftdemo from opencv to work in of for now.
ok, that was just sillyness
turns out it is there, I just didn’t get the code completion on it in codeblocks.
but since I got your attention I was wonderinmg if you could tell me what the best way to go is in terms of feature tracking. I’m geting all googled out, and keep hopping between different attempts. Is there any simple algorythm that I could undestand without any need to get into complex calculus?
I decided to redo the camshiftdemo (and stick to it - kind of) to get the basics, but I’m not sure it will do what I want it to yet. is there any other resources you know of could suggest?
Opencv is compiled as a library in any flavor of the 3 main operating systems. You are welcomed to use is separate from open frameworks. oF just make it easier to use the IplImage type to do many things with minimal effort. And if I understood you questions right:
- No ofxVectorMath has nothing to do with OpenCv. Look at the code.
- Yes you can use ofxVectorMath and OpenCv calls together.
- Yes you do need to include the specific header file from OpenCv if you wish to use it in you project, cv.h being the main one.
The main OpenCv wiki has been down for a few weeks but it is normally here
Have fun and post if you run into troubles.
 you beat me to my post
I’m turning out for the night but you might want to start with cvGoodFeaturesToTrack along with cvFindCornerSubPix and see if that is what you need.
uhhuh… I didn’t know about that, I’ll have a look thanks
also I meant to cut and past
and grabbed the wrong line
again … this is why it takes me 3x longer to code anything …
Also along with those 2 you should also add cvCalcOpticalFlowLK to the mix.
 What you might want to do is start by sending points you waant to track to goodpointstotrack then send those output points from that to findcornersubpix along with the original point coordinates you specified to track. This should refine the track points a bit more. finally do an opticalflowlk to give you the final good tracking points.
openFrameworks includes almost all the library - just not highGui which is for camera access / windowing.
Also this might be useful - a nice online openCV API - it was one of the few places I could find descriptions of cvAux functions
the hardest thing for me sofar, in terms of opencv, has been the lack of documentation.
(obviously due to the intel site)
If you download the Windows installer or the Linux package (from sourceforge) you get all the docs as well.
This is what I was referring to more or less
here is a video I found on youtube of the code doing its thing
There is an OF version of that here:
As part of a few computer Vision techniques I showed towards the end of my Flash on the Beach presentation a few days ago, it’s not very OF’ified yet though, it uses OpenCV types mostly, so I was hoping to get some time to sort that out before putting them out there (again).
There are Visual Studio 2005 and Xcode projects in there.
Nice! It’s more OF’ified than the code I just posted above yours. Thanks great resource. I know the ofxOpenCv is trying to keep it simple but I think this kind of stuff should be formatted as an addon along with the haar stuff and the opticalflow stuff and should be name ofxOpenCvAdvanced or something similar.
thanks for all the replies…
I’ve been playing around with the source, and most of the time has been battling with the compiler and linkages. but I finaly got some code to work, and I’m quite aexcited about it
I get this error with the face tracking example, and I don’t know enough about haar to know what to do
okay… I think I need to know more about the theory behind this.
the cvFindTrackPointExample from JGL is quite helpful, and it does the
cvGoodFeaturesToTrack and cvFindCornerSubPix without the optical flow
though I can see how oflow would be helpful in determining how reliable the tracked points are, I find it strange that most examples rely on the optical flow.
oFlow seems a bit crude or inprecise for my liking and with unreliable light or self calibrating cameras (which most are) the flow seems to be off quite often, as its picking up changes in luminosity as movement.
Masking the frames with a previous frame helps a lot though.
I was wondering if anyone though of running a high pass filter on the image before doing the optical flow or tracking.
to be honest, I haven’t thought out completely how exactly this would be beneficial but I think it could exclude areas that have no detectable corners and strengthen areas that do.
I’ll see if I can run a test on this …
I think the error above might be that it is not getting passed the XML file it needs, just a guess thoguh.