How to perform image registration on non-rectangular image
14 次查看(过去 30 天)
显示 更早的评论
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 个评论
raym
2024-11-8,6:09
编辑:Walter Roberson
2024-11-8,6:15
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
回答(2 个)
Matt J
2022-6-6
编辑:Matt J
2022-6-6
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 个评论
Matt J
2022-8-1
编辑:Matt J
2022-8-1
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.
Image Analyst
2022-8-1
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 个评论
Matt J
2022-8-11
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!