Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
counting object

Subject: counting object

From: Ashar

Date: 17 Apr, 2010 02:30:23

Message: 1 of 5

hi all, i need your help...

i want to make a program , my objective is to count a single object that move around a circle using webcam.

1. webcam is positioned on top of the object
2. the object begin to move around
3. if he/she has completely move 360 degree, count as one lap.

tell me, step by step how to count object that move around 360 degree.

(assumption, radial of the circle is 50cm)

Subject: counting object

From: ImageAnalyst

Date: 18 Apr, 2010 19:36:50

Message: 2 of 5

I'm sure you can come up with a block diagram for this algorithm -
should not be too tough as long as the object moves slowly. Post back
here what it is. If the object moves at unknown speed then you can't
tell. For example if you find the object at 30 degrees at time 0, and
at 50 degrees at time 1, how do you know if it moved 20 degrees or 380
degrees or 740 degrees, or moved -340 in the other direction?

Subject: counting object

From: Roger Stafford

Date: 18 Apr, 2010 19:54:05

Message: 3 of 5

"Ashar " <zero_fauzi@yahoo.com> wrote in message <hqb6fv$mos$1@fred.mathworks.com>...
> hi all, i need your help...
>
> i want to make a program , my objective is to count a single object that move around a circle using webcam.
>
> 1. webcam is positioned on top of the object
> 2. the object begin to move around
> 3. if he/she has completely move 360 degree, count as one lap.
>
> tell me, step by step how to count object that move around 360 degree.
>
> (assumption, radial of the circle is 50cm)

  If you are measuring the angle, then the 'unwrap' function would be very useful for this purpose, provided the measurements were made frequently enough.

Roger Stafford

Subject: counting object

From: Ashar

Date: 19 Apr, 2010 03:50:08

Message: 4 of 5


thank you for your respond, imageAnalyist and Roger Stafford.
i'm glad that both of you reply my message.

imageAnalyst said :
I'm sure you can come up with a block diagram for this algorithm -
should not be too tough as long as the object moves slowly. Post back
here what it is. If the object moves at unknown speed then you can't
tell. For example if you find the object at 30 degrees at time 0, and
at 50 degrees at time 1, how do you know if it moved 20 degrees or 380
degrees or 740 degrees, or moved -340 in the other direction?

sorry, i'm not familiar with simulink. hehe... ( I always use M-File and GUI)
the object is a mouse that moves around on a basket. I assume the object moves at random speed. if he found a hole on a basket then he can escape... i need to know how many times, he moves around on a basket to find the hole.
(the hole is 5 cm from the ground of basket)

this is a test for mouse intelligent.


Roger stafford said :
  If you are measuring the angle, then the 'unwrap' function would be very useful for this purpose, provided the measurements were made frequently enough.

how to measure the angle ?

thank you very much for answering my post

Subject: counting object

From: Adrian

Date: 13 Aug, 2010 20:38:05

Message: 5 of 5

Just repeatidly 'look' for the object at the start point on the circle. You can define a region of interest (ROI) on the circle at the start point and look for movement in that ROI. Movement could be detected by simply capturing a reference frame when the ROI is empty and then repeatidly capturing new frames and subtracting the new ROI from the empty reference ROI. If the result is non-zero, then your object has reappeared in the ROI. This would constitute a movement of 360 degrees. If you are ony looking in one ROI at one place on the circle, this can be done very rapidly (i.e., at the true highest frame rate of your camera), so this precludes missing the appearance of the object in this ROI as the object moves around the circle.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us