Sum two matrices shifted by a non integer number?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MementoMori
am 26 Mär. 2023
Bearbeitet: Matt J
am 26 Mär. 2023
Suppose we have two matrices A and B, and I want to sum them shifted by a non-integer number of pixels. How can I do it?
For example for a 0.5 shift. We can enlarge them by a factor of 2, sum them shifted by 1 pixel and reduce it by a factor 2.
But this way can be very computational expensive, in particular for a low pixel shift.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
John D'Errico
am 26 Mär. 2023
There is no magic, whereby you can do things that take computational time, and do them instantly.
What you want to do is implicitly interpolate the images, at sub-pixel levels. You can use interp2 to interpolate one array at a shift of some fractional amount. Then add the results. But no matter what, you will need to perform an interpolation.
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!