Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
cvblob-python cvUpdateTracks wrapper
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Neil  
View profile  
 More options Jun 9 2011, 1:39 pm
From: Neil <neilcgh...@gmail.com>
Date: Thu, 9 Jun 2011 10:39:34 -0700 (PDT)
Local: Thurs, Jun 9 2011 1:39 pm
Subject: cvblob-python cvUpdateTracks wrapper
Hi Nate

I have just installed cvblob-python, and have good results using it to
analyse weather patterns.

However, don't seem to be able to use the cvblob.UpdateTracks

Have run the tests in cvblob so pretty sure that is installed
correctly.

Should it work or is it not complete?

I have browsed through the source and seems to me I am passing it
correct objects, but get some error regards boost not knowing how to
deal with some type.

Thought I would just check here first.

Many thanks,
Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Oostendorp  
View profile  
 More options Jun 9 2011, 2:24 pm
From: Nathan Oostendorp <n...@oostendorp.net>
Date: Thu, 9 Jun 2011 14:24:48 -0400
Local: Thurs, Jun 9 2011 2:24 pm
Subject: Re: [cvblob] cvblob-python cvUpdateTracks wrapper

Hey Neil,

You're right -- it is not complete -- but UpdateTracks is in there, and it
*looks* sane.

The project I am working on, SimpleCV (http://simplecv.sf.net) doesn't use
the tracking -- but if you can give me some code to test it I can figure out
what's up and get it working.

You can also check out the SWIG python interfaces in the swig branch -- they
are feature complete.
http://code.google.com/p/cvblob/source/browse/#svn%2Fbranches%2F0.10....

--n


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil  
View profile  
 More options Jun 10 2011, 7:02 am
From: Neil <neilcgh...@gmail.com>
Date: Fri, 10 Jun 2011 04:02:18 -0700 (PDT)
Local: Fri, Jun 10 2011 7:02 am
Subject: Re: cvblob-python cvUpdateTracks wrapper
Thanks, Nate

I have succesfully installed the swig version now. However it appears
there isn't a wrapper for CvTracks only CvTrack and as such
UpdateTracks doesn't appear to work here either

Cristóbal; any thoughts Chris

Many thanks
Neil

On Jun 9, 8:24 pm, Nathan Oostendorp <n...@oostendorp.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Hart  
View profile  
 More options Jun 10 2011, 3:11 pm
From: Neil Hart <neilcgh...@gmail.com>
Date: Fri, 10 Jun 2011 21:11:26 +0200
Local: Fri, Jun 10 2011 3:11 pm
Subject: Re: [cvblob] cvblob-python cvUpdateTracks wrapper

Hey Nate

Blobs are really coming out nicely, so good work on your wrapper of
Christobal's great code.

Found the issue that was causing main problem BUT appear to get a glibc
error related to invalid pointer.

I have attached a test script basically copied from the test_tracking.cpp
script. Please find attached.

1-UpdateTracks does throw an error

2-checking type of blobs before and after
cvb.UpdateTracks(blobs, tracks, 5., 10, 0)
shows type of blobs changes to tracks

3- Fix I think: _cvblob.C in line 283 change

b[i->first]
to
t[i->first]

Seems to work now, type doesn't change, blobs stay blobs, tracks get
assigned values.

Now a get a glibc error though.

Haven't figure out that bug yet though.

Do you have any ideas? do you think it could be related to your FilterByArea
wrapper which you mention may cause sloppy memory management.

Anyway, hopefully get it sort and can contribute the test script to a
test_tracking.py for your cvblob-contribution.

Cheers Neil

On 9 June 2011 20:24, Nathan Oostendorp <n...@oostendorp.net> wrote:

--
Neil C.G. Hart
PhD Student
Dept. of Oceanography
University of Cape Town
Tel: +27 21 6505316

  test_UpdateTracking.py
2K Download

  EnterExitCrossingPaths2front_blobs.mpeg
772K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Oostendorp  
View profile  
 More options Jun 11 2011, 12:12 am
From: Nathan Oostendorp <n...@oostendorp.net>
Date: Sat, 11 Jun 2011 00:12:15 -0400
Local: Sat, Jun 11 2011 12:12 am
Subject: Re: [cvblob] cvblob-python cvUpdateTracks wrapper

Hi Neil,

Good eye -- that should have been t[i->first] since it was trying to modify
the tracks dict, not the blobs dict.

Unfortunately, I "dict" with it for about an hour this evening and was not
able to get past the glibc error you mentioned -- even explicitly copying
Track objects when reconstructing the dict gives the same error:

*** glibc detected *** python: free(): invalid pointer: 0x0000000001899ef0
***

I get it consistently on frame 205.  The wrapping is pretty simple (dict of
python objects, extracted to a CvTracks map, then back to a dict of Track
objects) -- but somewhere in there a referenced track must be getting
destroyed that python wants to free.

I've added your test to the wrapper and applied your patch.  At this point,
my suggestion would be to try and nail down where exactly that corruption
occurs -- it's a bit of a "if anything would break, it would be there" since
the dict gets passed into the function and modified as part of the main
loop.

--n


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Neil Hart  
View profile  
 More options Jun 11 2011, 11:49 am
From: Neil Hart <neilcgh...@gmail.com>
Date: Sat, 11 Jun 2011 17:49:34 +0200
Local: Sat, Jun 11 2011 11:49 am
Subject: Re: [cvblob] cvblob-python cvUpdateTracks wrapper

Hi Nate

Sadly don't have the know how to work getting the wrap fully functional.
This is my first real encounter with C++.

However, develop a hack of a work around in test_tracking.py

# UpdateTracks(blobs,tracks, maxDist2Blob, InactiveFrames, ActiveFrames)
# wrapping of pointers has problem if a track in tracks is deleted within
C++ cvUpdateTracks
# work around is keep InactiveFrame big, ActiveFrames 0, so track is never
deleted
cvb.UpdateTracks(blobs, tracks, 5.0, 10000, 0)

to avoid holding on to tracks that last only a few frames wrote this utility
in __init__.py:

def FilterByLifetime(tracks, Active):
  '''Python throws pointer error when CvTracks list has a member deleted,
which deletes a member   from  pythons Tracks dict. Simple fix, set
parameters such that a track is never deleted by UpdateTracks can now apply
criterion to delete tracks only active for few frames'''

  for i in tracks.keys():
    if (tracks[i].active <  Active):
      del tracks[i];

I have attached these files with my suggestions added. I have also cleaned
up the test_tracking.py so it can be used readily by others.
I suspect for complex scenes with many (1000's) frames this fix could eat up
memory but it'll work for my simple needs.

Thanks again for your interest and help.

Will hopefully be able to share with the group my use of these tools in
identifying weather systems in daily data.

All the best, Neil

On 11 June 2011 06:12, Nathan Oostendorp <n...@oostendorp.net> wrote:

  test_tracking.py
3K Download

  __init__.py
4K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »