How to perform image registration on non-rectangular image
Afficher commentaires plus anciens
I'm interesting in peforming image registration using imregtform on a non-rectangular region of interest that would be the "moving" image. Is there any way to do this? I initially tried to turn all the pixels within the "moving" image matrix that I don't want to affect registration to NaNs, but the imregtform function won't accept that input.
3 commentaires
Biral Pradhan
le 3 Juin 2022
I understand, you have a non-rectangular region of interest in a rectangular image, and you want to use "imregtform" it. Could you try converting all the other pixels to "black" colour instead of NaN?
Jeremy Eekhoff
le 6 Juin 2022
raym
le 8 Nov 2024
Modifié(e) : Walter Roberson
le 8 Nov 2024
Dear Jeremy D. Eekhoff,
I'm sorry to trouble you on on the forum here.
I read your article "Three-dimensional computation of fibre orientation, diameter and branching in segmented image stacks of fibrous networks" by Jeremy D. Eekhoff and Spencer P. Lake.This is a really great application on detection of fibers in 3D space. I want to have a try and download the code from github: https://github.com/jeremyeekhoff/Fiber-Analysis-Algorithm .
I used a demo 3D stack fiber stainning image to run the function fiberAnalysisAlgorithm.m on R1026a, with MinGW64 compiler on win8.1.
However, it shows the error on the two mexw64 files:
Invalid MEX-file 'mexfilename': The specified module could not be found.
I have tried using dependencywalker to find which dlls are missing. It first says that several dlls in C:\Program Files\MATLAB\R2016a\bin\win64 is missing. Thus I add this folder to env and restart computer and re-run, then it says the following dlls are missing, although most of them exist in folders below, except API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL.
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
I searched and find that API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL is obselete in Win8.1
After I download API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL and place in the same folder of m code, the error still persist, and
dependencywalker shows more complicated errors. I guess it is a problem of mexw64 compiling environment differs too much with my environment. Could you give me some instructions on this?
Thank you.
----the path to most of dlls above:
C:\Windows\System32\downlevel\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\SysWOW64\downlevel\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_2c5177c069a919dd\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_d032dc3cb14ba8a7\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
-----
C:\Windows\System32\downlevel\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\SysWOW64\downlevel\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_2c5177c069a919dd\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_d032dc3cb14ba8a7\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-core-privateprofile-l1-1-1.dll
-----this one may be missing, I will copy it and have a try
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-core-shutdown-l1-1-1.dll
-----
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-service-private-l1-1-1.dll
C:\Windows\System32\downlevel\api-ms-win-service-private-l1-1-1.dll
C:\Windows\SysWOW64\downlevel\api-ms-win-service-private-l1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_b8233abb5511544f\api-ms-win-service-private-l1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_5c049f379cb3e319\api-ms-win-service-private-l1-1-1.dll
Réponses (2)
If you have the Optimization Toolbox, you could use lsqcurvefit (don't be misled by the name) to minimize your own reigstration cost function, one which accepts an ROI mask.
5 commentaires
Jeremy Eekhoff
le 29 Juil 2022
Matt J
le 29 Juil 2022
Are you implementing a multi-resolution pyramid?
Jeremy Eekhoff
le 1 Août 2022
What is usually done to improve robustness is that you first smooth and downsample the images and perform an initial registration. Then you reduce the smoothing and repeat the registration with the previous registration result as your initial guess. This is repeated until the registration is done at full resolution.
Jeremy Eekhoff
le 1 Août 2022
Image Analyst
le 1 Août 2022
0 votes
Is it rotating and scaling while it translates? If not, you could use normalized cross correlation. See attached demo.
Or try one of the panoramic stitching algorithms. They find matching regions, which is necessary to construct the overall image.
5 commentaires
Matt J
le 1 Août 2022
Is it rotating and scaling while it translates?
For that matter, is the registration rigid or deformable?
Jeremy Eekhoff
le 1 Août 2022
Image Analyst
le 1 Août 2022
You might try SIFT or SURF
and point set matching on the results.
I think the Computer Vision Toolbox has some points set matching functions with the LIDAR capability.
Good luck - it's not an easy problem.
Jeremy Eekhoff
le 11 Août 2022
Matt J
le 11 Août 2022
Does this seem like a reasonable solution or am I missing something that could be problematic?
I can't argue with success, but I vaguely wonder why setting the background pixels to some constant wouldn't do the same thing. An atomic distribution is independent of every distribution as well.
Catégories
En savoir plus sur Geometric Transformation and Image Registration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!