This repository has been archived on 2021-02-05. You can view files and clone it, but cannot push or open issues or pull requests.
ipcv/julia_notebook/hough.ipynb

825 lines
528 KiB
Plaintext
Raw Normal View History

2019-05-14 22:37:19 +07:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
"using Images\n",
"using TestImages\n",
"using FileIO\n",
"using Colors\n",
"using ImageFeatures\n",
"using Formatting\n",
"using Plots\n",
"using DSP"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"hough (generic function with 1 method)"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function hough(img)\n",
" rows, cols = size(img)\n",
" D = round(Int32, sqrt(rows ^ 2 + cols ^ 2))\n",
" rhos = -D:1:D\n",
" thetas = deg2rad.(-90:1:90)\n",
"\n",
" A = zeros(Int32, length(rhos), length(thetas))\n",
" sins, coss = sin.(thetas), cos.(thetas)\n",
" \n",
" for idx in CartesianIndices(img)\n",
" if img[idx] == 0\n",
" # 0 or false\n",
" continue\n",
" end\n",
"\n",
" y, x = Tuple(idx)\n",
" for thetaIdx in 1:length(thetas)\n",
" rho = x * coss[thetaIdx] + y * sins[thetaIdx]\n",
" rho = round(Int32, rho)\n",
" A[rho + D, thetaIdx] += 1\n",
" end\n",
" end\n",
" \n",
" rowsA, colsA = size(A)\n",
" for idx in CartesianIndices(A)\n",
" y, x = Tuple(idx)\n",
" if x == 1 || y == 1 || x == colsA || y == rowsA\n",
" continue\n",
" end\n",
" C = A[idx]\n",
" C1 = (C < A[y - 1, x - 1]) || (C < A[y - 1, x])\n",
" C2 = (C < A[y - 1, x + 1]) || (C < A[y, x + 1])\n",
" C3 = (C < A[y + 1, x + 1]) || (C < A[y + 1, x])\n",
" C4 = (C < A[y + 1, x - 1]) || (C < A[y, x - 1])\n",
" if C1 || C2 || C3 || C4\n",
" A[idx] = 0\n",
" end\n",
" end\n",
"\n",
" A, rhos, thetas\n",
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Z5UKS1b4UZHpHSMsmT7flACWON5Ga5WqnFREprNrN5HpfLdqTVjwg3/RshrL/6W3tcFtWyNvNHi/0T+ezRlT/uZ1+qngrn/Pbin+3hfrZZ1EMPgO7in+U+ts8u/cHyxSM+Lqqzp1uaylBfLsQ0IQSE7uwL46G5SvZQWBs70LuUcPv870aV1aNHpR5Wj5/j2KxOt/3+9vFXyf+aAkN3+c0pD4uwDiU+PRv+ieZ/P5/8rnj6FX46sauzxBbM3cXfzvPfP8Sz5UjU52c+TUMNk3Lx1Wr8YDj/Zjs+Bu6iMAJjc1mVexYBuL96ssxPDvhiLpJmxtNxvLioUPZtJas+9JxoyA9KbC6u/Gg/2cz9cCq437okk6GezcNgrxTdctaa8TD5IIwdkOwkhvNTpIl5n1w7A8duM180lGiOmOV5piUiACADkYDe+5Ag9w023kAMoa63qyQtL9dVuVmT7ZYuL4cFKaJEttWmBVNip6RSCt12HmkgizFWT1VG1F6tDyYFtd61bSJIlXvz9RNhidt5fTBIscy6RQZSSkIwk4N6u9J9MsxWMipJ3K2NF5OhbhSizjQiCjsB/0KPQEry28rk/ewwITNs2tmAt5BY9VEty351cH/xj0f7ByfZFtb9+Zf6s2PVfPlcZqpIl//MHspMLr/4Zjo5TgvYagQUMraZTkTfxHj199OTydHy9Fmd52l/9c1FPCg0I+qyiGep0nY6NBjWT164w6EEAEHdPENbV5cQ+9O/VA9PshcX50HF6rwIUkBYffXn+mQy7vwq8OIFRxWvnkEU7Qu8qy1FlARIcfVNbMSed7Gb/325Px22m6221bOz+3epeXL5yWEKa5SJBL/45/xOogkAuX32aJiOYTPLxOVf/e8
"text/plain": [
"651×1004 Array{Gray{Float64},2} with eltype Gray{Float64}:\n",
" Gray{Float64}(0.00389093) … Gray{Float64}(0.00389093)\n",
" Gray{Float64}(0.0194547) Gray{Float64}(0.0194547) \n",
" Gray{Float64}(0.0428002) Gray{Float64}(0.0428002) \n",
" Gray{Float64}(0.058364) Gray{Float64}(0.058364) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) … Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) … Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" ⋮ ⋱ \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) … Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) … Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.0622549) Gray{Float64}(0.0622549) \n",
" Gray{Float64}(0.058364) Gray{Float64}(0.058364) \n",
" Gray{Float64}(0.0428002) Gray{Float64}(0.0428002) \n",
" Gray{Float64}(0.0194547) Gray{Float64}(0.0194547) \n",
" Gray{Float64}(0.00389093) … Gray{Float64}(0.00389093)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+4AAAKNCAAAAACbmG4iAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAIAASURBVHja7L13nB23df79xczcur33Qi7rsneRKlTvXXKLe3fcEvt14sSJ/YsTO8VxTRzHjh3H3ZZtyapU7yJFir1zyeX23tutU/D+gbl375JLik1cUtrn8yH3zgy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fwyyAQtgyxRV0oUOkX/KF9X2bgMtvgLcHvg+rHv5z2Jxb9T7g0X6o/XR0FxjrrgaQJbmZZcC99wKXv7+tCz7yTwDhitWXqCQdWVCz+s+AwSPA6FD1KnVf6hVXLV0CvP9dJcCfX/nAD3aU/HkW9Ky7awEAlXd9/trD7bD2alj6/nTgM1/0QPlfLwcWfWkZQPb6D//TZYC9FLjj9ngPLF0FfPhjQOAvPwINOzQl7vPuvc19ce7ln/tsHrDwlnwC77wCWHeX/dt6gKySggVuP0X+zZ+9Axhduwyg6LJVAOW3/PlNAOk3fPym093Dcq6R0t1Ie7ThlU3+T11zuhWOpqdXrliZ1/zMK8etmEjb1LNLyQQGciHaOYbhzcwLGsCuS64EKno2lAOv9pAPxFojS64vAQiU+4G8aqAhxCiBbOCX+/y31vwWqJ1TVQLEOutJnwH8+iA35RwEoukFH6R39whAx0udRTdC3e+hxuMDDxVAqwVpC8l0C6CHpsuA/3sKuKTy6OOLAA7DcmCIsenR/eTQCm8r5d8BvDNXf/D
"text/plain": [
"653×1006 Array{Gray{Float64},2} with eltype Gray{Float64}:\n",
" Gray{Float64}(-0.00389093) … Gray{Float64}(0.00389093)\n",
" Gray{Float64}(-0.0272365) Gray{Float64}(0.0272365) \n",
" Gray{Float64}(-0.0856005) Gray{Float64}(0.0856005) \n",
" Gray{Float64}(-0.163419) Gray{Float64}(0.163419) \n",
" Gray{Float64}(-0.221783) Gray{Float64}(0.221783) \n",
" Gray{Float64}(-0.245129) … Gray{Float64}(0.245129) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) … Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" ⋮ ⋱ ⋮ \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) … Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.24902) Gray{Float64}(0.24902) \n",
" Gray{Float64}(-0.245129) Gray{Float64}(0.245129) \n",
" Gray{Float64}(-0.221783) Gray{Float64}(0.221783) \n",
" Gray{Float64}(-0.163419) Gray{Float64}(0.163419) \n",
" Gray{Float64}(-0.0856005) … Gray{Float64}(0.0856005) \n",
" Gray{Float64}(-0.0272365) Gray{Float64}(0.0272365) \n",
" Gray{Float64}(-0.00389093) Gray{Float64}(0.00389093)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+4AAAKNCAAAAACbmG4iAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAIAASURBVHja7L13YB3HdS/8m9nd2y8ueu8dBMHeOylRIqlmFUuyLduSe1xiJ06cl+7k5aW/Fyf58tJeip3i3ptkdVHsvYAgQPRyAdze79aZ74+9AAEQJMFOSvdni7i7Ozs7M7vnzJkzpxBi8RR6JAKAAAA3/zWPeObfaZCLPzMlL/6dvmvqYObvWSB8zl9ciulaMz84yKzqwS9z4xUvX6yCg4CTqUZykDnNv6SXILO6NG8/Z43YFRp35UrmPIbPbJrZ7PnuNIvMuDbrTc7pDr9a6y4/IJdt56UPIZeUywwMJ1OXL3nEnHvnfxK/XLNmDDyf/r7IFbo7p6aLBTMDQC59wELeKycLGOOrNWnmxzpFj5hFFnwGyc77xc/8HNRoIKqKYuWejy69rnZlkUUW9w5O/cvPhgXb0j9YdKcbkkUWWdxqlDYeGKN3uhF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XDfsdkv0cK/ZVd1gnAEIRXNXrzlnruy2P7Wl9agB8EhuXp+BOnFk4p2nsLmZIFJOoT0ZDSXlUO9kfp0tFEvLKblicZESUOvW570IoCiHB2bZXVjz8nJsouTI8TgEvy8WT5MCiwJgffV5AACXJ3omc/PPAdEUAKxq6p/xQEGggigKIIIY9Af8CTNAK9MzVCQP9k/4Rns6+0KZz9dQdIBClTVV0QzGNEWsW7X6m0nzas7EqUSi9+Cx0Sl
"text/plain": [
"653×1006 Array{Gray{Float64},2} with eltype Gray{Float64}:\n",
" Gray{Float64}(0.00389093) … Gray{Float64}(0.00389093) \n",
" Gray{Float64}(0.0194547) Gray{Float64}(0.0194547) \n",
" Gray{Float64}(0.0389093) Gray{Float64}(0.0389093) \n",
" Gray{Float64}(0.0389093) Gray{Float64}(0.0389093) \n",
" Gray{Float64}(0.0194547) Gray{Float64}(0.0194547) \n",
" Gray{Float64}(0.00389093) … Gray{Float64}(0.00389093) \n",
" Gray{Float64}(-2.65822e-16) Gray{Float64}(-3.85526e-16)\n",
" Gray{Float64}(0.0) Gray{Float64}(-1.12255e-16)\n",
" Gray{Float64}(2.54746e-16) Gray{Float64}(2.71234e-16) \n",
" Gray{Float64}(-2.07673e-16) Gray{Float64}(-2.74454e-16)\n",
" Gray{Float64}(0.0) … Gray{Float64}(-1.18082e-16)\n",
" Gray{Float64}(-5.53795e-17) Gray{Float64}(2.55528e-16) \n",
" Gray{Float64}(1.43987e-16) Gray{Float64}(3.08044e-16) \n",
" ⋮ ⋱ ⋮ \n",
" Gray{Float64}(9.69141e-17) Gray{Float64}(4.10241e-16) \n",
" Gray{Float64}(4.70726e-17) Gray{Float64}(-1.42434e-16)\n",
" Gray{Float64}(-9.97696e-17) Gray{Float64}(-1.50949e-16)\n",
" Gray{Float64}(1.78253e-16) Gray{Float64}(2.84823e-16) \n",
" Gray{Float64}(-1.50887e-16) … Gray{Float64}(-5.30807e-16)\n",
" Gray{Float64}(1.78047e-16) Gray{Float64}(-8.47325e-18)\n",
" Gray{Float64}(-0.00389093) Gray{Float64}(-0.00389093) \n",
" Gray{Float64}(-0.0194547) Gray{Float64}(-0.0194547) \n",
" Gray{Float64}(-0.0389093) Gray{Float64}(-0.0389093) \n",
" Gray{Float64}(-0.0389093) … Gray{Float64}(-0.0389093) \n",
" Gray{Float64}(-0.0194547) Gray{Float64}(-0.0194547) \n",
" Gray{Float64}(-0.00389093) Gray{Float64}(-0.00389093) "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA+4AAAKNAQAAAACWiAxTAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAd2KE6QAAD/pSURBVHja7d0LeBxXnSj40yqjCozU5Rm+BQU9ytxhmW8vgShkYitIUZnJnWG+HWZz2VljJg+7vYYYEtnq4Ikkx1JXGYHFLkQKO/fLGGK7uTsscG0cK2Ri2chSlxDjZr4k1sxNHMvWo0r04Abb6i7RlqraVV1nz6lXV7+kblmy4OLDR9SSu/tX51+nTlWdVwGwtomBa5gkwK4lr/ye8x1rWfA6wH4x/RuFt+c281L6N6h4IHebeX868yjrpLTs71oef9r5hcH/0W4vv++w84ux32nutvId5+3XBA/85YASAVhv/H4btgPxu+zXFCA1KOIYdFpbAwC/6vx+O5edgEZFz9ds7X/CB4BHKv0r6wD+HjOJS/MP2TmUCA6QIxINYZzvEX3ndnb3QKg1+D18cTGwKjC0+QwHCJwpc+spfpGPdNRYm0jwNFgf1PyoFg4nBCkZ2xQeg7TeqUQixcSAkPSGT0p1fv8mwCGexKan3+ErCvFev/mSBB3NgOjd2AIfekHVHkxpTPT6Av+LwKVEohiegmMpWWOSejUBG7thMMqzKVhRtz7QAHH+mEI82WDtM4/YDMrkwHVivlPddClVPR29ejExHJhQ5WJ4mu6BoboAFKpJzGvtM+iU0sukINQjIIlez0Q4iszlCevAbyC5elA20d75B/Mzk83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H5VX/Xn+b+arN5ecwj1+
"text/plain": [
"653×1006 Array{Gray{N0f8},2} with eltype Gray{Normed{UInt8,8}}:\n",
" Gray{N0f8}(0.0) Gray{N0f8}(0.0) … Gray{N0f8}(0.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) … Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) … Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" ⋮ ⋱ ⋮ \n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) … Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(1.0) … Gray{N0f8}(1.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0)\n",
" Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0) Gray{N0f8}(0.0)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"gaussian_kernel = [\n",
" 1 4 6 4 1\n",
" 4 16 24 16 4\n",
" 6 24 36 24 6\n",
" 4 16 24 16 4\n",
" 1 4 6 4 1\n",
"] ./ 256\n",
"\n",
"sobel_x_kernel = [\n",
" -1 0 1\n",
" -2 0 2\n",
" -1 0 1\n",
"]\n",
"sobel_y_kernel = rotl90(sobel_x_kernel)\n",
"\n",
"img = load(\"../images/bangdiem.png\")\n",
"img_gray = Float64.(Gray.(img))\n",
"sobel_x_kernel = Float64.(sobel_x_kernel)\n",
"sobel_y_kernel = Float64.(sobel_y_kernel)\n",
"\n",
"img_blur = conv2(img_gray, gaussian_kernel)\n",
"img_edge_x = conv2(img_blur, sobel_x_kernel)\n",
"img_edge_y = conv2(img_blur, sobel_y_kernel)\n",
"\n",
"img_edge = round.(Int32, sqrt.((img_edge_x .^ 2) .+ (img_edge_y .^ 2)))\n",
"img_edge[img_edge .> 0] .= 1\n",
"img_bool = zeros(Bool, size(img_edge))\n",
"img_bool[img_edge .> 0] .= true\n",
"\n",
"display(Gray.(img_blur))\n",
"display(Gray.(img_edge_x))\n",
"display(Gray.(img_edge_y))\n",
"display(Gray.(img_edge))\n",
"# display(img_bool)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(-652, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-651, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-650, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-6, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-5, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-4, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(2, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(3, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(4, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(648, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(649, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(650, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-653, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-3, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(1, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(651, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-157, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(155, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-158, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(156, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-199, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(197, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-200, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(198, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-198, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(196, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-638, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(636, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-297, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(295, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-394, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(392, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-443, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(441, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-541, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(539, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-248, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(246, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-492, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(490, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-590, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(588, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-589, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(587, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-155, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(153, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(-197, -90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(195, 90.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(2, 0.0)"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(3, 0.0)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# using LinearAlgebra\n",
"# sample = zeros(Int32, 50,50)\n",
"# sample[10:39, 10:39] = I(30)\n",
"# sample = zeros(Int32, 30, 30)\n",
"# sample[25,5] = 1\n",
"# sample[10,20] = 1\n",
"# acc, r, t = hough(sample)\n",
"# img = Gray.(sample)\n",
"\n",
"acc, rhos, thetas = hough(img_edge)\n",
"\n",
"for i in 1:50\n",
" r_idx, t_idx = Tuple(argmax(acc))\n",
" acc[r_idx, t_idx] = 0\n",
" display((rhos[r_idx], rad2deg(thetas[t_idx])))\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"39-element Array{Tuple{Float64,Float64},1}:\n",
" (3.0, 1.5707963267948966) \n",
" (649.0, 1.5707963267948966)\n",
" (155.0, 1.5756147204353717)\n",
" (152.0, 1.5756147204353717)\n",
" (197.0, 1.5756147204353717)\n",
" (194.0, 1.5756147204353717)\n",
" (193.0, 1.5804331140758467)\n",
" (156.0, 1.5707963267948966)\n",
" (198.0, 1.5707963267948966)\n",
" (1.0, 1.5756147204353717) \n",
" (6.0, 1.5659779331544215) \n",
" (648.0, 1.5756147204353717)\n",
" (653.0, 1.5659779331544215)\n",
" ⋮ \n",
" (245.0, 1.5756147204353717)\n",
" (491.0, 1.5707963267948966)\n",
" (635.0, 1.5756147204353717)\n",
" (589.0, 1.5707963267948966)\n",
" (633.0, 1.5756147204353717)\n",
" (242.0, 1.5756147204353717)\n",
" (200.0, 1.5659779331544215)\n",
" (632.0, 1.5804331140758467)\n",
" (440.0, 1.5756147204353717)\n",
" (158.0, 1.5659779331544215)\n",
" (391.0, 1.5756147204353717)\n",
" (536.0, 1.5756147204353717)"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"lines = hough_transform_standard(img_bool)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"rows, cols = size(img)\n",
"plt = plot(img)\n",
"for i in 1:50\n",
" r_idx, t_idx = Tuple(argmax(acc))\n",
" acc[r_idx, t_idx] = 0\n",
" \n",
" rho, theta = rhos[r_idx], thetas[t_idx]\n",
" x = 1:cols\n",
" y = (rho .- x .* cos(theta)) ./ sin(theta)\n",
" # display((rhos[r_idx], rad2deg(thetas[t_idx])))\n",
" # display((x, y))\n",
" push!(plt, x, y)\n",
"end"
]
}
],
"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
}