Query regarding Real Time Motion Tracking

Hi, I'm developing a project in Java. The problem is :- In a steel plant steel blocks are generated one by one and they go through a platform on by one continuously. There is a
fixed camera ,watching the motion of the blocks continuously.I've to determine the speed of the blocks. I'm approaching in the following manner:-
1)I'm capturing the frames of the real time movie(through a digital camera).I've approached in this way to capture frames separately ,The movie is being displayed in a computer monitor in (200x200) dimension.With the help of java robot class's screen capture method I'm capturing frames displayed in the screen continuously(not from total monitor size,but only the portion on which the movie is being displayed),I'm capturing frames,average 1frame/sec(Pentium 4, 2Gz) speed.Roughly 60 pictures / sec (My Query:- Is this approach ok?(I've not seen such approach anywhere till now in internet. Am I doing any major mistake?)
2)I'm saving the grabbed frames in hard disk simultaneously.
3)Another program is collecting these picture frames one by one ,processing it by converting it to gray scale with edge detection and then binarizing it(above color value150 everything is white else black). (Query:-1)Should I use FFT for such applications?2)Should I change threshold value dynamically?)
4)After that I'm tracking some particular pixel continuously , measuring displacements between quardinate.If I know the time difference between capture of two picture frames I can find the speed.(Suppose 1 pixel shift0 meter or like that).
My Problem:-How can I get exact time difference between two frames?(is it possible to get it in mili second?)
Request:- Please give me some guidance don't have any experience in such applications. Is it any relevant way in which I'm approaching?Please suggest some better way(not very complex) which can make my job better.
Thanks and Regards
Subhadip Mukherjee
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Subha_Interra wrote:

I do not like your plan to capture images from the screen - you have no control over the processing and timing of the images before they get to the screen. This problem is exacerbated if you are not using a real-time OS on the computer - there may be unexpected delays occurring at any time that you have no way of detecting or correcting.
I would do this using a computer dedicated to the task. You might also consider purchasing a complete system specifically meant for video or ultrasonic speed-measurement. But before you do anything, you should completely specify the operating conditions and the degree of temporal and spatial accuracy/precision required.
-- Joe Legris
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
If you want to track moving objects, there's software for that. Try the Lukas-Kanade (LK) tracker in the Open Source Computer Vision Library. That's actually quite good.
The idea of using a doppler radar is tempting, but don't use the one from Dickey-John. That thing is intended as a speedometer for tractors, and it's sensitive to fluorescent light noise.
                John Nagle
Subha_Interra wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Why use a camera for this? These are blocks of steel, I assume on some sort of conveyor belt. There are gaps between them, yes? Why not just arrange two cheap electric eyes, a few centimeters apart, such that the beams are broken by the blocks as they go by. These provide two simple, clean digital inputs to your app. Measure the time the first beam is broken, and then the time the second beam is broken; find the difference and divide by the distance between the two beams, and there's the speed.
Best, - Joe
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Subha_Interra wrote:

FFT? Probably not. Dynamically adjust the threshold? Maybe -- are there issues with the color stability? How did you pick that threshold in the first place? How wide is the dead zone between foreground and background objects? If its wide enough and the images are stable, then there's no need for adaptive algorithms. Histograms are a good tool to answer these questions (and to calculate an adaptive threshold).

I hope you aren't trying to track a single thresholded pixel... that's a very noisy data source. A good, stable technique is to follow the thresholding by a routine that identifies groups of connected pixels and then track the centers of these groups. This process averages out noise at the object edges.

If you're using the JRobot class, then you probably can't expect better accuracy than to simply create a new java.util.Date as each image is read in and to take the difference between them as the elapsed time.
If you need better accuracy, then you will want greater control over the image stream, maybe using the java media framework.
Later, Daniel
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Subha_Interra wrote:

I can't help with the programming or frame timing. But, i do have a ffew ideas to suggest;
I imagine the steel block is quite hot, and therefore very bright in the infrared. I would suggest using an infrared sensitive camera and even blocking visible light. Your existing camera may be adaptable by removing the existing filter that is meant to prevent infrared from reaching the sensor. Then add a filter to block visible.
Since the camera is fixed, and the path of the block is probably always the same, you don't have to watch the entire screen for motion. You might gain accuracy, and reduce the probability of error by eliminating any part of the image outside of that path.
Joe Dunfee
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.