W&T's diary

W&T Thermal Cam に関連する情報

Thermal Cam D

2つの遠赤外線カメラを使って立体画像と暫定距離が確認できる実験的なアプリです。画素が160x120しかない超小型遠赤外線カメラの可能性に挑戦しています。専用部品と、ある程度の知識が必要であることから一般向けではありません。カメラは部品の調達方法や作成方法などすべて公開していますので、次のURLを参考にしてご自身の責任でのご用意をお願いします。

kansaidenki.biz/2022/06/08/ステレオサーマルカムの作り方

Thermal Cam DはVRゴーグルなどの使用を想定していますのでアプリはiPhone専用です。M1 MacではWiFiルータ経由の設定で、フルスクリーン表示可能です。

 It is an experimental application that allows you to check a stereoscopic image, a provisional distance, and a provisional temperature using two far-infrared cameras.
 We are challenging the possibility of an ultra-compact far-infrared camera with only 160x120 pixels.
 It is for an experimental purpose only because it requires special parts and some knowledge. Flir Lepton is available, including how to procure and make parts, so please refer to the following URL and prepare it at your own risk.

Thermal Cam D is required VR goggles, so the app is for iPhone only. It can also work on M1 Mac.

kansaidenki.biz/2022/06/08/ステレオサーマルカムの作り方

画面構成は多少違いますが、プロモーション用のビデオです。ステレオグラスなどで立体感をご確認ください。

The screen composition is slightly different, but it is a promotional video. Please check the stereoscopic effect with stereo glasses.

画面は2種類

1.立体画像モード

左右のカメラ画像をそのまま表示します。ステレオグラスやVRゴーグルを利用して立体画像が確認できます。

There are two types of screens

1. Stereoscopic image mode

The left and right camera images are displayed as they are. You can check the stereoscopic image using stereo glasses or VR goggles.

2.距離測定モード

OpenCVのStereoSGBMを応用して暫定距離測定を行ない、距離深度をポイントクラウド画像で表示します。一般画像と違い放射熱を対象とした画像である点にご注意ください。

遠赤外線カメラはカメラのキャリブレーションが非常に難しいため、カメラ本体の取り付け精度が非常に重要です。

2. Distance measurement mode

Temporary distance measurement is performed by applying OpenCV Stereo SGBM, and the distance depth is displayed as a point cloud image. Please note that the image is for radiant heat unlike the general image.
Since it is very difficult to calibrate the camera of a far-infrared camera, the mounting accuracy of the camera body is very important.

画像は 放射赤外線測定範囲の最高最低温度を基準とし、255諧調に変換したグレースケール画像で、環境の変化によりコントラストが変化します。

距離測定ではその温度範囲の高温側17.6%についての範囲を特定して、その中でも一番大きい部分の中心部に追従して距離測定と温度測定を行います。定点観測をする場合、異常温度判定に役立つ機能です。

The image is a grayscale image converted to 255 gradations based on the maximum and minimum temperature of the radiated infrared measurement range, and the contrast changes due to changes in the environment.
In the distance measurement, the range of 17.6% on the high temperature side of the temperature range is specified, and the distance measurement and temperature measurement are performed by following the center of the largest part. This function is useful for determining abnormal temperature when performing fixed point observation.

ESP8266プログラムインストール

ESP8266側のプログラム書き込み方法は次のURL中の4~12をご覧ください。

https://takesan.hatenablog.jp/entry/2019/11/18/204521

今回のプログラムソースは以下のアドレスからからダウンロードしてください。

drive.google.com

iPhoneに赤外線画像データを送信する方法は次の2種類です。ダウンロードしたArduinoソースはご自分の環境に合わせて修正し、左右ポート番号を変えてインストールします。

今回のSTEREO版は無線ルーター経由で接続した方が画像が安定します。その際iPhoneipアドレスが外出などにより始終変更され、その都度ESP8266側のプログラムインストール作業が必要となってきますのでiPhone側のiPアドレスは、固定(静的)アドレスに設定してください。

ESP8266 program installation
For the program writing method on the ESP8266 side, see 4 to 12 in the following URL.
Please download this program source from the following address.

ESP_LEPTON3.5Stereo0627.ino - Google ドライブ

There are two ways to send infrared image data to your iPhone. Modify the downloaded Arduino source according to your environment, and install it by changing the left and right port numbers.

テザリング接続の場合

  • 下図中37〜39行を修正します SSIDとパスワードはご自分のiPhoneに合わせてください。
  • 39行は修正しないでください
  • SSIDとパスワードはダブルクォーテーション“で囲みます。
For tethering connection
  • Correct lines 37-39 in the figure below. Match the SSID and password to your iPhone.
  • Do not modify line 39
  • Enclose the SSID and password in double quotes.

WiFiルーター経由の場合 

  • 下図中37~39行にコメント記号//を書き込みます。
  • 42~44行のコメント記号を外し、ルーターSSID、パスワードを書き込みます。
  • 44行はルーターに接続した場合のiPhoneipアドレスです。外出などによりアドレスが自動変更されますので、iPhone側で静的アドレスに設定しておくことをお勧めします。
  • ipアドレスは仕切り記号がカンマであることに注意してください。

左右のカメラは別々のポート番号である必要があります。49~53行のコメント記号を書き換えてインストールしてください。また、ポート番号は変更しないでください。

For WiFi router
  • Write the comment symbol // on lines 37-39 in the figure below.
  • Remove the comment symbol on lines 42 to 44 and write the SSID and password of the router.
  • Line 44 is the IP address of the iPhone when connected to the router. Since the address is automatically changed when you go out, it is recommended to set it to a static address on the iPhone side.
  • Note that the ip address has a comma as the divider.
The left and right cameras must have different port numbers. Please rewrite the comment symbol on lines 49 to 53 and install. Also, do not change the port number.

iPhone アプリ

アプリストアで thermalcamd で検索してください。

Search for thermalcamd in the app store.

設定

Fov:LEPTONの公称水平視野角度は57°ですが、正確に距離を合わせる場合はこの数値を変更します。

Setting

Fov: LEPTON has a nominal horizontal viewing angle of 57 °, but change this value if you want to adjust the distance accurately.

カメラ間距離:作成したステレオカメラのカメラ間隔を入力します。ステレオ距離認識にはある程度の解像度が必要ですが、LEPTONは160x120で、かなり解像度が落ちることから4倍に補完して距離を測定しています。標準18cmより小さくなると、視差解像度の精度が確保できないため、より測定誤差が大きくなります。

※Fov 57°、カメラ間距離が18cmの場合カメラから70cm以内の距離測定ができませんので、予めご了承ください。

Distance between cameras: Enter the camera distance of the created stereo camera. Stereo distance recognition requires a certain amount of resolution, but LEPTON is 160x120, and since the resolution drops considerably, it complements 4 times and measures the distance. If it is smaller than the standard 18 cm, the accuracy of the parallax resolution cannot be ensured, and the measurement error will be larger.
* Please note that if the Fov is 57 ° and the distance between the cameras is 18 cm, it is not possible to measure the distance within 70 cm from the camera.

WiFi接続の注意点

  • 画像の受信は妨害電波や周囲の環境に大きく左右されます。iPhoneBlueToothおよび位置情報取得は必ずOFFにしてください。エアコンなどの影響を受けやすい点にもご注意ください。
  • LEPTONはカメラ温度が一定にならないと自主キャリブレーション(シャッターの開閉)を頻繁に行います。その間画像が中断されますので、LEPTONの電源を入れて2分程度放置してからアプリを立ち上げてください
  • 画像が遅くなった場合は、再接続や、アプリの立ち上げ直しを行なってください。それでも改善しない場合はiPhoneの電源を入れ直して再実行してください
  • 左右の画像がシンクロするまで、多少の時間がかかる場合があります。
  • 距離測定中はCPUの稼働率が高くなります、iPhoneのケースを外したり風に当てるなど冷却対策を行なってください。

Precautions for WiFi connection

  •  Image reception is greatly affected by jamming radio waves and the surrounding environment. Be sure to turn off BlueTooth and location information acquisition on your iPhone. Please also note that it is easily affected by air conditioners.
  •  LEPTON frequently performs self-calibration (opening and closing of the shutter) if the camera temperature does not become constant. During that time, the image will be interrupted, so turn on the power of LEPTON and leave it for about 2 minutes before launching the application.
  • *If the image is slow, please reconnect or restart the app. If that doesn't work, power cycle your iPhone and try again.
  • *It may take some time for the left and right images to synchronize.
  •  The CPU operating rate will be high during distance measurement, so take cooling measures such as removing the iPhone case or exposing it to the wind.

テザリング接続の場合

iPhoneの「設定」で、共有設定をONにしておき、通常はコントロールセンターのインターネット共有で接続しますが、その前に必ず機内モードをON,OFFしてWiFiの初期設定を行なってください。環境により片方の共有設定が5~10分で切れてしまう場合があります。この場合も機内モードのON,OFFでWiFiの初期設定を行なった後インターネット共有設定をOFF・ONで復旧してください。WiFi環境が整っていない場所で使用できる点が最大の利点です。

  • 片方の画像が止まって動かない場合は、カメラの片方のLEDが点灯したままになります。WiFi共有設定を一度OFFにして再度オンにしてからアプリを再開させてください。
  • テザリング接続ができていて、アプリを立ち上げても両画像がなかなか表示されない場合は、アプリを立ち上げ直してください。
  • アプリがバックグラウンド状態のまま長時間iPhoneがスリープ状態になると、テザリングが切れます。この場合もアプリを立ち上げ直してください。
For tethering connection
Set the sharing setting to ON in the "Settings" of the iPhone, and normally connect via Internet sharing in the Control Center, but before that, be sure to turn on / off airplane mode and make the initial settings for WiFi. Depending on the environment, one of the shared settings may expire in 5 to 10 minutes. In this case as well, turn on / off the airplane mode to make the initial settings for WiFi, and then turn off / on to restore the Internet sharing settings. The biggest advantage is that it can be used in places where the WiFi environment is not set up.
  • If one image stops and does not move, one LED on the camera will remain lit. Please turn off the WiFi sharing setting, turn it on again, and then restart the app.
  • If the tethering connection is established and both images are not displayed easily even after launching the app, please launch the app again.
  • If the iPhone goes to sleep for a long time with the app in the background, tethering will be cut off. In this case as well, please restart the app.

WiFi中継点経由でiPhoneと接続する場合

テザリング接続よりかなり安定した画像となりますが、外部などWiFi環境が整っていない場所では使用できません。使用用途やご自分のWiFi環境により使い分けしてください。WiFi中継点経由でもiPhoneBlueToothや位置情報サービスに影響されますのでアプリ使用時はこれらの設定を必ずOFFにしてください。(アプリ終了後はONにすることを忘れずに!)

When connecting to an iPhone via a WiFi relay point
The image will be much more stable than the tethering connection, but it cannot be used in places where the WiFi environment is not set up, such as outside. Please use it properly according to the purpose of use and your WiFi environment. Be sure to turn off these settings when using the app, as it will be affected by the iPhone's BlueTooth and location information services even via the WiFi relay point. (Don't forget to turn it on after the app is closed!)

アプリ稼働中の注意点

  • 測定される距離や温度は暫定であることにご注意ください。
  • 長時間使用の場合はiPhoneの放熱対策が必要です。
Precautions while the app is running
  •  Please note that the measured distances and temperatures are tentative.
  • If you use it for a long time, you need to take measures to dissipate heat from your iPhone.

ESP8266のLEDについて

ESP8266のLEDピン番号を16にしてLEDを取り付けた場合、点灯の状態により次のような判定が可能です。

WiFiに接続できた場合: 細かな点滅。アプリを立ち上げてもこの点滅が続く場合はArduinoソース中、iPhoneiPアドレスが違う場合が想定されます。

アプリを立ち上げた場合:細かな点滅からランダムな点滅に変わり、消灯時間が長いほど、周辺電波やもう片方のESP8266との電波競合が少ないことを意味します。頻繁に点滅する場合はまずiPhoneBlueToothがOFFになっていないことを疑ってください。また、付近のBlueTooth機器を無効にする、エアコンから離れるなどの対策をとってください。

WiFi回線が切断された場合:点灯。最初から点灯が続く場合はiPhoneルーターSSID,パスワードが違う可能性があります。また、テザリング接続で途中から片方あるいは両方のLEDが点灯し続けている場合は、共有設定が切れていますので、共有設定をOFF->ONするかESP8266の電源を入れ直してください。

About LED of ESP8266
When the LED pin number of ESP8266 is set to 16 and the LED is attached, the following judgment can be made depending on the lighting state.
If you can connect to WiFi: Flashes finely. If this blinking continues even after launching the app, it is assumed that the iP address of the iPhone is different in the Arduino source.
When the app is launched: It changes from fine blinking to random blinking, and the longer the off time, the less the radio wave conflict with the peripheral radio wave and the other ESP8266. If it flashes frequently, first suspect that your iPhone's BlueTooth is not turned off. Also, take measures such as disabling nearby BlueTooth devices and moving away from the air conditioner.
If the WiFi line is disconnected: Lights up. If the light continues from the beginning, the SSID and password of the iPhone or router may be different. Also, if one or both LEDs continue to light in the middle of the tethering connection, the sharing setting has been turned off, so turn the sharing setting OFF-> ON or turn the power of the ESP8266 off and then on again.

Thermal Cam D開発にあたって

 LEPTONによる立体画像再現は、アプリを含め4年前に展示用のプロトタイプを作り、FLIR社のホームページにも掲載いただきました。ただし、ESP8266どおしの電波干渉の問題、距離測定の誤差やばらつきが非常に大きいこと、そしてなにより距離測定部分の特定や追従をどのような方法で行うかなど問題が山積みで、その後開発を断念しました。

 今回は、LEPTONの持つ可能性の最後のまとめとしてふさわしい課題に挑戦し、結果として下図のように一見何気ない画像ですが、一般のカメラには到底できない発生熱源の特定と追従・遠近表現・距離と温度測定がリアルタイムに、しかもiPhoneで実現できました。

In developing Thermal Cam D
For the 3D image reproduction by LEPTON, we made a prototype for exhibition 4 years ago including the application and posted it on the FLIR website. However, there are a lot of problems such as the problem of radio wave interference between ESP8266, the error and variation of distance measurement is very large, and above all, how to identify and follow the distance measurement part, and then developed. I gave up.
This time, I challenged the problem suitable as the final summary of the possibilities of LEPTON, and as a result, it looks casual as shown in the figure below, but the identification and tracking of the generated heat source, the perspective expression, and the distance, which cannot be achieved by a general camera, Temperature measurement was realized in real time and on the iPhone.

 世界に類を見ないWiFi接続したLEPTONによる立体画像再現と距離測定マシン&iPhoneアプリです。興味のある方は是非お試しください。

It is a stereoscopic image reproduction and distance measurement machine & iPhone application by LEPTON connected by WiFi like no other in the world. If you are interested, please try it.

Goto Home

アプリがM1 Macに対応しました

 Thermal Cam3X、Thermal Cam BOSONとも最新バージョンはM1 Macに対応します。速い速いと言われているM1プロセッサですが、Bionic A13と比べてニューラルネットワークエンジンを倍にした効果がどの程度のものか全く未知数だったので、その検証も兼ねて今回アプリを修正しています。Thermal Camシリーズは標準YOLOv3の16ビットまたは32ビットデータとCoreMLライブラリを使用しているのでM1の本当の実力がわかってきます。結果的にはM1 MacBook Airでビルド&実行した場合、AI認識時間が416x416の入力画像で最高0.017sec。つまり最高58fps程度になることがわかりました。Linuxマシンで外付けGPUを使っている皆さんはこれがどれだけ速いか理解できると思います。(少なくとも手元にあるInteli7+Nvidia1080Ti並みです)また、iOSと比べてファイル操作が非常に楽になるので、もともとThermal Camの持っている学習済みデータの入れ替え機能が存分に発揮できるようになります。そしてMac Book Airの場合、長時間稼働させても本体が熱くならず、電池の減りも気にならなくなります。

 ただし、現状はアプリストアを通すとM1バイナリコードであるにもかかわらず、AI認識スピードが10fpsくらい落ちてしまうようですが、それでも今回のものは最高42fpsで画像認識します!。M1 Macで動作させる場合は、iOS版と多少操作方法が違うので以下に説明します。

f:id:TAKEsan:20210109235431p:plain f:id:TAKEsan:20210115112925p:plain

                 Thermal Cam3X                                    Thermal Cam BOSON

最新バージョンのM1対応について

設定方法

iOSの設定機能はメニューバーの「Thermal Cam3X」-->「環境設定」で変更します。

Thermal Cam3Xの場合は初期段階でPIとの接続になっています。ESP8266を使用する場合はここで変更します。また画像認識データをダウンロードしてもここでYoloをONにしないと、画像認識しませんので注意してください。

f:id:TAKEsan:20210115120208p:plain

学習済みデータの保管先

HOME/Library/Containers/アプリ名/Data/Documents です。また、Finderでライブラリフォルダを見るには設定変更が必要です。

f:id:TAKEsan:20210115121453p:plain

Goto Home

 

 

 

 

Thermal Cam3Xバージョンアップ内容と使用方法

変更点

1.LEPTONがWi-Fi接続されていない場合は、iPhoneのフロント、リアカメラが使えます。また、操作ボタンを一部変更しました。

f:id:TAKEsan:20200618131825p:plain

LEPTONが接続されていない場合は、カメラ画像が表示されます。画面上をシングルタップすることでリアとフロントカメラが切り替わります。一般画像での画像認識が可能になります。

①:カメラ画像表示中、LEPTONが接続された場合は、青文字(Connect)が表示されます

②:ロゴはボタンになっていて、AIサンプルデータのダウンロードURLに切り替わります

③:新しく黒ボタンが追加されました。EPS8266を接続した場合はカラーレンジ切り替えボタンになります。PI3を接続した場合は後述メモリーポイント画面切り替えボタンになります

④:iPhoneカメラ画像、サーモグラフィー画像、3D画像に切り替わります

3.リアビューの精度が向上しました

設定画面で表示非表示を切り替えるリアビューの精度が向上しました。下図の場合27℃の温度帯が緑で表示されています。

f:id:TAKEsan:20200618132831p:plain

Raspberry PI 3を使用した場合の追加事項

開発者としては非常に不利な画像ですがあえて公開します。iPhoneとPIは最も妨害電波の影響を受けやすいテザリング接続です。横向きの顔で非常に厳しい条件でも確実に顔(マスク有無を含めて)を認識していることが分かると思います。また、この画像は軽い運動をした後で皆さん体温が高めのようです。カメラからの距離によってもかなり温度差があることが分かると思います。定距離・顔が正面を向くようにカメラを配置すれば完璧に機能します。

 

温度測定誤差を向上させるためにRaspberry PI3、及びLEPTON3.5、Bionic12以上のCPUを持つiPhone又はiPad限定の機能です。本来のLEPTON3.5は温度測定精度が±5度又は5%となっていて、実際、同一点を測定するとかなりの変化が見られます。つまり体温測定には不向きです。

f:id:TAKEsan:20200618152806p:plain
LEPTON3.5で、37.5℃の黒体炉を約40分にわたって測定しています。横軸が0.5℃ピッチなので、同一ポイントで3℃以上の開きがあることが分かります。

 そこで画面上で温度変化の少ないポイントを記憶させ、時間の経過とともに変動する数値を画像単位で補正するという発想が生まれました。結果的に±0.25℃程度の精度を保たせることができます。

f:id:TAKEsan:20200618153012p:plain

このグラフは今回のPI3を使ったLEPTON3.5の測定結果です。対象測定物が国産の電気釜の保温中の表面温度です。横軸が0.2℃ピッチです。LEPTON3.5でも素晴らしい精度になることがおわかりいただけると思います。電気釜なので大きな波で温度が上下していることも分かります。この電気釜も素晴らしい保温性能ですね!

 この温度測定機能に、マスク着用を含めた赤外線画像の顔認識機能を取り入れたものが、今回のシステムです。

 原理上基準点は温度変化のない場所が理想ですが、石膏ボードを使用した壁や天井、水槽、発泡スチロール版などを利用しても、かなりの精度が維持できることが分かっています。高度な顔認識AIを組み入れたシステムとしては非常に低価格に押さえられることになります。

1.Raspberry PI側アプリのインストール方法

次のリンクを確認して下さい。プログラムソースもダウンロード可能です。

2.使用方法

(1) ESP8266とRaspberry PIの切り替え

 ESP8366とRaspberry PIは自動判別します。

(2) マスクを含めた顔の学習済みデータのダウンロード

 ロゴボタンを押して、表示されたWEB画像下部(d)のデータ(マスクを考慮した顔認識)をダウンロードし、Thermal Cam3Xフォルダに移動し、解凍します。他のw_tフォルダが存在している場合は消去又は移動して下さい。

f:id:TAKEsan:20200618134526j:plain

(3) Raspberry PI側アプリの起動

 様々な起動方法が考えられますが、この場合は同一無線ルーターに、PI・MaciPhoneを接続して、Macのターミナル画面からSSHを使用してPIに接続、iPhoneiPアドレスを指定してPIアプリを起動してみました。もちろんPIにキーボードを接続すれば、PI本体からの起動もできます。

f:id:TAKEsan:20200618135658j:plain        ⇒f:id:TAKEsan:20200623171934p:plain

     iPhoneで顔認識されている場合、PI3にも同時に検出された顔の体温が表示されます。

(4) 基準となる人の体温測定(測定を実施する人)。

f:id:TAKEsan:20200618140531j:plain

平熱であればどなたでもかまいません。また、慣れてくると理解できると思いますが、必ずしも体温計が必要というわけではありません。想定温度でも十二分に機能を生かせます。

(5)基準ポイント(メモリーポイント)測定画面の表示

PIのアプリが起動して、PIとiPhoneが接続されていれば、画面右下の黒ボタンを押すことで、メモリーポイント設定画面に画面が切り替わります。

新たにモリーポイント指定カーソル(赤丸)が現れます。

メイン画面:画像内側にメモリーポイントカーソル(赤丸)の移動範囲を示すグレーの四角形が表示されます。

UI画面:新たに4つのボタンが追加されます

Color range:今までのカラーレンジ設定と同じ動作です

Cursor:モリーポイントの固定と解除を行います

Emissivty:放射率の変更を行います

M+:CursorのM+ボタンを押すことで、さらにスライダーが現れます

f:id:TAKEsan:20200618141229p:plain

この画面では標準体温の人の顔認識していて、バウンディングボックスの中央に、十字カーソル範囲内での最高温度が表示されています。

(6)体温を測定した人の顔認識と表面温度確認

実際に体温計で測った温度とどのくらい違うかを確認します

(7)誤差がある場合は体温となるべく近くなるよう放射率を調整

f:id:TAKEsan:20200618142848p:plain

Emissivtyボタンを押すと放射率選択用のピッカービューが表示されるので、測定した体温に一番近くなる様放射率に変更します。すぐに表示温度が反応するので一番近くなった所で黄色のボタン(Done)を押します。ここで1〜2℃違っていても微調整可能です。

(8)メモリーポイントの指定

測定の邪魔にならず、温度変化のない場所にメモリーポイントカーソルを移動して、M+ボタンを押します(この画像の場合は左上の壁)。一度LEPTONのキャリブレーション(シャッター開閉)を行うので2秒ほど待ちます(この間、温度調整用のスライダーが表示され、黄色に変わりアニメーションします)

赤丸カーソルは緑に変わり、以降ACボタンを押さない限り移動できなくなります

新たに中央に任意温度測定用のカーソルが現れます。そして、顔を認識している場合には十字カーソル範囲の最高温度も表示します。

f:id:TAKEsan:20200618143339p:plain

(9)メモリーポイント指定後基準測定者の体温をスライダーで微調整

体温計で測定した温度に近づく様にスライダーを調節します。M+の横に表示されるオレンジの数値はメモリーポイント温度の変化を表します。(メモリーポイントが黒体炉のように温度が一定のものであれば、このオレンジの数値を黒体炉の温度に合わせます。LEPTONから黒体炉までの距離と同位置に計測ポイント(顔)があればその計測ポイントは正確な温度と言うことになります。混乱するのでこの説明は別の機会にします)

f:id:TAKEsan:20200618144226p:plain

モリー機能は以上の(5)〜(9)までの手順が必要ですが、コツがつかめるとかなり簡単に設定できます。
(10)一般画面に戻り体温の測定開始

 メモリーポイントの設定が終わったら、右下の黒ボタンを押します。一般画面に戻り測定開始となります。以降ほぼ同じ位置に他の人が立った場合、正確な温度が表示されます。

f:id:TAKEsan:20200618144743p:plain

測定中、ダウンロードした学習済みデータはAI機能のThermalsが有効になっています。設定方法などについては「AI機能について」を参照して下さい。

ある温度以上の体温の人を検知した場合、英語や日本語、フラッシュやアラームでアラート発生が可能です。標準ではthermals=0.3(0.3℃以上の温度差がある場合はアラーム)となっていますが、36.5℃が標準の場合は1.0程度にしても良いと思います。

 thermalsが0の場合は顔認識しても独自の十字カーソルやカーソル範囲の最高温度に関する温度表示されません。また、クラス番号変更により顔以外でも同様のことができます。

 thermalsが0以上の場合

  • バウンディングボックスの中心に計測温度が表示されます。この場合の温度表示は、十字カーソルに含まれる範囲の最高温度です。
  • 一般画面に戻った時、画面上のタッチ方法で以下のように設定が変更されます。

シングルタッチ:認識した時点の対象物の温度を記憶し、画面下に記憶させた計測温度を緑で表示します。一般温度測定カーソルは中央固定となり、動かすことはできなくなります。また、対象画像を認識したバウンディングボックス中央部の温度表示は、記憶させた温度差表示となります。

ダブルタッチ:記憶された温度がクリヤーされ、バウンディングボックス内の中央部温度は計測したままの温度表示となります。一般温度測定カーソルは、任意点の温度計測が可能となります。   

f:id:TAKEsan:20200618145712p:plain

サンプル学習済みデータはグーチョキパーとマスクを含めた顔の認識。つまり4パターンの画像認識が可能です。このデータの意味は40%以上の認識率の場合、全てのクラスのバウンディングボックスを表示。特に顔が(class番号4)30%以上の認識率の場合かつ標準との温度差が0.3℃の場合は英語で"Caution"とsiriがアラートを出します。conf_allは0.3でも良いかもしれません。色々試してみて下さい。

ESP8266を使用した場合

  • モリーポイント測定画面の切り替えはできなくなります。したがってこの画面を使用してのカスタマイズはできません。画面下の黒いボタンは、現在の温度範囲で画像の色が固定されるColor Renge切り替えボタンとして機能します。
  • 画像認識は可能ですが、特定のクラスに関する温度計測はできなくなります。
  • w_t.txtは有効に使えますが、特定のクラスに関する条件(class,conf)で、countryとvoiceが反応します。countryとvoiceを使う場合は必ずthermalsを0に書き換えてください。

 

------------------------------------------------------------------------------------ 

※ここで説明している方法の他に、黒体炉や蓄熱材を使った方法など、様々なメモリーポイントの指定方法ができます。

※自主試験では、LEPTON設置位置から1mを境にして0.1m当たり約0.1℃の温度差が発生します(50cm近づくと0.5℃測定温度が上昇する)。したがって、体温測定位置はある程度一定であることが必要です。

※メモリーポイントを壁などに設定した場合、時間とともに変化することにご注意下さい。空調の開始時など、室温と壁面の温度差がある場合は、時間の経過とともに誤差が大きくなります。

※LEPTON3.5の精度は±5℃です。メモリーポイントを設定しない場合はこの範囲で表示温度が上下します。また、放射温度計という特性上、対象物の持つ絶対温度を測定しているわけではないことにご注意下さい。

Goto Home

 

 

 

 

Thermal Cam シリーズ

 Thermal Camとは About Thermal Cam.

Thermal CamはFlir LEPTON3.0又は3.5、BOSON QVGAを使ってiPhoneでサーモグラフィーを実現します。カメラとiPhoneテザリングによる無線接続です。BOSONを使用する場合はThmal Cam for BOSON - W&T's diaryを参照してください。

Thermal Cam can be used on iPhone with Flir LEPTON3.0 or 3.5 and BOSON QVGA for thermography. The camera and iPhone are wirelessly connected by tethering.

f:id:TAKEsan:20210115123455p:plain

Thermal Cam 3X

Thermal Cam3X はV10.0になりました。iPhone12シリーズやM1 Macにも対応します。

f:id:TAKEsan:20210109235431p:plain

Thermal Cam3X はV8.0になり、Raspberry PI3を使えば温度計測精度が向上します。

www.youtube.com

LEPTON3.5は標準で温度測定機能が付いていますが、精度はハイゲインモードで±5℃となっていて、正確な温度を測定したい場合、実用的ではありませんでした。そこで独自の工夫を加えた結果、ほぼ±0.25℃の精度で顔(マスク可)などを認識しながら、温度測定ができるようになりました。この機能はRaspberry PI3とLEPTON3.5、iPhone Xs以上のCPUを持つiPhone又はiPadで使用可能です。また、Raspberry PIをホストモードにすることで、電波のつながりにくいところでもピアツーピア接続が可能です。

 バージョンアップしたThermal Cam3Xは、Thermal Cam BOSON以上の機能を持ちます。また、Raspberry PI 3やLEPTON3.5をお持ちでない方も、今まで通りESP8266を使ってAIを取り入れたサーモグラフィーが実現できます。

前回までのバージョンアップ内容は以下の通りです。

  • 今までの使い勝手はそのままに、AIによる画像認識機能が加わった
  • 画像認識ファイルは自由に入れ替え可能。ユーザーが作成した学習済みファイルも使用可能で、認識した対象物についてアラート機能を付加。
  • 新たにM5Stackで動作可能になった。

Thermal Cam3Xは市販のESP8266またはRaspberry PI3ボードとFlir LEPTON3.5が必要です。以下の説明を確認し、必要部品をそろえて下さい。いままでESP8266を使っていた方は、ESP8266側のアプリの入れ替えが必要です。

LEPTON3.5の場合

Thermal_Cam3X_ESP_20220510.ino - Google ドライブ

 

Thermal Cam3 is new. It has the following features.

  • The image recognition function by AI has been added while maintaining the conventional usability.
  • Image recognition files can be freely replaced. User-created learned files can also be used, and an alert function is added for specified objects.
  • Newly operable with M5Stack

Thermal Cam3X requires a commercially available ESP8266 board and Flir LEPTON 3.5. Please check the following explanation and you have the necessary parts. If you have been using ESP8266 until now, you need to replace the ESP8266 app.  

for LEPTON3.5

Thermal_Cam3X_ESP_20220510.ino - Google ドライブ

基本機能の操作方法はこのビデオををご覧下さい。Watch this video for basic function operation.

      

AI機能を利用するとこのようなことができます。You can do this using the AI function.

      

M5Stackも使えるようになりました。M5Stack can now be used.

                      

取扱説明  Handling instructions 

Thermal Cam BOSON

 

 

 

 

 

 

 

ダイナミックレンジ・カラーレンジ・サイドビュー画面について About Dynamic Range,Color Range,Side View.

ダイナミックレンジについて About dynamic range

LEPTONは測定温度に応じて14bitの数値を出力しますが、白黒データにすると1ピクセルあたり最大8,192階調にもなります。計測範囲は-273 〜 + 300 ℃( 分 解 能 : 0.05℃ )。現状の通常ディスプレイで表現できるグラデーションは256段階。それに色を付けます。ところが表示装置の制限で、測定可能範囲を256階調にすると非常に荒い画像となることになります。さらに測定する温度範囲はその中のごく一部で、濃淡が出ないために画像が表現できません。回避策は画像として表示するため計測範囲をここで256階調に変換することになります。

LEPTON outputs a 14-bit value according to the measured temperature, but if it is monochrome data it will be up to 8,192 tonal levels per pixel. Measurement range is -273 ~ + 300 ℃ (resolution: 0.05 ℃). There are 256 gradations that can be expressed in the current normal display. I add color to it. However, due to limitations of the display device, if the measurable range is set to 256 tones, it will be a very rough image. Furthermore, the temperature range to be measured is only a part of it, and the image can not be expressed because there is no shade. Since the workaround is displayed as an image, the measurement range will be converted to 256 tones here.

f:id:TAKEsan:20180221104750p:plain

色付けした画像が下図のようになり、Thermal Camの標準画面です。

f:id:TAKEsan:20180221104916p:plain

この方法は問題があって、刻々と変化する温度領域をその都度256等分することになるので、測定場所の移動で、画面毎に色がめまぐるしく変化してしまいます。

Since this method has problems and it will divide the constantly changing temperature range into 256 equal parts each time, as the measurement place moves, the color changes dramatically from screen to screen.

f:id:TAKEsan:20180221105448p:plain

室内のように最高最低温度の差があまり無い場合は、気になりませんが、例えば画面に極端な高温部が部分的に存在する場合、温度差が増しただけ解像度が下がることになるので極端な温度幅になり、室内の階調がほとんど無くなることになります。 

If there is not much difference between maximum and minimum temperatures as in the room, you do not mind, for example if the extreme high temperature part is partially present on the screen, since the resolution will decrease as the temperature difference increases It becomes an extreme temperature width, and the gradation of the room almost disappears.   

       f:id:TAKEsan:20180221105344p:plain

f:id:TAKEsan:20180221105552p:plain

これを防ぐため、この例の場合低温寄りのある範囲で256階調にすれば画像表現できることになります。

調整する方法として、現状の最高最低温度の低温側及び高温側を全体の比率で調整できるようにしたのがダイナミックレンジです。調整範囲外は白又は黒になります。下図は低温側を調整した場合です。

In order to prevent this, in the case of this example, if it is 256 tones in a certain range close to low temperature, it is possible to express the image.

As a method of adjustment, the dynamic range is made to be able to adjust the low temperature side and the high temperature side of the current maximum and minimum temperature by the whole ratio. Outside adjustment range is white or black. The figure below shows when adjusting the low temperature side.

f:id:TAKEsan:20180221105809p:plain

f:id:TAKEsan:20180221105916p:plain

現在の最低最高温度の範囲で、低温側32%を256階調表現している。Max温度はこの場合炎の温度ではなく背景の最高温度となる。高温側を調整した場合はMin温度が変化する。

In the current lowest maximum temperature range, 32% of the low temperature side is expressed in 256 tones. In this case Max temperature is not the temperature of the flame but the maximum temperature of the background. When the high temperature side is adjusted, the Min temperature changes.

結果的に、ある温度帯でLPTONの分解能の限度まで階調を表現できるようになります。これがThermal Camのダイナミックレンジスライダーです。

As a result, gradation can be represented up to the limit of the resolution of LPTON in a certain temperature range. This is the dynamic range slider of Thermal Cam.

----------------------------------------------------------------------------------------------------------------------------

編集

 

カラーレンジについて  About color range

室内のように測定温度範囲が小さい状況で温度画像を再現したい場合、他の方法で背景色の変化をできるだけ無くする方法はないのでしょうか?。-273〜+300 ℃の計測範囲を例えば室内の最低最高温度(24℃〜34℃とか)に変えて、この間に256階調のカラーマップを適用させる方法で解決できます。測定温度に対応する色が固定されるので画像が安定することになります。

If you want to reproduce a temperature image in a situation where the measurement temperature range is small like indoors, is there no way to eliminate background color change as much as possible using other methods? . It can be solved by changing the measuring range of -273 to + 300 ° C to the minimum room temperature (24 ° C to 34 ° C, for example) in the room, and applying 256 gradation color maps during this period. Since the color corresponding to the measurement temperature is fixed, the image will stabilize.

  f:id:TAKEsan:20180221110100p:plain

    

f:id:TAKEsan:20191115143928p:plain

上記のようにKansai Denkiボタンを押しカラーレンジをONにすると、画像右上にグレーの点と、現在の最低最高温度が表示されます。

When the Kansai Denki button is pressed and the color range is turned on as shown above, a gray dot and the current minimum and maximum temperature are displayed in the upper right corner of the image.f:id:TAKEsan:20180221111008p:plain

同時に左下の現状最低最高温度表示部分に青と赤の点が現れます。二つの点の範囲が絶対カラーマップの範囲を示します。現状はその範囲でどのあたりを利用しているのか判別できるようにしました。測定した温度帯が刻々と変化しますので、この2つの点も常に動くことになります。カラーマップONで極端な温度が部分的に発生した場合でも、下図のように(ライターの火が画像に入っている)背景色は変化しなくなります。

At the same time, blue and red dots appear in the lowest highest temperature display area at the bottom left. The range of two points indicates the absolute color map range. The current situation has made it possible to judge which area is used within that range. Since the measured temperature zone changes every moment, these two points will also move at all times. By doing this, even if extreme temperatures are partially generated, the background color will not change as shown below (the lighter's fire is in the image).

f:id:TAKEsan:20180221111133p:plain

赤と青の点の範囲と現在のカラーマップがうまく動いていることがわかると思います

You can see that the range of red and blue points and the current color map are moving well.

この新機能は、現状カラーマップが標準カラーマップのごく一部の範囲となった場合階調が著しく失われますので注意が必要です。

Please note that this new function will cause the gradation to be significantly lost if the current color map becomes a small part of the standard color map.

----------------------------------------------------------------------------------------------------------------------------

サイドビューについて  About side view

設定でSide View をON。特に確認したい温度領域 Target temp で温度を指定します。

この設定で、画面右側にサブビューが表示され、ターゲット測定温度は緑色で表示されます。

Set Side View on setting. Specify the temperature with the temperature range Target temp you want to check.With this setting, a subview is displayed on the right side of the screen and the target measurement temperature is displayed in green.

f:id:TAKEsan:20180221111400p:plainf:id:TAKEsan:20180221111454p:plain

f:id:TAKEsan:20180221111642p:plain

この例のように最高温度最低温度域、設定温度域が即座に確認できます。測定域が現在の最低温度より低いときは、当然ですが緑表示されないのでご注意下さい。

As in this example, the maximum temperature minimum temperature range, set temperature range can be confirmed immediately. Please note that when the measurement area is lower than the current minimum temperature, green display will not be made.

----------------------------------------------------------------------------------------------------------------------------

LEPTONの温度計測に関する全般的な注意点は、 Overall note on temperature measurement of LEPTON

  • LEPTONは温度計測が安定するまで多少の時間が必要です
  • 作成したアプリは対象熱源の放射率を考慮していません
  • 現在販売しているLEPTON3は温度測定の保証はしていません
  • LEPTON needs some time until the temperature measurement stabilizes
  • The created application does not consider the emissivity of the target heat source
  • Temperature measurement is not guaranteed for  LEPTON 3 which are currently on sale

以上のことから場面や環境で測定温度に誤差があることをご理解下さい。

Please understand that there is an error in the measured temperature in the scene or environment from the above.

 Goto Home 

----------------------------------------------------------------------------------------------------------------------------

 * 1: There are few noises depending on the distance and the surrounding conditions, but the frame rate drops.

Thermal Cam3X System overview

システム概要

そもそもLEPTONサーモセンサーってなに? What is LEPTON thermosensor in the first place?

このセンサーだけで熱を感知して、画像を再現します。真っ暗闇で何の照明も使わずに画像が再現できます。詳しくはメーカーサイトを御覧ください。

This sensor alone senses heat and shows thermal image. Thermal Images can be seen in the dark without any lighting. Please see the manufacturer site for details.

FLIR Lepton® | FLIR Systems

なぜ WROOM02 (ESP8266) を使うのか? Why use WROOM 02 (ESP 8266)?

その消費電力の少なさと価格の安さに尽きます。消費電力はESP32やPi Zero の約半分。基盤を選べば280mAhの極小リポバッテリーでLEPTON3の場合でも1時間以上赤外線動画を発信し続けます。

It consumes less power and lower price. Power consumption is about half of ESP32 and Pi Zero. If a good pcb is chosen, it will continue to transmit infrared video for over 1 hour even in case of LEPTON 3 with 280 mAh mini lipo battery.

f:id:TAKEsan:20170920222645j:plain

新しく開発したドローン向けの比較的大型の基板でも、電池を含めて僅か18gです

このことは、小型ドローン搭載を始め色々な用途で使えることを意味します。ESP8266でLEPTON3の画像を30~100m離れたところからiPhoneで受信できます。

上記写真は、小型ドローンに特化したボードでスイッチサイエンスさんで取り扱っていただいています。

ESP8266には何も改良を加えていないので当然技適も問題ありません。このボードとiPhoneアプリとの組み合わせで双方100m程度離れている条件で、iPhoneからLEPTON3のほぼノイズがない画像が継続して再現できました。しかも測定した場所はWIFI中継点が20箇所程度と非常に劣悪な環境でした。(下記で実際の動画が確認できます)

残念ながら一般のボードでは最大の動画受信距離は35m程度です。今回のアプリはボードを選びませんが、性能と安定性を望むならカスタム基盤が必要になります。

This means that you can use it for various purposes, including toy drone. However, as we introduced in previous articles, there are many problems. LEPTON 3 with ESP 8266 and still be able to receive on iPhone from30~100 m .

The picture above is a board specializing in small drones and handled by Switch Science.Since there is nothing to improve on ESP 8266 naturally, there is no problem with skill. With this combination of this board and software of this time it was able to reproduce images with almost no noise of LEPTON 3 from iPhone under the condition that both are 100 m away.

Moreover, the place where we measured was a very bad environment with WIFI relay point of about 20 places. (Actual video can be confirmed below) 

Unfortunately the maximum video reception distance on a general board is around 35 m. This application does not choose a board, but if you want performance and stability, you need a custom pcb made by Wiwao. If you can successfully distribute movies with ESP 8266, there is nothing to benefit from using other processors or ESP32.

LEPTON3+Thermal Cam3をMavic Airに取り付けて撮影すると.......。When LEPTON 3 + Thermal Cam 3 is attached to Dobby and shot ........

次の動画は、Oosawaさんが小型ドローンMabic Airに今回のシステムを取り付けて、実際に太陽電池メンテナンス用にTestフライトを実施したものです。(協力:大澤 雄一郎)

The following video is Oosawa's installed this system on a small drone Mabic Air and actually conducted a Test flight for solar cell maintenance.

      Thermal Cam3はUDP OSC通信をiPhoneデザリングで実現していますが、周りの妨害電波からほとんど影響を受けません。Thermal Cam 3 conducts UDP OSC communication with iPhone tethering, but it is not hardly affected by surrounding jamming waves.

次の動画はWiFi中継点が20ヶ所程度でパケットに影響の出やすい駅構内で録画していますが、多少フレームレートが落ちる程度で、画像ノイズは全くないことが確認できます。

Although the next movie is recording on the station premises where the WiFi relay point is likely to affect packets at around 20 places, it can be confirmed that there is no image noise at all, as the frame rate goes down slightly.

     夜なのにこんな画像が録画できます。Even though it is night, you can record such an image.

 人も車も風景も、そして電線も.....。このクオリティー。結構いいかもしれません。

People, cars, landscapes, electric wires ...... This quality. It might be pretty good.   

   

100m離れた場所での画像です。It is an image at a place 100 m away.

 WROOM02(ESP8266)側のWIFI中継点は20箇所。iPhone側は7箇所でした。少しパケット紛失(インジケーター黄色点滅)しているようですが、動画のスピードは問題ありませんでした。この画像の撮影ではWiwaoさんの最新ボードを使っています。

There are 20 WIFI relay points on WROOM 02 (ESP 8266) side. There were 7 places on the iPhone side. It seems that a little packet loss (indicator yellow flashing), but the speed of the video was not a problem. For shooting this image, I use his latest board of Wiwao.

   LEPTON3が風に揺れています。ほとんど遅れがないことと、画像のノイズが全くないことが確認できました。この場所はすぐ左側が崖になっている住宅地で、パケットのエラー修正がまともにできていないと、満足に画像が再現できない「魔」の場所です。

LEPTON 3 is swaying in the wind. It was confirmed that there was almost no delay and no image noise. This place is a residential area where the left side is a cliff soon and it is a place of "devil" that can not reproduce images satisfactorily if error correction of packet is not done properly.

Goto Home

ESP8266を使う場合のインストール方法 Installation method when using ESP8266

アプリ実行前に...。 Before running the application ....

 

このアプリは以下の別部品およびソースのインストールが必要です。順番に沿って部品の調達およびソフトのインストールを行ってください。WROOM02のソースコンパイル時はモリーとCPUスピード設定をそれぞれ80MHz,160MHzに設定が必要です。(Thermal Cam (for LEPTON1)は以前周波数を下げていましたが、V2.0では周波数を上げてコンパイルします)※「5.ボード設定は以下の通りとしてください」参照

まずESP8266開発ボード、LEPTON3、LEPTONブレイクアウトボードを手に入れてください。 以下必要部品の入手先とLEPTON画像再現までの手順です。

This application requires installation of the following separate parts and source. Please procure parts and install software according to the order. When source compiling WROOM 02, it is necessary to set memory and CPU speed setting to 80 MHz and 160 MHz respectively. 

 First, get the ESP 8266 development board,  LEPTON 3, LEPTON breakout board.Below is the procedure from where to obtain the required parts to LEPTON image reproduction.

 1.ESP8266開発ボードを用意してください。Prepare the ESP8266 development board.

f:id:TAKEsan:20191118111932p:plain 

LEPTON3はSPIとi2C及び3.3V出力端子が必要です。これらの端子が使用できないボードもありますので、購入時は注意してください。

LEPTON 3 requires SPI and i2C and 3.3 V output terminals. Some boards can not use these terminals, so be careful when purchasing.

専用のボードを販売しています。(W&T Thermal Cam PCB)

         W&T Thermal Cam PCB - スイッチサイエンス

         W&T Thermal Cam PCB用パーツセット - スイッチサイエンス

SPIの信号が安定するばかりでなく、WiFiの飛距離が技適範囲内で大きく伸びます。

 We decided to sell the board we made. In addition to stabilizing the signal of SPI, the distance of WiFi will dramatically increase within the technical range! ! .

2. LEPTON3又は3.5を用意してください。Please prepare LEPTON3 or 3.5

f:id:TAKEsan:20191118113207p:plain

 LEPTONセンサー自体は完全防水で、衝撃にもかなり強いため悪条件にびくともしませんが、取り外し可能なシャッター部品は壊れやすい欠点があります。取り扱いには十分に注意してください。LEPTONは定期的にシャッターを閉じて画像のキャリブレーションを行っていますが、シャッターが壊れると残像が残るなど、画像に障害が出て来ます。今の所シャッターの交換部品は販売していない様なので、取り扱いには十分注意が必要です。

The LEPTON sensor itself is completely waterproof, and it is quite strong for impact, so it does not bother with adverse conditions, but detachable shutter parts have a breakable disadvantage. Please handle with care. LEPTON regularly closes the shutter and calibrates the image, but if the shutter breaks, afterimages will remain, such as image failure will come out. Currently it seems that we do not sell replacement parts for the shutter, so careful handling is necessary.

3. BREAKOUT BOARDが必要です。 BREAKOUT BOARD is required.   

f:id:TAKEsan:20191118113845p:plain

Ver1.0 は製造中止ですが ver2.0 はFLIR Lepton Breakout Board v2.0 | FLIR Systemsで手に入ります

In Japan, you can get it with Cornes Technology or Digi - Key.                              

 4. Arduino IDEをインストールします(Macの場合) Install Arduino IDE (Mac)

Arduino IDE https://www.arduino.cc/en/main/software  をインストール

IDEを起動させたら、

Arduino-->Preferences 

出てきた環境設定ダイアログの下の方「追加ボードマネージャーのURL:」の中に

http://arduino.esp8266.com/stable/package_esp8266com_index.json

を書き込む。

Install Arduino IDE https://www.arduino.cc/en/main/software   After starting the IDE,

Arduino-->Preferences

In the lower part of the setting dialog that came out "in the URL of additional board manager:"

http://arduino.esp8266.com/stable/package_esp8266com_index.json

 f:id:TAKEsan:20171008224533p:plain

ツール-->開発ボード-->ボードマネージャー を選択

最後の方にesp8266 by esp8266 Community という項目があります。 f:id:TAKEsan:20170920210049p:plain

バージョンは必ず2.2.0 を選択してください。(上図はすでに2.2.0を選択してるので選択画面には出て来ていない)すでに 2.3.0を選択している方は 2.2.0にバージョンを落としてください。2.3.0で今回のソースをインストールするとうまく動作しません。 

Be sure to select 2.2.0 for the version. (Since the above figure has already selected 2.2.0, it has not appeared on the selection screen.) If you have already selected 2.3.0 please drop the version to 2.2.0. Installing this source in 2.3.0 does not work well.

 5. ボード設定は以下の通りです。 The board settings should be as follows.

シリアルポートはESP8266を接続すれば表示されますが、Bluetoothでない方を選択します。注意点は、Macの場合ESP8266を何回も抜き差しすると、USBを認識しなくなることです。認識しない場合はMac側のUSBコネクタを変更すると、認識するようになります。MacBookのようにUSBコネクタが2つしかなくて両方認識しなくなったら、再起動……。です。       Flash Frequency=80MHz、CPU Frequency=160MHzであることに注意してください。    

The serial port will be displayed if you connect the ESP 8266, but choose the one that is not Bluetooth. The caveat is that if you plug or unplug ESP 8266 multiple times on a Mac, it will not recognize USB. If you do not recognize it, you will recognize it when you change the USB connector on the Mac side. If there are only two USB connectors like a MacBook and both do not recognize, restart ....... is. Please note that Flash Frequency = 80 MHz, CPU Frequency = 160 MHz.                 

f:id:TAKEsan:20170924110748p:plain

f:id:TAKEsan:20170920210155p:plain   

 6. OSCライブラリをインストールします。 Install the OSC library.

Arduino IDEの Arduino—>Preferences..  を選択して一番上の スケッチブックの保存場所を確認します。

Select Arduino-> Preferences .. in the Arduino IDE and check the storage location of the top sketchbook.

 f:id:TAKEsan:20170920210844p:plain

この中にlibraries フォルダがあるかどうか確認します

Make sure there is a libraries folder in this.

無かったらlibrariesフォルダを作成します。以下のURLを開いて

https://github.com/sandeepmistry/esp8266-OSC

ESP8266のOSCライブラリをダウンロード解凍してlibrariesフォルダに移動させます。

一度Arduino IDEを終了させ、再起動後 スケッチ-->ライブラリをインクルードを選択して 「OSC 」が入っているかどうか確認。

If you do not have it, create a libraries folder. Open the following URL

    https://github.com/sandeepmistry/esp8266-OSC 

Unzip the OSC library of ESP 8266 and move it to the libraries folder.

Exit the Arduino IDE once, after restarting, select Sketch -> Include Library to check if "OSC" is included.

 7. iPhoneを設定します。 Configure iPhone.

iPhone を普通に初期設定するとssidは日本語になります。エラーが起きる可能性がありますので半角英字に修正してください。

 設定-->一般-->情報-->名前-->現在のiPhone名称>を選択 で名称を変更します。名称を変更してもiPhone自体の挙動に影響はありません。 

When initializing iPhone as usual, ssid becomes Japanese. Please correct it to half-width alphabetical as it may cause an error.

Choose Settings -> General -> Information -> Name -> Current iPhone Name> to change the name. Changing the name does not affect the behavior of the iPhone itself.

 8. ESP8266Arduino ソースをダウンロードします。Download the ESP 8266 Arduino source.

LEPTON3.5の場合(for LEPTON3.5 )

Thermal_Cam3X_ESP_20220510.ino - Google ドライブ

上記URLからダウンロードしてください。Arduino IDEを開いて、ダウンロードしたファイルをダブルクリック。フォルダの中に入れますか?と聞かれるので、YESを選択。OSCやSPIの安定化、UDPパケット紛失問題の解消、ESP特有のWDTリセットの解決方法をコメントしておきました。ボードを選べば100m以上離れた場所でLEPTONの画像が再現できます。 

Please download from the above URL.Open Arduino IDE and double click on the file you downloaded now. Can you put it in the folder? As you are asked, choose YES. We commented on the stabilization of OSC and SPI, the elimination of UDP packet loss problem, and the solution method of WSP reset specific to ESP. If you choose a board, LEPTON images can be reproduced in places more than 100 m away.

 9. 今回のiPhoneアプリをダウンロードします。Download this iPhone application.                

f:id:TAKEsan:20191114144756p:plain

W&T又はkansaidenkiで検索。Themal Cam3Xを探します。申し訳有りませんが有料アプリです。

Search by W&T or kansai. Look for  Themal Cam 3X according. Sorry, this is a paid app.

 10. 今回のソースを開いて一部を修正します。Open this source and fix some.

修正が必要な部分は、以下の3箇所です。 

         40,41行目付近   

          #define SSID_X    “ABiPhone”   //iPhone 

          #define PASS_X    "11111111"   //iPhone 

 ABiPhoneにiPhoneの名称、11111111 に 設定-->モバイルデータ通信-->Wi-Fiのパスワード を調べて パスワードを入力します。

          51行目付近

          #define LEDpin 16 

に自分のボードに合ったLEDのピン番号を入力してください。LEDは特に必要ありませんが、ESP8266の状態がわかるので、点灯すると便利です。サインは以下の通りです。

  • LED 長点滅 初期のWiFi接続中の場合点滅。
  • LED 短点滅 iPhone側のアプリが中断した場合点滅。
  • 無点滅   正常にデータを送っている場合。
  • 無点滅中一瞬LEDが光る場合 パケットが紛失して、再度同じパケットを送っている時。ピカッピカッが多いときは、周囲の電波状態が悪く連続してパケット修正をしている状態なので、画像のフレームレートが下がります。

 GPSをONにすると、周期的に一瞬ピカッと光ります。確実にパケットを紛失してるのですが画像にはさほど影響がないことがわかると思います。BlueToothをONにするとさすがにたくさん点滅してフレームレートが多少落ちます。

The parts that need to be modified are the following three places. 

Near lines 34 and 35 

          #define SSID_X    “ABiPhone”   //iPhone

          #define PASS_X    "11111111"   //iPhone

Set the name of iPhone to ABiPhone, set to 11111111 -> Mobile data communication -> Enter the password by checking the Wi - Fi password.

          Line 47 (for LEPTON 1) Near line 53 (for LEPTON 3)

           #define LEDpin 16

Please enter the pin number of LED matching your board. Although LED is not particularly necessary, it is convenient to light up as you can understand the state of ESP 8266. The signature is as follows.

  • LED blinking - when initial WiFi connection is in progress. 
  • LED Flash short blink Blinks - when iPhone side application is interrupted.
  • No flashing - When sending data normally.
  • When the LED glows instantaneously during blinking - When the packet is lost and is sending the same packet again. When there are a lot of shocks, the frame rate of the image decreases because the ambient radio condition is bad and the packet is being corrected continuously.

When GPS is turned on, it glows shimmerly periodically. I think that you can see that there is not much effect on the picture although it surely loses the packet. When BlueTooth is turned on, it glows a lot and the frame rate drops.

11. ESP8266とLEPTON BREAKOUT BOARD を接続します。Connect ESP 8266 and LEPTON BREAKOUT BOARD.

スイッチサイエンスESPrの場合、LEPTONブレイクアウトボードとESP8266の結線は以下の通りです

For switch science ESPr, the connection between LEPTON breakout board and ESP 8266 is as follows 

       f:id:TAKEsan:20191118122016p:plain                       

 12. WROOM02(ESP8266)ボードにプログラムを転送します。Transfer the program to WROOM02 (ESP8266) board.

以上設定が終わったらコンパイル、転送します。たまにエラーが出る場合がありますが、その場合は再度転送してください。(USBを認識していない場合が多い)

When compilation and transfer are done, it completes. Although occasionally an error may appear, please transfer again in that case. (USB is not recognized in many cases) 

13. いよいよサーモグラフィー開始 The thermography finally starts !!

iPhoneX、11Proでの動作確認をしています。iPadでも動くと思いますが、両者ともCPUはA9以上が必要です。iPhone 11 Pro MAX、Xs、Xs Pro、XR、8、8Plus、他のiPadに関してはシュミレーターで動作を確認・調整しています。

インストール作業から1回目の動作確認までは、簡単とは言えませんが、Arduinoに慣れている皆さんにとっては全く問題のない過程です。セキュリティーを保ったまま、2回目以降は3ステップ(LEPTON側スイッチオン-->インターネット共有-->iPhoneアプリ起動)で動いてしまいます。煩わしいWiFi選択やIP、パスワード入力などは全く必要ありません。また、テザリングを使っていても外部とは通信しないので、Thermal Cam3動作に関する通信料金は発生しません。

*iPhoneの機種や周囲の環境によりテザリングがつながりにくい場合があります。その場合には

  • ESP8266の電源を入れ直す
  • 機内モードON->OFF を実行してからインターネット共有をONにする。
  • iPhoneの電源を入れ直す
  • 時間や場所を変えて再接続を行う

I am checking the operation with X,11Pro. I think that it will work on general iPad, but both require A9 or more CPU. For iPhone Xs,Xs Pro,XR,8, 8 Plus, and other iPads, the operation is checked and adjusted with a simulator.

It is not easy from installation to first confirmation of operation, but for everyone who is accustomed to Arduino it is a completely problem free process. While keeping security, it moves with 3 steps (LEPTON side switch ON -> Internet share -> iPhone application launch) after the second time. No troublesome WiFi selection, IP, password entry etc are required at all. Also, even if you use tethering, you will not communicate with the outside, so there will be no communication fee for Thermal Cam 3 operation.

*Tethering may be difficult to connect depending on the iPhone model and surrounding environment. In that case.

  • Power cycle ESP8266.
  • Execute Airplane mode ON-> OFF and then turn on Internet sharing.
  • Power cycle your iPhone.
  • Reconnect at a different time or location.

Goto Home