Image comparison with respect to edges - 2

1 次查看(过去 30 天)
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?

采纳的回答

Ashish Uthama
Ashish Uthama 2011-7-6
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 个评论
Sean de Wolski
Sean de Wolski 2011-7-6
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 2011-7-7
Thank you very much!!! It works perfectly!!!

请先登录,再进行评论。

更多回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by