-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated plot with sharex=True and wrap with a mode 'constant' #4
base: master
Are you sure you want to change the base?
Conversation
Hello @alexlib, and sorry for my too late answer 🙏. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again @alexlib for this contribution, I just recommend using edge
instead of constant
, otherwise my other comments are optional 😉
@@ -36,7 +36,7 @@ | |||
|
|||
y, x = np.meshgrid(np.arange(nl), np.arange(nc), indexing='ij') | |||
|
|||
wI1 = warp(I1, np.array([y+v, x+u]), mode='nearest') | |||
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') | |
wI1 = warp(I1, np.array([y+v, x+u]), mode='edge') |
Thank you for spotting this 😉. Instead of the constant
mode, I would recommend the edge
mode: the constant
mode will in most cases introduce high gradient values on the image border, and thus create artifacts 😕
@@ -74,7 +74,7 @@ def _tvl1(I0, I1, u0, v0, dt, lambda_, tau, nwarp, niter, tol, prefilter): | |||
u = ndi.filters.median_filter(u, 3) | |||
v = ndi.filters.median_filter(v, 3) | |||
|
|||
wI1 = warp(I1, np.array([y+v, x+u]), mode='nearest') | |||
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') | |
wI1 = warp(I1, np.array([y+v, x+u]), mode='edge') |
@@ -238,7 +238,7 @@ def _ilk(I0, I1, u0, v0, rad, nwarp, gaussian, prefilter): | |||
u = ndi.filters.median_filter(u, 3) | |||
v = ndi.filters.median_filter(v, 3) | |||
|
|||
wI1 = warp(I1, np.array([y+v, x+u]), mode='nearest') | |||
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wI1 = warp(I1, np.array([y+v, x+u]), mode='constant') | |
wI1 = warp(I1, np.array([y+v, x+u]), mode='edge') |
@@ -70,7 +70,7 @@ def parse_requirements_file(filename): | |||
], | |||
install_requires=REQUIRES, | |||
extras_require=EXTRA_REQUIRES, | |||
python_requires='>=3.5', | |||
python_requires='>=3.7', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this change is mandatory 😕
@@ -59,7 +59,7 @@ | |||
# --- Show the result | |||
|
|||
fig = plt.figure(figsize=(15, 4)) | |||
ax0, ax1, ax2 = fig.subplots(1, 3, True) | |||
ax0, ax1, ax2 = fig.subplots(1, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ax0, ax1, ax2 = fig.subplots(1, 3) | |
ax0, ax1, ax2 = fig.subplots(1, 3, sharex=True, sharey=True) |
Probably not necessary, but it doesn't hurt ^^
new matplotlib requires explicit
sharex=True
andsharey=True
scikit-image wrap changed to
constant
(nearest
does not exist anymore)