New GRIME2 release with CLI generator

This release makes the creation of CLI calls much easier. The ROI’s and other parameters you select in the GUI can be used to create CLI parameters and output them as test to the textbox below the main image. There are two “Create command line” buttons: one on the Calibration tab and one on the Find Line tab.

https://github.com/gaugecam-dev/GRIME2/releases/tag/v0.3.0.8

Screenshot of the GRIME2 GUI showing the Create command line button and output in the Line Find tab.
Create command line button and output in the Line Find tab.

Water Level Camera: mini-octagon target test

This post describes the first testing of a mini-octagon calibration target for measuring water level with a camera and machine vision algorithms.

Image of three signs installed in a small stream. Each sign contains a blue octagon shape that is used to calibrate images for water level measurements.
Mini-octagon (center) is approximately eight inches across, leading to a much smaller footprint for the target background. The other two octagons in the image are printed on plexiglass backgrounds two feet in width. Image credit: Mary Harner

The original GaugeCam “bow-tie” calibration target was about three feet wide and four feet tall. This target yielded excellent calibration and precise water level readings. However, the size of the target is obtrusive in images and prohibitive at some sites.

The next generation calibration target, the “octagon target,” is approximately two feet wide. The benefits of the octagon are that (1) the target footprint is much smaller, and (2) the calibration target remains above the water line, so a calibration can be performed for every image. Calibrating each image is more robust because it accounts for camera movement, which is inevitable. The large octagon target performs on par with the original bow-tie calibration target, as shown in Ken Chapman’s dissertation.

Our goal with the mini-octagon is to reduce the target background to the minimal size required for robust calibration and water level measurement. The current size is larger than a traditional staff gauge but reasonable size for installation in many environments. Below you can see our field fabrication of the first mini-octagon, using a sheet of Coroplast, spray paint, and octagon stencil.

Initial tests show that our algorithms can detect the vertices of the mini-octagon in low-light conditions and under IR illumination.

Mini-octagon detection for image calibration. We are working to determine how much calibration precision is reduced by the smaller octagon.
The latest KOLA imagery can be found at https://apps.usgs.gov/hivis/camera/NE_Kearney_Outdoor_Learning_Area_RISE.

What does it take to install GaugeCam? Here are the gritty details and caveats.

Today I wrote a long email to a colleague interested in setting up GaugeCam. Why not share (a lightly-edited version) with the world?!

First, here’s a recent animation of me installing a target. This might take a moment to load.

animation of image-based water level camera installation
Installation of stop-sign target for GaugeCam water level measurement system.

Second, there are a number of additional resources available at https://gaugecam.org/grime2-details/, including this document that describes the installation details for a bowtie target at our North Carolina tidal marsh site: http://gaugecam.org/wp-content/uploads/2022/06/Gaugecam_org_background_installation_guideline.pdf.

A small photo gallery of a stop-sign target installation in Nebraska:

Some practical considerations and details:

  1. The first question that needs to be answered is the level of reliability and accuracy that is required for your application. If this is an easily-accessed (for maintenance) “demo” site, then this system is perfect for facilitating science communication, etc. If it’s a remote site, with only occasional access for maintenance and data collection, we strongly recommend putting in a cheap transducer alongside the GaugeCam system (e.g., HOBO, $300).
  2. Accuracy depends on (1) how many real-world mm or cm are represented by each pixel in the image, and (2) the quality of installation and maintenance of the background target. The following are issues to consider for field application:
    1. In controlled lab experiments, we can achieve high accuracy (+/- 3 mm, about the size of a meniscus; see Gilmore et al. 2013).
    2. In a carefully maintained tidal marsh installation, accuracy was less, but still quite good (see Birgand et al. 2022).
    3. You will encounter foggy mornings, spider webs on lens, and other similar environmental issues when using cameras. Expect data gaps of minutes to hours due to these issues.
    4. While biofouling is a universal problem for many reasons for many applications and industries, we are actively working to mitigate biofouling affects in our application. In the nutrient-rich agricultural streams where we work, biofouling accumulates within 7-10 days, which requires regular cleaning.
    5. The background must be plumb (perpendicular to the water surface).
    6. The original bow-tie target (template here, nominally 3’ x 4’) was used in the studies above. The new stop-sign target (template here, nominally 2’ x 4’) is experimental, but is smaller and still seems to give pretty good results. The bow-tie requires a survey of the real-world location of bowtie intersections. The stop-sign target requires only the facet length measurement (assumed to be the same for all 8 facets on the printed target) and reference measurement from the bottom left corner.
  3. In terms of installation, here is a parts list from my recent installations in sandy to slightly gravelly streambeds:
    1. Target
      1. Target background, matte print laminated on plexiglass*
      2. Two treated 4×4 posts, 8’ long [NOTE: before digging post holes you should have utilities located; contact your local utilities for this (usually free) service!]
      3. Two treated 2×4 boards, 8’ long
      4. Two Post- Base Spike for 4×4 Nominal Lumber**
      5. One ¾” treated sheet of plywood***
      6. Short (1” or 1 ¼”) pan-head screws (for attaching the plexiglass to the plywood)
      7. Long (3”) outdoor decking screws
      8. Thin wood wedges or spacers (for adjusting background so it is plumb – you might be able to cut these in the field)
    2. Camera
      1. We suggest Reconyx cameras due to their quality, though nearly any game camera will do
      2. Suggest RAM mount products to minimize any camera movement (example 1, example 2)
      3. Suggest adding a lock on camera for security
      4. Suggest treated 4×6 post for mounting the camera; 4×4 post as very minimum.
      5. Camera can be mounted on a large tree or similar, but this will usually create a good bit of movement of the camera. Small amounts of movement can be handled by the software, but minimal movement is better.
    3. Tools that you need (at the very minimum)
      1. Sledge hammer
      2. Post hole digger
      3. Cordless drill
      4. Cordless saw(s) (at least a reciprocating saw)
      5. Level
      6. Measuring tape
      7. Screwdriver

*We are looking for a better alternative that does not require as much cleaning and/or is more resistant to biofouling. The matte finish seems like a good attachment surface for biofouling. If you find a local sign shop for printing, I can send you the contact info for my sign shop so they can talk.

**I have used these in the sandy streams, where I cannot dig holes more than ~1 ft into the streambed (the sand collapses in), so adding these spikes on the bottom helps solidify the installation.

***You can print the background on very thick plexiglass and skip the plywood, but I found this to be expensive. So I printed on ¼” plexiglass and mounted on plywood backing.