{"id":263952,"date":"2015-08-20T13:27:02","date_gmt":"2015-08-20T09:27:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=263952"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=263952","title":{"rendered":"\u0421\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u0439\u043c\u043b\u0430\u043f\u0441-\u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0435 (IPython+OpenCV)"},"content":{"rendered":"<p>             \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u0441\u0442\u0438\u0445\u0438\u0439\u043d\u044b\u043c \u0438 \u0441\u0435\u0437\u043e\u043d\u043d\u044b\u043c \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0430\u0441\u0442\u0440\u043e\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438, \u0432 \u044d\u0442\u043e\u043c \u0430\u0432\u0433\u0443\u0441\u0442\u0435 \u044f \u043b\u043e\u0432\u0438\u043b \u043d\u043e\u0447\u044c\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%B5%D1%80%D1%81%D0%B5%D0%B8%D0%B4%D1%8B\">\u041f\u0435\u0440\u0441\u0435\u0438\u0434\u044b<\/a>. \u0423\u043b\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0435\u0441\u0442\u044c, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043e \u043d\u0451\u043c, \u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043b\u043e\u0432\u0430 \u0441\u0442\u0430\u043b\u0430 \u0441\u0435\u0440\u0438\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u0442\u0430\u0439\u043c\u043b\u0430\u043f\u0441. \u041d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0430\u043c\u0435\u0440\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u0443\u0436 \u0436\u0435\u0441\u0442\u043a\u043e\u0439, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435. \u041f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0434\u0435\u0448\u0435\u0439\u043a\u0438\u043d\u0433\u0430 \u0432 VirtualDub, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u043b\u0438. \u0422\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434: \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0438 \u0442\u043e\u043c \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u2014 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u00ab\u0434\u043e\u00bb \u0438 \u00ab\u043f\u043e\u0441\u043b\u0435\u00bb (\u0442\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442). \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0430, \u043d\u043e \u0434\u0430\u0436\u0435 \u0442\u0443\u0442 \u0432\u0438\u0434\u043d\u043e \u00ab\u0434\u0440\u043e\u0436\u0430\u043d\u0438\u0435 \u043a\u0430\u043c\u0435\u0440\u044b\u00bb:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c76\/97d\/6b6\/c7697d6b6e9a4ff0bab94f0955341f9a.gif\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f7a\/bb7\/a32\/f7abb7a326ff436782f154f42dddb2cc.gif\"\/><\/p>\n<p>  \u041d\u0430 \u0447\u0451\u043c \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f: IPython notebook+NumPy+OpenCV.<\/p>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: \u0432 \u043f\u043e\u0441\u0442\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u043d\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e \u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u044f\u0437\u044b\u043a \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438; \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u043d\u0430\u0439\u0434\u0443\u0442 \u0442\u0443\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\u043a\u0430\u043a \u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb, \u043d\u043e \u0437\u0430\u0442\u043e \u00ab\u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432 IPython notebook\u00bb. \u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u0430\u043c \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u043b\u044e\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0447\u0435\u043c\u0443 &quot;\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440&quot;, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e \u0442\u043e\u043c \u0437\u0430\u0447\u0435\u043c \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u2014 \u043b\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\u0420\u0435\u0448\u0438\u0432 \u043e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e\u0442 \u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c, \u0441\u0440\u0435\u0434\u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u0437\u0430\u043c\u0435\u043d\u0443 \u043c\u0430\u0442\u043b\u0430\u0431\u0443. \u0418 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u044f\u0437\u043a\u0435 IPython+SciPy[+OpenCV]. \u041e\u0434\u043d\u0430\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0438\u0445 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0440\u043e\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e, \u043d\u043e \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430: \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0434\u0435\u0439 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0449\u0435 \u0441\u0430\u043c\u043e\u043c\u0443 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443 \u0447\u0442\u043e \u043c\u043d\u0435 \u043e\u0442 \u043d\u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0435\u043c \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0435\u0449\u0451 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u0438\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043d\u0435 \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u2014 \u0432\u043e\u0442 \u043f\u0440\u043e \u044d\u0442\u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u0439 \u044f \u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043f\u043e\u0441\u0442\u0435.  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h5>\n<p>  \u0414\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0440\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0441\u0435\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u043f\u043e \u043d\u0435\u0439. \u0427\u0442\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0430\u0434\u0440\u0435 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e:  <\/p>\n<ul>\n<li>\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0430 \u044f\u0440\u043a\u043e\u0441\u0442\u044c \u0444\u043e\u043d\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c \u0438 \u0442\u0451\u043c\u043d\u044b\u043c\u0438 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 <\/li>\n<li>\u043e\u0431\u0440\u0435\u0437\u043a\u043e\u0439 \u043a\u0430\u0434\u0440\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u0435\u0440\u0435\u0432\u044c\u044f- \u043e\u043d\u0438 \u0443\u0436 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0441\u0442\u0438 <\/li>\n<li>\u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439- \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 <\/li>\n<\/ul>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u0434\u0440\u044b (\u0441\u043f\u0440\u0430\u0432\u0430) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 (\u0441\u043b\u0435\u0432\u0430):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bd3\/6a8\/3a8\/bd36a83a8d934773b22c18b66fc970a0.png\"\/><\/p>\n<h5>\u0427\u0442\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u0430\u0434\u0440\u043e\u0432<\/h5>\n<p>  \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u043e \u043d\u0438\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f). \u0420\u0430\u0431\u043e\u0447\u0438\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u044d\u0442\u0438 \u043a\u0430\u0434\u0440\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 sampledata. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u043e\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u043e\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0430\u0442\u044c. \u0418\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438-\u043c\u0430\u043a\u0440\u043e\u0441\u044b, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"#ipnb\">\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 IPython notebook<\/a>.<\/p>\n<p>  \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u043f\u0430\u0440\u0443 \u043a\u0430\u0434\u0440\u043e\u0432 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u043d\u0438\u0445 \u0432\u0441\u0451 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c (\u043f\u0443\u0441\u0442\u044c 0 \u0438 4). \u041f\u043e\u043a\u0430\u0436\u0435\u043c \u044d\u0442\u0438 \u043a\u0430\u0434\u0440\u044b \u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435\u043c cv2.absdiff():<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/28e\/b58\/b3a\/28eb58b3a4144fb8aca6e435b5a2ca1d.png\"\/><\/p>\n<p>  \u0421\u0434\u0432\u0438\u0433 \u043a\u0430\u0434\u0440\u0430 \u0432\u0438\u0434\u0435\u043d \u043f\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u043f\u0440\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u0440\u0430\u044f \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0430 \u0432\u043e\u0442 \u0434\u0432\u0438\u0436\u0443\u0449\u0438\u0435\u0441\u044f \u0437\u0432\u0451\u0437\u0434\u044b \u2014 \u043d\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438 \u0432 \u043e\u0446\u0435\u043d\u043a\u0435 \u0441\u0434\u0432\u0438\u0433\u0430 \u043a\u0430\u043c\u0435\u0440\u044b. \u0422\u0430\u043a \u0447\u0442\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0438\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 erode. \u0420\u0430\u0437\u043c\u0435\u0440 \u044f\u0434\u0440\u0430 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043d \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0432\u043e\u0442 \u0442\u0430\u043a<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">qx,qy=4,4 k=ones((qx,qy)) im1g=cv2.erode(im1g,k) im2g=cv2.erode(im2g,k) show1(im1g,u&quot;\u043f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4b9\/285\/ff4\/4b9285ff47144f8ba8c471340bc411d9.png\"\/><\/p>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u0434\u0440\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c\u0441\u044f.<\/p>\n<h5>\u041e\u0446\u0435\u043d\u043a\u0430 \u0441\u0434\u0432\u0438\u0433\u0430 \u043c\u0435\u0436\u0434\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438<\/h5>\n<p>  \u041f\u043e\u0438\u0441\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 <a href=\"https:\/\/github.com\/Itseez\/opencv\/blob\/master\/samples\/python2\/find_obj.py\">find_obj.py<\/a> \u0438\u0437 opencv: \u043d\u0430\u0439\u0434\u0451\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u043c\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/docs.opencv.org\/modules\/nonfree\/doc\/feature_detection.html?highlight=sift#sift\">Scale Invariant Feature Transform (SIFT)<\/a>, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0438 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u00a9\u043e\u0442\u043a\u0443\u0434\u0430 \u0447\u0442\u043e \u0431\u0435\u0440\u0451\u0442\u0441\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\u00a9 \u0444\u0443\u043d\u043a\u0446\u0438\u044f `filter_matches` \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0438\u0437 <a href=\"https:\/\/github.com\/Itseez\/opencv\/blob\/master\/samples\/python2\/find_obj.py\">\u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/a>, `detectandselectmatches` \u0442\u043e\u0436\u0435 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0412\u0441\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043d\u0438\u0445 \u2014 \u0437\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0430\u0432\u0442\u043e\u0440\u0430\u043c\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0435 \u044f \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u0431\u0443\u0434\u0443, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"http:\/\/docs.opencv.org\/modules\/nonfree\/doc\/feature_detection.html?highlight=sift#sift\">\u0445\u0435\u043b\u043f<\/a> \u2014 \u0442\u0430\u043c \u0432\u0441\u0451 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u0438 \u043f\u043e\u0433\u043e\u043d\u044f\u0442\u044c <a href=\"https:\/\/github.com\/Itseez\/opencv\/blob\/master\/samples\/python2\/find_obj.py\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u2014 \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0430\u0433\u043b\u044f\u0434\u0435\u043d.  <\/p>\n<pre><code class=\"python\">detector = cv2.SIFT() norm = cv2.NORM_L2 matcher = cv2.BFMatcher(norm)  def filter_matches(kp1, kp2, matches, ratio = 0.75):     mkp1, mkp2 = [], []     for m in matches:         if len(m) == 2 and m[0].distance &lt; m[1].distance * ratio:             m = m[0]             mkp1.append( kp1[m.queryIdx] )             mkp2.append( kp2[m.trainIdx] )     p1 = np.float32([kp.pt for kp in mkp1])     p2 = np.float32([kp.pt for kp in mkp2])     kp_pairs = zip(mkp1, mkp2)     return p1, p2, kp_pairs  def detectandselectmatches(fr1a,fr2a):     kp1, desc1 = detector.detectAndCompute(fr1a, None)     kp2, desc2 = detector.detectAndCompute(fr2a, None)     raw_matches = matcher.knnMatch(desc1, trainDescriptors = desc2, k = 2) #2     p1, p2, kp_pairs = filter_matches(kp1, kp2, raw_matches)     return p1, p2 <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<pre><code class=\"python\">p1, p2 = detectandselectmatches(im1g,im2g) <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b p1, p2 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0430\u0431\u043e\u0440\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 x,y \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0442\u043e\u0447\u0435\u043a \u043d\u0430 1 \u0438 2 \u043a\u0430\u0434\u0440\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre> [665.927307129,17.939201355] \t [668.513000488,19.468919754] [744.969177246,60.6581344604] \t [747.49786377,61.8129844666] [746.388549805,77.1945953369] \t [749.15411377,78.5462799072] [892.944763184,169.295532227] \t [895.570373535,170.530929565] [906.57824707,185.634231567] \t [908.093933105,186.593307495] ... <\/pre>\n<\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0443, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u043a\u0430\u0434\u0440\u0430 \u043f\u043e \u0432\u0435\u0440\u0441\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0442\u043e\u0447\u0435\u043a. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e (\u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u0440\u044f\u0434\u0430), \u043d\u043e \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0434\u0438\u0430\u043d\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e, \u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0432\u0430\u0436\u043d\u044b. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435: \u0441\u0438\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u043e\u0439 \u0438\u0437 \u043f\u0430\u0440 \u0442\u043e\u0447\u0435\u043a, \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c, \u0430 \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0437\u0435\u043b\u0451\u043d\u044b\u043c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435.  <\/p>\n<pre><code class=\"python\">dp=p2-p1 mx,my=np.median(dp[:,0]),np.median(dp[:,1]) <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/575\/723\/3a0\/5757233a0c1f4e48b73c8359d4028d7e.png\"\/><\/p>\n<pre>dx=2.68393 dy=1.34059 <\/pre>\n<h5>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430<\/h5>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u0442\u0440\u043e\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 <a href=\"http:\/\/docs.opencv.org\/modules\/imgproc\/doc\/geometric_transformations.html?highlight=warpaffine\">\u0430\u0444\u0438\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/a> \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0435\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0437 opencv, \u043d\u043e \u0434\u043b\u044f \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\"  src=\"http:\/\/tex.s2cms.ru\/svg\/%0AM%20%3D%20%5Cbegin%7Bbmatrix%7D%0A%20cos(%20%5Cphi%20)%20%26%20%20-sin%20(%5Cphi)%20%26%20%20dx%20%20%5C%5C%20%0A%20sin(%20%5Cphi%20)%20%26%20%20cos%20(%5Cphi)%20%26%20%20dy%0A%5Cend%7Bbmatrix%7D%0A\" alt=\"M = \\begin{bmatrix}  cos( \\phi ) &amp;amp;  -sin (\\phi) &amp;amp;  dx  \\\\   sin( \\phi ) &amp;amp;  cos (\\phi) &amp;amp;  dy \\end{bmatrix}\"\/><\/div>\n<p>  \u0433\u0434\u0435 <img decoding=\"async\" src=\"http:\/\/tex.s2cms.ru\/svg\/%5Cphi\" alt=\"\\phi\"\/> \u2014 \u0443\u0433\u043e\u043b \u043f\u043e\u0432\u043e\u0440\u043e\u0442\u0430, \u0430 <img decoding=\"async\" src=\"http:\/\/tex.s2cms.ru\/svg\/dx\" alt=\"dx\"\/> \u0438 <img decoding=\"async\" src=\"http:\/\/tex.s2cms.ru\/svg\/dy\" alt=\"dy\"\/> \u2014 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"python\">def getshiftmatrix( (dx,dy)):     return array([[ 1.,  0,   dx],                   [ 0,  1.,   dy]]) <\/code><\/pre>\n<p>  \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435  <\/p>\n<pre><code class=\"python\">def shiftimg(im2,shift):     tr1=getshiftmatrix(shift)     return cv2.warpAffine(im2,tr1,tuple(reversed(im2.shape[:2]) )) im2r= shiftimg(im2,tuple(-array(shift))) <\/code><\/pre>\n<p>  \u041d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u0440\u0430\u0432\u043d\u0438\u0432, \u043a\u0430\u043a \u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e6a\/304\/2a6\/e6a3042a6f7a49bc87f7c053c5c1cf3d.png\"\/><\/p>\n<p>  \u0412\u0443\u0430\u043b\u044f! \u0422\u043e, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u2014 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0447\u0435\u0440\u043d\u043e\u0442\u0430. \u0417\u043d\u0430\u0447\u0438\u0442 \u043a\u0430\u0434\u0440\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043b\u0438\u0441\u044c.<\/p>\n<h5>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u0435\u0445 \u043a\u0430\u0434\u0440\u043e\u0432<\/h5>\n<p>  \u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041c\u043e\u0436\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443\u2026 \u0438\u043b\u0438 \u0435\u0449\u0451 \u043d\u0435\u0442? \u041e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439:  <\/p>\n<ul>\n<li>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435-\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043e \u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u043c \u0438 \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0434\u0440\u0435, \u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0443\u0436\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c;<\/li>\n<li>\u043f\u043e\u0441\u043b\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u0440\u0430\u044f\u043c \u043a\u0430\u0434\u0440\u0430 \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0447\u0435\u0440\u043d\u044b\u0435 \u043f\u043e\u043b\u043e\u0441\u044b \u0442\u0430\u043c, \u043e\u0442\u043a\u0443\u0434\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441\u0434\u0432\u0438\u043d\u0443\u043b\u0438. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0430\u0437\u0430\u0442\u044c \u0438\u0437 \u0441\u043e\u0441\u0435\u0434\u043d\u0435\u0433\u043e \u043a\u0430\u0434\u0440\u0430.<\/li>\n<\/ul>\n<p>  \u0423\u0447\u0442\u0451\u043c \u0432\u0441\u0451 \u044d\u0442\u043e \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c.<\/p>\n<pre><code class=\"python\"># \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 basepath4orig \u0441\u043e\u043e\u0431\u0449\u0438\u043c \u0433\u0434\u0435 \u0431\u0440\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u044b\u0435 \u043a\u0430\u0434\u0440\u044b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438  arshifts=[]  im1= cv2.imread(sampledata[0]) # base frame im1g = preprocess(im1) kp1, desc1 = detector.detectAndCompute(im1g, None)  imgprev=cv2.imread(basepath4orig+sampledata[0]) #base original frame  for i,x in enumerate(sampledata):     print x,     im2g = preprocess(cv2.imread(x))         kp2, desc2 = detector.detectAndCompute(im2g, None)          raw_matches = matcher.knnMatch(desc1, trainDescriptors = desc2, k = 2) #2     p1, p2, kp_pairs = filter_matches(kp1, kp2, raw_matches)     dp=p2-p1          if len(dp)&lt;=0: shift=0,0      else: dx,dy=np.median(dp[:,0]),np.median(dp[:,1])     print dx,dy              #process original frame     imgr= shiftimg(cv2.imread(basepath4orig+x),(-dx,-dy))      if -dy&gt;0: imgr[:int(ceil(abs(dy))),:,:] = imgprev[:int(ceil(abs(dy))),:,:]     if -dy&lt;0: imgr[-int(ceil(abs(dy))):,:,:] = imgprev[-int(ceil(abs(dy))):,:,:]     if -dx&gt;0: imgr[:,:int(ceil(abs(dx))),:] = imgprev[:,:int(ceil(abs(dx))),:]     if -dx&lt;0: imgr[:,-int(ceil(abs(dx))):,:] = imgprev[:,-int(ceil(abs(dx))):,:]          imgprev=imgr          cv2.imwrite('shifted_'+x+'.JPG',imgr) <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0451 \u2014 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d: \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u2014 \u043a\u0430\u043a \u043f\u0440\u0438\u043a\u043b\u0435\u0435\u043d\u043d\u044b\u0435, \u0437\u0432\u0451\u0437\u0434\u044b \u0432\u0435\u0440\u0442\u044f\u0442\u0441\u044f \u043a\u0430\u043a \u0438\u043c \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e, \u043e\u0431\u043b\u0430\u043a\u0430 \u043f\u043b\u044b\u0432\u0443\u0442 \u043f\u043e \u0441\u0432\u043e\u0438\u043c \u0434\u0435\u043b\u0430\u043c, \u0430 \u044f \u0440\u0430\u0437\u0434\u0443\u043c\u044b\u0432\u0430\u044e \u0447\u0442\u043e \u0431\u044b \u0435\u0449\u0451 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043d\u044f\u0442\u044c \u2014 \u0443\u0436\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0430\u0439\u043c\u043b\u0430\u043f\u0441\u0430.<\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 youtube.com:<\/p>\n<p>  <iframe loading=\"lazy\" width=\"560\" height=\"349\" src=\"\/\/www.youtube.com\/embed\/j4JJIajjrAc?wmode=opaque\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>  <font><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">***<\/b><\/p>\n<div class=\"spoiler_text\">\u0421\u0430\u043c\u044b\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u0432 youtube \u043f\u043e\u043f\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f- \u0431\u0435\u0437 \u043a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u0438 \u0447\u0451\u0440\u043d\u044b\u0445 \u043f\u043e\u043b\u043e\u0441 \u043f\u043e \u043a\u0440\u0430\u044f\u043c- \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u0443\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443, \u0432 gif\u043a\u0430\u0445 \u0432 \u043f\u043e\u0441\u0442\u0435 \u0443\u0436\u0435 \u0434\u0430\u043d\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f <\/div>\n<\/div>\n<p><\/font><\/p>\n<p>  <a name=\"ipnb\"><\/a>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"http:\/\/nbviewer.ipython.org\/urls\/dl.dropbox.com\/s\/y7uop7mlp2x466p\/deshake_calc_2%D1%81_4pub-clear1.ipynb\">\u043a\u043e\u043f\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 IPython notebook, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0441\u0451 \u0438 \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c<\/a><\/p>\n<h5>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430:<\/h5>\n<p>  <\/p>\n<ul>\n<li> <a href=\"http:\/\/opencv.org\/\">OpenCV<\/a><\/li>\n<li> <a href=\"http:\/\/ipython.org\/notebook.html\">IPython Notebook<\/a> <\/li>\n<li> <a href=\"http:\/\/www.numpy.org\/\">NumPy<\/a><\/li>\n<li>\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 opencv <a href=\"https:\/\/github.com\/Itseez\/opencv\/blob\/master\/samples\/python2\/find_obj.py\">find_obj.py<\/a> <\/li>\n<li><a href=\"http:\/\/docs.opencv.org\/modules\/nonfree\/doc\/feature_detection.html?highlight=sift#sift\">Scale Invariant Feature Transform (SIFT)<\/a> <\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438 <\/p>\n<ul>\n<li> <a href=\"http:\/\/locv.ru\/wiki\/%D0%93%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0\">locv.ru<\/a> <\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/121031\/\">\u043f\u043e\u0441\u0442\u0443 \u043f\u0440\u043e NumPy<\/a> \u043e\u0442  <a href=\"http:\/\/habrahabr.ru\/users\/leomat\/\" class=\"user_link\">LeoMat<\/a> <\/li>\n<li><a href=\"http:\/\/tex.s2cms.ru\/page\/\">Markdown &#038; Latex Editor \u043e\u0442 Roman Parpalak <\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/265155\/\"> http:\/\/habrahabr.ru\/post\/265155\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>             \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u0441\u0442\u0438\u0445\u0438\u0439\u043d\u044b\u043c \u0438 \u0441\u0435\u0437\u043e\u043d\u043d\u044b\u043c \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0430\u0441\u0442\u0440\u043e\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438, \u0432 \u044d\u0442\u043e\u043c \u0430\u0432\u0433\u0443\u0441\u0442\u0435 \u044f \u043b\u043e\u0432\u0438\u043b \u043d\u043e\u0447\u044c\u044e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%B5%D1%80%D1%81%D0%B5%D0%B8%D0%B4%D1%8B\">\u041f\u0435\u0440\u0441\u0435\u0438\u0434\u044b<\/a>. \u0423\u043b\u043e\u0432 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0435\u0441\u0442\u044c, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u043e \u043d\u0451\u043c, \u0430 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043b\u043e\u0432\u0430 \u0441\u0442\u0430\u043b\u0430 \u0441\u0435\u0440\u0438\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u0442\u0430\u0439\u043c\u043b\u0430\u043f\u0441. \u041d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430: \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0430\u043c\u0435\u0440\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u0443\u0436 \u0436\u0435\u0441\u0442\u043a\u043e\u0439, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435. \u041f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0434\u0435\u0448\u0435\u0439\u043a\u0438\u043d\u0433\u0430 \u0432 VirtualDub, \u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u043f\u043e\u0440\u0430\u0434\u043e\u0432\u0430\u043b\u0438. \u0422\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434: \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445 \u0438 \u0442\u043e\u043c \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u2014 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c.  <\/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-263952","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263952","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=263952"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/263952\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=263952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=263952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=263952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}