Public Lab Research note


Comment flagged.

PhotoMonitoringPlugin fuzzy

by gpenzo | May 16, 2015 08:39 16 May 08:39 | #11821 | #11821

What I want to do

For my NDVI cap project i'm trying to make a lightweight PhotoMonitoringPlugin application. In my setup the cameras are ridgid. For evry photo I make the translation and rotation are the same. What I want to do is to make one calbration and use the translation and rotation for all other pictures. This will speed up NDVI picture calculation. I want to verify my implementation with PhotoMonitoringPlugin

My attempt and results

I got everything working with opencv but I do not get 100% the same result compare to PhotoMonitoringPlugin. Especially the float images.

PhotoMonitoringPlugin setup: Calculation NDVI Minimum scaling -1.0 Maximum scaling 1.0 No stretch for both IR and visible Lut: NDVIBleu2Red.lut

PhotoMonitoringPlugin result

PhotoMonitoringPlugin Float image

vis_36_NDVI_Float.jpg

PhotoMonitoringPlugin NDVI image

vis_36_NDVI_Color.jpg

This is already strange. The color image has more information than the floating image. I expect them to be the same. Color image has a lut with 255 colors and float image has 255 gray colors. When I load the float image in Fiji and use the same lut on it I get the following image:

Lut applied on PhotoMonitoringPlugin Float image

float_with_lut.jpg

Can any one explain what is going on here, why does PhotoMonitoringPlugin generate a float with less information. I checked the plugin code but could not find the reason for this.

My application gives the following results. Applying a lut on my float image gives almost the same result as the plugin.

NDVICAPE Float image

ndvi_36_float.jpg

NDVICAPE Ndvi image

ndvi_36.jpg

Why I'm interested

Should the floating image be used like this or does it has another purpose.


7 Comments

Do you pull those into an application which can handle images with floats? To make sure if both images are the same just plot them in a scatter plot just as I did with my NDVI / EVI comparison. If you have biases or binning in either image it will show up. Just looking at the images won't tell you much.

Is this a question? Click here to post it to the Questions page.

Reply to this comment...


The generated float image does not have float values in it. It is just a normal image where the plugin converts float value -1.0 to Red = 0x00 Green = 0x00 Blue = 0x00 and float value 1.0 to Red = 0xFF Green = 0xFF Blue = 0xFF. It is a gray scale image.

I expect if I load the generated float image from the PhotoMonitoringPlugin in Fiji and apply the same lut which the PhotoMonitoringPlugin uses too generate the color image the result should be the same. seems it is not. When I use my own generated gray image (float image) and apply the same lut than the result is almost the same as (my pairing algorithm give a little bit different match) PhotoMonitoringPlugin. So I'm wondering if the float image generated by PhotoMonitoringPlugin is correct. I will try the scatterplot approch

Reply to this comment...


Also have a look at the histograms of both initial float images. You might be stretching your data somehow, leaving the majority of the pixels black in one case (although information is there). Again, a scatterplot will tell you this as well.

Reply to this comment...


Hallo khufkens

I checked the histogram of both float and they are not the same. PhotoMonitoringPlugin float image misses allot of information.

To be clear my application generated the same NDVI color picture based on my float as PhotoMonitoringPlugin. It is the PhotoMonitoringPlugin which does not create the correct float image in my opinion.

Reply to this comment...


I just checked the float image I created earlier this week and it seems that all negative values are clipped on my float images as well, leaving them black (this is when outputting as a jpg). So yes, some data seems to be lost in the process if saving as a jpeg as floats are not supported.

Using the tiff format I do not have this problem as tiff images can be floats, so they are reported correctly. However, applying the LUT to this images generates bad results. All negative values are also black and it's hard to stretch the colours into the negative space.

In short, make sure that whatever output format you use supports float values to begin with! Fiji is fickle about the LUT so loading it in something like QGIS or R will make interpretation easier.

Reply to this comment...


This seems to be related to an old issue posted at Github. Applying a lut to a float NDVI image from the photomonitoring plugin does not produce the same color NDVI image output by the plugin. The NDVI produced by applying a lut to a floating point NDVI image is the same as the NDVI image produced by the plugin when scaling from 0 to 1 is selected (instead of scaling from -1 to 1). At one point I figured out a workaround but I can't remember what I did. .
ColorNDVI.jpg
Above: Color NDVI from the plugin with scaling of NDVI from -1 to 1.
.
Float.jpg
.
Above: Floating point NDVI from same run of plugin.
.
Float0to1.jpg
Above: Color NDVI made by applying the lut to the floating point image.
.
0to1ndvi.jpg
.
Above: Color NDVI made by the plugin with scaling of NDVI from 0 to 1

Reply to this comment...


I need to change the scaling in my own application so I can check the result with the plugin. cfastie and khufkens thanks for help.

Reply to this comment...


Login to comment.