Building a line profile of a pattern in a real time video
1 view (last 30 days)
Show older comments
Hi guys,
I'm new to the Matlab Video processing module and want to get some help or some idea to start for the following problem.
1. I have a real time video, where there are two sets of ruler line marks. 2. These two sets of marks could be separate by a distance or could be in close proximity. 2. I want to recognize these two set of marks and see which mark on the left lines up with which one on the right. See figure below: https://dl.dropbox.com/u/10571500/matlab.png In this example, only 1 and 8 line line up.
My idea is to have a profile line drawn perpendicular to each sets of those marks ("A" and "B" in the figure) and build two sets of profile to compare. Once I get the line profile of the marks, I should be able to determine which one has lined up. Or does Matlab have a better way to do this?
Thanks,
Gene
0 Comments
Answers (1)
Image Analyst
on 28 Aug 2012
Edited: Image Analyst
on 28 Aug 2012
First sum the whole image vertically. That will allow you to get column1, column2, column3 and column4 where the bar patterns start and stop. Then sum the image horizontally between column 1 and column2 to get the profile of the left block. Then do the same to get the average profile of the right block. Then threshold each profile and pass into diff() to find where each bright-to-dark and dark-to-bright transition is. Now you have two arrays saying where each line starts and stops and you can compare them, for example subtract to find out how many image lines the line/bar on the left is separated vertically from the corresponding one on the right. Let me know if you can't figure it out. If you need me to work on the code, you should upload an image without the red lines.
When I try to download your image, all I get is the red lines on a black background - no bars at all. Please upload it somewhere where I can get the monochrome image of the bars without the red lines.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!