{"id":295821,"date":"2019-12-17T16:28:26","date_gmt":"2019-12-17T16:28:26","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295821"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295821","title":{"rendered":"\u0424\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0436\u0430\u0442\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479200\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/326\/5ab\/330\/3265ab330cddc36c57d2d7645c6c68e8.png\" alt=\"image\"><\/div>\n<p>  \u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0436\u0430\u0442\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u043a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/github.com\/pvigier\/fractal-image-compression\">github<\/a>.<\/p>\n<p>  \u041a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0449\u0443\u044e \u0435\u0433\u043e \u0438 \u0442\u0435\u043e\u0440\u0438\u044e.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0422\u0435\u043e\u0440\u0438\u044f<\/h1>\n<p>  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f, \u0438 \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u043a\u043e\u0434\u0443, \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0451 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<h2>\u0421\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041f\u0443\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8f6\/d84\/452\/8f6d84452df69f0b30ec5dcfa7b935c0.svg\" alt=\"$(E, d)$\" data-tex=\"inline\"><\/math> \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Complete_metric_space\">\u043f\u043e\u043b\u043d\u043e\u0435 \u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e<\/a>, \u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/29f\/f95\/142\/29ff95142abe091f685bd1c8b6d20d1c.svg\" alt=\"$f : E \\rightarrow E$\" data-tex=\"inline\"><\/math> \u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4f\/55a\/37f\/d4f55a37fb733b176d0ef014591e1b35.svg\" alt=\"$E$\" data-tex=\"inline\"><\/math> \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4f\/55a\/37f\/d4f55a37fb733b176d0ef014591e1b35.svg\" alt=\"$E$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u041c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Contraction_mapping\">\u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c<\/a>, \u0435\u0441\u043b\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/852\/f62\/31f\/852f6231ff21476d4f75289ab9f7ac50.svg\" alt=\"$0 &lt; s &lt; 1$\" data-tex=\"inline\"><\/math>, \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0a5\/52a\/c43\/0a552ac436f98fc968078a467ed0cf02.svg\" alt=\"$\\forall x, y \\in E, d(f(x), f(y)) \\leq sd(x, y)$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c \u0441\u0436\u0438\u043c\u0430\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f9d\/da2\/695\/f9dda26950cb67bd3ecef956c5341c14.svg\" alt=\"$s$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u041e \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0432\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0442\u0435\u043e\u0440\u0435\u043c\u044b: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Banach_fixed-point_theorem\">\u0442\u0435\u043e\u0440\u0435\u043c\u0430 \u0411\u0430\u043d\u0430\u0445\u0430 \u043e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435<\/a> \u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Collage_theorem\">\u0442\u0435\u043e\u0440\u0435\u043c\u0430 \u043a\u043e\u043b\u043b\u0430\u0436\u0430<\/a>.<\/p>\n<p>  <em>\u0422\u0435\u043e\u0440\u0435\u043c\u0430 \u043e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0435<\/em>: <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dd9\/d9b\/fae\/dd9d9bfae919d91df1f03fb250819ac4.svg\" alt=\"$x_0$\" data-tex=\"inline\"><\/math>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/09e\/7eb\/9d3\/09e7eb9d3a9400ab8a1953ebfc4ef2d9.svg\" alt=\"$(u_n)$\" data-tex=\"inline\"><\/math>, \u0437\u0430\u0434\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u043a <math>$inline$\\left\\{\\begin{alignat*}{2}u_0 &amp; = x\\\\ u_{n+1} &amp; = f(u_n)\\end{alignat*}\\right.$inline$<\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d51\/ff6\/d72\/d51ff6d722cb5f5552612dbd842322e6.svg\" alt=\"$x \\in E$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/00b\/460\/68b\/00b46068bfcb011cca57de13800a090e.svg\" alt=\"$m &lt; n \\in \\mathbb{N}$\" data-tex=\"inline\"><\/math>:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1ca\/35d\/624\/1ca35d624e41ed5a9293c59bbd9755e1.svg\" alt=\"$\\begin{alignat*}{2} d(u_m, u_n) &amp; = d(f^m(x), f^n(x)) \\\\ &amp; \\leq s^md(x, f^{n-m}(x)) \\text{ \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443} f \\text{ - \u044d\u0442\u043e \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435} \\\\ &amp; \\leq s^m\\left(\\sum_{i=0}^{n-m-1}{d(f^i(x), f^{i+1}(x))}\\right) \\text{ \u0438\u0437 \u043d\u0435\u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430} \\\\ &amp; \\leq s^m\\left(\\sum_{i=0}^{n-m-1}{s^id(x, f(x))}\\right) \\text{ \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443} f \\text{ - \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435} \\\\ &amp; = s^m\\left(\\frac{1 - s^{n-m}}{1 - s}d(x, f(x))\\right) \\\\ &amp; \\leq \\frac{s^m}{1 - s}d(x, f(x)) \\underset{m \\rightarrow \\infty}{\\rightarrow} 0 \\end{alignat*}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/09e\/7eb\/9d3\/09e7eb9d3a9400ab8a1953ebfc4ef2d9.svg\" alt=\"$(u_n)$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cauchy_sequence\">\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u041a\u043e\u0448\u0438<\/a>, \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4f\/55a\/37f\/d4f55a37fb733b176d0ef014591e1b35.svg\" alt=\"$E$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/09e\/7eb\/9d3\/09e7eb9d3a9400ab8a1953ebfc4ef2d9.svg\" alt=\"$(u_n)$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f. \u041f\u0443\u0441\u0442\u044c \u0435\u0451 \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u043c \u0431\u0443\u0434\u0435\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dd9\/d9b\/fae\/dd9d9bfae919d91df1f03fb250819ac4.svg\" alt=\"$x_0$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Lipschitz_continuity\">\u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u043c \u043a\u0430\u043a \u043b\u0438\u043f\u0448\u0438\u0446\u0435\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/a>, \u043e\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u044b\u043c, \u0442\u043e \u0435\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/806\/6bf\/b5a\/8066bfb5af690ee2f91b618068f6459a.svg\" alt=\"$f(u_n) \\rightarrow f(x_0)$\" data-tex=\"inline\"><\/math>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/08d\/9fa\/efb\/08d9faefbe272bdf8fbb80773542e343.svg\" alt=\"$n$\" data-tex=\"inline\"><\/math> \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0ba\/7f4\/8c8\/0ba7f48c8b7bd1f5579366e6efa0a9cb.svg\" alt=\"$u_{n+1} = f(u_n)$\" data-tex=\"inline\"><\/math>, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a25\/167\/bd1\/a25167bd14fa3d852e5b17bfd8014af9.svg\" alt=\"$x_0 = f(x_0)$\" data-tex=\"inline\"><\/math>. \u0422\u043e \u0435\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dd9\/d9b\/fae\/dd9d9bfae919d91df1f03fb250819ac4.svg\" alt=\"$x_0$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u041c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430. \u041f\u0443\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1b9\/1ac\/8d8\/1b91ac8d88cd44dffb1764b06f4e1086.svg\" alt=\"$y_0$\" data-tex=\"inline\"><\/math> \u2014 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430. \u0422\u043e\u0433\u0434\u0430:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0d2\/a77\/2bc\/0d2a772bcbe4c419796752de34e4cabb.svg\" alt=\"$d(x_0, y_0) = d(f(x_0), f(y_0)) \\leq sd(x_0, y_0) &lt; d(x_0, y_0)$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0412\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0435.<\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043a\u0430\u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dd9\/d9b\/fae\/dd9d9bfae919d91df1f03fb250819ac4.svg\" alt=\"$x_0$\" data-tex=\"inline\"><\/math> \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  <em>\u0422\u0435\u043e\u0440\u0435\u043c\u0430 \u043a\u043e\u043b\u043b\u0430\u0436\u0430<\/em>: \u0435\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bae\/43a\/846\/bae43a846e577a0144e5e79de5a44726.svg\" alt=\"$d(x, f(x)) &lt; \\epsilon$\" data-tex=\"inline\"><\/math>, \u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e9c\/043\/787\/e9c043787462d065eeb47cbcf833dc05.svg\" alt=\"$d(x, x_0) &lt; \\frac{\\epsilon}{1 - s}$\" data-tex=\"inline\"><\/math>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/580\/dbf\/88d\/580dbf88d874fba5b78d5fa357b82b50.svg\" alt=\"$d(u_m, u_n) \\leq \\frac{s^m}{1 - s}d(x, f(x)) = \\frac{s^m}{1 - s}\\epsilon$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e2e\/33f\/15a\/e2e33f15a96008ca33579599483c4531.svg\" alt=\"$m$\" data-tex=\"inline\"><\/math> \u0432 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f9c\/3c8\/e48\/f9c3c8e488ead4696749012f5ece6d13.svg\" alt=\"$0$\" data-tex=\"inline\"><\/math>, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/295\/7a4\/ec6\/2957a4ec654bf1b880ec5b5a46591ef0.svg\" alt=\"$d(x, u_n) \\leq \\frac{\\epsilon}{1 - s}$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u041f\u0440\u0438 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/08d\/9fa\/efb\/08d9faefbe272bdf8fbb80773542e343.svg\" alt=\"$n$\" data-tex=\"inline\"><\/math> \u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/div>\n<\/div>\n<p>  \u0412\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u043e\u0440\u0435\u043c\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0451\u043c \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math>, \u0442\u0430\u043a\u043e\u0435, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math> \u0431\u043b\u0438\u0437\u043a\u043e \u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math>, \u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u0442\u043e\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u0438\u0437\u043a\u043e \u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0418 \u0432 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u043b\u0438\u0437\u043a\u0430 \u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e.<\/p>\n<h2>\u0421\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h2>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0431\u043b\u0438\u0437\u043a\u043e \u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435. \u041c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/85d\/939\/56a\/85d93956a3e73d4183c58fc51295cbca.svg\" alt=\"$E = [0, 1]^{h \\times w}$\" data-tex=\"inline\"><\/math>. <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d4f\/55a\/37f\/d4f55a37fb733b176d0ef014591e1b35.svg\" alt=\"$E$\" data-tex=\"inline\"><\/math> \u2014 \u044d\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0442\u0440\u0438\u0446 \u0441 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/517\/4f4\/9cc\/5174f49cc4f41fc5c4802c76f4c76c5a.svg\" alt=\"$h$\" data-tex=\"inline\"><\/math> \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1d0\/034\/a09\/1d0034a09108db7af7cf42ea23a91ecd.svg\" alt=\"$w$\" data-tex=\"inline\"><\/math> \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438 \u0438 \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a5d\/538\/f83\/a5d538f83bd73f9d1c9e8338db9a398a.svg\" alt=\"$[0, 1]$\" data-tex=\"inline\"><\/math>. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0432\u043e\u0437\u044c\u043c\u0451\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/92e\/c06\/b1a\/92ec06b1a3c7485007692365a34d84de.svg\" alt=\"$d(x, y) = \\left(\\sum_{i=1}^{h}{\\sum_{j=1}^{w}{(x_{ij}-y_{ij})^2}}\\right)^{0.5}$\" data-tex=\"inline\"><\/math>. <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/35e\/a85\/36b\/35ea8536b3e6152e60442ccecbc46812.svg\" alt=\"$d$\" data-tex=\"inline\"><\/math> \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0438\u0437 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Matrix_norm#Frobenius_norm\">\u043d\u043e\u0440\u043c\u044b \u0424\u0440\u043e\u0431\u0435\u043d\u0438\u0443\u0441\u0430<\/a>.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d51\/ff6\/d72\/d51ff6d722cb5f5552612dbd842322e6.svg\" alt=\"$x \\in E$\" data-tex=\"inline\"><\/math> \u2014 \u044d\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0436\u0430\u0442\u044c.<\/p>\n<p>  \u041c\u044b \u0434\u0432\u0430\u0436\u0434\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438:<\/p>\n<ul>\n<li>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <em>\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435<\/em> \u0438\u043b\u0438 <em>\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044c\u043d\u044b\u0435<\/em> \u0431\u043b\u043e\u043a\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/928\/6f1\/e6d\/9286f1e6d0b413365ed08db0da54bd63.svg\" alt=\"$R_1, ..., R_L$\" data-tex=\"inline\"><\/math>. \u042d\u0442\u0438 \u0431\u043b\u043e\u043a\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u0438 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u0438\u043a\u043e\u043c.<\/li>\n<li>\u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u043b\u043e\u043a\u0438 <em>\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/em> \u0438\u043b\u0438 <em>\u0434\u043e\u043c\u0435\u043d\u043e\u0432<\/em> <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ada\/af4\/c46\/adaaf4c467beac6c2c401594925a0c8c.svg\" alt=\"$D_1, ..., D_K$\" data-tex=\"inline\"><\/math>. \u042d\u0442\u0438 \u0431\u043b\u043e\u043a\u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u0438 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0432\u0441\u0451 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/li>\n<\/ul>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c14\/5c0\/ef0\/c145c0ef0261826dfbb226920c3f1f67.png\"><\/div>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0c2\/403\/64e\/0c240364ed535e3f8257ae53214a50f3.svg\" alt=\"$R_l$\" data-tex=\"inline\"><\/math> \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0431\u043b\u043e\u043a \u0434\u043e\u043c\u0435\u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/05a\/3db\/898\/05a3db89813497ca0bd3bc3c5a9dc303.svg\" alt=\"$D_{k_l}$\" data-tex=\"inline\"><\/math> \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/963\/89b\/d42\/96389bd421e336c59679a787bda50d4e.svg\" alt=\"$f_l : [0, 1]^{D_{k_l}} \\rightarrow [0, 1]^{R_{l}}$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u043a\u0430\u043a:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7de\/922\/878\/7de922878328b980f6700df40a0bcbef.svg\" alt=\"$f(x)_{ij} = f_l(x_{D_{k_l}})_{ij} \\text{ if } (i, j) \\in R_l$\" data-tex=\"display\"><\/math><\/p>\n<p>  <em>\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435<\/em>: \u0435\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0442\u043e \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math> \u0442\u043e\u0436\u0435 \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\u041f\u0443\u0441\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/972\/b8d\/979\/972b8d9792c89d20f99b179f90c12299.svg\" alt=\"$x, y \\in E$\" data-tex=\"inline\"><\/math> \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c \u0441\u0436\u0438\u043c\u0430\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c95\/3b9\/45f\/c953b945f7b351c6777b64f4a9140907.svg\" alt=\"$s_l$\" data-tex=\"inline\"><\/math>. \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/307\/852\/ea7\/307852ea74b7887fd96f04db20d631fb.svg\" alt=\"$\\begin{alignat*}{2} d(f(x), f(y))^2 &amp; = \\sum_{i=1}^{h}{\\sum_{j=1}^{w}{(f(x)_{ij}-f(y)_{ij})^2}} \\text{ \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e } d \\\\ &amp; = \\sum_{l=1}^L{\\sum_{(i,j) \\in R_l}{(f(x)_{ij}-f(y)_{ij})^2}} \\text{ \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 } (R_l) \\text{ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c} \\\\ &amp; = \\sum_{l=1}^L{\\sum_{(i,j) \\in R_l}{(f_l(x_{D_{k_l}})_{ij}-f_l(y_{D_{k_l}})_{ij})^2}} \\text{ \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e } f \\\\ &amp; = \\sum_{l=1}^L{d(f_l(x_{D_{k_l}}), f_l(y_{D_{k_l}}))^2} \\text{ \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e } d \\\\ &amp; \\leq \\sum_{l=1}^L{s_l^2d(x_{D_{k_l}}, y_{D_{k_l}})^2} \\text{ \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 } (f_l) \\text{ \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438} \\\\ &amp; \\leq \\underset{l}{\\max}{s_l^2}\\sum_{l=1}^L{d(x_{D_{k_l}}, y_{D_{k_l}})^2} \\\\ &amp; = \\underset{l}{\\max}{s_l^2}\\sum_{l=1}^L{\\sum_{(i,j) \\in R_l}{(x_{ij}-y_{ij})^2}} \\text{ \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e } d \\\\ &amp; = \\underset{l}{\\max}{s_l^2}\\sum_{i=1}^{h}{\\sum_{j=1}^{w}{(x_{ij}-y_{ij})^2}} \\text{ \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 } (R_l) \\text{ \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c} \\\\ &amp; = \\underset{l}{\\max}{s_l^2}d(x, y)^2 \\text{ \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e } d \\\\ \\end{alignat*}$\" data-tex=\"display\"><\/math><\/p>\n<\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c: \u043a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/05a\/3db\/898\/05a3db89813497ca0bd3bc3c5a9dc303.svg\" alt=\"$D_{k_l}$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math>?<\/p>\n<p>  \u0422\u0435\u043e\u0440\u0435\u043c\u0430 \u043a\u043e\u043b\u043b\u0430\u0436\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0445 \u0432\u044b\u0431\u043e\u0440\u0430: \u0435\u0441\u043b\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b0d\/4d6\/c18\/b0d4d6c18768fead0007efcf0c45fa92.svg\" alt=\"$x_{R_l}$\" data-tex=\"inline\"><\/math> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u0438\u0437\u043a\u043e \u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6a4\/27f\/d71\/6a427fd71360ace0689b750e9ec23fb3.svg\" alt=\"$f(x_{D_{k_l}})$\" data-tex=\"inline\"><\/math> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/30f\/b68\/14e\/30fb6814eea0091044df0e5de33dfbc2.svg\" alt=\"$l$\" data-tex=\"inline\"><\/math>, \u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043b\u0438\u0437\u043a\u043e \u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math> \u0438 \u043f\u043e \u0442\u0435\u043e\u0440\u0435\u043c\u0435 \u043a\u043e\u043b\u043b\u0430\u0436\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/817\/b92\/407\/817b92407f764f57af9226e50cc788fd.svg\" alt=\"$x$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/dd9\/d9b\/fae\/dd9d9bfae919d91df1f03fb250819ac4.svg\" alt=\"$x_0$\" data-tex=\"inline\"><\/math> \u0442\u043e\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u043b\u0438\u0437\u043a\u043e.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/30f\/b68\/14e\/30fb6814eea0091044df0e5de33dfbc2.svg\" alt=\"$l$\" data-tex=\"inline\"><\/math> \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/975\/10f\/529\/97510f5295facfbb54b46d94ed82a651.svg\" alt=\"$D_{k}$\" data-tex=\"inline\"><\/math> \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0c2\/403\/64e\/0c240364ed535e3f8257ae53214a50f3.svg\" alt=\"$R_l$\" data-tex=\"inline\"><\/math> \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<h1>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h1>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u044f \u0431\u0443\u0434\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u0430 \u0432\u0435\u0441\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/pvigier\/fractal-image-compression\/blob\/master\/compression.py\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u0411\u043b\u043e\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0435\u0442\u043a\u0435, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0432\u044b\u0448\u0435.<\/p>\n<p>  \u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u043e\u0432 \u0440\u0430\u0432\u0435\u043d \u0441\u0442\u0435\u043f\u0435\u043d\u044f\u043c \u0434\u0432\u043e\u0439\u043a\u0438 \u0438 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u0411\u043b\u043e\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 8 \u043d\u0430 8, \u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u2014 4 \u043d\u0430 4.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u043a\u0432\u0430\u0434\u0440\u0430\u043d\u0442\u043e\u0432 (quadtree), \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0434\u0435\u0442\u0430\u043b\u0435\u0439.<\/p>\n<h2>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h2>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438\u0437 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/975\/10f\/529\/97510f5295facfbb54b46d94ed82a651.svg\" alt=\"$D_{k}$\" data-tex=\"inline\"><\/math> \u043d\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0c2\/403\/64e\/0c240364ed535e3f8257ae53214a50f3.svg\" alt=\"$R_l$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math>, \u0447\u0442\u043e\u0431\u044b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/76a\/536\/b63\/76a536b6306e9fc35eadcfe80bec8ed5.svg\" alt=\"$f(x_{D_k})$\" data-tex=\"inline\"><\/math> \u0431\u044b\u043b\u043e \u0431\u043b\u0438\u0437\u043a\u043e \u043a <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b0d\/4d6\/c18\/b0d4d6c18768fead0007efcf0c45fa92.svg\" alt=\"$x_{R_l}$\" data-tex=\"inline\"><\/math>. \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0435.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0436\u0430\u0442\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0438\u0442\u043e\u0432, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math>. \u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0442\u043e \u0441\u0436\u0430\u0442\u0438\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043b\u043e\u0445\u0438\u043c. \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441.<\/p>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/37c\/bb8\/a14\/37cbb8a144a9ab46349e586b65b891d3.svg\" alt=\"$f_l$\" data-tex=\"inline\"><\/math> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ca1\/5ac\/f45\/ca15acf45da688512de08ca761e412d2.svg\" alt=\"$f_l(x_{D_k}) = s \\times rotate_{\\theta}(flip_d(reduce(x_{D_k}))) + b$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0433\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6b1\/5dd\/240\/6b15dd240be2baa6044454f2c5aec31a.svg\" alt=\"$reduce$\" data-tex=\"inline\"><\/math> \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043e\u0442 \u0431\u043b\u043e\u043a\u043e\u0432 8 \u043d\u0430 8 \u043a \u0431\u043b\u043e\u043a\u0430\u043c 4 \u043d\u0430 4, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b8f\/df1\/c61\/b8fdf1c61bfed396e5916bcd0e5dd26e.svg\" alt=\"$flip$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/be1\/184\/c2e\/be1184c2ed48fd3e7343741b05fe1ef9.svg\" alt=\"$rotate$\" data-tex=\"inline\"><\/math> \u2014 \u0430\u0444\u0444\u0438\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f9d\/da2\/695\/f9dda26950cb67bd3ecef956c5341c14.svg\" alt=\"$s$\" data-tex=\"inline\"><\/math> \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c, \u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/302\/c72\/04e\/302c7204ea9987e698a70307646abd71.svg\" alt=\"$b$\" data-tex=\"inline\"><\/math> \u2014 \u044f\u0440\u043a\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>reduce<\/code> \u0441\u043d\u0438\u0436\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0443\u0441\u0440\u0435\u0434\u043d\u044f\u044f \u043e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">def reduce(img, factor):     result = np.zeros((img.shape[0] \/\/ factor, img.shape[1] \/\/ factor))     for i in range(result.shape[0]):         for j in range(result.shape[1]):             result[i,j] = np.mean(img[i*factor:(i+1)*factor,j*factor:(j+1)*factor])     return result<\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>rotate<\/code> \u043f\u043e\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u0443\u0433\u043e\u043b:<\/p>\n<pre><code class=\"python\">def rotate(img, angle):     return ndimage.rotate(img, angle, reshape=False)<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u0433\u043e\u043b <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/ff2\/c64\/99d\/ff2c6499d038a61a41d7ce75cd78788f.svg\" alt=\"$\\theta$\" data-tex=\"inline\"><\/math> \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6f4\/fa0\/014\/6f4fa00143e3fb44f25e50f00fd4c4b0.svg\" alt=\"$\\{0^{\\circ}, 90^{\\circ}, 180^{\\circ}, 270^{\\circ}\\}$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>flip<\/code> \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 <code>direction<\/code> \u0440\u0430\u0432\u043d\u043e -1 \u0438 \u043d\u0435 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e 1:<\/p>\n<pre><code class=\"python\">def flip(img, direction):     return img[::direction,:]<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>apply_transformation<\/code>:<\/p>\n<pre><code class=\"python\">def apply_transformation(img, direction, angle, contrast=1.0, brightness=0.0):     return contrast*rotate(flip(img, direction), angle) + brightness<\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d 1 \u0431\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043b\u0438 \u0437\u0435\u0440\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0438 2 \u0431\u0438\u0442\u0430 \u0434\u043b\u044f \u0443\u0433\u043b\u0430 \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f9d\/da2\/695\/f9dda26950cb67bd3ecef956c5341c14.svg\" alt=\"$s$\" data-tex=\"inline\"><\/math> \u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/302\/c72\/04e\/302c7204ea9987e698a70307646abd71.svg\" alt=\"$b$\" data-tex=\"inline\"><\/math>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043f\u043e 8 \u0431\u0438\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0443, \u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u043c \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e 11 \u0431\u0438\u0442\u043e\u0432.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0438\u043c\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0414\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043a\u0443\u0447\u043d\u043e, \u0438 \u043d\u0435 \u043e\u0441\u043e\u0431\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u0437\u0436\u0435 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<h2>\u0421\u0436\u0430\u0442\u0438\u0435<\/h2>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0436\u0430\u0442\u0438\u044f \u043f\u0440\u043e\u0441\u0442. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0430\u0444\u0444\u0438\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>generate_all_transformed_blocks<\/code>:<\/p>\n<pre><code class=\"python\">def generate_all_transformed_blocks(img, source_size, destination_size, step):     factor = source_size \/\/ destination_size     transformed_blocks = []     for k in range((img.shape[0] - source_size) \/\/ step + 1):         for l in range((img.shape[1] - source_size) \/\/ step + 1):             # Extract the source block and reduce it to the shape of a destination block             S = reduce(img[k*step:k*step+source_size,l*step:l*step+source_size], factor)             # Generate all possible transformed blocks             for direction, angle in candidates:                 transformed_blocks.append((k, l, direction, angle, apply_transform(S, direction, angle)))     return transformed_blocks<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0432\u0441\u0435 \u0440\u0430\u043d\u0435\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>find_contrast_and_brightness2<\/code>, \u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0435 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043f\u043e\u043a\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445, \u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"python\">def compress(img, source_size, destination_size, step):     transformations = []     transformed_blocks = generate_all_transformed_blocks(img, source_size, destination_size, step)     for i in range(img.shape[0] \/\/ destination_size):         transformations.append([])         for j in range(img.shape[1] \/\/ destination_size):             print(i, j)             transformations[i].append(None)             min_d = float('inf')             # Extract the destination block             D = img[i*destination_size:(i+1)*destination_size,j*destination_size:(j+1)*destination_size]             # Test all possible transformations and take the best one             for k, l, direction, angle, S in transformed_blocks:                 contrast, brightness = find_contrast_and_brightness2(D, S)                 S = contrast*S + brightness                 d = np.sum(np.square(D - S))                 if d &lt; min_d:                     min_d = d                     transformations[i][j] = (k, l, direction, angle, contrast, brightness)     return transformations<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0438 \u044f\u0440\u043a\u043e\u0441\u0442\u0438 \u043c\u0435\u0442\u043e\u0434 <code>find_contrast_and_brightness2<\/code> \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432:<\/p>\n<pre><code class=\"python\">def find_contrast_and_brightness2(D, S):     # Fit the contrast and the brightness     A = np.concatenate((np.ones((S.size, 1)), np.reshape(S, (S.size, 1))), axis=1)     b = np.reshape(D, (D.size,))     x, _, _, _ = np.linalg.lstsq(A, b)     return x[1], x[0]<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0430<\/h2>\n<p>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0435\u0449\u0451 \u043f\u0440\u043e\u0449\u0435. \u041c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/12a\/b92\/a58\/12ab92a586fb3d91b2b9c1e1ca0dc58c.svg\" alt=\"$f$\" data-tex=\"inline\"><\/math>:<\/p>\n<pre><code class=\"python\">def decompress(transformations, source_size, destination_size, step, nb_iter=8):     factor = source_size \/\/ destination_size     height = len(transformations) * destination_size     width = len(transformations[0]) * destination_size     iterations = [np.random.randint(0, 256, (height, width))]     cur_img = np.zeros((height, width))     for i_iter in range(nb_iter):         print(i_iter)         for i in range(len(transformations)):             for j in range(len(transformations[i])):                 # Apply transform                 k, l, flip, angle, contrast, brightness = transformations[i][j]                 S = reduce(iterations[-1][k*step:k*step+source_size,l*step:l*step+source_size], factor)                 D = apply_transformation(S, flip, angle, contrast, brightness)                 cur_img[i*destination_size:(i+1)*destination_size,j*destination_size:(j+1)*destination_size] = D         iterations.append(cur_img)         cur_img = np.zeros((height, width))     return iterations<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0438 \u043a\u0430\u043a\u043e\u0435 \u0431\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u044b \u043d\u0438 \u0432\u044b\u0431\u0440\u0430\u043b\u0438, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0435\u043c\u0443.<\/p>\n<p>  \u0414\u0443\u043c\u0430\u044e, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u042f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u0441\u0436\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u0431\u0435\u0437\u044c\u044f\u043d\u044b:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/422\/b7b\/8e9\/422b7b8e9d4c90d8c6bd9c5573e7ed4b.png\"><\/div>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>test_greyscale<\/code> \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u0436\u0438\u043c\u0430\u0435\u0442 \u0435\u0433\u043e, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/326\/5ab\/330\/3265ab330cddc36c57d2d7645c6c68e8.png\"><\/div>\n<p>  \u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438!<\/p>\n<h2>RGB-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u0436\u0430\u0442\u0438\u044e RGB-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0436\u0430\u0442\u0438\u0438 \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">def compress_rgb(img, source_size, destination_size, step):     img_r, img_g, img_b = extract_rgb(img)     return [compress(img_r, source_size, destination_size, step), \\         compress(img_g, source_size, destination_size, step), \\         compress(img_b, source_size, destination_size, step)]<\/code><\/pre>\n<p>  \u0410 \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0451\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0445 \u0432 \u0442\u0440\u0438 \u043a\u0430\u043d\u0430\u043b\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"python\">def decompress_rgb(transformations, source_size, destination_size, step, nb_iter=8):     img_r = decompress(transformations[0], source_size, destination_size, step, nb_iter)[-1]     img_g = decompress(transformations[1], source_size, destination_size, step, nb_iter)[-1]     img_b = decompress(transformations[2], source_size, destination_size, step, nb_iter)[-1]     return assemble_rbg(img_r, img_g, img_b)<\/code><\/pre>\n<p>  \u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0440\u0451\u0445 \u043a\u0430\u043d\u0430\u043b\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0433\u043e \u0441\u0436\u0438\u043c\u0430\u044e\u0449\u0435\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043e\u043d\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>test_rgb<\/code>:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2cf\/cb3\/0d7\/2cfcb30d74acebf6d6ce7b294775f7a5.png\"><\/div>\n<p>  \u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u0430\u0438\u0432\u0435\u043d \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432.<\/p>\n<h1>\u041a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435<\/h1>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0436\u0430\u0442\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u043c\u043e\u0433\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/spie.org\/publications\/book\/353798?print=2&amp;amp;SSO=1\">Fractal and Wavelet Image Compression Techniques<\/a> \u0421\u0442\u0438\u0432\u0435\u043d\u0430 \u0423\u044d\u043b\u0441\u0442\u0435\u0434\u0430. \u0415\u0451 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0432 \u043d\u0435\u0439 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u044b \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438.<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/479200\/\"> https:\/\/habr.com\/ru\/post\/479200\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/479200\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/326\/5ab\/330\/3265ab330cddc36c57d2d7645c6c68e8.png\" alt=\"image\"><\/div>\n<p>  \u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0444\u0440\u0430\u043a\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0436\u0430\u0442\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0441\u0442\u0443\u0434\u0435\u043d\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u043a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/github.com\/pvigier\/fractal-image-compression\">github<\/a>.<\/p>\n<p>  \u041a \u043c\u043e\u0435\u043c\u0443 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u044e, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u0434 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0449\u0443\u044e \u0435\u0433\u043e \u0438 \u0442\u0435\u043e\u0440\u0438\u044e.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-295821","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295821"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295821\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}