- imcrop region of interest (since it's always at the same position
- imbinarize image
- maybe clear a bit with bwareaopen
- find pixels you are interested in
- use findpeaks

4 views (last 30 days)

i need to find the distance of the wave. i refer to some questions & answers from that i get to know can solve canny's edge detection method.

but i don't know how to process it. can anyone help me...?

darova
on 19 Feb 2020

I suggest next algorithm

- imcrop region of interest (since it's always at the same position
- imbinarize image
- maybe clear a bit with bwareaopen
- find pixels you are interested in
- use findpeaks

darova
on 24 Feb 2020

In case of other error try this:

function main

for i = 0:1

try

STR = sprintf('%05d.jpg',i);

write_length(STR);

pause(1)

catch ME

if ~exist(STR,'file')

disp(['File ' STR ' Does not exist'])

else

disp(ME.identifier)

disp(['File ' STR ' was not processed'])

end

end

end

end

Sign in to comment.

basha Shaik
on 25 Feb 2020

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 4 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799446

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799446

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799456

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799456

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799464

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799464

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799500

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/506318-how-can-i-find-the-distance-from-the-peak-of-one-wave-to-another-wave-in-a-image#comment_799500

Sign in to comment.