SA2-66 - 1 -
x y ( d + 1) x G( x) = dx + 1 ( d + 1) y G( = dy + 1-2 -
- 3 -
x y - 4 -
P O ( r, θ) P ( f ( r), θ) f (r) [, R] R f ( r) = 1 r [, ) >1 [,1) [, R] - 5 -
r 1 f ( r) = R R 1 [, R] [, R] O x, ) P R ( y ( x, P O ( r, θ) r r = ( x x y 2 2 ) + ( y ) π π [, ] θ [,2π] y y θ = sin x x y y r y y θ = π sin x x y y r y y θ = π + sin x x y y r 2 2 y y θ = 2π sin x x y y r O O( x, y ) O O x = x y y = P P P O ( r, θ) 1 r R 1 θ = θ r = R >1-6 -
P ( x, y ) x = x + rcos θ y = y + rsin θ GDI+ - 7 -
Dim tmpimg1 As Bitmp Dim tmpimg2 As Bitmp Dim CR, Cx, Cy As Integer Const = 1.13 Privte Sub PictureBox1_MouseDown(ByVl sender As Object, ByVl e As System.Windows.Forms.MouseEventArgs) _ Hndles PictureBox1.MouseDown Dim BlckColor As Color Dim Imgwidth, Imgheight, x, y, Newx, Newy, Difx, Dify As Integer Dim r, fr, rf, Ridx, Ridy As Double Dim Mousex, Mousey As Integer Mousex = CInt(e.X) Click x Mousey = CInt(e.Y) Click y tmpimg1 = PictureBox1.Imge.Clone Imgwidth = tmpimg1.width Imgheight = tmpimg1.height tmpimg2 = tmpimg1.clone Cx = Mousex x Cy = Mousey y TextBox1.Text = CStr(Mousex) x TextBox1 TextBox2.Text = CStr(Mouse y TextBox2 CR = CInt(TextBox3.Text) TextBox3 For x = 1 To Imgwidth For y = 1 To Imgheight tmpimg2.setpixel(x - 1, y - 1, BlckColor.White) For x = 1 To Imgwidth For y = 1 To Imgheight r = Mth.Sqrt((x - Cx) ^ 2 + (y - C ^ 2) If r > CR + 2 Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) If (r <= CR + 2) And (r >= CR) Then tmpimg2.setpixel(x - 1, y - 1, BlckColor.White) If (r < CR) And (r > ) Then Difx = x - Cx Dify = Cy - y Ridx = Mth.Acos(Difx / r) Ridy = Mth.Asin(Dify / r) fr = CR * (1 - Mth.Pow(, -r)) / (1 - Mth.Pow(, -CR)) Newx = Cx + CInt(fr * Mth.Cos(Ridx)) Newy = Cy - CInt(fr * Mth.Sin(Rid) tmpimg2.setpixel(newx - 1, Newy - 1, tmpimg1.getpixel(x - 1, y - 1)) If r = Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) PictureBox2.Imge = tmpimg2 End Sub P ( x, P( x, O( x, y ) O x, y ) ( - 8 -
x = x y y = P ( x, O( x, y ) ( r, θ ) r = ( x x 2 2 ) + ( y y y θ = sin r x x y y y y θ = π sin r x x y y y y θ = π + sin r x x y y y y θ = π 2 sin r x x y y r P O ( r, θ) 1 r = R R 1 >1 = R r log (1 R R r ) θ = θ P ( x, x = x + r cosθ y = y + r sin θ - 9 -
Dim tmpimg1 As Bitmp Dim tmpimg2 As Bitmp Dim CR, Cx, Cy As Integer Const = 1.13 Privte Sub PictureBox1_MouseDown(ByVl sender As Object, ByVl e As System.Windows.Forms.MouseEventArgs) _ Hndles PictureBox1.MouseDown Dim BlckColor As Color Dim Imgwidth, Imgheight, x, y, Newx, Newy, Difx, Dify As Integer Dim r, fr, Ridx, Ridy As Double Dim Mousex, Mousey As Integer Mousex = CInt(e.X) Click x Mousey = CInt(e.Y) Click y tmpimg1 = PictureBox1.Imge.Clone Imgwidth = tmpimg1.width Imgheight = tmpimg1.height tmpimg2 = tmpimg1.clone Cx = Mousex x Cy = Mousey y TextBox1.Text = CStr(Mousex) x TextBox1 TextBox2.Text = CStr(Mouse y TextBox2 CR = CInt(TextBox3.Text) TextBox3 For x = 1 To Imgwidth For y = 1 To Imgheight tmpimg2.setpixel(x - 1, y - 1, BlckColor.White) For x = 1 To Imgwidth For y = 1 To Imgheight fr = Mth.Sqrt((x - Cx) ^ 2 + (y - C ^ 2) If fr > CR + 2 Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) If (fr <= CR + 2) And (fr >= CR) Then tmpimg2.setpixel(x - 1, y - 1, BlckColor.White) If (fr < CR) And (fr > ) Then Difx = x - Cx Dify = Cy - y Ridx = Mth.Acos(Difx / fr) Ridy = Mth.Asin(Dify / fr) r = (Mth.Log((CR * Mth.Pow(, CR)) / (CR * Mth.Pow(, CR) - fr * (Mth.Pow(, CR) - 1)))) / (Mth.Log()) Newx = Cx + CInt(r * Mth.Cos(Ridx)) Newy = Cy - CInt(r * Mth.Sin(Rid) tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(newx - 1, Newy - 1)) If fr = Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) PictureBox2.Imge = tmpimg2 End Sub - 1 -
r r f < r R er f ( r) = r r rf r f r 1 f ( r) = R r R f < r R 1 r f O( x, P( x, rf O( x, y ) P ( x, R er O( x, y ) O x, y ) O ( x, y ) = O( x, ) y ( P ( x, O( x, y ) ) P ( r, θ r r > R P ( x, ) P( x, y P ( x, = P( x, R r > er r 1 r = f ( r) = R R 1 = R r log (1 R R r ) - 11 -
θ θ = θ P ( x, P( x, x = x + r cosθ y = y + r sin θ er r> f 1 er = R R 1 R r = log 1 e(1 ) x y r ( ) f er er r = f ( r) = r = R r log 1 e(1 ) log r = f R ( 1 e(1 )) er r ( ) θ θ = θ P ( x, P( x, x = x + r cosθ y = y + r sin θ r x y - 12 -
Dim tmpimg1 As Bitmp Dim tmpimg2 As Bitmp Dim CR, Cx, Cy As Integer Const = 1.18 Const ncr = 4 / 5 Privte Sub PictureBox1_MouseDown(ByVl sender As Object, ByVl e As System.Windows.Forms.MouseEventArgs) _ Hndles PictureBox1.MouseDown Dim BlckColor As Color Dim Imgwidth, Imgheight, x, y, Newx, Newy, Difx, Dify As Integer Dim r, fr, rf, Ridx, Ridy As Double Dim Mousex, Mousey As Integer Mousex = CInt(e.X) Click x Mousey = CInt(e.Y) Click y tmpimg1 = PictureBox1.Imge.Clone Imgwidth = tmpimg1.width Imgheight = tmpimg1.height tmpimg2 = tmpimg1.clone Cx = Mousex x Cy = Mousey y TextBox1.Text = CStr(Mousex) x TextBox1 TextBox2.Text = CStr(Mouse y TextBox2 CR = CInt(TextBox3.Text) TextBox3 rf = -1 * (Mth.Log(1 - ncr * (1 - Mth.Pow(, -CR)))) / (Mth.Log()) For x = 1 To Imgwidth For y = 1 To Imgheight tmpimg2.setpixel(x - 1, y - 1, BlckColor.Blck) For x = 1 To Imgwidth For y = 1 To Imgheight fr = Mth.Sqrt((x - Cx) ^ 2 + (y - C ^ 2) If fr > CR + 2 Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) If (fr <= CR + 2) And (fr >= CR) Then tmpimg2.setpixel(x - 1, y - 1, BlckColor.White) If (fr < CR) And (fr > ) Then Difx = x - Cx Dify = Cy - y Ridx = Mth.Acos(Difx / fr) Ridy = Mth.Asin(Dify / fr) If fr < ncr * CR Then r = (fr * rf) / (ncr * CR) Else r = (Mth.Log((CR * Mth.Pow(, CR)) / (CR * Mth.Pow(, CR) - fr * (Mth.Pow(, CR) - 1)))) / (Mth.Log()) Newx = Cx + CInt(r * Mth.Cos(Ridx)) Newy = Cy - CInt(r * Mth.Sin(Rid) tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(newx - 1, Newy - 1)) If fr = Then tmpimg2.setpixel(x - 1, y - 1, tmpimg1.getpixel(x - 1, y - 1)) PictureBox2.Imge = tmpimg2 End Sub - 13 -
- 14 -
1. George W. Furns., Generlized fisheye views, Proceeding of Humn Fctors in Computing System, CHI 86, ACM Press, pp. 16-23, 1986. 2. Mnojit Srkr, nd Mrc H. Brown., Grphicl fisheye views, Communictions of the ACM, 37(12), pp. 73-84, 1994. 3., FLASH 5 Action,, 11, 21. 4.,,, 2, 1963. 5., DirectX+VB.NET 3D,, 23. - 15 -