GO-Eratosthenes / dhdt

Extracting topography from mountain glaciers, through the use of shadow casted by surrounding mountains.
https://dhdt.readthedocs.io
Apache License 2.0
7 stars 1 forks source link

Registration question #41

Open timpc0526 opened 1 year ago

timpc0526 commented 1 year ago

Hello,

I'm a rookie of Registration, I try to use your own dataset for testing, and found that the results of frequency subpixel are not very good (unstable), while the results of spatial sub-pixel are better (get_top_moment or get_top_2d_gaussian), most of which are stated in the paper It is the phase correlation plus curve fitting/line fitting that works best, but there is no relevant open source for the implementation of curve fitting/line fitting. I would like to ask if you recommend a more accurate and stable method for registration.

Thx

dicaearchus commented 1 year ago

Hey timpc0526!

Sorry for the late reply. Registration is very domain dependent, but a practical overview can be found here: https://www.mdpi.com/2072-4292/12/4/696

From your message I am not able to figure out what you mean, which paper, which method are you referring to. Can you please specify a bit more?

Best, bas

timpc0526 commented 1 year ago

Thanks for your reply, I have a few questions.

  1. The paper is "Image Registration With Fourier-Based Image Correlation: A Comprehensive Review of Developments and Applications". In the paper, it is mentioned that using Plane fiitting and Line fitting can be better than the general method. However, at this stage, for this type of There are too few examples of implementation, and there are ways to try your frequency subpixel, but the results are not very good. I would like to ask if you have any suggestions.
  2. When using frequency-based correlation, if the image size is different, the template image size is smaller than the test image size, because the cross product needs to be the same size, I have tried zero padding the image, but the result is the same as using two images of the same size The results are not the same (results are worse), is there any way to fix this?

Looking forward to your reply, thank you

dicaearchus commented 1 year ago
  1. Maybe it is good to provide a code snippet, something like:

    import numpy as np
    from ..generic.test_tools import create_sample_image_pair
    im1,im2,ti,tj,_ = create_sample_image_pair(d=2**5, max_range=1)
    Q = phase_corr(im1, im2)
    di,dj,_,_ = phase_svd(Q)
    assert(np.isclose(ti, di, atol=.2))
    assert(np.isclose(tj, dj, atol=.2))

    Then it is easier to figure out what you mean, and am I able to give some directions

  2. The "match_pair" function, has an option to "refine", this first finds a match and relocates the template to this region. Is this what you are looking for?

timpc0526 commented 1 year ago

After conducting research for a period of time, I tried to test the creation of sub-pixel photos using the Bilinear downsample method. The x-axis ranges from 0 to 1 pixel, with a step interval of 0.01 pixel. The figure below shows the results of comparing the Subpixel methods, where the values have been subtracted by the mean value.

Among the Spatial subpixel methods, the parabolic1D, gaussian2D, ForthOrder, and Bicubic methods have better tracking trends. However, a clear segmental difference appears around 0.5 pixel. On the other hand, the centroid1D, gaussian1D, parabolic2D, and MassCenter methods perform poorly. For the spatial subpixel method, input is the inverseFFT, shift-corrected cross product rather than the normalized cross product. SpatialSubpixel

As for the Frequency subpixel method, I input the normalized cross product. From a paper you previously recommended, I learned that to obtain subpixels in the frequency domain, it is necessary to first calculate the phase difference and then use line fitting. However, most of the Frequency subpixel methods I tested have very poor results. May I ask if there is anything to be aware of when using the Frequency subpixel method?

I look forward to your response, thank you.

timpc0526 commented 1 year ago

Hello I have read some papers in the past few days, It is found that this phenomenon may be caused by phase wrapping or pixel locking effect. Since these two phenomena will cause precision errors, do you have any solutions for this? For example, use phase unwrapping for phase wrapping, pixel locking effect currently has no special ideas. I look forward to your response, thank you.

timpc0526 commented 1 year ago

I would like to ask what is your opinion on the above issues. I still don't have a better solution.

dicaearchus commented 1 year ago

Sorry for the late reply, but the question is very generic, though concerns a detail. Don't understand me wrong, but the results also high depend on the data used. For instance a consumer camera might be more noisy, and have blur. While this is not the case for very stable and highly sensitive satellite sensors. If you core gister satellite images, it also depends on the application, for example, if you use the analysis for the build environment, the appearance does not change considerably, while for natural environments like glaciers, the differential flow, snow cover and melt patterns might significantly alter the image composition. In such cases, more robust methods might be more preferred. Similarly, clever selection of the spectral bands, spatial filters or other pre-processing steps might improve matching performance significantly. Thus, it is very difficult to say something about your case, if I do not know your data source, nor your application under study. Thus, if you can provide more specifics, please do so.

timpc0526 commented 1 year ago

Hello: I'm sorry for not explaining the relevant information about the data set. I am using simulation to generate a sub-pixel data set. Suppose I want to generate a cross-shaped feature with a photo size of 200 200 and a feature position at (100.1, 99.9). I will first create a For a 2000 2000 photo, set the cross feature at the position of (1001, 999), and then reduce the photo by 10 times through downsampling (Bilinear or Bicubic) to obtain the sub-pixel position at (100.1, 99.9). This sub-pixel data set is established mainly to verify the accuracy of the registration method under sub-pixels, and the results shown in the figure above are obtained. In the figure above, the horizontal axis is the displacement of 0.01 pixels per step, and the vertical axis is the actual positioning result. It is expected that the graph will show a linear slash. However, the step difference found in the figure is currently suspected of two problems of phase wrapping or pixel locking effect. Thanks for your reply.

timpc0526 commented 1 year ago

Hello: Do you have any thoughts on this verification method? thank you.