529 lines
29 KiB
Plaintext
529 lines
29 KiB
Plaintext
|
{
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 1,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [],
|
|||
|
"source": [
|
|||
|
"using Formatting\n",
|
|||
|
"using StatsBase\n",
|
|||
|
"using FFTW\n",
|
|||
|
"using Plots"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 10,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"Histogram normalized\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"5×5 Array{Int64,2}:\n",
|
|||
|
" 7 1 1 3 5\n",
|
|||
|
" 5 3 7 3 5\n",
|
|||
|
" 8 3 7 3 5\n",
|
|||
|
" 8 6 7 6 5\n",
|
|||
|
" 8 3 8 3 5"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"output_type": "display_data"
|
|||
|
},
|
|||
|
{
|
|||
|
"name": "stdout",
|
|||
|
"output_type": "stream",
|
|||
|
"text": [
|
|||
|
"[0.08, 0.28, 0.16, 0.08, 0.08, 0.16, 0.04, 0.12]\n",
|
|||
|
"Cumsum Histogram normalized\n",
|
|||
|
"[0.08, 0.36, 0.52, 0.6, 0.68, 0.84, 0.88, 1.0]\n",
|
|||
|
"Prefered Histogram\n",
|
|||
|
"[0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125]\n",
|
|||
|
"Cumsum Prefered Histogram\n",
|
|||
|
"[0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0]\n",
|
|||
|
"out hist\n",
|
|||
|
"[0.125, 0.375, 0.625, 0.625, 0.75, 0.875, 1.0, 1.0]\n",
|
|||
|
"out color\n",
|
|||
|
"[0, 1, 2, 3, 4, 5, 6, 7]\n",
|
|||
|
"[1.0, 3.0, 5.0, 5.0, 6.0, 7.0, 8.0, 8.0]\n",
|
|||
|
"\n",
|
|||
|
"New Histogram\n",
|
|||
|
"[2, 0, 7, 0, 6, 2, 4, 4]\n",
|
|||
|
"New Histogram normalized\n",
|
|||
|
"[0.08, 0.0, 0.28, 0.0, 0.24, 0.08, 0.16, 0.16]\n",
|
|||
|
"New Cumsum Histogram normalized\n",
|
|||
|
"[0.08, 0.08, 0.36, 0.36, 0.6, 0.68, 0.84, 1.0]\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
" I_cau1 = [\n",
|
|||
|
" 5 0 0 1 2\n",
|
|||
|
" 2 1 5 1 2\n",
|
|||
|
" 7 1 5 1 2\n",
|
|||
|
" 7 4 5 4 3\n",
|
|||
|
" 7 1 6 1 3\n",
|
|||
|
" ]\n",
|
|||
|
"\n",
|
|||
|
" hist = fit(Histogram, reshape(I_cau1, (length(I_cau1))), nbins=8).weights\n",
|
|||
|
" normalized_hist = hist ./ sum(hist)\n",
|
|||
|
" cumsum_normalized_hist = cumsum(normalized_hist)\n",
|
|||
|
"\n",
|
|||
|
" println(\"Histogram normalized\")\n",
|
|||
|
" println(normalized_hist)\n",
|
|||
|
" println(\"Cumsum Histogram normalized\")\n",
|
|||
|
" println(cumsum_normalized_hist)\n",
|
|||
|
"\n",
|
|||
|
" prefered_hist = fit(Histogram, 0:7, nbins=8).weights\n",
|
|||
|
" normalized_prefered_hist = prefered_hist ./ sum(prefered_hist)\n",
|
|||
|
" cumsum_normalized_prefered_hist = cumsum(normalized_prefered_hist)\n",
|
|||
|
"\n",
|
|||
|
" println(\"Prefered Histogram\")\n",
|
|||
|
" println(normalized_prefered_hist)\n",
|
|||
|
" println(\"Cumsum Prefered Histogram\")\n",
|
|||
|
" println(cumsum_normalized_prefered_hist)\n",
|
|||
|
"\n",
|
|||
|
" # https://dsp.stackexchange.com/questions/16166/histogram-matching-of-two-images-using-cdf\n",
|
|||
|
" out_hist = zeros(8)\n",
|
|||
|
" out_color = zeros(8)\n",
|
|||
|
"\n",
|
|||
|
" for i in 1:length(out_color)\n",
|
|||
|
" for k in 1:length(cumsum_normalized_prefered_hist)\n",
|
|||
|
" if cumsum_normalized_prefered_hist[k] - cumsum_normalized_hist[i] < 0\n",
|
|||
|
" continue\n",
|
|||
|
" end\n",
|
|||
|
" out_hist[i] = cumsum_normalized_prefered_hist[k]\n",
|
|||
|
" out_color[i] = k\n",
|
|||
|
" break\n",
|
|||
|
" end\n",
|
|||
|
" end\n",
|
|||
|
"\n",
|
|||
|
" println(\"out hist\")\n",
|
|||
|
" println(out_hist)\n",
|
|||
|
" println(\"out color\")\n",
|
|||
|
" println([i for i=0:7])\n",
|
|||
|
" println(out_color)\n",
|
|||
|
"\n",
|
|||
|
" for idx in CartesianIndices(I_cau1)\n",
|
|||
|
" newcolor = out_color[I_cau1[idx] + 1]\n",
|
|||
|
" I_cau1[idx] = newcolor\n",
|
|||
|
" end\n",
|
|||
|
"\n",
|
|||
|
" display(I_cau1)\n",
|
|||
|
" println()\n",
|
|||
|
" hist = fit(Histogram, reshape(I_cau1, (length(I_cau1))), nbins=8).weights\n",
|
|||
|
" normalized_hist = hist ./ sum(hist)\n",
|
|||
|
" cumsum_normalized_hist = cumsum(normalized_hist)\n",
|
|||
|
"\n",
|
|||
|
" println(\"New Histogram\")\n",
|
|||
|
" println(hist)\n",
|
|||
|
" println(\"New Histogram normalized\")\n",
|
|||
|
" println(normalized_hist)\n",
|
|||
|
" println(\"New Cumsum Histogram normalized\")\n",
|
|||
|
" println(cumsum_normalized_hist)\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 18,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/svg+xml": [
|
|||
|
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
|
|||
|
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip8700\">\n",
|
|||
|
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8700)\" points=\"\n",
|
|||
|
"0,1600 2400,1600 2400,0 0,0 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip8701\">\n",
|
|||
|
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8700)\" points=\"\n",
|
|||
|
"121.251,1503.47 2321.26,1503.47 2321.26,47.2441 121.251,47.2441 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip8702\">\n",
|
|||
|
" <rect x=\"121\" y=\"47\" width=\"2201\" height=\"1457\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 342.665,1503.47 342.665,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 844.717,1503.47 844.717,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 1346.77,1503.47 1346.77,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 1848.82,1503.47 1848.82,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1462.26 2321.26,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1069.75 2321.26,1069.75 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 121.251,677.231 2321.26,677.231 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 121.251,284.716 2321.26,284.716 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1503.47 2321.26,1503.47 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1503.47 121.251,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 342.665,1503.47 342.665,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 844.717,1503.47 844.717,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1346.77,1503.47 1346.77,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1848.82,1503.47 1848.82,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1462.26 154.251,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,1069.75 154.251,1069.75 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,677.231 154.251,677.231 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 121.251,284.716 154.251,284.716 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 342.665, 1557.47)\" x=\"342.665\" y=\"1557.47\">0</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 844.717, 1557.47)\" x=\"844.717\" y=\"1557.47\">2</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1346.77, 1557.47)\" x=\"1346.77\" y=\"1557.47\">4</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1848.82, 1557.47)\" x=\"1848.82\" y=\"1557.47\">6</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1479.76)\" x=\"97.2505\" y=\"1479.76\">0</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 1087.25)\" x=\"97.2505\" y=\"1087.25\">2</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 694.731)\" x=\"97.2505\" y=\"694.731\">4</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 97.2505, 302.216)\" x=\"97.2505\" y=\"302.216\">6</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"242.255,1069.75 242.255,1462.26 443.076,1462.26 443.076,1069.75 242.255,1069.75 242.255,1069.75 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 242.255,1069.75 242.255,1462.26 443.076,1462.26 443.076,1069.75 242.255,1069.75 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"493.281,1462.26 493.281,1462.26 694.101,1462.26 694.101,1462.26 493.281,1462.26 493.281,1462.26 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 493.281,1462.26 493.281,1462.26 694.101,1462.26 493.281,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"744.306,88.4582 744.306,1462.26 945.127,1462.26 945.127,88.4582 744.306,88.4582 744.306,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 744.306,88.4582 744.306,1462.26 945.127,1462.26 945.127,88.4582 744.306,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"995.332,1462.26 995.332,1462.26 1196.15,1462.26 1196.15,1462.26 995.332,1462.26 995.332,1462.26 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 995.332,1462.26 995.332,1462.26 1196.15,1462.26 995.332,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"1246.36,284.716 1246.36,1462.26 1447.18,1462.26 1447.18,284.716 1246.36,284.716 1246.36,284.716 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1246.36,284.716 1246.36,1462.26 1447.18,1462.26 1447.18,284.716 1246.36,284.716 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"1497.38,1069.75 1497.38,1462.26 1698.2,1462.26 1698.2,1069.75 1497.38,1069.75 1497.38,1069.75 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1497.38,1069.75 1497.38,1462.26 1698.2,1462.26 1698.2,1069.75 1497.38,1069.75 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"1748.41,677.231 1748.41,1462.26 1949.23,1462.26 1949.23,677.231 1748.41,677.231 1748.41,677.231 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1748.41,677.231 1748.41,1462.26 1949.23,1462.26 1949.23,677.231 1748.41,677.231 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8702)\" points=\"\n",
|
|||
|
"1999.43,677.231 1999.43,1462.26 2200.26,1462.26 2200.26,677.231 1999.43,677.231 1999.43,677.231 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8702)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1999.43,677.231 1999.43,1462.26 2200.26,1462.26 2200.26,677.231 1999.43,677.231 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8700)\" points=\"\n",
|
|||
|
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip8700)\" points=\"\n",
|
|||
|
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip8700)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<g clip-path=\"url(#clip8700)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"</svg>\n"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 18,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"# h = fit(Histogram, reshape(I_cau1, (length(I_cau1))), nbins=8)\n",
|
|||
|
"bar(0:length(hist)-1, hist)"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 19,
|
|||
|
"metadata": {},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"data": {
|
|||
|
"image/svg+xml": [
|
|||
|
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
|
|||
|
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip9100\">\n",
|
|||
|
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9100)\" points=\"\n",
|
|||
|
"0,1600 2400,1600 2400,0 0,0 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip9101\">\n",
|
|||
|
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9100)\" points=\"\n",
|
|||
|
"188.156,1503.47 2321.26,1503.47 2321.26,47.2441 188.156,47.2441 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<defs>\n",
|
|||
|
" <clipPath id=\"clip9102\">\n",
|
|||
|
" <rect x=\"188\" y=\"47\" width=\"2134\" height=\"1457\"/>\n",
|
|||
|
" </clipPath>\n",
|
|||
|
"</defs>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 402.838,1503.47 402.838,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 889.621,1503.47 889.621,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 1376.4,1503.47 1376.4,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 1863.19,1503.47 1863.19,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1462.26 2321.26,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1118.81 2321.26,1118.81 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 188.156,775.359 2321.26,775.359 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 188.156,431.909 2321.26,431.909 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
|
|||
|
" 188.156,88.4582 2321.26,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1503.47 2321.26,1503.47 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1503.47 188.156,47.2441 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 402.838,1503.47 402.838,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 889.621,1503.47 889.621,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1376.4,1503.47 1376.4,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1863.19,1503.47 1863.19,1481.63 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1462.26 220.153,1462.26 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,1118.81 220.153,1118.81 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,775.359 220.153,775.359 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,431.909 220.153,431.909 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 188.156,88.4582 220.153,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 402.838, 1557.47)\" x=\"402.838\" y=\"1557.47\">0</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 889.621, 1557.47)\" x=\"889.621\" y=\"1557.47\">2</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1376.4, 1557.47)\" x=\"1376.4\" y=\"1557.47\">4</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1863.19, 1557.47)\" x=\"1863.19\" y=\"1557.47\">6</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 1479.76)\" x=\"164.156\" y=\"1479.76\">0.00</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 1136.31)\" x=\"164.156\" y=\"1136.31\">0.25</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 792.859)\" x=\"164.156\" y=\"792.859\">0.50</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 449.409)\" x=\"164.156\" y=\"449.409\">0.75</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 164.156, 105.958)\" x=\"164.156\" y=\"105.958\">1.00</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"305.481,88.4582 305.481,1462.26 500.194,1462.26 500.194,88.4582 305.481,88.4582 305.481,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 305.481,88.4582 305.481,1462.26 500.194,1462.26 500.194,88.4582 305.481,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"548.872,88.4582 548.872,1462.26 743.586,1462.26 743.586,88.4582 548.872,88.4582 548.872,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 548.872,88.4582 548.872,1462.26 743.586,1462.26 743.586,88.4582 548.872,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"792.264,88.4582 792.264,1462.26 986.977,1462.26 986.977,88.4582 792.264,88.4582 792.264,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 792.264,88.4582 792.264,1462.26 986.977,1462.26 986.977,88.4582 792.264,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"1035.66,88.4582 1035.66,1462.26 1230.37,1462.26 1230.37,88.4582 1035.66,88.4582 1035.66,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1035.66,88.4582 1035.66,1462.26 1230.37,1462.26 1230.37,88.4582 1035.66,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"1279.05,88.4582 1279.05,1462.26 1473.76,1462.26 1473.76,88.4582 1279.05,88.4582 1279.05,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1279.05,88.4582 1279.05,1462.26 1473.76,1462.26 1473.76,88.4582 1279.05,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"1522.44,88.4582 1522.44,1462.26 1717.15,1462.26 1717.15,88.4582 1522.44,88.4582 1522.44,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1522.44,88.4582 1522.44,1462.26 1717.15,1462.26 1717.15,88.4582 1522.44,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"1765.83,88.4582 1765.83,1462.26 1960.54,1462.26 1960.54,88.4582 1765.83,88.4582 1765.83,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1765.83,88.4582 1765.83,1462.26 1960.54,1462.26 1960.54,88.4582 1765.83,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9102)\" points=\"\n",
|
|||
|
"2009.22,88.4582 2009.22,1462.26 2203.94,1462.26 2203.94,88.4582 2009.22,88.4582 2009.22,88.4582 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9102)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 2009.22,88.4582 2009.22,1462.26 2203.94,1462.26 2203.94,88.4582 2009.22,88.4582 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9100)\" points=\"\n",
|
|||
|
"1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 \n",
|
|||
|
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1958.43,251.724 2249.26,251.724 2249.26,130.764 1958.43,130.764 1958.43,251.724 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<polygon clip-path=\"url(#clip9100)\" points=\"\n",
|
|||
|
"1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
|
|||
|
" \" fill=\"#009af9\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
|
|||
|
"<polyline clip-path=\"url(#clip9100)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
|
|||
|
" 1982.43,215.436 2126.43,215.436 2126.43,167.052 1982.43,167.052 1982.43,215.436 \n",
|
|||
|
" \"/>\n",
|
|||
|
"<g clip-path=\"url(#clip9100)\">\n",
|
|||
|
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2150.43, 208.744)\" x=\"2150.43\" y=\"208.744\">y1</text>\n",
|
|||
|
"</g>\n",
|
|||
|
"</svg>\n"
|
|||
|
]
|
|||
|
},
|
|||
|
"execution_count": 19,
|
|||
|
"metadata": {},
|
|||
|
"output_type": "execute_result"
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"bar(0:length(prefered_hist)-1, prefered_hist)"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"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
|
|||
|
}
|