{"id":532,"date":"2022-03-06T11:08:45","date_gmt":"2022-03-06T02:08:45","guid":{"rendered":"https:\/\/www.7crystalsky.com\/?p=532"},"modified":"2022-03-06T11:11:30","modified_gmt":"2022-03-06T02:11:30","slug":"%e3%80%90raspberrypi%e3%80%91%e4%bd%93%e6%b8%a9%e6%b8%ac%e5%ae%9a%e3%80%80%e3%82%b5%e3%83%bc%e3%83%a2%e3%82%bb%e3%83%b3%e3%82%b5%e3%83%bcamg8833","status":"publish","type":"post","link":"https:\/\/www.7crystalsky.com\/?p=532","title":{"rendered":"\u3010RaspBerryPi\u3011\u4f53\u6e29\u6e2c\u5b9a\u3000\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"316\" src=\"https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2021\/12\/image-6.png\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2021\/12\/image-6.png 474w, https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2021\/12\/image-6-300x200.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/div>\n<p>Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u7c21\u6613\u7684\u306a\u4f53\u6e29\u6e2c\u5b9a\u6a5f\u5668\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4eca\u56de\u306fRaspberry Pi 4\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u4f53\u6e29\u304c\u6e2c\u5b9a\u3067\u304d\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"500\" src=\"https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2022\/03\/ca7a34f3-e1e6-498e-8034-5b2523d068f7.jpg\" alt=\"\" class=\"wp-image-1084\" srcset=\"https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2022\/03\/ca7a34f3-e1e6-498e-8034-5b2523d068f7.jpg 500w, https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2022\/03\/ca7a34f3-e1e6-498e-8034-5b2523d068f7-300x300.jpg 300w, https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2022\/03\/ca7a34f3-e1e6-498e-8034-5b2523d068f7-150x150.jpg 150w, https:\/\/www.7crystalsky.com\/wp-content\/uploads\/2022\/03\/ca7a34f3-e1e6-498e-8034-5b2523d068f7-100x100.jpg 100w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BCAMG8833%E3%81%AE%E6%8E%A5%E7%B6%9A%E6%BA%96%E5%82%99\" >\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833\u306e\u63a5\u7d9a\u6e96\u5099<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#Raspberry_Pi%E5%81%B4%E3%81%AE%E8%A8%AD%E5%AE%9A\" >Raspberry Pi\u5074\u306e\u8a2d\u5b9a<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#Raspberry_Pi%E3%81%A8%E6%B8%A9%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%81%A7%E4%BD%93%E6%B8%A9%E3%82%92%E6%B8%AC%E3%82%8B\" >Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u4f53\u6e29\u3092\u6e2c\u308b<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BCAMG8833%E3%81%AE%E6%8E%A5%E7%B6%9A%E6%BA%96%E5%82%99-2\" >\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833\u306e\u63a5\u7d9a\u6e96\u5099<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#Raspberry_Pi%E5%81%B4%E3%81%AE%E8%A8%AD%E5%AE%9A-2\" >Raspberry Pi\u5074\u306e\u8a2d\u5b9a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92OpenCV%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\" >\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092OpenCV\u3067\u8868\u793a\u3057\u3066\u307f\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E4%BA%BA%E3%82%92%E8%AA%8D%E8%AD%98%E3%81%97%E3%81%9F%E3%82%89%E6%A4%9C%E6%B8%A9%E3%81%99%E3%82%8B\" >\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u691c\u6e29\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#Raspberry_Pi%E3%81%A7%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%AB%E3%83%A1%E3%83%A9%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E4%BD%93%E6%B8%A9%E6%A4%9C%E5%87%BA\" >Raspberry Pi\u3067\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3063\u3066\u4f53\u6e29\u691c\u51fa<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92OpenCV%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B-2\" >\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092OpenCV\u3067\u8868\u793a\u3057\u3066\u307f\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#%E4%BA%BA%E3%82%92%E8%AA%8D%E8%AD%98%E3%81%97%E3%81%9F%E3%82%89%E6%A4%9C%E6%B8%A9%E3%81%99%E3%82%8B-2\" >\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u691c\u6e29\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.7crystalsky.com\/?p=532\/#Raspberry_Pi%E3%81%A7%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%AB%E3%83%A1%E3%83%A9%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E4%BD%93%E6%B8%A9%E6%A4%9C%E5%87%BA-2\" >Raspberry Pi\u3067\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3063\u3066\u4f53\u6e29\u691c\u51fa<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BCAMG8833%E3%81%AE%E6%8E%A5%E7%B6%9A%E6%BA%96%E5%82%99\"><\/span>\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833\u306e\u63a5\u7d9a\u6e96\u5099<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4eca\u56de\u4f53\u6e29\u6e2c\u5b9a\u306b\u4f7f\u3046\u5916\u90e8\u30bb\u30f3\u30b5\u30fc\u306f\u3001AMG8833\u3068\u3044\u3046\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u3002<br>\u89e3\u50cf\u5ea6\u306f8\u00d78\u30010\u301c80\u5ea6\u307e\u3067\u6e2c\u5b9a\u53ef\u80fd\u306e\u30bb\u30f3\u30b5\u30fc\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Raspberry Pi4\u3068\u30bb\u30f3\u30b5\u30fc\u3092\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u7aef\u5b50\u3092\u6307\u5b9a\u3055\u308c\u305f\u7b87\u6240\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u57fa\u76e4\u306b\u540d\u79f0\u304c\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u4e0b\u8a18\u3092\u53c2\u8003\u306b\u3057\u306a\u304c\u3089\u63a5\u7d9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>AMG8833(3.3v) \u2192 Raspberry Pi (3.3V)<br>AMG8833(GND) \u2192 Raspberry Pi (GND)<br>AMG8833(SDA) \u2192 Raspberry Pi (SDA)<br>AMG8833(SCL) \u2192 Raspberry Pi (SCL)<\/p>\n\n\n\n<p>\u3057\u3063\u304b\u308a\u3068\u7aef\u5b50\u306b\u63a5\u7d9a\u3057\u306a\u3044\u3068\u3001\u8aa4\u8a8d\u8b58\u3084\u8a8d\u8b58\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u306e\u3067\u5916\u308c\u306a\u3044\u3088\u3046\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Raspberry_Pi%E5%81%B4%E3%81%AE%E8%A8%AD%E5%AE%9A\"><\/span>Raspberry Pi\u5074\u306e\u8a2d\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Raspberry Pi\u306e\u96fb\u6e90\u3092\u5165\u308c\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u8d77\u52d5\u3057\u305f\u3089\u753b\u9762\u5de6\u4e0a\u90e8\u306e\u30e9\u30b9\u30d9\u30ea\u30fc\u30d1\u30a4\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001Raspberry Pi\u306e\u8a2d\u5b9a\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image03.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image03.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u300c\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u306e\u30bf\u30d6\u958b\u3044\u3066\u3001\u305d\u306e\u306a\u304b\u306e\u300cI2C\u300d\u306e\u9805\u76ee\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u305f\u5834\u5408\u306f\u6709\u52b9\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u5148\u307b\u3069Raspberry Pi\u306b\u63a5\u7d9a\u3057\u305f\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u304c\u6b63\u5e38\u306b\u8aad\u307f\u53d6\u308c\u308b\u304b\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u300c\u30bf\u30fc\u30df\u30ca\u30eb\u300d\u3092\u958b\u3044\u3066\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo i2cdetect -y 1<\/pre>\n\n\n\n<p>\u6b63\u5e38\u306b\u30bb\u30f3\u30b5\u30fc\u304c\u63a5\u7d9a\u3055\u308c\u3066\u308b\u5834\u5408\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306b\u300c68\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u3082\u3057\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u3057\u3063\u304b\u308a\u63a5\u7d9a\u3067\u304d\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\" id=\"breadcrumb\"><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/\">\u30d1\u30bd\u30b3\u30f3\u5de5\u623fNEXMAG \u30c8\u30c3\u30d7<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/challenge\">\u30c1\u30e3\u30ec\u30f3\u30b8&amp;\u30ca\u30ec\u30c3\u30b8<\/a><\/li><li>Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u4f53\u6e29\u3092\u6e2c\u308b<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_main-810x450.png\" alt=\"\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/challenge\">\u30c1\u30e3\u30ec\u30f3\u30b8&amp;\u30ca\u30ec\u30c3\u30b8<\/a>\u6700\u7d42\u66f4\u65b0\u65e5:&nbsp;2021\/1\/12<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"post-title\"><span class=\"ez-toc-section\" id=\"Raspberry_Pi%E3%81%A8%E6%B8%A9%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%81%A7%E4%BD%93%E6%B8%A9%E3%82%92%E6%B8%AC%E3%82%8B\"><\/span>Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u4f53\u6e29\u3092\u6e2c\u308b<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/tag\/python\">Python<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/tag\/raspberry-pi\">Raspberry Pi<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/tag\/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/tag\/%e3%83%9e%e3%82%a4%e3%82%b3%e3%83%b3%e3%83%9c%e3%83%bc%e3%83%89\">\u30de\u30a4\u30b3\u30f3\u30dc\u30fc\u30c9<\/a><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>https:\/\/www.facebook.com\/v2.11\/plugins\/like.php?action=like&amp;app_id=&amp;channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df1e16aa58f17ee4%26domain%3Dwww.pc-koubou.jp%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fwww.pc-koubou.jp%252Ff18b4a275ed5c78%26relation%3Dparent.parent&amp;container_width=0&amp;href=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;layout=button_count&amp;locale=ja_JP&amp;sdk=joey&amp;share=false&amp;show_faces=false&amp;size=small<\/li><li>https:\/\/platform.twitter.com\/widgets\/tweet_button.21f942bb866c2823339b839747a0c50c.ja.html#dnt=false&amp;id=twitter-widget-0&amp;lang=ja&amp;original_referer=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;size=m&amp;text=Raspberry%20Pi%E3%81%A8%E6%B8%A9%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%81%A7%E4%BD%93%E6%B8%A9%E3%82%92%E6%B8%AC%E3%82%8B%20%7C%20%E3%83%91%E3%82%BD%E3%82%B3%E3%83%B3%E5%B7%A5%E6%88%BF%20NEXMAG&amp;time=1639618779041&amp;type=share&amp;url=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197<\/li><li>javascript:false<\/li><li>https:\/\/social-plugins.line.me\/widget\/share?url=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;buttonType=share-a&amp;lang=ja&amp;type=share&amp;id=0&amp;origin=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;title=Raspberry%20Pi%E3%81%A8%E6%B8%A9%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%81%A7%E4%BD%93%E6%B8%A9%E3%82%92%E6%B8%AC%E3%82%8B%20%7C%20%E3%83%91%E3%82%BD%E3%82%B3%E3%83%B3%E5%B7%A5%E6%88%BF%20NEXMAG<\/li><li>https:\/\/widgets.getpocket.com\/v1\/button?label=pocket&amp;count=none&amp;v=1&amp;url=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;title=Raspberry%20Pi%E3%81%A8%E6%B8%A9%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%81%A7%E4%BD%93%E6%B8%A9%E3%82%92%E6%B8%AC%E3%82%8B%20%7C%20%E3%83%91%E3%82%BD%E3%82%B3%E3%83%B3%E5%B7%A5%E6%88%BF%20NEXMAG&amp;src=https%3A%2F%2Fwww.pc-koubou.jp%2Fmagazine%2F45197&amp;r=0.44313209280449195<\/li><\/ul>\n\n\n\n<p id=\"overview\">Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u7c21\u6613\u7684\u306a\u4f53\u6e29\u6e2c\u5b9a\u6a5f\u5668\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4eca\u56de\u306fRaspberry Pi 4\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u4f53\u6e29\u304c\u6e2c\u5b9a\u3067\u304d\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u76ee\u6b21<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/45197#section01\">\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833\u306e\u63a5\u7d9a\u6e96\u5099<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/45197#section02\">Raspberry Pi\u5074\u306e\u8a2d\u5b9a<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/45197#section03\">\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092OpenCV\u3067\u8868\u793a\u3057\u3066\u307f\u308b<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/45197#section04\">\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u691c\u6e29\u3059\u308b<\/a><\/li><li><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/45197#section05\">Raspberry Pi\u3067\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3063\u3066\u4f53\u6e29\u691c\u51fa<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section01\"><span class=\"ez-toc-section\" id=\"%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BCAMG8833%E3%81%AE%E6%8E%A5%E7%B6%9A%E6%BA%96%E5%82%99-2\"><\/span>\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fcAMG8833\u306e\u63a5\u7d9a\u6e96\u5099<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4eca\u56de\u4f53\u6e29\u6e2c\u5b9a\u306b\u4f7f\u3046\u5916\u90e8\u30bb\u30f3\u30b5\u30fc\u306f\u3001AMG8833\u3068\u3044\u3046\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u3002<br>\u89e3\u50cf\u5ea6\u306f8\u00d78\u30010\u301c80\u5ea6\u307e\u3067\u6e2c\u5b9a\u53ef\u80fd\u306e\u30bb\u30f3\u30b5\u30fc\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Raspberry Pi4\u3068\u30bb\u30f3\u30b5\u30fc\u3092\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u7aef\u5b50\u3092\u6307\u5b9a\u3055\u308c\u305f\u7b87\u6240\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u57fa\u76e4\u306b\u540d\u79f0\u304c\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u4e0b\u8a18\u3092\u53c2\u8003\u306b\u3057\u306a\u304c\u3089\u63a5\u7d9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>AMG8833(3.3v) \u2192 Raspberry Pi (3.3V)<br>AMG8833(GND) \u2192 Raspberry Pi (GND)<br>AMG8833(SDA) \u2192 Raspberry Pi (SDA)<br>AMG8833(SCL) \u2192 Raspberry Pi (SCL)<\/p>\n\n\n\n<p>\u3057\u3063\u304b\u308a\u3068\u7aef\u5b50\u306b\u63a5\u7d9a\u3057\u306a\u3044\u3068\u3001\u8aa4\u8a8d\u8b58\u3084\u8a8d\u8b58\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u308b\u306e\u3067\u5916\u308c\u306a\u3044\u3088\u3046\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image01.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image01.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image02.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image02.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section02\"><span class=\"ez-toc-section\" id=\"Raspberry_Pi%E5%81%B4%E3%81%AE%E8%A8%AD%E5%AE%9A-2\"><\/span>Raspberry Pi\u5074\u306e\u8a2d\u5b9a<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Raspberry Pi\u306e\u96fb\u6e90\u3092\u5165\u308c\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u8d77\u52d5\u3057\u305f\u3089\u753b\u9762\u5de6\u4e0a\u90e8\u306e\u30e9\u30b9\u30d9\u30ea\u30fc\u30d1\u30a4\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001Raspberry Pi\u306e\u8a2d\u5b9a\u958b\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image03.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image03.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u300c\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u300d\u306e\u30bf\u30d6\u958b\u3044\u3066\u3001\u305d\u306e\u306a\u304b\u306e\u300cI2C\u300d\u306e\u9805\u76ee\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u305f\u5834\u5408\u306f\u6709\u52b9\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image04.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image04.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u3053\u3053\u3067\u3001\u5148\u307b\u3069Raspberry Pi\u306b\u63a5\u7d9a\u3057\u305f\u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u304c\u6b63\u5e38\u306b\u8aad\u307f\u53d6\u308c\u308b\u304b\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001\u300c\u30bf\u30fc\u30df\u30ca\u30eb\u300d\u3092\u958b\u3044\u3066\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo i2cdetect -y 1<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image05.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image05.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u6b63\u5e38\u306b\u30bb\u30f3\u30b5\u30fc\u304c\u63a5\u7d9a\u3055\u308c\u3066\u308b\u5834\u5408\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306b\u300c68\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u3082\u3057\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u3057\u3063\u304b\u308a\u63a5\u7d9a\u3067\u304d\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image06.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image06.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3067\u3001\u6b63\u5e38\u306b\u30bb\u30f3\u30b5\u30fc\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306e\u4e2d\u306b\u3001\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u4e0b\u8a18\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import time\nimport busio\nimport board\n\nimport adafruit_amg88xx\n\n# I2C\u306e\u521d\u671f\u5316\ni2c = busio.I2C(board.SCL, board.SDA)\n# \u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u306e\u521d\u671f\u5316\nsensor = adafruit_amg88xx.AMG88XX(i2c, addr=0x68)\n\n# \u521d\u671f\u5316\u306e\u305f\u3081\u306b\u5f85\u3064\ntime.sleep(0.2)\n\n# 8x8\u306e\u6e29\u5ea6\u914d\u5217\nprint(sensor.pixels)<\/pre>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7528\u610f\u3067\u304d\u305f\u3089\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 thermo1.py<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section03\"><span class=\"ez-toc-section\" id=\"%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92OpenCV%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B\"><\/span>\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092OpenCV\u3067\u8868\u793a\u3057\u3066\u307f\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6b21\u306b\u5148\u307b\u3069\u8868\u793a\u3057\u305f8\u00d78\u30d4\u30af\u30bb\u30eb\u306e\u914d\u5217\u3092OpenCV\u3092\u53ef\u8996\u5316\u3055\u305b\u307e\u3059\u3002<br>Raspberry Pi\u306bOpenCV\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066OpenCV\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u6700\u521d\u306bOpenCV\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u30fc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<br>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4e00\u884c\u305a\u3064\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100\n    sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test \n    python3-pyqt5sudo apt-get install libatlas-base-dev\n    sudo apt-get install libjasper-devsudo pip3 --default-timeout=1000 install opencv-python<\/pre>\n\n\n\n<p>\u6b21\u306bOpenCV\u672c\u4f53\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo pip3 --default-timeout=1000 install opencv-python<\/pre>\n\n\n\n<p>\u6b21\u306b\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u3092\u3059\u308b\u305f\u3081\u306b\u6570\u5024\u8a08\u7b97\u306e\u6642\u9593\u3092\u77ed\u7e2e\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo pip3 install numpy<\/pre>\n\n\n\n<p>\u5fc5\u8981\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import cv2 as cv\nimport numpy as np\n\nimport time\nimport busio\nimport board\n\nimport adafruit_amg88xx\nimport colorsys\n\n# I2C\u306e\u521d\u671f\u5316\ni2c = busio.I2C(board.SCL, board.SDA)\n# \u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u306e\u521d\u671f\u5316\nsensor = adafruit_amg88xx.AMG88XX(i2c, addr=0x68)\n\n# \u521d\u671f\u5316\u306e\u305f\u3081\u306b\u5f85\u3064\ntime.sleep(0.2)\n\n# \u8868\u793a\u306e\u305f\u3081\u306e\u914d\u5217\u3092\u7528\u610f\u3059\u308b\nimg = np.full((320, 320, 3), 128, dtype=np.uint8)\n\n# \u30bb\u30eb\u30b5\u30a4\u30ba\ncellsize = 40\n\ndef hsv2rgb(h,s,v):\n    return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h,s,v))\n\ndef mapVal(val, inMin, inMax, outMin, outMax):\n    return (val - inMin) * (outMax - outMin) \/ (inMax - inMin) + outMin\n\n# 8x8\u306e\u6e29\u5ea6\u914d\u5217\npixels = sensor.pixels\nfor x in range(len(pixels)):\n    for y in range(len(pixels[0])):\n        # 15\u301c28\u306e\u5024\u3092\u3001270\u301c0\u306e\u7bc4\u56f2\u306b\u5909\u63db\u3059\u308b\n        val = mapVal(pixels[x][y], 15, 28, 270, 0)\n        # \u5024\u30920\u301c270\u306e\u7bc4\u56f2\u306b\u53ce\u3081\u308b\n        val = min(max(0, val), 270)\n        # HSV\u3067\u6307\u5b9a\u3057\u305f\u8272\u3092RGB\u306b\u5909\u63db\u3059\u308b\n        color = tuple(reversed(hsv2rgb(val\/360, 1.0, 0.5)))\n        # 1\u30d4\u30af\u30bb\u30eb\u305a\u3064\u8868\u793a\u3059\u308b\n        cv.rectangle(img, (x*cellsize, y*cellsize), (x*cellsize+cellsize, y*cellsize+cellsize), color, thickness=-1)\n\n# \u7d50\u679c\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\ncv.imshow('image', img);\n# \u4f55\u304b\u30ad\u30fc\u304c\u62bc\u3055\u308c\u308b\u307e\u3067\u5f85\u6a5f\u3059\u308b\ncv.waitKey()\n\n# \u8868\u793a\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\ncv.destroyAllWindows()<\/pre>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 thermo2.py<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image10.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image10.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001OpenCV\u306b\u3088\u3063\u3066\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6570\u5024\u3092\u753b\u50cf\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u8272\u304c\u8d64\u304f\u306a\u308b\u307b\u3069\u3001\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6570\u5024\u3001\u3064\u307e\u308a\u6e29\u5ea6\u304c\u9ad8\u3044\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image11.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image11.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u624b\u3092\u8986\u3046\u306a\u3069\u3057\u3066\u3001\u8272\u304c\u5909\u5316\u3059\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image12.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image12.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section04\"><span class=\"ez-toc-section\" id=\"%E4%BA%BA%E3%82%92%E8%AA%8D%E8%AD%98%E3%81%97%E3%81%9F%E3%82%89%E6%A4%9C%E6%B8%A9%E3%81%99%E3%82%8B\"><\/span>\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u691c\u6e29\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6b21\u306bUSB\u30ab\u30e1\u30e9\u3092\u63a5\u7d9a\u3057\u3066\u3001\u6620\u50cf\u3092\u8868\u793a\u3057\u3064\u3064\u3001\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u4f53\u6e29\u3092\u6e2c\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>USB\u30ab\u30e1\u30e9\u306f\u5e02\u8ca9\u3067\u58f2\u3089\u308c\u3066\u3044\u308b\u30ab\u30e1\u30e9\u3092\u4f7f\u3044\u307e\u3059\u3002Raspberry Pi\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u4eba\u3092\u8a8d\u8b58\u3055\u305b\u308b\u305f\u3081\u306b\u3001OpenCV\u3067\u3042\u3089\u304b\u3058\u3081\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u4eba\u306e\u9854\u304c\u542b\u307e\u308c\u308b\u753b\u50cf\u306e\u7279\u5fb4\u3092\u307e\u3068\u3081\u305f\u30c7\u30fc\u30bf\uff08\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u30d5\u30a1\u30a4\u30eb\uff09\u3092\u6e96\u5099\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7d30\u304b\u3044\u624b\u9806\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u306b\u307e\u3068\u3081\u3066\u3042\u308b\u306e\u3067\u3001\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/19205\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pc-koubou.jp\/magazine\/19205<\/a><\/p>\n\n\n\n<p>\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u3054\u3068\u30b3\u30d4\u30fc\u3057\u3066\u8a2d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u4f7f\u3046\u306e\u306f\u300chaarcascade_frontalface_default\u300d\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image13.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image13.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001\u6b21\u306b\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import time\nimport numpy as np\nimport cv2 as cv\n\nimport busio\nimport board\n\nimport adafruit_amg88xx\n\ni2c = busio.I2C(board.SCL, board.SDA)\nsensor = adafruit_amg88xx.AMG88XX(i2c, addr=0x68)\n\ntime.sleep(0.2)\n\n# \u30ab\u30e1\u30e9\u521d\u671f\u5316\ncap = cv.VideoCapture(0)\n\n# \u9854\u306e\u5206\u985e\u5668\u306e\u4f5c\u6210\nfaceCascade = cv.CascadeClassifier('haarcascades\/haarcascade_frontalface_default.xml')\n\nwhile True:\n    ret, frame = cap.read()\n    h, w, c = frame.shape\n\n    # \u30ab\u30e1\u30e9\u306e\u753b\u50cf\u3092\u534a\u5206\u306b\u3059\u308b\n    gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)\n\n    # \u9854\u306e\u8a8d\u8b58\n    facerect = faceCascade.detectMultiScale(gray, scaleFactor=1.2, minNeighbors=6, minSize=(1, 1))\n\n    if len(facerect) &gt; 0:\n        for rect in facerect:\n            # \u914d\u5217\u306e\u30b9\u30e9\u30a4\u30b9\u2192 rect[\u958b\u59cb\u4f4d\u7f6e:\u7d42\u4e86\u4f4d\u7f6e] rect[0:2]\u2192[\u5de6\u4e0aX\u5ea7\u6a19, \u5de6\u4e0aY\u5ea7\u6a19]\n            cv.rectangle(frame, tuple(rect[0:2]), tuple(rect[0:2]+rect[2:4]), (0, 0, 255), thickness=2)\n        \n        max_temp = 0.0\n        # 8x8\u306e\u6e29\u5ea6\u914d\u5217\n        pixels = sensor.pixels\n        for x in range(len(pixels)):\n            for y in range(len(pixels[0])):\n                # \u6700\u5927\u6e29\u5ea6\u3092\u683c\u7d0d\u3059\u308b\n                if (pixels[x][y] &gt; max_temp):\n                    max_temp = pixels[x][y]\n        \n        print('\u4eba\u3092\u691c\u77e5\u3057\u307e\u3057\u305f: '+str(max_temp))\n\n    cv.imshow('camera capture', frame)\n\n    # ESC\n    if cv.waitKey(1) == 27:\n        break\n\ncap.release()\n# \u8868\u793a\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\ncv.destroyAllWindows()<\/pre>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u304c\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 thermo3_face<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image14.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image14.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001USB\u306e\u30ab\u30e1\u30e9\u304b\u3089\u306e\u6620\u50cf\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br>\u30ab\u30e1\u30e9\u306e\u6620\u50cf\u5185\u306b\u9854\u304c\u8a8d\u8b58\u3059\u308b\u3068\u3001\u8d64\u3044\u67a0\u304c\u8868\u793a\u3055\u308c\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u306b\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u306e8\u00d78\u5185\u306e\u6700\u5927\u6e29\u5ea6\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image15.png\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" src=\"https:\/\/www.pc-koubou.jp\/magazine\/wp-content\/uploads\/2020\/11\/raspberry_pi_thermo_image15.png\" alt=\"\" title=\"\"\/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section05\"><span class=\"ez-toc-section\" id=\"Raspberry_Pi%E3%81%A7%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%AB%E3%83%A1%E3%83%A9%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E4%BD%93%E6%B8%A9%E6%A4%9C%E5%87%BA\"><\/span>Raspberry Pi\u3067\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3063\u3066\u4f53\u6e29\u691c\u51fa<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3067\u5b9f\u969b\u306b\u4eba\u3092\u8a8d\u8b58\u3059\u308b\u3068\u4f53\u6e29\u691c\u51fa\u3059\u308b\u307e\u3067\u3092\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br>\u3055\u3089\u306b\u7cbe\u5ea6\u3092\u9ad8\u304f\u3059\u308b\u5834\u5408\u306f\u3001\u4ed6\u306e\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3046\u3053\u3068\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eba\u3092\u8a8d\u8b58\u3059\u308b\u305f\u3073\u306b\u691c\u6e29\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u8077\u5834\u306a\u3069\u306e\u30aa\u30d5\u30a3\u30b9\u306b\u7f6e\u304d\u3001\u3056\u3063\u304f\u308a\u3068\u3057\u305f\u691c\u6e29\u30b7\u30b9\u30c6\u30e0\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002<br>\u3059\u3067\u306b Raspberry Pi \u3092\u9632\u72af\u30ab\u30e1\u30e9\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u8ffd\u52a0\u6a5f\u80fd\u3068\u3057\u3066\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3001\u7d44\u307f\u5408\u308f\u305b\u3066\u307f\u308b\u306e\u3082\u9762\u767d\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section03\"><span class=\"ez-toc-section\" id=\"%E5%8F%96%E5%BE%97%E3%81%97%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92OpenCV%E3%81%A7%E8%A1%A8%E7%A4%BA%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B-2\"><\/span>\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092OpenCV\u3067\u8868\u793a\u3057\u3066\u307f\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6b21\u306b\u5148\u307b\u3069\u8868\u793a\u3057\u305f8\u00d78\u30d4\u30af\u30bb\u30eb\u306e\u914d\u5217\u3092OpenCV\u3092\u53ef\u8996\u5316\u3055\u305b\u307e\u3059\u3002<br>Raspberry Pi\u306bOpenCV\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066OpenCV\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u6700\u521d\u306bOpenCV\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u30fc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u307e\u3059\u3002<br>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4e00\u884c\u305a\u3064\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    sudo apt-get install libhdf5-dev libhdf5-serial-dev libhdf5-100\n    sudo apt-get install libqtgui4 libqtwebkit4 libqt4-test \n    python3-pyqt5sudo apt-get install libatlas-base-dev\n    sudo apt-get install libjasper-devsudo pip3 --default-timeout=1000 install opencv-python<\/pre>\n\n\n\n<p>\u6b21\u306bOpenCV\u672c\u4f53\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo pip3 --default-timeout=1000 install opencv-python<\/pre>\n\n\n\n<p>\u6b21\u306b\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u3092\u3059\u308b\u305f\u3081\u306b\u6570\u5024\u8a08\u7b97\u306e\u6642\u9593\u3092\u77ed\u7e2e\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo pip3 install numpy<\/pre>\n\n\n\n<p>\u5fc5\u8981\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u30d5\u30a1\u30a4<\/p>\n\n\n\n<p>\u30eb\u3092\u4f5c\u6210\u3057\u3066\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import cv2 as cv\nimport numpy as np\n\nimport time\nimport busio\nimport board\n\nimport adafruit_amg88xx\nimport colorsys\n\n# I2C\u306e\u521d\u671f\u5316\ni2c = busio.I2C(board.SCL, board.SDA)\n# \u30b5\u30fc\u30e2\u30bb\u30f3\u30b5\u30fc\u306e\u521d\u671f\u5316\nsensor = adafruit_amg88xx.AMG88XX(i2c, addr=0x68)\n\n# \u521d\u671f\u5316\u306e\u305f\u3081\u306b\u5f85\u3064\ntime.sleep(0.2)\n\n# \u8868\u793a\u306e\u305f\u3081\u306e\u914d\u5217\u3092\u7528\u610f\u3059\u308b\nimg = np.full((320, 320, 3), 128, dtype=np.uint8)\n\n# \u30bb\u30eb\u30b5\u30a4\u30ba\ncellsize = 40\n\ndef hsv2rgb(h,s,v):\n    return tuple(round(i * 255) for i in colorsys.hsv_to_rgb(h,s,v))\n\ndef mapVal(val, inMin, inMax, outMin, outMax):\n    return (val - inMin) * (outMax - outMin) \/ (inMax - inMin) + outMin\n# 8x8\u306e\u6e29\u5ea6\u914d\u5217\npixels = sensor.pixels\nfor x in range(len(pixels)):\n    for y in range(len(pixels[0])):\n        # 15\u301c28\u306e\u5024\u3092\u3001270\u301c0\u306e\u7bc4\u56f2\u306b\u5909\u63db\u3059\u308b\n        val = mapVal(pixels[x][y], 15, 28, 270, 0)\n        # \u5024\u30920\u301c270\u306e\u7bc4\u56f2\u306b\u53ce\u3081\u308b\n        val = min(max(0, val), 270)\n        # HSV\u3067\u6307\u5b9a\u3057\u305f\u8272\u3092RGB\u306b\u5909\u63db\u3059\u308b\n        color = tuple(reversed(hsv2rgb(val\/360, 1.0, 0.5)))\n        # 1\u30d4\u30af\u30bb\u30eb\u305a\u3064\u8868\u793a\u3059\u308b\n        cv.rectangle(img, (x*cellsize, y*cellsize), (x*cellsize+cellsize, y*cellsize+cellsize), color, thickness=-1)\n\n# \u7d50\u679c\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\ncv.imshow('image', img);\n# \u4f55\u304b\u30ad\u30fc\u304c\u62bc\u3055\u308c\u308b\u307e\u3067\u5f85\u6a5f\u3059\u308b\ncv.waitKey()\n\n# \u8868\u793a\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\ncv.destroyAllWindows()\n<\/pre>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 thermo2.py<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001OpenCV\u306b\u3088\u3063\u3066\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6570\u5024\u3092\u753b\u50cf\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u8272\u304c\u8d64\u304f\u306a\u308b\u307b\u3069\u3001\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u304b\u3089\u53d6\u5f97\u3057\u305f\u6570\u5024\u3001\u3064\u307e\u308a\u6e29\u5ea6\u304c\u9ad8\u3044\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u624b\u3092\u8986\u3046\u306a\u3069\u3057\u3066\u3001\u8272\u304c\u5909\u5316\u3059\u308b\u306e\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section04\"><span class=\"ez-toc-section\" id=\"%E4%BA%BA%E3%82%92%E8%AA%8D%E8%AD%98%E3%81%97%E3%81%9F%E3%82%89%E6%A4%9C%E6%B8%A9%E3%81%99%E3%82%8B-2\"><\/span>\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u691c\u6e29\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6b21\u306bUSB\u30ab\u30e1\u30e9\u3092\u63a5\u7d9a\u3057\u3066\u3001\u6620\u50cf\u3092\u8868\u793a\u3057\u3064\u3064\u3001\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u4f53\u6e29\u3092\u6e2c\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>USB\u30ab\u30e1\u30e9\u306f\u5e02\u8ca9\u3067\u58f2\u3089\u308c\u3066\u3044\u308b\u30ab\u30e1\u30e9\u3092\u4f7f\u3044\u307e\u3059\u3002Raspberry Pi\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u4eba\u3092\u8a8d\u8b58\u3055\u305b\u308b\u305f\u3081\u306b\u3001OpenCV\u3067\u3042\u3089\u304b\u3058\u3081\u306b\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u4eba\u306e\u9854\u304c\u542b\u307e\u308c\u308b\u753b\u50cf\u306e\u7279\u5fb4\u3092\u307e\u3068\u3081\u305f\u30c7\u30fc\u30bf\uff08\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u30d5\u30a1\u30a4\u30eb\uff09\u3092\u6e96\u5099\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7d30\u304b\u3044\u624b\u9806\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u306b\u307e\u3068\u3081\u3066\u3042\u308b\u306e\u3067\u3001\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br><a href=\"https:\/\/www.pc-koubou.jp\/magazine\/19205\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pc-koubou.jp\/magazine\/19205<\/a><\/p>\n\n\n\n<p>\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u3067\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30a9\u30eb\u30c0\u30fc\u3054\u3068\u30b3\u30d4\u30fc\u3057\u3066\u8a2d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u4f7f\u3046\u306e\u306f\u300chaarcascade_frontalface_default\u300d\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30ab\u30b9\u30b1\u30fc\u30c9\u5206\u985e\u5668\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001\u6b21\u306b\u4e0b\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import time\nimport numpy as np\nimport cv2 as cv\n\nimport busio\nimport board\n\nimport adafruit_amg88xx\n\ni2c = busio.I2C(board.SCL, board.SDA)\nsensor = adafruit_amg88xx.AMG88XX(i2c, addr=0x68)\n\ntime.sleep(0.2)\n\n# \u30ab\u30e1\u30e9\u521d\u671f\u5316\ncap = cv.VideoCapture(0)\n\n# \u9854\u306e\u5206\u985e\u5668\u306e\u4f5c\u6210\nfaceCascade = cv.CascadeClassifier('haarcascades\/haarcascade_frontalface_default.xml')\n\nwhile True:\n    ret, frame = cap.read()\n    h, w, c = frame.shape\n\n    # \u30ab\u30e1\u30e9\u306e\u753b\u50cf\u3092\u534a\u5206\u306b\u3059\u308b\n    gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)\n\n      # \u9854\u306e\u8a8d\u8b58\n    facerect = faceCascade.detectMultiScale(gray, scaleFactor=1.2, minNeighbors=6, minSize=(1, 1))\n\n    if len(facerect) &gt; 0:\n        for rect in facerect:\n            # \u914d\u5217\u306e\u30b9\u30e9\u30a4\u30b9\u2192 rect[\u958b\u59cb\u4f4d\u7f6e:\u7d42\u4e86\u4f4d\u7f6e] rect[0:2]\u2192[\u5de6\u4e0aX\u5ea7\u6a19, \u5de6\u4e0aY\u5ea7\u6a19]\n            cv.rectangle(frame, tuple(rect[0:2]), tuple(rect[0:2]+rect[2:4]), (0, 0, 255), thickness=2)\n        \n        max_temp = 0.0\n        # 8x8\u306e\u6e29\u5ea6\u914d\u5217\n        pixels = sensor.pixels\n        for x in range(len(pixels)):\n            for y in range(len(pixels[0])):\n                # \u6700\u5927\u6e29\u5ea6\u3092\u683c\u7d0d\u3059\u308b\n                if (pixels[x][y] &gt; max_temp):\n                    max_temp = pixels[x][y]\n        \n        print('\u4eba\u3092\u691c\u77e5\u3057\u307e\u3057\u305f: '+str(max_temp))\n\n    cv.imshow('camera capture', frame)\n\n    # ESC\n    if cv.waitKey(1) == 27:\n        break\n\ncap.release()\n# \u8868\u793a\u3057\u305f\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u9589\u3058\u308b\ncv.destroyAllWindows()<\/pre>\n\n\n\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58\u304c\u3067\u304d\u305f\u3089\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br>\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">python3 thermo3_face<\/pre>\n\n\n\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3001USB\u306e\u30ab\u30e1\u30e9\u304b\u3089\u306e\u6620\u50cf\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<br>\u30ab\u30e1\u30e9\u306e\u6620\u50cf\u5185\u306b\u9854\u304c\u8a8d\u8b58\u3059\u308b\u3068\u3001\u8d64\u3044\u67a0\u304c\u8868\u793a\u3055\u308c\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u306b\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u306e8\u00d78\u5185\u306e\u6700\u5927\u6e29\u5ea6\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section05\"><span class=\"ez-toc-section\" id=\"Raspberry_Pi%E3%81%A7%E3%82%B5%E3%83%BC%E3%83%A2%E3%82%AB%E3%83%A1%E3%83%A9%E3%82%BB%E3%83%B3%E3%82%B5%E3%83%BC%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6%E4%BD%93%E6%B8%A9%E6%A4%9C%E5%87%BA-2\"><\/span>Raspberry Pi\u3067\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3063\u3066\u4f53\u6e29\u691c\u51fa<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u30b5\u30fc\u30e2\u30ab\u30e1\u30e9\u30bb\u30f3\u30b5\u30fc\u3067\u5b9f\u969b\u306b\u4eba\u3092\u8a8d\u8b58\u3059\u308b\u3068\u4f53\u6e29\u691c\u51fa\u3059\u308b\u307e\u3067\u3067\u304d\u307e\u3057\u305f\u3002<br>\u3055\u3089\u306b\u7cbe\u5ea6\u3092\u9ad8\u304f\u3059\u308b\u5834\u5408\u306f\u3001\u4ed6\u306e\u30bb\u30f3\u30b5\u30fc\u3092\u4f7f\u3046\u3053\u3068\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4eba\u3092\u8a8d\u8b58\u3059\u308b\u305f\u3073\u306b\u691c\u6e29\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u305f\u3081\u3001\u8077\u5834\u306a\u3069\u306e\u30aa\u30d5\u30a3\u30b9\u306b\u7f6e\u304d\u3001\u3056\u3063\u304f\u308a\u3068\u3057\u305f\u691c\u6e29\u30b7\u30b9\u30c6\u30e0\u3068\u3057\u3066\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002<br><\/p>\n<div class=\"veu_socialSet veu_socialSet-position-after veu_contentAddSection\"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src=\"https:\/\/platform.twitter.com\/widgets.js\";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,\"script\",\"twitter-wjs\"));<\/script><ul><li class=\"sb_facebook sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/www.facebook.com\/sharer.php?src=bm&u=https%3A%2F%2Fwww.7crystalsky.com%2F%3Fp%3D532&amp;t=IT%E3%82%92%E6%A5%BD%E3%81%97%E3%82%80%E4%BC%9A\" target=\"_blank\" onclick=\"window.open(this.href,'FBwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_fb icon_sns\"><\/span><span class=\"sns_txt\">Facebook<\/span><span class=\"veu_count_sns_fb\"><\/span><\/a><\/li><li class=\"sb_x_twitter sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.7crystalsky.com%2F%3Fp%3D532&amp;text=IT%E3%82%92%E6%A5%BD%E3%81%97%E3%82%80%E4%BC%9A\" target=\"_blank\" ><span class=\"vk_icon_w_r_sns_x_twitter icon_sns\"><\/span><span class=\"sns_txt\">X<\/span><\/a><\/li><\/ul><\/div><!-- [ \/.socialSet ] -->","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u7c21\u6613\u7684\u306a\u4f53\u6e29\u6e2c\u5b9a\u6a5f\u5668\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 \u4eca\u56de\u306fRaspberry Pi 4\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u4eba\u3092\u8a8d\u8b58\u3057\u305f\u3089\u4f53\u6e29\u304c\u6e2c\u5b9a\u3067\u304d\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7d44\u3093\u3067\u52d5\u304b\u3057\u3066\u307f\u305f\u3044\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[2,63,61,3],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it_meeting","category-63","category-61","category-electronicswork"],"_links":{"self":[{"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=532"}],"version-history":[{"count":5,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":1085,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions\/1085"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=\/wp\/v2\/media\/558"}],"wp:attachment":[{"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.7crystalsky.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}