Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review canopy cover extractor & output #186

Closed
3 of 15 tasks
max-zilla opened this issue Sep 18, 2017 · 15 comments
Closed
3 of 15 tasks

Review canopy cover extractor & output #186

max-zilla opened this issue Sep 18, 2017 · 15 comments

Comments

@max-zilla
Copy link

max-zilla commented Sep 18, 2017

Review issue for the canopy cover extractor and output using RGB full field input.

Completion criteria:

  • Code review complete (includes extractor, any functions in terrautils, etc)
  • Sample data output verified
    • Geostreams
    • BETYdb
  • old data purged
    • file system
    • Geostreams
    • Clowder
    • BETYdb
  • Sample metadata verified
  • Changes for 2017 release implemented
  • Issue(s) for changes postponed until 2018 created
  • Extractor tagged/versioned
  • Extractor deployed
  • Final output verified/reviewed
@max-zilla
Copy link
Author

max-zilla commented Sep 18, 2017

The following RGB full-field image (05/29) was run through the extractor:
https://terraref.ncsa.illinois.edu/clowder/files/59bb28044f0c0b27bc3d5421

The datapoints were created in per-plot streams. You can find a datapoint by:

There is currently one canopy cover entry for all the plots we have coverage of in full field mosaic. We will need to check the number, in the linked example the datapoint properties include source image and value:

properties: {
source: "https://terraref.ncsa.illinois.edu/clowder/files/59bb28044f0c0b27bc3d5421",
canopy_cover: 0.4618905450310325
}
...
stream_id: "3360",
sensor_id: "586",
sensor_name: "MAC Field Scanner Season 4 Range 25 Column 14"

Here, Range 25 Column 14 is reported as having 46.2% green pixel coverage on this date.

To check this, I loaded the _thumb.tif image from that dataset in QGIS and created a plot.js file with the GeoJSON from the sensors link:
https://terraref.ncsa.illinois.edu/clowder/geostreams/sensors/586
...you can then drag and drop the plot.js file into QGIS and see where it falls in the field:
screen shot 2017-09-18 at 1 57 28 pm
...so 48% at least doesn't seem outrageous in either direction here.

@dlebauer
Copy link
Member

Looks good so far. Does this issue cover insertion into BETYdb?

@max-zilla
Copy link
Author

@dlebauer yes, this should've pushed 864 traits to BETYdb.

I put a link to the variable in the metadata:
https://terraref.ncsa.illinois.edu/bety/api/beta/variables?name=canopy_cover

...but I can't remember the right query to see the actual trait observations. They should be in there though, added today.

@dlebauer
Copy link
Member

I've purged data from BETYdb:

delete from traits where variable_id = (select id from variables where name = 'canopy_cover')

@ZongyangLi
Copy link

Canopy cover extractor statement

This extractor processes binary stereo images and generates plot-level percentage canopy cover traits for BETYdb. The core idea for this extractor is a plant-soil segmentation. We apply a threshold to differentiate plant and soil, and do a smoothing after binary processing. At last it returns a plant area ratio within the bounding box.

We believe the tested threshold works well in a normal illumination. Below are some examples of segmentation:
cc1
cc2
cc3

At the same time, there are some limitation with the current threshold.

  1. Image captured in a low illumination.
    2016-10-07__03-06-00-741

  2. Image captured in a very high illumination.
    2016-09-28__12-19-06-452

  3. In late season, panicle is covering a lot in the image, and leaves is getting yellow.
    2016-11-15__09-45-50-604

  4. Sometimes sensor problem.
    2016-10-10__11-04-18-165

@ZongyangLi
Copy link

@max-zilla
Copy link
Author

@ZongyangLi good idea, that was old name before I understood. will rename to CanopyCoverPercentage.

dlebauer added a commit to terraref/extractors-stereo-rgb that referenced this issue Oct 2, 2017
@dlebauer
Copy link
Member

dlebauer commented Oct 2, 2017

@ZongyangLi I moved the quality statement to the README terraref/extractors-stereo-rgb#17 - please flush it out there. Thanks!

@remotesensinglab
Copy link

We have just developed an algorithm to enhance illumination condition of RGB images. The paper is in review right now. We can test on these datasets to address soil issues under shadow. I tagged Patrick on this issue. We will update soon.

@dlebauer
Copy link
Member

dlebauer commented Oct 3, 2017

Wasit - this extractor is ready to go, had been tested, checked etc. Please create a new pull request or issue describing this feature and we can put it in the pipeline for the next release.

@Paheding
Copy link

Paheding commented Oct 3, 2017

@dlebauer Yes, we can put it in the next release. As a reference, here is a preliminary result of the algorithm using the image shown above.

Left: Original image ---- Right: Enhanced image

image

@dlebauer
Copy link
Member

dlebauer commented Mar 8, 2018

@ZongyangLi can you please review the output data? If you are logged in to BETYdb at https://terraref.ncsa.illinois.edu/bety you can download it from https://terraref.ncsa.illinois.edu/bety/search.csv?search=canopy+cover&include_unchecked=true

@dlebauer
Copy link
Member

needed to update output from fraction in range [0,1] to percent [0,100] #234

@dlebauer
Copy link
Member

No longer relevant owing to new implementation.

But I have marked all data generated by the old version of the extractor as 'checked=-1' i.e. 'checked and found to be in error' because it is clear that the algorithm got confused:

image

update traits set checked = -1 
   where  method_id in 
       (select id from methods where name = 'Canopy Cover Estimation from Field Scanner RGB images') 
   and site_id in 
      (select id from sites where sitename not like '%Season 6%');
-- UPDATE 82341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants