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