545 lines
5.3 MiB
Plaintext
545 lines
5.3 MiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 2,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"using FileIO\n",
|
|||
|
"using Images, ImageView\n",
|
|||
|
"using Formatting"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"roundAround (generic function with 1 method)"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"function roundAround(x, low, high)\n",
|
|||
|
" if x < low\n",
|
|||
|
" low\n",
|
|||
|
" elseif x > high\n",
|
|||
|
" high\n",
|
|||
|
" else\n",
|
|||
|
" round(Int32, x)\n",
|
|||
|
" end\n",
|
|||
|
"end"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 99,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"forwardTransform (generic function with 2 methods)"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 99,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"function forwardTransform(M, P, outSize=nothing)\n",
|
|||
|
" rows, cols = size(P)\n",
|
|||
|
" if outSize == nothing\n",
|
|||
|
" outSize = size(P)\n",
|
|||
|
" end\n",
|
|||
|
" out = zeros(eltype(P), outSize)\n",
|
|||
|
" for index in CartesianIndices(P)\n",
|
|||
|
" y, x = Tuple(index)\n",
|
|||
|
" newindex = M * [x; y; 1]\n",
|
|||
|
" newindex ./= newindex[end]\n",
|
|||
|
" x1 = roundAround(newindex[1], 1, cols)\n",
|
|||
|
" y1 = roundAround(newindex[2], 1, rows)\n",
|
|||
|
" out[y1, x1] = P[index]\n",
|
|||
|
" end\n",
|
|||
|
" out\n",
|
|||
|
"end"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 92,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"backwardTransform (generic function with 2 methods)"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 92,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"function backwardTransform(algo, M, P, outSize=nothing)\n",
|
|||
|
" M = inv(M)\n",
|
|||
|
" rows, cols = size(P)\n",
|
|||
|
" if outSize == nothing\n",
|
|||
|
" outSize = size(P)\n",
|
|||
|
" end\n",
|
|||
|
" out = zeros(eltype(P), outSize)\n",
|
|||
|
"\n",
|
|||
|
" for index in CartesianIndices(out)\n",
|
|||
|
" y, x = Tuple(index)\n",
|
|||
|
" sourceIndex = M * [x; y; 1]\n",
|
|||
|
" sourceIndex ./= sourceIndex[end]\n",
|
|||
|
" x1, y1 = round.(Int32, sourceIndex)\n",
|
|||
|
" if (x1 < 1 || y1 < 1 || x1 > cols || y1 > rows)\n",
|
|||
|
" continue\n",
|
|||
|
" end\n",
|
|||
|
" out[index] = P[y1, x1]\n",
|
|||
|
" end\n",
|
|||
|
" out\n",
|
|||
|
"end"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 6,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"genMatrix (generic function with 1 method)"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 6,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"function genMatrix(what, params...)\n",
|
|||
|
" M = zeros(Float32, (3,3))\n",
|
|||
|
" M[3, 3] = 1\n",
|
|||
|
"\n",
|
|||
|
" if what == \"scale\"\n",
|
|||
|
" if length(params) < 2\n",
|
|||
|
" error(\"Scale requires two parameter (x, y)\")\n",
|
|||
|
" end\n",
|
|||
|
" x, y = params\n",
|
|||
|
" printfmt(\"Scale with x = {}; y = {}\\n\", x, y)\n",
|
|||
|
" M[1, 1] = x\n",
|
|||
|
" M[2, 2] = y\n",
|
|||
|
" elseif what == \"translate\"\n",
|
|||
|
" if length(params) < 2\n",
|
|||
|
" error(\"Translate requires two parameter (dx, dy)\")\n",
|
|||
|
" end\n",
|
|||
|
" dx, dy = params\n",
|
|||
|
" M[1, 1] = 1\n",
|
|||
|
" M[2, 2] = 1\n",
|
|||
|
" M[1, 3] = dx\n",
|
|||
|
" M[2, 3] = dy\n",
|
|||
|
" elseif what == \"rotate\"\n",
|
|||
|
" if length(params) < 2\n",
|
|||
|
" error(\"Rotate requires one parameter (theta, isRadian)\")\n",
|
|||
|
" end\n",
|
|||
|
" theta = params[1]\n",
|
|||
|
" isRadian = 1\n",
|
|||
|
" if length(params) >= 2\n",
|
|||
|
" isRadian = params[2]\n",
|
|||
|
" end\n",
|
|||
|
"\n",
|
|||
|
" if isRadian == 1\n",
|
|||
|
" M[1, 1] = cos(theta)\n",
|
|||
|
" M[1, 2] = -sin(theta)\n",
|
|||
|
" M[2, 1] = sin(theta)\n",
|
|||
|
" M[2, 2] = cos(theta)\n",
|
|||
|
" else\n",
|
|||
|
" M[1, 1] = cosd(theta)\n",
|
|||
|
" M[1, 2] = -sind(theta)\n",
|
|||
|
" M[2, 1] = sind(theta)\n",
|
|||
|
" M[2, 2] = cosd(theta)\n",
|
|||
|
" end\n",
|
|||
|
" elseif what == \"shear\"\n",
|
|||
|
" if length(params) < 4\n",
|
|||
|
" error(\"Rotate requires four parameter (a, b, c, d)\")\n",
|
|||
|
" end\n",
|
|||
|
" a,b,c,d = params\n",
|
|||
|
" M[1, 1] = a\n",
|
|||
|
" M[1, 2] = b\n",
|
|||
|
" M[2, 1] = c\n",
|
|||
|
" M[2, 2] = d\n",
|
|||
|
" else\n",
|
|||
|
" error(printfmt(\"Matrix of {} is unknown\\n\", what))\n",
|
|||
|
" end\n",
|
|||
|
" M\n",
|
|||
|
"end"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 100,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"3×3 Array{Float32,2}:\n",
|
|||
|
" 0.707107 -0.707107 500.0 \n",
|
|||
|
" 0.707107 0.707107 -207.107\n",
|
|||
|
" 0.0 0.0 1.0 "
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAIAAABAH0oBAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42rz92dMlSXYfiJ3fcY+4y7fkl2tV1tZV3dVVvaPR3VgIggBBcigKokTSRibTg2QmzYP0V+hRzzIbMy0vYzYyG5NJmqHN0IZGDkECBNFANwA2eq2u7urat9zzy2+9S4T7OXrwJTzixv0ys4FRWFrV/e6N8HA/ftz9LL9zDiYv/7qCiIjC/zj8QUQkIFImIiLO30MlflNcAIihqvFv5d5PxY1d48ThJ47NEhGxkiC9nEkptMm5wfQrAVAQAJL4UlYW5IYRHgFR7lV4nZTdIYYSAChJ7rJ2dygJjKH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AlQTz6bNMRwYBI32qTvw+jU1ZoRNcQKSk8KZMICCSKAA2RoEODolfcaOAvCAe7eKk2BBJieEzlc2x0jVcy9dOpziePWv3Z28upd8sTIWbouIczr+nHWXzSPMpjtqlusXDPrlQ2RBdsdtt0lc40EO2t0IIaG1epH/abLxyhAw4atf92N4+7lNP/slBrRXw9seu2XUszMbYSQ85T6k9ak+EQFGSLQTS7CvpiIvpvVNJ482Yf4gg5GePD6strMCroadmmTRhhm9WgVAYVVRnEIBaCErMG/BcTQBTMN8JqiAzBMUMknNLI29w4rVIHlZXD/hH6CY0e+87vShzUG2Q
|
|||
|
"text/plain": [
|
|||
|
"720×1280 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:\n",
|
|||
|
" RGB{N0f8}(0.027,0.125,0.212) … RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.024,0.125,0.216) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.024,0.125,0.216) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.027,0.129,0.22) … RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.027,0.129,0.22) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.027,0.129,0.22) RGB{N0f8}(0.02,0.114,0.224) \n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) RGB{N0f8}(0.031,0.114,0.235)\n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) RGB{N0f8}(0.031,0.114,0.235)\n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) … RGB{N0f8}(0.024,0.114,0.235)\n",
|
|||
|
" RGB{N0f8}(0.024,0.129,0.212) RGB{N0f8}(0.024,0.114,0.235)\n",
|
|||
|
" RGB{N0f8}(0.024,0.125,0.216) RGB{N0f8}(0.02,0.122,0.227) \n",
|
|||
|
" ⋮ ⋱ \n",
|
|||
|
" RGB{N0f8}(0.067,0.063,0.086) RGB{N0f8}(0.016,0.125,0.18) \n",
|
|||
|
" RGB{N0f8}(0.075,0.063,0.098) RGB{N0f8}(0.016,0.129,0.192)\n",
|
|||
|
" RGB{N0f8}(0.071,0.067,0.098) … RGB{N0f8}(0.02,0.133,0.196) \n",
|
|||
|
" RGB{N0f8}(0.059,0.071,0.098) RGB{N0f8}(0.02,0.133,0.196) \n",
|
|||
|
" RGB{N0f8}(0.043,0.063,0.075) RGB{N0f8}(0.02,0.133,0.196) \n",
|
|||
|
" RGB{N0f8}(0.059,0.051,0.106) RGB{N0f8}(0.016,0.129,0.192)\n",
|
|||
|
" RGB{N0f8}(0.063,0.055,0.098) RGB{N0f8}(0.02,0.125,0.192) \n",
|
|||
|
" RGB{N0f8}(0.047,0.067,0.082) … RGB{N0f8}(0.016,0.125,0.18) \n",
|
|||
|
" RGB{N0f8}(0.043,0.059,0.094) RGB{N0f8}(0.016,0.125,0.18) \n",
|
|||
|
" RGB{N0f8}(0.071,0.075,0.094) RGB{N0f8}(0.016,0.125,0.18) \n",
|
|||
|
" RGB{N0f8}(0.059,0.063,0.078) RGB{N0f8}(0.016,0.122,0.188)\n",
|
|||
|
" RGB{N0f8}(0.067,0.063,0.125) RGB{N0f8}(0.016,0.122,0.188)"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAIAAABAH0oBAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42uy9d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GB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" ⋮ ⋱ \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.231) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.231) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.02,0.125,0.231) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.231) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.231) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.239) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.02,0.125,0.239) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.024,0.129,0.235)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.024,0.129,0.235)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.024,0.129,0.235)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.024,0.129,0.235)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.137,0.243)"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAIAAABAH0oBAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42uz9W7BsS3Ydho0xc62qvfc5575Ov24/gAbxJAkIJAHSsoKOkEgGZT0o0qII0pIcYYUi7B9/O8Kf/vSPf/zlcDActmy+RTYAUgrZIVOWSJggutEkwCYaDaAb6Oe93fd17nnsXbUy5/DHzMyVVXuf7gYaAIHuNaPjdu2qVWvlysxVJ0eOMccktthii9+VeOVv/oxEiJIICCAJqr0jgJJInn1R3t5RgSYAgK+filYIq8coXhSXOB5YaBNhzmXSIp+uzCd85E+87089vPcrh8M/+8LN9z64/9az45PP30g6fOntUgqZSKrA3UnCRScAd8cxuzsFOlScznI86OZALygOFfgCQHlhyQBMKCigW3EJJnPPgBndD48B5Le+iLe/Iml//UxwEzRBBcPNOgCqFNHgZ71UO1AkxHq4TADgqX2XBOA0K2J5IiwATE6ZJMDotfMpaDi98+RC/TXT2UBZO8jick4ABCBMtAlAmSbQYARiDpyMuJgw7dN8BZhzJyUApABz0GIiiABEkKnf1O0gEhD3hUKQhBmm2ff3GA1wSYI8geMN1junxnfI5ChkgowmmIaBqXdtx4P8KIleABunKGJIZOeNvNV4p5E8PfL8W+N3xZOW1ltvR9TP2liSdBpgdWLw5FQnIVMbu+f18HgkW0hyxmRLdKE/j3efxJ5/cut9f9dvQv8UlMPSra97P4bicHVbxy1m+WkXQdnSheeS3rufPnp/+sGXy0f29y7uf//7X/0hv/oX7z7+tV8+HH79y4/+f5+y7CkluhItU0//zv8aW2yxxRZbb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HqZ7w66JfSwA80Sy0yjtvUJZy1RdZKigxVUaes20iNKH43bdvd705jvvZ7Z/+GdNSNm5WnR15SnHLnH7r0ztHIQQFt9Bv+7C+Y6Sei37HS1DwdQ54ivSEyeInJ1+aXVmJNHr36RCPMHTMVYtAxdfX3zRyywfeYostttji93hsDPAWW/xOxSt/5590wXMTYVY9aX0/9RVwVTaf8MRB3p6i30bwBlMb63iDIqsR1tfZRslpBoE2BQNcE03JhARi2VnKQkrLzH0gmpWBMkhwIfyOJJdNsElahGSJNvnNopyRCwhfjru8+IQ85akw5SxruY4iQRNJFoDGVI4E8e7X/O0vG4Rnb9ELCLeUSqkgt0bcpHPMi6YC+1EnyZet78DJQFekohIJdKN5oR/p2UgM6Lf2FlIFLUBi9Y4iCTohk92lhbZuZEXCzjWoQh1PnkqpQwstWLLiquRqBcf1FBIJQhIEh81AJPfamevT6rF10hP166juVh4qWDEF5gv4fZeq98790LN09OCyjVQHdXShZMkB0c8SgEfOs7Od0XvdKOs3jX41GecL0ZLNnPdIc/SMpzloX05zoEA4QWNDgCRkHRneectdQn7r9kMmzbrnMqJfkrKTdGqS4Hj8Kq6/C/2ip0B8A/RbO/Iu9NsGnt12K8apo19jyNfPkooJqyoAmugkCsJVL6WcuIjy5XBM18XlOzfkklRPUX2+lEiDSBjM9j/854+f+ilsscUWW2yxxe/V2ADwFlv8jsTD//JngUp7Jdb8wzX3r+lLQ22Jdf1bDY5WDDzkarY3bV3iSvBVYFrXvECVf0LkHN8IRNXMpqvrU6IJSMUBeEDw1v6alSxQSAeklEg7LouKm9nxuKQiLQtJXxbPeYJKljkMerZ3FCQ5QEMyD22y08zyNQi982W98QWQevJG8hKa24RCnHSUwUM
|
|||
|
"text/plain": [
|
|||
|
"720×1280 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.0,0.0,0.0) \n",
|
|||
|
" ⋮ ⋱ \n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.027,0.176,0.329)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) … RGB{N0f8}(0.031,0.169,0.325)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.318)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.318)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.318)\n",
|
|||
|
" RGB{N0f8}(0.0,0.0,0.0) RGB{N0f8}(0.031,0.169,0.318)"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"img = load(\"../images/f124074.jpg\")\n",
|
|||
|
"Matrixes = [\n",
|
|||
|
" # do last\n",
|
|||
|
" genMatrix(\"translate\", 500, 500),\n",
|
|||
|
" genMatrix(\"rotate\", 45, false),\n",
|
|||
|
" genMatrix(\"translate\", -500, -500) \n",
|
|||
|
" # do first\n",
|
|||
|
"]\n",
|
|||
|
"\n",
|
|||
|
"M = *(Matrixes...)\n",
|
|||
|
"display(M)\n",
|
|||
|
"\n",
|
|||
|
"display(img)\n",
|
|||
|
"\n",
|
|||
|
"forward = forwardTransform(M, img)\n",
|
|||
|
"display(forward)\n",
|
|||
|
"\n",
|
|||
|
"backward = backwardTransform(\"zero\", M, img)\n",
|
|||
|
"display(backward)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 102,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"projectiveTransform (generic function with 1 method)"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 102,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"function createProjectiveMatrix(points)\n",
|
|||
|
" if length(points) != 4\n",
|
|||
|
" error(\"Not correct number of point\")\n",
|
|||
|
" end\n",
|
|||
|
"\n",
|
|||
|
" A = zeros(Int64, 2*length(points), 8)\n",
|
|||
|
" B = zeros(Int64, 2*length(points), 1)\n",
|
|||
|
" for i in 1:length(points)\n",
|
|||
|
" x, y, x1, y1 = points[i]\n",
|
|||
|
" A[2*i - 1,:] = [x y 1 0 0 0 -x*x1 -x1*y]\n",
|
|||
|
" A[2*i,:] = [0 0 0 x y 1 -x*y1 -y*y1]\n",
|
|||
|
" B[2*i - 1] = x1\n",
|
|||
|
" B[2*i] = y1\n",
|
|||
|
" end\n",
|
|||
|
"\n",
|
|||
|
" H = vcat(A\\B, 1)\n",
|
|||
|
" M = reshape(H, (3,3))'\n",
|
|||
|
" \n",
|
|||
|
" # display(M)\n",
|
|||
|
" M\n",
|
|||
|
"end\n",
|
|||
|
"\n",
|
|||
|
"function projectiveTransform(picture, points, outSize)\n",
|
|||
|
" M = createProjectiveMatrix(points)\n",
|
|||
|
" backwardTransform(\"zero\", M, picture, outSize)\n",
|
|||
|
"end"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 104,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"8×8 Array{Int64,2}:\n",
|
|||
|
" 55 187 1 0 0 0 -55 -187\n",
|
|||
|
" 0 0 0 55 187 1 -55 -187\n",
|
|||
|
" 1276 619 1 0 0 0 -1919104 -930976\n",
|
|||
|
" 0 0 0 1276 619 1 -1276 -619\n",
|
|||
|
" 1447 1761 1 0 0 0 -2176288 -2648544\n",
|
|||
|
" 0 0 0 1447 1761 1 -2917152 -3550176\n",
|
|||
|
" 166 1819 1 0 0 0 -166 -1819\n",
|
|||
|
" 0 0 0 166 1819 1 -334656 -3667104"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"8×1 Array{Int64,2}:\n",
|
|||
|
" 1\n",
|
|||
|
" 1\n",
|
|||
|
" 1504\n",
|
|||
|
" 1\n",
|
|||
|
" 1504\n",
|
|||
|
" 2016\n",
|
|||
|
" 1\n",
|
|||
|
" 2016"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"3×3 LinearAlgebra.Adjoint{Float64,Array{Float64,2}}:\n",
|
|||
|
" 0.886982 -0.060257 -36.5144\n",
|
|||
|
" -0.500302 1.41336 -235.78 \n",
|
|||
|
" -0.000275854 8.95484e-5 1.0 "
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAvEAAAPxCAIAAAD8LWUCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42uz925skt5EniJoBcI+IzMqqLLJIFiWqpe7plvombc88nPOd///57Ow3Z3Zndrent7t1ISmSdcvMuLg7zM6DAXADHB7hkZnFKvU0RJGREe64GACDwexnZvj86fr50zUiAgAzIyIiGmOsMc5Y+ZKZAUB+YgAAhrEgTEr+FbP6HmvPs3oGYlvSKCCOT6kWEHU9qH5IH61Bk6rkss95BfOFdfWBEqffOE6fRUVRilWt+UDq9Cxoq/4Y+4+YEav+LjHD6QEvKppwp6pkpkg6ZgBM86hXCs6tMiEXM/OxAeb1MDMws8wWYtoOsiOyTmuKsKIPY30vnD3/pv7OonkIm5WZpY64d8eXERFANtekRgzf4OL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PfuSwCIxoAAgYtF54En4iWBMRsIp3wzxUCgMEsQ8NQqlzs9Zm907dPQ2XiecrpjkDYDEGTwJ9YG4krk55TedceZKxLgdo97ys5kKhpQ/q/DqhT9+5ZzS5xyFqI092TamMUeshaOY8Xsp3lD4/fWetQUTyROSz6jM9aobnOBeDnEyxhW2rOi9Tpfr0Gd2yLGA5iSeghFS/GQmt5EKh60jhWbrV2aLqQ+A+hQ0IsNCXsqovrz2SvD6PPAJqMF+0M/fv8a8C14BJu0MEzChsJ9i/AQBllQkCQVc5sUok8p5eeNm7aoPkiuJsOWj
|
|||
|
"text/plain": [
|
|||
|
"2016×1504 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) … RGB{N0f8}(0.341,0.278,0.22) \n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.337,0.275,0.216)\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.337,0.275,0.216)\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.329,0.267,0.208)\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) … RGB{N0f8}(0.322,0.259,0.2) \n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.318,0.255,0.196)\n",
|
|||
|
" RGB{N0f8}(0.267,0.22,0.125) RGB{N0f8}(0.314,0.251,0.192)\n",
|
|||
|
" RGB{N0f8}(0.263,0.216,0.122) RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" RGB{N0f8}(0.263,0.216,0.122) RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" RGB{N0f8}(0.259,0.212,0.118) … RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" RGB{N0f8}(0.259,0.212,0.118) RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" RGB{N0f8}(0.259,0.212,0.118) RGB{N0f8}(0.325,0.263,0.204)\n",
|
|||
|
" ⋮ ⋱ \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) … RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) … RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) RGB{N0f8}(0.0,0.004,0.012) \n",
|
|||
|
" RGB{N0f8}(0.024,0.031,0.02) … RGB{N0f8}(0.0,0.004,0.012) "
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAvEAAAPxCAIAAAD8LWUCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAACAAElEQVR42qz927IjSbIdC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lX8rz3rbWeu859POqkSgCWu91moCoLYu7S5FcDkqdEcLUkubrqgAgTAGccWQeFgDyZMwdEQ1MVQkpWNRc3Ql5m68AgFvwzSxIIaX0MURKnSq4JpTZVjTEDJ0CNoxSWDAA93CEUEQEkYMcADwgELmU8MilxjwCnXHnABAASEohwjEGIYW6mW+EGSFi4BYWAjEBbrAvr+5Y04+lNm8yJSdhtu0ohOCgqqUUIlQzMyWRhFwEwMJMhL4DBwR3O+gCM4MgQHAIJCylIgYTMRMqUECAZVyaFKS7gzszE9NQQwaIJJNgmmo+/bcIHgHRAQLAARkJ3SPCeN/mAULdYwumg4kSfe6hJzCX3O2Itu0tn1cCMndFJGLxCAgvQswSAG4OEeCRDwYJETa2IGPoeZ577+6DhXKn3wH3BssigokIGcMAzdxq5SR0VdVsRARC3qikiICIIgwxRFiEem8eVisTkfnOH+BDWB5YqCAQMouEOnRthCBTQSRThQiCYATG2IgDIg93swDbI3faaIoEe4REsmEmsACDSJqJ8kkFmJmaG0BAOO6BOO0MT0A4OHISjoGIpZRSyrq2xGfMTISqtlNo4aHqGgTESWKRCCWz4Kp9jI0WFQ5
|
|||
|
"text/plain": [
|
|||
|
"2016×1504 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:\n",
|
|||
|
" RGB{N0f8}(0.467,0.467,0.427) … RGB{N0f8}(0.02,0.016,0.0) \n",
|
|||
|
" RGB{N0f8}(0.416,0.416,0.376) RGB{N0f8}(0.016,0.016,0.0) \n",
|
|||
|
" RGB{N0f8}(0.416,0.416,0.376) RGB{N0f8}(0.016,0.016,0.0) \n",
|
|||
|
" RGB{N0f8}(0.384,0.384,0.345) RGB{N0f8}(0.039,0.039,0.008)\n",
|
|||
|
" RGB{N0f8}(0.38,0.38,0.341) RGB{N0f8}(0.039,0.039,0.008)\n",
|
|||
|
" RGB{N0f8}(0.376,0.376,0.337) … RGB{N0f8}(0.11,0.11,0.078) \n",
|
|||
|
" RGB{N0f8}(0.376,0.376,0.337) RGB{N0f8}(0.11,0.11,0.078) \n",
|
|||
|
" RGB{N0f8}(0.388,0.388,0.349) RGB{N0f8}(0.09,0.09,0.059) \n",
|
|||
|
" RGB{N0f8}(0.388,0.38,0.333) RGB{N0f8}(0.09,0.09,0.059) \n",
|
|||
|
" RGB{N0f8}(0.4,0.392,0.345) RGB{N0f8}(0.118,0.118,0.086)\n",
|
|||
|
" RGB{N0f8}(0.4,0.392,0.345) … RGB{N0f8}(0.118,0.118,0.086)\n",
|
|||
|
" RGB{N0f8}(0.443,0.435,0.388) RGB{N0f8}(0.18,0.18,0.141) \n",
|
|||
|
" RGB{N0f8}(0.427,0.42,0.373) RGB{N0f8}(0.18,0.18,0.141) \n",
|
|||
|
" ⋮ ⋱ \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) … RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.439,0.4,0.353) \n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) … RGB{N0f8}(0.443,0.404,0.365)\n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.443,0.404,0.365)\n",
|
|||
|
" RGB{N0f8}(0.427,0.392,0.325) RGB{N0f8}(0.443,0.404,0.365)\n",
|
|||
|
" RGB{N0f8}(0.42,0.384,0.318) RGB{N0f8}(0.443,0.404,0.365)\n",
|
|||
|
" RGB{N0f8}(0.42,0.384,0.318) RGB{N0f8}(0.443,0.404,0.365)\n",
|
|||
|
" RGB{N0f8}(0.42,0.384,0.318) … RGB{N0f8}(0.443,0.4,0.329) "
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"img = load(\"../images/aaa.jpg\")\n",
|
|||
|
"row, col = size(img)\n",
|
|||
|
"points = [\n",
|
|||
|
" # [x y x1 y1],\n",
|
|||
|
" [55 187 1 1],\n",
|
|||
|
" [1276 619 col 1],\n",
|
|||
|
" [1447 1761 col row],\n",
|
|||
|
" [166 1819 1 row]\n",
|
|||
|
"]\n",
|
|||
|
"\n",
|
|||
|
"# out = projectiveTransform(img,points)\n",
|
|||
|
"\n",
|
|||
|
"M = createProjectiveMatrix()\n",
|
|||
|
"out = backwardTransform(\"zero\", M, picture)\n",
|
|||
|
"\n",
|
|||
|
"display(img)\n",
|
|||
|
"display(out)"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"kernelspec": {
|
|||
|
"display_name": "Julia 1.2.0-DEV",
|
|||
|
"language": "julia",
|
|||
|
"name": "julia-1.2"
|
|||
|
},
|
|||
|
"language_info": {
|
|||
|
"file_extension": ".jl",
|
|||
|
"mimetype": "application/julia",
|
|||
|
"name": "julia",
|
|||
|
"version": "1.2.0"
|
|||
|
}
|
|||
|
},
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 2
|
|||
|
}
|