- Edge Detection: https://www.mathworks.com/discovery/edge-detection.html
- Feature-Based Image Registration: https://www.mathworks.com/help/images/image-registration.html
- Normalized 2-D cross-correlation using 'normxcorr2 function': https://www.mathworks.com/help/images/ref/normxcorr2.html
- Find edges in 2-D grayscale image using 'edge' function: https://www.mathworks.com/help/releases/r2021b/images/ref/edge.html
Similar features in images
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a time based spray images and would like to find out the distance travelled by a wave between two images. The waves mostly retain their shape but undergo slight changes. I am attaching relevent images along with this. The waves are marked with boxes. 

0 Commenti
Risposte (1)
Rahul
il 6 Mar 2025
Hi Edin,
To determine the distance traveled by the wave between two consecutive images, you can use MATLAB’s image processing and feature-matching techniques. First, the images are converted to grayscale to ensure consistent intensity analysis, which simplifies further processing.
gray1 = rgb2gray(img1);
gray2 = rgb2gray(img2);
Edge detection, typically using the Canny method, can then be applied to highlight the wave boundaries effectively.
edges1 = edge(gray1, 'Canny');
edges2 = edge(gray2, 'Canny');
To estimate displacement, techniques such as normalized cross-correlation can be used, which help in identifying the pixel shift between the two images by finding the peak correlation point.
c = normxcorr2(edges1, edges2);
[~, imax] = max(abs(c(:)));
[yPeak, xPeak] = ind2sub(size(c), imax);
Alternatively, feature-based methods like SIFT or SURF can be used to track distinctive wave features that remain consistent across frames. For more dynamic motion estimation, MATLAB’s optical flow functions, such as 'opticalFlowFarneback,' can be useful in analyzing pixel-wise velocity across frames. Once the displacement in pixels is determined, it is converted into a real-world distance using a known spatial scaling factor (e.g., pixels per millimeter).
real_distance = displacement * scale;
The accuracy of this approach can be further enhanced using image registration techniques 'imregcorr' to align images before computing displacement. Depending on the level of precision required, different methods can be combined or refined. For more details, you can refer to the following documentation links which can be leveraged to optimize the analysis:
Hope this helped!
0 Commenti
Vedere anche
Categorie
Scopri di più su Geometric Transformation and Image Registration in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!