Is there a program/code for distinguishing between plants in thermal camera imaging?

My research includes monitoring canopy temperature over time with a thermal FLIR camera. I am looking for a code/program that will help me analyze the videos easily and automatically. For my analysis, I am looking for a code that can separate plants and background and that distinguish between the different plants. I then need the average temperature from each plant in every frame.

The file we get from the thermal imaging is a ‘seq’ file.
I attached a RGB picture of a tray in my experiment.

Thank you in advance for your help.

Welcome to the forum!

In order to help you it would be great if you could post a picture.
Then we can point you in the right direction.

You mention you get a ‘seq’ file and suggest you post an RGB image. I guess some data will get lost. Is it possible to obtain the raw image data from the FLIR? A quick internet search indicates that a .seq file is a movie format. In the .seq file there is also a calibration between color and temperature. From the RGB that temperature has to be reconstructed while with a proper export, you might be able to keep the calibration.

.jpgs are not suitable for image analysis: https://imagej.net/Principles#Why_.28lossy.29_JPEGs_should_not_be_used_in_imaging

I would suggest you try the color threshold. Since your objects are very easily differentiated by color: https://imagej.nih.gov/ij/docs/guide/146-28.html#sub:Color-Threshold
Image > Adjust > Color Threshold…

In case you get more variability over your dataset in terms of background and objects. One can then try Weka segmentation: https://imagej.net/Trainable_Weka_Segmentation

Thank you for introducing me to Fiji and Weka segmentation!!

This is one image I extracted from the thermal video.

I was working around with Weka and got to some sort of segmentation (added pic).Is there a way to gather the leaves together and call them as one plant? Is there a way to turn the classification to ROI file? (So I will be able to use it on my video).
plants threshold.tif (206.1 KB)

I will just quickly go through the options that come to mind for me right now.

A. Improve the segmentation.

When you look at your input images than you will see that your objects are much more connected than the result you have now. I think when you play around with the segmentation you will find that you can generate more connected objects and exploit that for further measurements.

B. Use a regular grid

Since your images are already assorted in a grid the easiest solution would be to exploit that.

Unfortunately this example has quite some deformation from the lens and the acquisition. So this approach does not really work effectively. Below you would find a macro that draws a regular grid onto your image. But as I said when trying you will find out it does not work:

startOffsetX = 10;
startOffsetY = 2;

rectangleSizeX = 55;
rectangleSizeY = 55;

columnNumber = 12;
rowNumber = 6;

rectangleY = startOffsetY;

for ( row = 0; row < rowNumber; row++) {

   rectangleX = startOffsetX;

   for (column = 0; column < columnNumber; column++) {

   	makeRectangle(rectangleX, rectangleY, rectangleSizeX, rectangleSizeY);
   	roiManager("Add");

   	if (column == 2 || column == 5 || column == 8) {

   		batchOffsetX = 16;
   	
   	} else {

   		batchOffsetX = 0;
   		
   	}
   
   	rectangleX += rectangleSizeX + batchOffsetX;
   	
   }

   if (row == 2) {

   	batchOffsetY = 20;
   	
   } else {

   	batchOffsetY = 0;
   		
   }
   
   rectangleY += rectangleSizeY + batchOffsetY;
   
}

C. Segment the individual fields

Alternatively you could detect the uniformly colored outlines of the larger earth squares. Then invert the image to get these earth fields as objects. These you could further partition into the individual squares. Then use these fields with the segmentation to do your measurements.

1 Like