Skip to content

Commit 1a48e28

Browse files
committed
Hot Pixel Fix
1 parent 616fcfc commit 1a48e28

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Version 0.3.0.1 - (2020-12-01)
2+
## Fixes
3+
- Fixed a long-standing bug where hot pixels frequently appeared in blended images [[before](https://i.imgur.com/W8RniY5.jpg) and [after](https://i.imgur.com/B5dLjRn.jpg)]
4+
- Comment: <i>While researching 2D interpolation methods in Python for what feels like the hundredth time (and still concluding that
5+
RectBivariateSpline is apparently the best method I can use), I noticed the optional 'kx' and 'ky' parameters that this method supports.
6+
Naturally, the [documentation](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.RectBivariateSpline.html) on them
7+
isn't very helpful (and honestly, I'm too lazy to put my computer engineering hat back on to understand what [Wikipedia](https://en.wikipedia.org/wiki/Spline_(mathematics))
8+
makes of them), but it does mention that the default value for each parameter is 3 degrees.. which got me thinking that a change here could lead
9+
to a potential performance improvement for PIM! In an unexpected turn of events, from what I can tell, setting 'kx' and 'ky' to 1 completely removes ALL
10+
hot/dead pixels that were appearing during interpolation. As a bonus, it also gives a 1-2% performance improvement based on surface level analysis.. win-win.</i>
11+
112
# Version 0.3.0.0 - (2020-11-21)
213
## Known Bugs
314
- The GUI can sometimes become unresponsive during morphing calculations (but eventually returns to normal)

Morphing/Morphing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def __init__(self, leftImage, leftTriangles, rightImage, rightTriangles):
9797
self.leftTriangles = leftTriangles # Not of type np.uint8
9898
self.rightImage = copy.deepcopy(rightImage)
9999
self.rightTriangles = rightTriangles # Not of type np.uint8
100-
self.leftInterpolation = RectBivariateSpline(np.arange(self.leftImage.shape[0]), np.arange(self.leftImage.shape[1]), self.leftImage)
101-
self.rightInterpolation = RectBivariateSpline(np.arange(self.rightImage.shape[0]), np.arange(self.rightImage.shape[1]), self.rightImage)
100+
self.leftInterpolation = RectBivariateSpline(np.arange(self.leftImage.shape[0]), np.arange(self.leftImage.shape[1]), self.leftImage, kx=1, ky=1)
101+
self.rightInterpolation = RectBivariateSpline(np.arange(self.rightImage.shape[0]), np.arange(self.rightImage.shape[1]), self.rightImage, kx=1, ky=1)
102102

103103

104104
def getImageAtAlpha(self, alpha, smoothMode):

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ python get-pip.py
6161
## Development 'To-Do' List:
6262
- <b>Feature:</b> Image Zoom
6363
- User may click the right mouse button on an image to zoom in for more accurate point placement
64+
- <b>Feature:</b> Automatic Correspondence Determination
65+
- User may click a button to have PIM automatically generate points by scanning for similar features between images
6466
- <b>Change:</b> Improved Morphing Performance
6567
- Currently, interpolation is the biggest bottleneck, second to the required matrix math
66-
- <b>Fix:</b> Improved Image Interpolation
67-
- Hot pixels can appear in blends - this is a complicated issue (being implicitly tied to performance) and is mentioned [here](https://github.com/ddowd97/Morphing/issues/2)
6868

6969
If you encounter an error, a bug, or if you simply wish to request a change/feature, please file an issue using the tracker that GitHub provides, [here](https://github.com/ddowd97/Morphing/issues).
7070

0 commit comments

Comments
 (0)