BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Video recognition

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Jorrit Jongma
Guest





PostPosted: Wed Apr 07, 2004 2:01 pm    Post subject: Video recognition Reply with quote



Hi group,

I need to do some video recognition, I have never done this before so I am
wondering where and how to start.

I thought of handling the video's like this:
- Break down the frames from the original video into a collection of objects
(detectable forms by using edge/corner recognition)
- Store this information

When new video plays:
- Break down the frames of the new video, see if they match
- Compare to the original stored data, with a bit of fuzzyness since the
original and new video can be of somewhat different image quality

This was all I could come up with to do it. Is this the right way to go?
Ofcourse then we have the matter of speed. The original videos will be
around 200, so that isn't to many. Will it be possible to reach realtime
comparing speed with the new playing video? Breaking down and comparing do
not necessarily have to be done on the same PC. They may both be done on
dedicated multiple proc machines with quite some memory.

Pointers, information, tales of experience, all is welcome!

TiA


Back to top
Roy Magne Klever
Guest





PostPosted: Wed Apr 07, 2004 2:57 pm    Post subject: Re: Video recognition Reply with quote



Hi Jorrit,

If you go to www.delphipages.com and do a search for TMED you will get a
freeware component for doing Motion and Edge detection. It is very good.


Kind Regards
Roy Magne Klever



Back to top
Nils Haeck
Guest





PostPosted: Wed Apr 07, 2004 3:42 pm    Post subject: Re: Video recognition Reply with quote



What do you want to recognise in the video?

Or do you mean: video comparison?

There are many different approaches and concepts. Just to name one example:
facial recognition is usually done by transforming pictures into an
eigenvalue problem and finding the eigenvalues that are characteristic for
faces. This is quite a complicated process already.

Nils
www.simdesign.nl


"Jorrit Jongma >" <
Quote:
Hi group,

I need to do some video recognition, I have never done this before so I am
wondering where and how to start.

I thought of handling the video's like this:
- Break down the frames from the original video into a collection of
objects
(detectable forms by using edge/corner recognition)
- Store this information

When new video plays:
- Break down the frames of the new video, see if they match
- Compare to the original stored data, with a bit of fuzzyness since the
original and new video can be of somewhat different image quality

This was all I could come up with to do it. Is this the right way to go?
Ofcourse then we have the matter of speed. The original videos will be
around 200, so that isn't to many. Will it be possible to reach realtime
comparing speed with the new playing video? Breaking down and comparing do
not necessarily have to be done on the same PC. They may both be done on
dedicated multiple proc machines with quite some memory.

Pointers, information, tales of experience, all is welcome!

TiA





Back to top
Jorrit Jongma
Guest





PostPosted: Wed Apr 07, 2004 10:11 pm    Post subject: Re: Video recognition Reply with quote

Video comparison might be a better description.

I have one video stream, embedded in this stream is another video stream I
already have on file. I want to know when this embedded stream plays.


Back to top
Nils Haeck
Guest





PostPosted: Thu Apr 08, 2004 12:06 am    Post subject: Re: Video recognition Reply with quote

Aha, that sounds encouraging.

So, suppose that you can perfectly estimate if two frames are identical.

Lets consider your one video stream to be built of frames:
Stream 1: ABCDEFGHIJKLMNOPQR

Now, you also have another stream somewhere, that has

Stream 2: HIJKLMN

and

Stream 3: FZWXY

You can start with frame H of stream 2, then compare it to the frames in
stream 1. Obviously, the first ABCDEFG frames are no matches. Then, you find
that H matches H.

The next step is to find if following frames also match. Yes they do, we
find I=I, J=J, etc until N=N.

When we want to find stream 3, we will find a match with F = F. But, in this
case, following frames do not match, after all Z <> G, W <> H etcetera.

In order to use above, you must be certain that the videos have the exact
same frame rate and timing.

You can make the comparison quite relaxed, after all, you are comparing
quite a few frames probably, and so you can afford having a few false
positives.

What I would do is probably create a thumbnail image, something like 4x4
pixels, of each frame. Compare these 16 pixels with 16 pixels of the other
frame. If their differences (absolute values, added together) are below a
certain treshold, you consider the frames equal.

This step is a little bit like the first step in my image comparison
function in ABC-View Manager (a shareware viewer that can find similar
images). Perhaps nice to try for you:
http://www.abc-view.com/abcview.html
http://www.abc-view.com/articles/article3.html

Hope that helps,

Nils Haeck
www.simdesign.nl


"Jorrit Jongma >" <
Quote:
Video comparison might be a better description.

I have one video stream, embedded in this stream is another video stream I
already have on file. I want to know when this embedded stream plays.





Back to top
Monty
Guest





PostPosted: Thu Apr 08, 2004 7:27 am    Post subject: Re: Video recognition Reply with quote

Nils, i have checked your image comparison function and it's great!

Are you planning to sell this feature as a separate component?


"Nils Haeck" <n.haeckno (AT) spamchello (DOT) nl> escribió en el mensaje
news:40749502$1 (AT) newsgroups (DOT) borland.com...
Quote:
Aha, that sounds encouraging.

So, suppose that you can perfectly estimate if two frames are identical.

Lets consider your one video stream to be built of frames:
Stream 1: ABCDEFGHIJKLMNOPQR

Now, you also have another stream somewhere, that has

Stream 2: HIJKLMN

and

Stream 3: FZWXY

You can start with frame H of stream 2, then compare it to the frames in
stream 1. Obviously, the first ABCDEFG frames are no matches. Then, you
find
that H matches H.

The next step is to find if following frames also match. Yes they do, we
find I=I, J=J, etc until N=N.

When we want to find stream 3, we will find a match with F = F. But, in
this
case, following frames do not match, after all Z <> G, W <> H etcetera.

In order to use above, you must be certain that the videos have the exact
same frame rate and timing.

You can make the comparison quite relaxed, after all, you are comparing
quite a few frames probably, and so you can afford having a few false
positives.

What I would do is probably create a thumbnail image, something like 4x4
pixels, of each frame. Compare these 16 pixels with 16 pixels of the other
frame. If their differences (absolute values, added together) are below a
certain treshold, you consider the frames equal.

This step is a little bit like the first step in my image comparison
function in ABC-View Manager (a shareware viewer that can find similar
images). Perhaps nice to try for you:
http://www.abc-view.com/abcview.html
http://www.abc-view.com/articles/article3.html

Hope that helps,

Nils Haeck
www.simdesign.nl


"Jorrit Jongma >" < news:40747c7d (AT) newsgroups (DOT) borland.com...
Video comparison might be a better description.

I have one video stream, embedded in this stream is another video stream
I
already have on file. I want to know when this embedded stream plays.







Back to top
Nils Haeck
Guest





PostPosted: Thu Apr 08, 2004 6:27 pm    Post subject: Re: Video recognition Reply with quote

Quote:
Are you planning to sell this feature as a separate component?

Actually I already have sold it two times in the past. If you're interested,
contact me by email through the address listed on the site below.

Kind regards,

Nils Haeck
www.simdesign.nl


"Monty" <jordimontoya (AT) eresmas (DOT) com> wrote

Quote:
Nils, i have checked your image comparison function and it's great!

Are you planning to sell this feature as a separate component?


"Nils Haeck" <n.haeckno (AT) spamchello (DOT) nl> escribió en el mensaje
news:40749502$1 (AT) newsgroups (DOT) borland.com...
Aha, that sounds encouraging.

So, suppose that you can perfectly estimate if two frames are identical.

Lets consider your one video stream to be built of frames:
Stream 1: ABCDEFGHIJKLMNOPQR

Now, you also have another stream somewhere, that has

Stream 2: HIJKLMN

and

Stream 3: FZWXY

You can start with frame H of stream 2, then compare it to the frames in
stream 1. Obviously, the first ABCDEFG frames are no matches. Then, you
find
that H matches H.

The next step is to find if following frames also match. Yes they do, we
find I=I, J=J, etc until N=N.

When we want to find stream 3, we will find a match with F = F. But, in
this
case, following frames do not match, after all Z <> G, W <> H etcetera.

In order to use above, you must be certain that the videos have the
exact
same frame rate and timing.

You can make the comparison quite relaxed, after all, you are comparing
quite a few frames probably, and so you can afford having a few false
positives.

What I would do is probably create a thumbnail image, something like 4x4
pixels, of each frame. Compare these 16 pixels with 16 pixels of the
other
frame. If their differences (absolute values, added together) are below
a
certain treshold, you consider the frames equal.

This step is a little bit like the first step in my image comparison
function in ABC-View Manager (a shareware viewer that can find similar
images). Perhaps nice to try for you:
http://www.abc-view.com/abcview.html
http://www.abc-view.com/articles/article3.html

Hope that helps,

Nils Haeck
www.simdesign.nl


"Jorrit Jongma >" < news:40747c7d (AT) newsgroups (DOT) borland.com...
Video comparison might be a better description.

I have one video stream, embedded in this stream is another video
stream
I
already have on file. I want to know when this embedded stream plays.









Back to top
Jorrit Jongma
Guest





PostPosted: Thu Apr 08, 2004 6:44 pm    Post subject: Re: Video recognition Reply with quote

Quote:
So, suppose that you can perfectly estimate if two frames are identical.

This is the big problem, the rest what you say below I thought of myself.
The framerates and video sizes are identical, but the quality of the frames
may differ. A little distortion here and there, brightness differences and
such. I have been trying several different approaches the past few days to
this but if you have any advice, I'd be glad to hear it :-)






Back to top
Nils Haeck
Guest





PostPosted: Thu Apr 08, 2004 10:04 pm    Post subject: Re: Video recognition Reply with quote

I already gave you some advice.. Divide a frame into 16 blocks (4x4). Each
of these blocks has a colour, but let's do this for grayscale as an example.

There are block values X[i], where i = 0..15 (16 values) and Y[i] for
another frame, always a value from 0 to 255.

Now, your error (per block) = abs(X[i] - Y[i])

The total error:

Err = Sigma(abs(X[i] - Y[i]), i = 0..15

or with code

Err := 0;
for i := 0 to 15 do
Err := Err + abs(X[i] - Y[i]);

Of course, the images are not exactly the same, but images that are close
will have a small total error. So you can say

IsIdentical := Error < Limit;

Experiment with a few limit settings.

Search back in this newsgroup to find fast downscale algorithms you can use
to scale (any) image down to 4x4 size.

Kind regards,

Nils Haeck
www.simdesign.nl


"Jorrit Jongma >" <
Quote:
So, suppose that you can perfectly estimate if two frames are identical.

This is the big problem, the rest what you say below I thought of myself.
The framerates and video sizes are identical, but the quality of the
frames
may differ. A little distortion here and there, brightness differences and
such. I have been trying several different approaches the past few days to
this but if you have any advice, I'd be glad to hear it :-)








Back to top
shahram
Guest





PostPosted: Sun Apr 11, 2004 9:08 pm    Post subject: Re: Video recognition Reply with quote

Hi,
Does your project depend on video file format or not (your video file is
MPEGII, MPEG4 or non-standard)? I think if you use the data and information
that exists in the file, you will do half of your project. After that you
compare two digitized frame.

"Jorrit Jongma >" <
Quote:
Hi group,

I need to do some video recognition, I have never done this before so I am
wondering where and how to start.

I thought of handling the video's like this:
- Break down the frames from the original video into a collection of
objects
(detectable forms by using edge/corner recognition)
- Store this information

When new video plays:
- Break down the frames of the new video, see if they match
- Compare to the original stored data, with a bit of fuzzyness since the
original and new video can be of somewhat different image quality

This was all I could come up with to do it. Is this the right way to go?
Ofcourse then we have the matter of speed. The original videos will be
around 200, so that isn't to many. Will it be possible to reach realtime
comparing speed with the new playing video? Breaking down and comparing do
not necessarily have to be done on the same PC. They may both be done on
dedicated multiple proc machines with quite some memory.

Pointers, information, tales of experience, all is welcome!

TiA





Back to top
Jorrit Jongma
Guest





PostPosted: Sun Apr 11, 2004 10:52 pm    Post subject: Re: Video recognition Reply with quote

Quote:
Hi,
Does your project depend on video file format or not (your video file is
MPEGII, MPEG4 or non-standard)? I think if you use the data and
information
that exists in the file, you will do half of your project. After that you
compare two digitized frame.

Sadly no. Data is uncompressed as it comes in :-(



Back to top
Dominique Louis
Guest





PostPosted: Wed Apr 14, 2004 11:25 am    Post subject: Re: Video recognition Reply with quote

Jorrit Jongma < wrote:
Quote:
Hi group,

I need to do some video recognition, I have never done this before so I am
wondering where and how to start.

I thought of handling the video's like this:
- Break down the frames from the original video into a collection of objects
(detectable forms by using edge/corner recognition)
- Store this information

When new video plays:
- Break down the frames of the new video, see if they match
- Compare to the original stored data, with a bit of fuzzyness since the
original and new video can be of somewhat different image quality

This was all I could come up with to do it. Is this the right way to go?
Ofcourse then we have the matter of speed. The original videos will be
around 200, so that isn't to many. Will it be possible to reach realtime
comparing speed with the new playing video? Breaking down and comparing do
not necessarily have to be done on the same PC. They may both be done on
dedicated multiple proc machines with quite some memory.

Pointers, information, tales of experience, all is welcome!

Intel have a library called Open Source Computer Vision Library which
sounds like it could be usefull for what you are trying to do.
It's home page resides @
http://www.intel.com/research/mrl/research/opencv/

If this looks like it does what you want, you can find some Delphi
headers to get you started over @
http://groups.yahoo.com/group/OpenCV/files/Delphi%20API%20/
there are some non-Delphi goodies @
http://groups.yahoo.com/group/OpenCV/files/

I hope this helps.


Dominique.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.