Skip to content

spatial_filter: refactor double difference#687

Merged
forrestfwilliams merged 2 commits intoinsarlab:mainfrom
forrestfwilliams:filter
Nov 4, 2021
Merged

spatial_filter: refactor double difference#687
forrestfwilliams merged 2 commits intoinsarlab:mainfrom
forrestfwilliams:filter

Conversation

@forrestfwilliams
Copy link
Collaborator

  • combine the local and regional filter into
    one filter to reduce number of
    convolutional operations

  • change regional filter shape from a disk to
    a doughnut

Reminders

  • Fix #xxxx
  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

- combine the local and regional filter into
  one filter to reduce number of
  convolutional operations
- change regional filter shape from a disk to
  a doughnut
@yunjunz
Copy link
Member

yunjunz commented Nov 3, 2021

Thank you @forrestfwilliams. Applying one convolution sounds like a good idea. The implementation change looks good to me. I am wondering what's the motivation for changing the shape of the regional filter from a disk to a donut?

@forrestfwilliams
Copy link
Collaborator Author

Hey @yunjunz, good question! The small local_kernel is meant to represent the local deformation signal, while the regional_kernel is supposed to represent the deformation occurring outside of the local area. By not including local_kernel pixels within the regional_kernel (i.e. making the regional kernel a doughnut) we are trying to capture only the regional signal in the regional_kernel.

In practice, @dbekaert found that the regional_kernel is typically large enough that the effect of including the local_kernel pixels is negligible, but I thought it would be good to make this modification regardless. Especially since it does not require any extra steps when you're already combining the two kernels.

@yunjunz
Copy link
Member

yunjunz commented Nov 3, 2021

Thank you for the explanation @forrestfwilliams, that makes sense. Could you please add this as comments next to the code as well? I believe that would help other users too.

@forrestfwilliams
Copy link
Collaborator Author

Can do!

@yunjunz yunjunz self-requested a review November 3, 2021 21:25
Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thank you @forrestfwilliams. Please feel free to go ahead and merge the PR.

@forrestfwilliams
Copy link
Collaborator Author

Thank you @yunjunz !

@forrestfwilliams forrestfwilliams merged commit fe32d26 into insarlab:main Nov 4, 2021
@forrestfwilliams forrestfwilliams deleted the filter branch November 4, 2021 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants