Axis of a graph

Hi all,
So basically I have the following image :
Each dot going positive in the x axis (right)is time and is 0.04 seconds. Each dot going positive in the y axis (up) is voltage and is 0.1mV.
The idea is that the user is presented with a big graphical paper and he is given the option to crop the image to whatever dimensions he wants to. An example of which is shown above.
What i want to do is be able to some how count the number of dots that exist horizontally and vertically. So in this example, i manually counted that there are : 62 dots horizontally and 6 lines vertically.
So i want the computer to be able to do the above and also calibrate it. I.E 1 dot horizontally = 0.04 seconds and one dot vertically is 0.1mV. This is so that i can use these x and y values as the axis for a waveform that i have segmented.
The end result i want matlab to do is to find x values ranging from 0 to 2.48 seconds (62*0.04) and y values to be 0.6 mV.
I did have a go at thresholding the image and this is what i got up to :
Many thanks!!

Answers (1)

Image Analyst
Image Analyst on 29 Jun 2012

0 votes

Looks to me like your image does not have enough resolution or contrast to do reliable blob counting. I'd fix the image capture problem first and avoid a big headache with post processing.
Another question I have is whether the rows and columns of your dots are guaranteed to be aligned with the image rows and columns, or can you dot pattern be tilted?

3 Comments

HASNAIN
HASNAIN on 29 Jun 2012
Edited: HASNAIN on 29 Jun 2012
Hi, Basically the graph paper is from that of a graph. I have successfully managed to extract the waveform that exists on this graph paper, its just that i need to calibrate its axis automatically. Hence why i need it to count the number of dots in the x and y direction.
Unfortunately it is not possible to increase the resolution of the image. Is there anything that you would recommend me to do to count the dots in the x and y direction and calibrate please?
With regards to your second question, no it is not guaranteed to be aligned with the image rows and columns. However we can adjust the offset.
Thanks
Image Analyst
Image Analyst on 29 Jun 2012
Try to use hough to identify the lines and the angles. Then use imrotate to align the image. Use bwareaopen to remove big items, like the axis, or small items like noise. Then just count what's left with standard blob counting mathods, like BlobsDemo, in my File Exchange shows you how to do.
HASNAIN
HASNAIN on 29 Jun 2012
Thanks for the reply. Iam a beginner to IPT, could you point me to an example for the hough transform please? Thanks!

Sign in to comment.

Asked:

on 28 Jun 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!