HillInHarwich
HillInHarwich

Reputation: 449

Tracking object size using opencv on iPhone

i am looking at developing an app for the iPhone that tracks a selected object, and monitors the size of a rectangle drawn around it.

I have seen the a demo that tracks a selected object - but was wondering if anyone can point me in the direction of examples where the size of an object (rectangle) is monitored?

Many thanks in advance,

Steve

Upvotes: 1

Views: 344

Answers (1)

HillInHarwich
HillInHarwich

Reputation: 449

I hadn't realised how long ago it was that I asked this question. For anybody looking for an answer to this - I have done the following:

  1. Convert the current frame to a grey scale image.
  2. Use a Haar Cascade Classifier to identify vehicles in the current frame.
  3. Draw a rectangle around the vehicle, and have a look to see if we have seen this car before (based on similar position)
  4. If we haven't, the size and position of the current car are added to a list of trackable cars...
  5. If we have, the current dimensions of the rectangle are added to an array of objects
  6. The difference in size is calculated between the rectangles as a percentage of the current rectangle height - this should hopefully be fairly constant and linear.
  7. Apply a "calibration constant" to this percentage - this should give the relative speed of the vehicle.

If anyone would like a more detailed explanation, please let me know...

Upvotes: 1

Related Questions