Image comparison with respect to edges - 2

3 views (last 30 days)
I want to compare two pictures with respect to edges.
I have a slit that moves over lens and camera takes pictures for each step on lens.
To detection of starting point of lens, i want to take pictures continuously and use edge detection to compare with old picture until having a picture with edges.
At my last question, i mentioned, the first picture is full of dark. But after many tries, I saw that sometimes some noises can occur. Without using any filter to delete these noises and so without using the command "any()", How can i compare and tell to program if a picture occurs?

Accepted Answer

Ashish Uthama
Ashish Uthama on 6 Jul 2011
This is my interpretation of your question:"How do I find the first valid image which has a slit in it? I cant use any because there could be some noise".
How about sum instead? If the sum of all pixel values is above a certain threshold you could assume that a valid slit was captured.
You could also try variations like using the number of pixels above a threshold value as a trigger condition. [Sean de]'s code and explanation:
Npx_bright = sum(I(:)>80)
The '>' makes every pixel with an intensity larger than 80 one and everything else zero; the (:) turns it into a column vector for summing the 'sum()' adds up all of the ones.
  3 Comments
Sean de Wolski
Sean de Wolski on 6 Jul 2011
Npx_bright = sum(I(:)>80)
the '>' makes every pixel with an intensity larger than 80 one and everything else zero; the (:) turns it into a column vector for summing
the 'sum()' adds up all of the ones.
Can Acar
Can Acar on 7 Jul 2011
Thank you very much!!! It works perfectly!!!

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!