CVTools coordinate system

vade's picture

Just a question, what is the coordinate system the CV tools outputs ? It looks like its in the QC coordinate system, but, why?

Is there a way I can have the output of the Apply Haar Cascade to be in pixel space? The input is an image, and the coordinates represent data in the image? What is going on internally with Initial Scale and Scale Delta? Those controls and the coordinate system makes it really hard to get repetitive results for even the same lighting scenario.

It makes working with replacing, drawing or doing things to the image in image space really annoyingly complex.

Im curious whats going on internally. The cascade also seems to track less accurately (Ive tried a few trained models / xml files), and find it more finicky than Jitters OpenCV implementation.

Not bitching and moaning, just wondering what I can do to increase accuracy and ensure I am getting the right coordinates in pixel space.

Thanks for any info, and if i've missed a doc explaining the nuances, let me know.

gtoledo3's picture
Re: CVTools coordinate system

I think it's been in QC Coords because of the concept of taking the output structure and interfacing that with the iterator/structure renderers/other stuff that's in QC coordinates.

It's been awhile since I've looked, but I think initial scale and scale delta have to do with the size output parameters... so that an image can look bigger or smaller as the haar classifier data appears to be closer or further from the camera. Maybe it was that the initial scale controls how small it can get, and the delta controls the range of how much larger it can get. Conversely... it might have been that the initial scale is like a minimum threshold for the tracker, and the delta is what controlled the size range. I can't remember. (Maybe someone else will chime in!)

(Sorry, not trying to be counterproductive by conveying wish washy info... I just don't have it installed, am doing a bunch of updates, etc. I've used it a decent amount, and I think I'm on point about that stuff.)

I think there's some Apple Developer Example that used to show an iPod, where you twirl it in image space from mouse coords, that I've used for these kind of scenarios.

It would be seriously nice to see CVTools fleshed out more/and or source. Pixel space stuff makes sense for some scenarios, especially since it's 2D. If there were a few more objects available, some of the OpenNI skeletal tracking stuff could be replaced and/or nicely augmented.

Personally, I'd like to get ahold of the Hough Transform patch, so that I can use that to render cones/voronoi and get the medial transform more eloquently than I can now, or implement a few more of the filters. (Can't say I've asked smokris either, so I'm not whining.)

vade's picture
Re: CVTools coordinate system

What makes anything about QC coordinates more suited for being used in an iterator? The tracking info is coming from an image (as it almost always is in OpenCV). If you have two differently sized images, why should they output to anything but pixel coordinate space, as the QC coordinate space ?

I am aware that the scale inputs change the output coordinate system, but consider this; Take an input image, resize it. Send both to the two identically configured Haar Cascades. Two differently sized images output the same coordinates for the detected faces. That seems very very wrong, no?

gtoledo3's picture
Re: CVTools coordinate system

I didn't mean that QC coords are more suited for an iterator...if I wrote that, I mis-wrote.

I meant that I just remember the initial compositions all being based around the built in iSight (I think?) and plugging stuff into GL Tools structure renderers, and/or using the iterator to render stuff. I didn't mean to infer anything qualitative about the approach.

I think you're right on. I remember having a composition where I used hand tracking to cut out a square from an image, and doing it how I wanted to initially do it was probably overly difficult because of the reasons you're pointing out.

gtoledo3's picture
Re: CVTools coordinate system

Did you ever mess around with this more?

I've been working on a kind of algorithm that makes a voronoi pattern based on one of the CV processing techniques. I'm curious if you made any inroads or revelations.