Reports

Contents

Title: Picam FWB Rescaling - HS
Date:2022-01-19 - 2022-11-30
Data File: HS_PicamResc_AWB.csv
HS_PicamResc_R14B13.csv
HS_PicamResc_R18B18.csv
Refers to:HS,RPI0W-004

Acronyms

R = red

B = blue

G = green

GCC = green chromatic coordinate, [green/(red+blue+green)]

AWB = automatic white balance where red, blue, and green gains are set by the camera

FWB = fixed white balance where at least one of the red, blue, or green gains is set to a fixed value by the user

 

Hill Slough

2021-03-11 (DOY 70): Installed picam onto HS tower as part of initial tower setup

2022-01-19 (DOY 19): Added FWB photos using R=1.4, B=1.3 (scaling factors Joe found online)

2022-07-13 (DOY 194): Changed FWB to use R=1.8,B=1.8 (scaling factors determined by Joe's analysis comparing R1.4B1.3 photos with AWB photos)

 

Based on our analysis at Mayberry, the FWB photos are nicer because there is less noise in the GCC values day to day. However, with our current RGB gains for FWB photos, there is a step change in the timeseries graph of GCC values when the data changes from AWB to FWB. To make a nice-looking graph, we decided to scale the FWB photos so the GCC from FWB photos is about the same magnitude as the GCC from the AWB photos.

 

Fig 1. Timeseries of GCC at Hill Slough calculated with AWB and FWB photos. This is before the FWB photos are rescaled so that FWB GCC has similar values to AWB GCC.

Compared to East End and Mayberry, at Hill Slough we don't see any seasonal variation in GCC. Our footprint is mostly populated by pickleweed skeletons (pickleweed was maybe killed by prolonged innundation during initial levee work), and there hasn't been much change in vegetation since the site was flooded in October 2021.

However, we do see a clear ~28 day cycle in the GCC data because of the tides. Our photos capture a high marsh system, where at low tide the ground is exposed with maybe a few puddles remaining, to at high tide the ground is under >50cm of water. 

Fig 2. Auto White Balance photos taken at Hill Slough at 12:15 each day over the first two weeks or June 2022. Each photos shows a different point in the tidal cycle because the tidal cycle changes by +50 minutes every day.

Fig 3. Timeseries of GCC at Hill Slough. GCC is slightly higher when midday coincides with low tide and photosynthetic organisms on the ground are exposed to the camera's view (e.g., Jun 01 and Jun 14). GCC is slightly lower when midday coincides with high tide and the camera sees only water (e.g., Jun 07).

A "solar day" is 24 hours, but a "lunar day" is about 24 hours and 50 minutes, so the whole tidal cycle shifts +50 minutes every "solar day." At noon of each day, the ratio of vegetation:water we see in the photos from day to day will change depending on where we are in the 28-day tidal cycle.

When midday photos are taken during low tide and some ground is exposed (e.g., around 2022-06-01 and 2022-06-14), the GCC will be higher to reflect the photosynthetic organisms (algae/biofilms?) that are exposed. When midday photos are taken during high tide (e.g., 2022-06-10), the GCC will be lower because there are no exposed photosynthetic organisms.

For Met processing in MATLAB, I believe Ari is using a water level filter to limit analysis to midday photos taken at low tide levels to avoid the tidal influence on GCC values. For the purposes of calculating rescaling factors for this report, keeping all values is better since it gives us a wider range of values.

Joe did some initial analysis with the FWB photos when R=1.4, B=1.3 and determined that if we scaled R and B so that R=1.8, B=1.8, the resulting GCC would be the same magnitude as the AWB GCC.

I also calculated rescaling factors for R, G, B using linear regression comparing R, G, B between AWB and FWB photos for all daytime data. Restricting the regression to midday data did not provide enough range for a good regression. I forced the regression through 0 and used the slope of the regression line as my rescaling factor.

DOY 2022-19 to 2022-194 when R=1.4, B=1.3

Fig 4. Timeseries of red, green, and blue values of AWB and FWB R1.4, B1.3 photos.

  AWB vs. FWB R1.4B1.3
  slope R2
red 1.49 54%
green 0.95 87%
blue 1.07 69%

Fig 5. Linear regressions of red, green, and blue values between AWB and FWB R1.4, B1.3 photos. Red R2 is the worse at 54%.

 

Fig 6. Picam photos (1) AWB directly from camera, (2) FWB directly from camera, (3) FWB rescaled R and B values only, (4) FWB rescaled R, G, B values.

 

DOY 194-321 (present) when R=1.8, B=1.8

After changing the picam software to incorporate the R=1.8, B=1.8 scaling factors for FWB photos, the FWB GCC was still way off, so we had to calculate scaling factors for R, G, B again.

Fig 7. Timeseries of red, green, and blue values of AWB and FWB R1.8, B1.8 photos.

  AWB vs. FWB R1.8B1.8
  slope R2
red 1.15 21%
green 1.10 70%
blue 0.78 64%

Fig 8. Linear regressions of red, green, and blue values between AWB and FWB R1.8, B1.8 photos. Red R2 is only 20%, but the slope of the line looks reasonable in the figure.

Fig 9. Picam photos (1) AWB directly from camera, (2) FWB directly from camera, (3) FWB rescaled R, G, B values.

 

Results


Fig 10. Timeseries figures with AWB, FWB, and rescaled FWB GCC values with (L) daily midday averages) and (R) 5-day moving midday averages. The rescaled FWB values are pretty similar to the AWB GCC values.

Fig 11. One issue with the rescaling is that even though the rescaled FWB GCC is more comparable to the AWB GCC, it reduces the amplitude of changes. It's more obvious here at Hill Slough with the tidal amplitude compared to the East End and Mayberry where the changes are more seasonal.

 

Summary

Scaling factors used
FWB R1.4B1.3
FWB R1.8B1.8
  RB RGB RGB
Red 1.29 1.49 1.15
Green n/a 0.95 1.10
Blue

1.38

1.07

0.78
Method to calculating rescaling factors

Joe taking photos outside his window and testing which scaling factors made the photo closest to what his eye could see

Linear regression

Linear regression
Conclusion Could rescale these photos by RGB scaling factors Could rescale these photos by RGB scaling factors

 

After all of this rescaling analysis, Joe and I decided it wouldn't be worth the trouble of processing the FWB photos for our own database. FWB photos don't provide a significant improvement over AWB photos, especially if we use moving averages and take the 90th percentile of our GCC data anyways.

 

Hill Slough data in database:

2021-13-11 (DOY 70) to present: Picam AWB photos

Hill Slough photos available:

2022-01-19 (DOY 19) to 2022-07-13 12:45 (DOY 194): FWB photos rescaled using R(1.49), G(0.95), B(1.07)

2022-07-13 13:15 (DOY 194) to present: FWB photos rescaled using R(1.15), G(1.10), B(0.78)