Showing posts with label Thermal imaging. Show all posts
Showing posts with label Thermal imaging. Show all posts

Wednesday, November 21, 2018

The SmartIR Gallery

Fig. 1: Thermal images in the Gallery
Gallery is a tool within the SmartIR app for users to manage their own thermal images, temperature graphs, and other data within the app. Unlike the default gallery in the operating system, SmartIR Gallery shows only things related to thermal imaging and provides image processing functions for analyzing thermal images and videos.

Fig. 2: Image processing in the Gallery
The gallery can be opened from the action bar of the SmartIR app. Once launched, it displays all the files that the user has collected through the app and stored on the device in a grid view (Figure 1). Tapping an image within the grid will display an enlarged view of the image in a popup window (by the way, the enlarged image in Figure 1 shows the liquid level of a propane tank revealed by the effect of cooling due to evaporation that feeds the gaseous fuel to the pipeline). Within the window, the user can swipe to the left or right, or tap the left or right arrow buttons, to browse the images.
Fig. 3: Temperature graphs in the Gallery

Based on OpenCV, SmartIR Gallery provides a number of image analysis tools for the user to quickly process thermal images. For instance, the user can blur, sharpen, invert, posterize, and adjust the brightness and contrast of an image (Figure 2). In the left image shown in Figure 2, sharpening a thermal image makes the view of the house more pronounced than the default view rendered by the FLIR ONE thermal camera. Inverting the thermal image, as shown in the middle image of Figure 2, may be a quick way to show how a heated house in the winter might look like in the opposite thermal condition such as an air-conditioned house in a hot summer day. In the right image shown in Figure 2, posterizing the thermal image creates an artistic view. More OpenCV tools will be added in the future to extend SmartIR's thermal vision capacity.

SmartIR Gallery also allows the user to filter the image files. For instance, the user can choose to show only the graphs, which are screenshot images taken from the temperature chart of SmartIR (Figure 3). Using the Share button, the user can easily send the displayed image to other apps such as an email app or a social network app.

Wednesday, September 19, 2018

A Small Step towards a Big Dream of Infrared Street View

The Infrared Street View is an award-winning project recognized by the U.S. Department of Energy and subsequently funded by the National Science Foundation. The idea is to create a thermal equivalent of Google's Street View that would serve as the starting point to develop a thermographic information system (i.e., the "Map of Temperature"). This is an ambitious goal that is normally only attainable through big investments from the Wall Street or by big companies like Google. However, as a single developer who doesn't have a lot of resources, I decided to give it a shot on my own. Being a non-Googler, I am counting on the citizen scientists out there to help me build the Infrared Street View. The first step is to create a free app so that they have a way to contribute.

My journey started in the mid of July 2018. In two months I have learned how to develop a powerful app from scratch. At the end, the Infrared Street View is coming into sight! This blog article shows some of the (imperfect but promising) results, as demonstrated in Figures 1 and 2.


Fig. 1: Panoramas in visible light and infrared light generated by SmartIR
This milestone is about developing the functionality in the SmartIR app for creating infrared panoramas so that anyone who has a smartphone with an infrared camera attachment such as FLIR ONE could produce a panoramic image and contribute it to the Infrared Street View, much like what you can do with Google's Street View app. Although this sounds easy at first glance, it has turned out to be quite challenging as we must work under the constraint of a very slow infrared thermal camera that can only take less than ten pictures per second. As our app targets average people who may be interested in science and technology, we must provide an easy-to-do user interface so that the majority of people can do the job without being overwhelmed. Lastly, to create virtual reality in infrared light, we must overcome the challenge of stitching the imperfect thermal images together to produce a seamless panoramic picture. Although they are many image stitchers out there, no one can be sure that they would be applicable to thermal images as those stitchers may have been optimized for only visible light images.

Fig. 2: Panoramas in visible light and infrared light (two coloring styles) generated by SmartIR
To support users to make 360° panoramas, SmartIR guides them to aim at the right angles so that the resulting image set can be used for stitching. These images should be evenly distributed in the azimuthal dimension and they should overlap considerably for the stitcher to have a clue about how to knit them together. SmartIR uses the on-board sensors of the smartphone to detect the orientation of the infrared camera. A number of circles are shown on the screen to indicate the orientations which the user should aim the cursor of the camera at. When the cursor is within the circle, an image is automatically taken and stored in a 360° scroller. By turning at a fixed position and aiming at the circles, the user can capture a series of images for stitching. The following YouTube videos show how this image collector works.



Although this is a very primitive prototype, it nonetheless represents the first concrete step towards the realization of the Infrared Street View. Down the road, stitchers for infrared thermal images still need significant improvements to truly achieve seamless effects similar to those for visible light images. Tremendous challenges for weaving the Map of Temperature still lie ahead. I will keep folks posted as I inch towards the goal and I am quite optimistic that I can get somewhere, even though I am not a Googler.

Sunday, September 9, 2018

Creating Augmented Reality Experiences in the Thermal World with SmartIR

Location-based augmented reality (AR) games such as Pokemon Go have become popular in recent years. What can we learn from them in order to make SmartIR into a fun science app? In the past week, I have been experimenting with AR in SmartIR using the location and orientation sensors of the smartphone. This article shows the limited progress I have achieved thus far. Although there are still tons of challenges ahead, AR appears to be a promising direction to explore further in the world of infrared thermal imaging.

According to Wikipedia, augmented reality is an interactive experience of a real-world environment whereby the objects in the real world are "augmented" by computed information. Typically, AR is implemented with a mobile device that has a camera and a display. In a broad sense, an image from a FLIR ONE thermal camera using the so-called MSX technology is automatically AR by default as it meshes a photo of the real world with false colors generated from the thermal radiation of the objects in the real world measured by the camera's microbolometer array. Similarly, the object-tracking work I have recently done for Project Snake Eyes can augment thermal images with information related to the recognized objects computed from their infrared radiation data, such as their silhouettes and their average temperatures.

Fig. 1: Very simple AR demos in SmartIR

But these are not the AR applications that I want to talk about in this article. The AR experience I hope to create is more similar to games like Pokemon Go, which is based on information geotagged by users and discovered by others. The involvement of users in creating AR content is critical to our app, as it aims to promote location-based observation, exploration, and sharing using thermal imaging around the world and aggregate large-scale thermal data for citizen science applications. Figure 1 shows the augmentation of the thermal image view with geotagged information for a house. If you are wondering about the usefulness of this feature other than its coolness (the so-what question), you can imagine tagging the weak points of a thermal envelope of a building during a home energy assessment. The following YouTube videos show how geotagging works in the current version of SmartIR and how users can later discover those geotags.




At this point of the development, I envision SmartIR to provide the following AR experiences. For users who have a thermal camera, a geotag can obviously guide them to find and observe something previously marked by others. What if you don't have a thermal camera but would still like to see how a place would look like through the lens of a thermal camera? In that case, a geotag allows you to see a plain thermal image or virtual reality (VR) view stored in the geotag, taken previously by someone else who had a thermal camera and overlaid in the direction of the current view on the screen of your phone. If VR is provided for the tagged site, the thermal image can also change when you turn your phone. Although nothing beats using a thermal camera to explore on your own, this is a "better than nothing" solution that mimics the experience of using one. In fact, this is the vision of our Infrared Street View project that aims at providing a thermal view of our world. In addition to the Web-based approach to exploring the Infrared Street View, AR provides a location-based approach that may be more intuitive and exciting.

Thursday, August 30, 2018

Adding Instructional Support in SmartIR

Fig. 1
A goal of the SmartIR app is to provide basic instructional support directly in the app so that students, citizen scientists, professionals, and other users can learn what they can do with the incredible power of thermal vision beyond its conventional applications. This requires a lot of development work, such as inventing the artificial intelligence that can guide them through making their own scientific discoveries and engineering decisions. While that kind of instructional power poses an enormous challenge to us, adding some instructional materials in the app so that users can get started is a smaller step that we can take right now.

As of August 30, 2018, I have added 17 experiments in physical sciences that people can do with thermal vision in SmartIR. These experiments, ranging from heat transfer to physical chemistry, are based on my own work in the field of infrared imaging in the past eight years and are all very easy to do (to the point that I call them "kitchen science"). I now finally have a way to deliver these experiments through a powerful app. Figure 1 shows the list of these experiments in SmartIR. Users can click each card to open the corresponding instructional unit (which is a sequence of steps that guide users through the selected set of experiments).

Fig. 2
To do better than just putting some HTML pages into the app, I have also built critical features that allow users to switch back and forth between the thermal view and the document view (Figure 2). When users jump to the thermal view from a document, a thumbnail view of that document is shown on top of a floating button in the thermal view window (see the left image in Figure 2), allowing users to click it and go back to the document at any time. The thumbnail also serves to remind them which experiment they are supposed to conduct. When they go back to the document, a thumbnail view of the thermal camera is shown on top of a floating button in the document view window (see the right image in Figure 2), allowing users to click it and go back to the thermal view at any time. This thumbnail view also connects to the image stream from the thermal camera so that users can see current picture the camera is displaying without leaving the document.

These instructional features will be further enhanced in the future. For instance, users will be able to insert a thermal image into a container, or even create a slide show, in an HTML page to document a finding. At the end, they will be able to use SmartIR to automatically generate a lab report.

These new features, along with what I have built in the past few weeks, mark the milestone of Version 0.0.2 of SmartIR (i.e., only 2% of the work has been done towards maturity). The following video offers a sneak peek of this humble version.


Wednesday, August 22, 2018

Project Snake Eyes: Automatic Feature Extraction Based on Thermal Vision

I am pleased to announce Project Snake Eyes. This ambitious project aims to combine image analysis and infrared imaging to create biomimetic thermal vision -- computer vision that simulates the ability of some animals such as snakes to see in darkness. One of the goals of Project Snake Eyes is to create probably the world's first robotic snake that can hunt through thermal sensing. Project Snake Eyes not only can detect heat, but it can also estimate the size and proximity of the source, giving the robotic snake the artificial intelligence to figure out whether or not it should strike the target. Through two weeks of intense research and development, I have come up with original algorithms that allow robust automatic feature extraction in real time from thermal images through a FLIR ONE camera. This article reports my progress thus far. The algorithms will be published in a journal in the field of image processing and computer vision later.



Figure 1 shows the detection of windows at night from outside a house. Half of the window was open at the time of observation. The lower temperature of the upper pane was partially due to the reflection of infrared light from the cooler environment such as the sky by the glass. The lower pane, which was the open part of the window, was due to the warmer inside of the house. As you can see, Project Snake Eyes approximately identified the shapes and sizes of the two panes, which stood out from the background because of their distinct temperatures. This ability will be used to develop advanced algorithms to automatically analyze the thermal signature of a building, paving the road to large-scale building thermal analyses through automation.

Figure 2 shows a more complex scenario using my computer desk as an example. As you can see, Project Snake Eyes automatically detected most of the hot spots (or cold spots, but I use hot spots to represent points of interest at either high or low temperature). Feature extraction such as blob detection through thermal vision could result in enhanced computer vision for technologies such as unmanned vehicles.

Figure 3 shows object reconstruction based on residue heat using my hand as an example. The residue heat that my hand left on the wall revealed its shape as six separate polygons (the largest one corresponds to the palm and the five smaller ones to the fingertips). Object reconstruction through residue heat could find its applications in certain industry monitoring and control.

Project Snake Eyes aims to identify and track objects.
Figure 4 shows object tracking using a colleague as an example. As you can see, Project Snake Eyes basically captured his body shape. The video clip that follows shows how this works in real time. The algorithms still need optimization to reduce the lag, but you get the basic idea of how object tracking using Project Snake Eyes works. Object tracking will be used to realize animal and human tracking in dark conditions for many science and engineering applications. For instance, we are collaborating with biologists in Texas to develop a system that can track bats at night in order to monitor the health of their colonies.

With all these excitements, I expect to carry on the research and development of Project Snake Eyes in the coming years. As a landmark step, we are working tirelessly towards the unveiling of the first prototype of the robotic snake with thermal vision, collaborating with two robotics teams led by Prof. Yan Gu at the University of Massachusetts Lowell and Prof. Zhenghui Sha at the University of Arkansas, respectively.

Stay tuned!

Thursday, August 2, 2018

Using SmartIR in Science Experiments

Fig. 1: The paper-on-cup experiment with SmartIR
SmartIR is a smartphone app that I am developing to support infrared (IR) thermal imaging applications, primarily in the field of science and engineering, based on the FLIR ONE SDK. The development officially kicked off in July 2018. By the end of the month, a rudimentary version, to which I assigned V 0.0.1 (representing approximately 1% of the work that needs to be done for a mature release), has been completed.

Fig. 2: Time graphs of temperatures in SmartIR
Although a very early version, SmartIR V0.0.1 can already support some scientific exploration. In this article, I share the results from doing the can't-be-simpler experiment that I did back in 2011 with a FLIR I5. This experiment needs only a cup of water, a piece of paper, and, of course, an IR camera (which is FLIR ONE Pro Generation 3 in my case). When a piece of paper is placed on top of an open cup of tap water that has sit in the room for a few hours, it warms up -- instead of cooling down -- as a result of the adsorption of water molecules onto the underside of the paper and the condensation of more water molecules to form a layer of liquid water, as shown in Figure 1.

While the user can observe this effect with any thermal camera, it is sometimes useful to also record the change of temperatures as time goes by. To do this, SmartIR allows the user to add any number of thermometers to the view (and move or delete them as needed) and show their temperature readings in a time graph on top of the thermal image view (this is sort of like the translucent sensor graph in my Energy2D computational fluid dynamics simulation program). Figure 2 shows the time graph of temperatures. To study the effect, I added three thermometers: one for measuring the ambient temperature (T3), one for measuring the temperature of water (T2), and one for measuring the temperature of the paper (T1). Note that, before the paper was placed, T1 and T2 both measured the temperature of the water in the cup. As today is pretty hot, T3 registered higher than 35 °C. Due to the effect of evaporative cooling, T2 registered about 33 °C. When a piece of paper was put on top of the cup, T1 rose to nearly 37 °C in a few seconds!

SmartIR is currently only available in Android. It hasn't been released in Google Play as intense development is expected to be under way in the next six months. A public release may be available next year.

Thursday, August 17, 2017

National Science Foundation funds citizen science project to crowdsource an infrared street view

We are pleased to announce that the National Science Foundation has awarded us a two-year, $500,000 exploratory grant to develop, test, and evaluate a citizen science program that engages youth to investigate energy issues through scientific inquiry with innovative technology. The project will crowd-create the Infrared Street View, a citizen science program that aims to produce a thermal version of Google's Street View using an affordable infrared (IR) camera attached to a smartphone. In collaboration with high schools and out-of-school programs in Massachusetts, we will conduct pilot-tests with approximately 200 students in this exploratory phase. The project will develop SmartIR, a smartphone app that will guide users to collect IR images on both Android and iOS platforms for synthesizing a seamless street view. Figure 1 shows a prototype of the Infrared Street View and Figure 2 shows a little math behind the scenes.

Fig. 1: A hemispherical infrared street view (prototype)
In essence, an IR camera serves as a high-throughput data acquisition instrument that collects thousands of temperature data points each time a picture is taken. With this incredible tool, youth can collect massive geotagged thermal data that have considerable scientific and educational value for visualizing energy usage and improving energy efficiency at all levels. The Infrared Street View program will provide a Web-based platform for youth and anyone interested in energy efficiency to view and analyze the aggregated data to identify possible energy losses. By sharing their scientific findings with stakeholders, youth will make changes to the way energy is being used. 

We are completely aware of possible legal implications and complications of the proposed citizen science program. In the case of Kyllo v. United States in 2001,  the Supreme Court has ruled that the use of a thermal camera from a public vantage point to monitor the radiation of heat from a person's home was a “search” within the meaning of the Fourth Amendment, and thus required a warrant. The ruling seems to be limited to the use of thermal cameras by law enforcement, however. Back then, IR cameras were available to only a handful of professionals, but they are only $200 nowadays and just a few clicks away on Amazon. The widespread use of smartphone-based IR cameras is making thermal images commonplace on the Internet and it is probably an interesting question for law scholars to study how civilian use of IR cameras should be regulated.

Fig. 2: Math behind the scenes.
Regardless, we will take the privacy issue very seriously and will take every precaution that we can think of to avoid potential side effects resulted from this well-intentioned program. Fortunately, we have a lot of public supports to conduct this research on large public buildings and possible commercial buildings, where the concerns of privacy are far less than private residential buildings and the needs to reduce the energy waste of those buildings and save taxpayer dollars are far more pressing. Hence, we will start with school, public, and commercial buildings in selected areas where performing thermal scan of the buildings and publishing their thermal images for educational and research purposes are permitted by school leaders, town officials, and property owners.  

From a broader perspective, the Infrared Street View program could serve as a pilot test that may shed light on increasingly important issues related to citizen privacy in the era of the Internet of Things (IoT), which features the ubiquity of sensor data collection that could be viewed by many as invasive into their physical space (not just cyberspace). While no one can deny the tremendous potential of the technology in transforming the ways people learn, work, and live, careful research must be carried out to address legitimate concerns. This program could be one of those projects that provide a unique approach to meet those challenges from a citizen science point of view, which integrates many interesting scientific, technical, educational, and legal aspects. The lessons we can learn from conducting this work could be very useful to the citizen science community in the IoT era.

Wednesday, July 26, 2017

Thermal imaging as a universal indicator of chemical reactions: An example of acid-base titration

Fig. 1: NaOH-HCl titration
Funded by the National Science Foundation, we are exploring the feasibility of using thermal imaging as a universal indicator of chemical reactions. The central tenet is that, as all chemical reactions absorb or release thermal energy (endothermic or exothermic), we can infer certain information from the time evolution and spatial distribution of the temperature field.

To prove the concept, we first chose titration, a common laboratory method of quantitative chemical analysis that is used to determine the unknown concentration of an identified analyte, as a beginning example. A reagent, called the titrant, is prepared as a standard solution. A known concentration and volume of titrant reacts with a solution of analyte to determine its concentration.

The experiment we did today was an acid-base titration. An acid–base titration is the determination of the concentration of an acid or base by exactly neutralizing the acid or base with a base or acid of known concentration. Such a titration is typically done with a burette that drops titrant into an Erlenmeyer flask containing the analyte. A pH indicator is used to determine whether the equivalence point has been reached. The pH indicator usually depends on the analyte and the titrant. But a differential thermal analysis based on infrared imaging may provide a universal indicator as the technique depends only on the heat of reaction and thermal energy is universal.

Fig. 2: The dish-array titration revealed by FLIR ONE
Figures 1 and 2 in this article show the results of the NaOH+HCl titration, taken using a FLIR ONE thermal camera attached to my iPhone 6. A solution of 10% NaOH was prepared as the analyte of "unknown" concentration and 1%, 3%, 5%, 7%, 10%, 12%, 15%, 18%, and 20% HCl were used as the titrant. The experiment was conducted with a 3×3 array of Petri dishes. Hence, we call this setup as dish-array titration. Preliminary results of this first experiment appeared to be encouraging, but we have to be cautious as the dissolving of HCl after the acid-base neutralization completes can also release a significant amount of heat. How to separate the thermal signatures of reaction and dissolving requires some further thinking.

Wednesday, April 5, 2017

A demo of the Infrared Street View

An infrared street view
The award-winning Infrared Street View program is an ambitious project that aims to create something similar to Google's Street View, but in infrared light. The ultimate goal is to develop the world's first thermographic information system (TIS) that allows the positioning of thermal elements and the tracking of thermal processes on a massive scale. The applications include building energy efficiency, real estate inspection, and public security monitoring, to name a few.
An infrared image sphere


The Infrared Street View project is based on infrared cameras that work with now ubiquitous smartphones. It takes advantages of the orientation and location sensors of smartphones to store information necessary to knit an array of infrared thermal images taken at different angles and positions into a 3D image that, when rendered on a dome, creates an illusion of immersive 3D effects for the viewer.

The project was launched in 2016 and later joined by three brilliant computer science undergraduate students, Seth Kahn, Feiyu Lu, and Gabriel Terrell, from Tufts University, who developed a primitive system consisting of 1) an iOS frontend app to collect infrared image spheres, 2) a backend cloud app to process the images, and 3) a Web interface for users to view the stitched infrared images anchored at selected locations on a Google Maps application.

The following YouTube video demonstrates an early concept played out on an iPhone:



Saturday, September 17, 2016

National Science Foundation funds chemical imaging research based on infrared thermography

The National Science Foundation (NSF) has awarded Bowling Green State University (BGSU) and Concord Consortium (CC) an exploratory grant of $300 K to investigate how chemical imaging based on infrared (IR) thermography can be used in chemistry labs to support undergraduate learning and teaching.

Chemists often rely on visually striking color changes shown by pH, redox, and other indicators to detect or track chemical changes. About six years ago, I realized that IR imaging may represent a novel class of universal indicators that, instead of using  halochromic compounds, use false color heat maps to visualize any chemical process that involves the absorption, release, or distribution of thermal energy (see my original paper published in 2011). I felt that IR thermography could one day become a powerful imaging technique for studying chemistry and biology. As the technique doesn't involve the use of any chemical substance as a detector, it could be considered as a "green" indicator.

Fig. 1: IR-based differential thermal analysis of freezing point depression
Although IR cameras are not new, inexpensive lightweight models have become available only recently. The releases of two competitively priced IR cameras for smartphones in 2014 marked an epoch of personal thermal vision. In January 2014, FLIR Systems unveiled the $349 FLIR ONE, the first camera that can be attached to an iPhone. Months later, a startup company Seek Thermal released a $199 IR camera that has an even higher resolution and can be connected to most smartphones. The race was on to make better and cheaper cameras. In January 2015, FLIR announced the second-generation FLIR ONE camera, priced at $231 in Amazon. With an educational discount, the price of an IR cameras is now comparable to what a single sensor may cost (e.g., Vernier sells an IR thermometer at $179). All these new cameras can take IR images just like taking conventional photos and record IR videos just like recording conventional videos. The manufacturers also provide application programming interfaces (APIs) for developers to blend thermal vision and computer vision in a smartphone to create interesting apps.

Fig. 2: IR-based differential thermal analysis of enzyme kinetics
Not surprisingly, many educators, including ourselves, have realized the value of IR cameras for teaching topics such as thermal radiation and heat transfer that are naturally supported by IR imaging. Applications in other fields such as chemistry, however, seem less obvious and remain underexplored, even though almost every chemistry reaction or phase transition absorbs or releases heat. The NSF project will focus on showing how IR imaging can become an extraordinary tool for chemical education. The project aims to develop seven curriculum units based on the use of IR imaging to support, accelerate, and expand inquiry-based learning for a wide range of chemistry concepts. The units will employ the predict-observe-explain (POE) cycle to scaffold inquiry in laboratory activities based on IR imaging. To demonstrate the versatility and generality of this approach, the units will cover a range of topics, such as thermodynamics, heat transfer, phase change, colligative properties (Figure 1), and enzyme kinetics (Figure 2).

The research will focus on finding robust evidence of learning due to IR imaging, with the goal to identify underlying cognitive mechanisms and recommend effective strategies for using IR imaging in chemistry education. This study will be conducted for a diverse student population at BGSU, Boston College, Bradley University, Owens Community College, Parkland College, St. John Fisher College, and SUNY Geneseo.

Partial support for this work was provided by the National Science Foundation's Improving Undergraduate STEM Education (IUSE) program under Award No. 1626228. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.