Mercurial > ift6266
comparison writeup/techreport.tex @ 417:0282882aa91f
Completed the pinch transformation text
author | fsavard |
---|---|
date | Fri, 30 Apr 2010 09:25:20 -0400 |
parents | 5f9d04dda707 |
children | a3a4a9c6476d e7790db265b1 |
comparison
equal
deleted
inserted
replaced
416:5f9d04dda707 | 417:0282882aa91f |
---|---|
119 | 119 |
120 This is another GIMP filter we used. The filter is in fact named "Whirl and pinch", but we don't use the "whirl" part (whirl is set to 0). As described in GIMP, a pinch is "similar to projecting the image onto an elastic surface and pressing or pulling on the center of the surface". | 120 This is another GIMP filter we used. The filter is in fact named "Whirl and pinch", but we don't use the "whirl" part (whirl is set to 0). As described in GIMP, a pinch is "similar to projecting the image onto an elastic surface and pressing or pulling on the center of the surface". |
121 | 121 |
122 Mathematically, for a square input image, think of drawing a circle of radius $r$ around a center point $C$. Any point (pixel) $P$ belonging to that disk (region inside circle) will have its value recalculated by taking the value of another "source" pixel in the original image. The position of that source pixel is found on the line thats goes through $C$ and $P$, but at some other distance $d_2$. Define $d_1$ to be the distance between $P$ and $C$. $d_2$ is given by $d_2 = sin(\frac{\pi{}d_1}{2r})^{-pinch} \times d_1$, where $pinch$ is a parameter to the filter. | 122 Mathematically, for a square input image, think of drawing a circle of radius $r$ around a center point $C$. Any point (pixel) $P$ belonging to that disk (region inside circle) will have its value recalculated by taking the value of another "source" pixel in the original image. The position of that source pixel is found on the line thats goes through $C$ and $P$, but at some other distance $d_2$. Define $d_1$ to be the distance between $P$ and $C$. $d_2$ is given by $d_2 = sin(\frac{\pi{}d_1}{2r})^{-pinch} \times d_1$, where $pinch$ is a parameter to the filter. |
123 | 123 |
124 If the image is not square | 124 If the region considered is not square then, before computing $d_2$, the smallest dimension (x or y) is stretched such that we may consider the region as if it was square. Then, after $d_2$ has been computed and corresponding components $d_2\_x$ and $d_2\_y$ have been found, the component corresponding to the stretched dimension is compressed back by an inverse ratio. |
125 | 125 |
126 The actual value is given by bilinear interpolation considering the pixels around the (non-integer) source position. | 126 The actual value is given by bilinear interpolation considering the pixels around the (non-integer) source position thus found. |
127 | 127 |
128 The value for $pinch$ in our case was given by sampling from an uniform distribution over the range $[-complexity, 0.7 \times complexity]$. | 128 The value for $pinch$ in our case was given by sampling from an uniform distribution over the range $[-complexity, 0.7 \times complexity]$. |
129 | 129 |
130 | 130 |
131 \subsection{Occlusion} | 131 \subsection{Occlusion} |