diff --git a/bps_package/docs/build/doctrees/environment.pickle b/bps_package/docs/build/doctrees/environment.pickle index dd7b117..ffac63b 100644 Binary files a/bps_package/docs/build/doctrees/environment.pickle and b/bps_package/docs/build/doctrees/environment.pickle differ diff --git a/bps_package/docs/build/doctrees/index.doctree b/bps_package/docs/build/doctrees/index.doctree index ddd4399..daaaadb 100644 Binary files a/bps_package/docs/build/doctrees/index.doctree and b/bps_package/docs/build/doctrees/index.doctree differ diff --git a/bps_package/docs/build/doctrees/installation.doctree b/bps_package/docs/build/doctrees/installation.doctree index 7dac56a..f70163e 100644 Binary files a/bps_package/docs/build/doctrees/installation.doctree and b/bps_package/docs/build/doctrees/installation.doctree differ diff --git a/bps_package/docs/build/doctrees/introduction.doctree b/bps_package/docs/build/doctrees/introduction.doctree index 9cb6172..92ad1a0 100644 Binary files a/bps_package/docs/build/doctrees/introduction.doctree and b/bps_package/docs/build/doctrees/introduction.doctree differ diff --git a/bps_package/docs/build/doctrees/tutorial.doctree b/bps_package/docs/build/doctrees/tutorial.doctree index 9e8f12f..4dc075c 100644 Binary files a/bps_package/docs/build/doctrees/tutorial.doctree and b/bps_package/docs/build/doctrees/tutorial.doctree differ diff --git a/bps_package/docs/build/html/.buildinfo b/bps_package/docs/build/html/.buildinfo index 2701c1a..4fde7a2 100644 --- a/bps_package/docs/build/html/.buildinfo +++ b/bps_package/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 732bbb7096e5f2e700c15542dd748bcf +config: 959eb7efce5788a4746d103b350d255f tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/bps_package/docs/build/html/_images/bps_depth_plot.png b/bps_package/docs/build/html/_images/bps_depth_plot.png new file mode 100644 index 0000000..ffc59d5 Binary files /dev/null and b/bps_package/docs/build/html/_images/bps_depth_plot.png differ diff --git a/bps_package/docs/build/html/_images/bps_just_opened.png b/bps_package/docs/build/html/_images/bps_just_opened.png new file mode 100644 index 0000000..fce27dc Binary files /dev/null and b/bps_package/docs/build/html/_images/bps_just_opened.png differ diff --git a/bps_package/docs/build/html/_images/bps_loaded.png b/bps_package/docs/build/html/_images/bps_loaded.png new file mode 100644 index 0000000..f885fed Binary files /dev/null and b/bps_package/docs/build/html/_images/bps_loaded.png differ diff --git a/bps_package/docs/build/html/_images/bps_prefs.png b/bps_package/docs/build/html/_images/bps_prefs.png new file mode 100644 index 0000000..b2794c0 Binary files /dev/null and b/bps_package/docs/build/html/_images/bps_prefs.png differ diff --git a/bps_package/docs/build/html/_modules/index.html b/bps_package/docs/build/html/_modules/index.html index 44d8313..a6a0750 100644 --- a/bps_package/docs/build/html/_modules/index.html +++ b/bps_package/docs/build/html/_modules/index.html @@ -6,7 +6,7 @@ - Overview: module code — Benthic Photo Survey 1.0.0 documentation + Overview: module code — Benthic Photo Survey 1.0.1 documentation @@ -14,7 +14,7 @@ - + @@ -80,7 +80,7 @@

Navigation

  • modules |
  • -
  • Benthic Photo Survey 1.0.0 documentation »
  • +
  • Benthic Photo Survey 1.0.1 documentation »
  • @@ -712,7 +712,7 @@

    Navigation

  • modules |
  • -
  • Benthic Photo Survey 1.0.0 documentation »
  • +
  • Benthic Photo Survey 1.0.1 documentation »
  • Module code »
  • diff --git a/bps_package/docs/build/html/_sources/index.txt b/bps_package/docs/build/html/_sources/index.txt index dbfe8df..0bfac93 100644 --- a/bps_package/docs/build/html/_sources/index.txt +++ b/bps_package/docs/build/html/_sources/index.txt @@ -8,17 +8,17 @@ Welcome to Benthic Photo Survey's documentation! Benthic Photo Survey (BPS) is a software tool (written in Python) that is intended to simplify the task of collecting reference data (sometimes called groundtruth data) for remote sensing of the marine environment. Using a digital camera in a water proof housing, a consumer grade handheld GPS, and (optionally) a depth logger a user can collect data in the field. -.. image:: images/BPS_overview.png - The photos and logs (GPS and Depth) are then loaded into BPS. BPS can then tag the photos with position, depth, and temperature (if using the Sensus Ultra depth/temperature logger). The the users can view each photo in BPS and tag each photo with a substrate and habitat type. All data (position, depth, temperature, habitat, and substrate) are stored in the exif portion of the jpeg photos. Once the photos are all tagged, BPS can export a GIS Shapefile with habitat, substrate, depth, and temperature attributed points for each photo's location. This shapefile can then be used to create a training set for supervised classification or as reference data for accuracy assessment. +.. image:: images/BPS_overview.png + Contents -------- .. toctree:: - :maxdepth: 2 + :maxdepth: 3 introduction installation diff --git a/bps_package/docs/build/html/_sources/installation.txt b/bps_package/docs/build/html/_sources/installation.txt index 02cf68b..92b18e5 100644 --- a/bps_package/docs/build/html/_sources/installation.txt +++ b/bps_package/docs/build/html/_sources/installation.txt @@ -1,126 +1,6 @@ -IMPORTANT NOTE: -=============== - -Most of this information is out of date. Go to the `GitHub Repository`_ or `BPS page`_ for up to date information. I will update these docs but haven't had time yet. - - Installation ============ -Bethic Photo Survey (BPS) can run on Linux, Mac, and Windows operating systems. There are a few different ways to install BPS. - -Requirements ------------- -The following items need to be installed in order for BPS to work. Make sure you read at least to the end of this section before you start installing this stuff. There may be an easier way than installing all these things individually. Then check the section below for your operating system. There may be seperate quirks to the installation process for Windows, Linux, and Mac. I will try to give step-by-step instructions for each operating system below. - -1. `Python 2.7`_ BPS may work on older versions of Python but I wouldn't bet on it -2. `GDAL`_ 1.8 or greater -3. `Matplotlib`_ 1.1.1 or greater, can be installed as part of `SciPy`_ or with `PythonXY`_ (see end of this section). -4. `PyQt4`_ -5. `pynmea`_ can be installed with `pip`_ by typing ``pip install pynmea`` at the command prompt (or ``sudo pip install pynmea`` if you're on Linux or Mac and need root privileges to install). -6. `pyexiv2`_ has actually been deprecated now. I will eventually rewrite the code to use a different library but, for now, pyexiv2 is required. - -That's kind of a lot of stuff to have to install. Fortunately, items 1 - 4 can be taken care of with the `PythonXY`_ installer. `PythonXY`_ is a set of free scientific software tools all bundeled together for easy installation. You can download the `PythonXY`_ installer, run it, make sure that items 1 - 4 are selected, and it will take care of all those steps for you. If you decide later that you want some of the other items to be installed as well, you just run the installer again and check more boxes. It makes things much easier, especially on Windows. - - -Ways to Get BPS ---------------- -There are two different ways to get release versions of BPS and one way to get the latest code from the repository. These are outlines of the steps needed that should be applicable to all operating systems. For a more step-by-step approach, check the OS specfic sections further down the page. - -Installing the Latest Release with pip -______________________________________ - -Go to the command line and type ``pip install BenthicPhotoSurvey``. Depending on your OS, you may need to type ``sudo pip install BenthicPhotoSurvey`` instead and enter your root password. - -In order to run BPS, you have to figure out where `pip`_ installed the code and that can vary according to OS and configuration. If you have version of pip >= 1.2.1.post1, you can figure it out by typing ``pip show BenthicPhotoSurvey`` on your command line. The response should contain the location of the ``benthic_photo_survey`` directory. To run BPS, navigate to that directory and start BPS by typing ``python benthic_photo_survey.py`` (on Windows, you'll leave off the ``python`` and just type ``benthic_photo_survey.py``). - -On my computer it looks somthing like this:: - - blah@blahbidyblah:~$ pip show BenthicPhotoSurvey - --- - Name: BenthicPhotoSurvey - Version: 0.1 - Location: /usr/local/lib/python2.7/dist-packages - Requires: - -So, to launch, I type:: - - blah@blahbidyblah:~$ cd /usr/local/lib/python2.7/dist-packages/benthic_photo_survey - blah@blahbidyblah:/usr/local/lib/python2.7/dist-packages/benthic_photo_survey$ python benthic_photo_survey.py - -...and the program should run and you can move on to the :doc:`tutorial`. I will, hopefully, get around to packaging BPS a little better so it's easier to launch after installing but this will have to do for now. - -Downloading and Installing a Release from bitbucket -___________________________________________________ - -Use your web browser to `download the code`_ from bitbucket. Unzip that file somewhere. Navigate into the ``benthic_photo_survey`` directory that contains ``benthic_photo_survey.py`` and type ``python benthic_photo_survey.py`` (on Windows, you'll leave off the ``python`` and just type ``benthic_photo_survey.py``). - -Getting the Latest Code from bitbucket -______________________________________ - -First, make sure you have `git`_ installed. Then open the command line where you'd like to put the code and type ``git clone https://jkibele@bitbucket.org/jkibele/benthic_photo_survey.git``. That will download the latest code **which may not be stable**. To run it just follw the instructions from the previous subsection. - -Windows -------- - -The following steps will demostrate how to install the software required to run BPS, use the `git`_ version control system to download BPS, and then run BPS on Windows. - -- Satisify Install Requirements 1 - 4 with PythonXY - 1. Download the latest `PythonXY`_ installer from the `PythonXY Windows Download Page`_. Just click on one of the ``.exe`` files listed under 'Current Release'. The multiple links all lead to the same file, just on different servers. - #. Run the installer, and make sure that Python2.7.x (currently 2.7.3 but that may change, you just don't want 3.x), GDAL, PyQt4.x, pip, and Matplotlib are selected. These items are listed under the expandable python menu. You can check whatever additional items you'd like installed as well. - #. Click through the dialogs to finish the installation process. -- Install `pynmea`_ with pip - 1. Go to the `command prompt`_ and type ``pip install pynmea``. If you installed pip in the previous step, that command should work and you should be able to move on to the 'installing pyexiv2' step below. If there was a problem with pip, you can use the sub-steps below to install it. - #. If you get a message that says something about the 'command pip not found', then try typing ``easy_install pip`` at the `command prompt`_. If that doesn't work, you'll need to install `python-distribute`_ and `pip`_ as described in the next sub-step. If it does work (and it installs pip), just go back to the previous sub-step and it should work. - #. Download the correct installer for your system architecture (32 or 64 bit) from the list of `python-distribute installers`_. We installed python2.7.x so you want the one that matches your system architecture and ends with py2.7.exe. After running that installer, you should be able to type ``easy_install pip`` followed by ``pip install pynmea``. The good news is that python-distribute and pip can be used to install all sorts of useful python stuff and, now that you have them installed, that'll be easy. -- Install pyexiv2 - 1. Go to the `pyexiv2 download page`_, scroll down to the Windows section appropriate to your system (32 or 64 bit) and download the latest installer for Python 2.7. Note that the latest versions are at the bottom of the list rather than the top. - #. Run the installer -- Install `git`_ if you don't already have it - 1. Go to the `git download page`_, download the installer for your system, and run it. - #. The default list of components on the 'Select Components' screen is fine. - #. The choice of 'Start Menu Folder' doesn't really matter. I used the default. - #. On the next screen, choose "Run Git from the Windows command prompt". - #. On the 'Configure Line Ending' screen, select the default of 'Checkout Windows-style, commit, unix-style'. -- Use git to get BPS - 1. Open a `command prompt`_ and navigate to a directory where you would like to install BPS - #. Type ``git clone https://jkibele@bitbucket.org/jkibele/benthic_photo_survey.git``. This will clone the contents of BPS code repository to your computer. - #. If, after changes have been made to BPS, you want the latest version you can return to a command prompt in this directory and type ``git pull``. - -That should do it. Make sure you make a note of where you installed BPS. Then take a look at the :doc:`tutorial`. I intend to add a section there specifically about using the test data for a dry run. For now just check out the "Using BPS" section and look for the ``test_data`` directory at the same level as the ``data`` directory. There are some images, a gps log, and a sensus depth log in there that you can use to get the hang of it. - -Mac ---- - -Need to write up these steps too. - -Ubuntu ------- - -Need to write up these steps too. - -Testing -------- - -I will describe how to run the automated tests and how to use the test data that's installed with BPS to make sure everything is working. +Bethic Photo Survey (BPS) can run on Linux, Mac, and Windows operating systems. For installation instructions please see the `BPS Installation Page`_. -.. _download the code: https://bitbucket.org/jkibele/benthic_photo_survey/downloads -.. _bitbucket: https://bitbucket.org/jkibele/benthic_photo_survey -.. _pip: https://pypi.python.org/pypi/pip -.. _GDAL: http://www.gdal.org/ -.. _PyQt4: http://www.riverbankcomputing.com/software/pyqt/download -.. _pynmea: http://code.google.com/p/pynmea/ -.. _PythonXY: http://code.google.com/p/pythonxy/ -.. _PythonXY Windows Download Page: http://code.google.com/p/pythonxy/wiki/Downloads?tm=2 -.. _git: http://git-scm.com/ -.. _git download page: http://git-scm.com/downloads -.. _Python 2.7: http://www.python.org/download/releases/2.7.3/ -.. _pyexiv2: http://tilloy.net/dev/pyexiv2/ -.. _pyexiv2 download page: http://tilloy.net/dev/pyexiv2/download.html -.. _Matplotlib: http://matplotlib.org/ -.. _SciPy: http://scipy.org/ -.. _PythonXY: http://code.google.com/p/pythonxy/ -.. _command prompt: http://www.computerhope.com/issues/chdos.htm -.. _python-distribute: https://pypi.python.org/pypi/distribute -.. _python-distribute installers: http://www.lfd.uci.edu/~gohlke/pythonlibs/#distribute -.. _GitHub Repository: https://github.com/jkibele/benthic_photo_survey -.. _BPS page: http://jkibele.github.io/benthic_photo_survey/ \ No newline at end of file +.. _BPS Installation Page: + http://jkibele.github.io/benthic_photo_survey/installation/ \ No newline at end of file diff --git a/bps_package/docs/build/html/_sources/introduction.txt b/bps_package/docs/build/html/_sources/introduction.txt index 3e4f5d8..21907ee 100644 --- a/bps_package/docs/build/html/_sources/introduction.txt +++ b/bps_package/docs/build/html/_sources/introduction.txt @@ -14,7 +14,7 @@ Benthic Photo Survey is designed to work with inexpensive and relatively easy to 3. A depth logger is optional but if you're going to spend the time and money to go in the field, it seems worthwhile. BPS is set up to import log files from the `Sensus Ultra`_ depth and temperature logger. It should be fairly easy to adapt it to deal with a different logger but that would require a bit of coding. -4. A computer to run BPS. BPS was developed on Ubuntu but should work on Windows and Mac as well. +4. A computer to run BPS. BPS was developed on Ubuntu but is also available for Windows. In theory it will run on Mac as well but has almost no testing there. What BPS Actually Does @@ -24,9 +24,9 @@ There are 4 steps to what BPS does. 1. It imports your GPS and/or depth and temperature logs into a database. -2. It writes data from those logs to the exif portion of each of your jpeg photos based on the time stamp on each photo and the time stamps in the respective logs. +2. It writes data from those logs to the Exif portion of each of your jpeg photos based on the time stamp on each photo and the time stamps in the respective logs. -3. You use BPS to tag each photo with a habitat and/or depth and temperature. +3. You use BPS to tag each photo with habitat and/or substrate information. This is also written to the Exif portion of each photo. 4. BPS can export a point shapefile with a point at each location where a photo was taken. Each point is attributed with the habitat, substrate, depth, temperature, direction, and file path to the photo. @@ -41,7 +41,7 @@ There are 4 steps to what BPS does. .. _Sensus Ultra: http://reefnet.ca/products/sensus/ -.. rubric:: Citations +.. rubric:: References .. [RP2010] Roelfsema, C., Phinn, S., 2010. Integrating field data with high spatial resolution multispectral satellite imagery for calibration and validation of coral reef benthic community diff --git a/bps_package/docs/build/html/_sources/tutorial.txt b/bps_package/docs/build/html/_sources/tutorial.txt index 47956e5..899a6ca 100644 --- a/bps_package/docs/build/html/_sources/tutorial.txt +++ b/bps_package/docs/build/html/_sources/tutorial.txt @@ -1,69 +1,142 @@ +Learning BPS +============ + +This document will, hopefully, teach you what you need to know to collect photo transect data and process it with BPS. It will cover: + +1. A step by step tutorial on how to run BPS using the included test data. + +2. Setting up for and conducting field work. + +3. Getting your data into BPS. + +4. Using BPS and exporting the results. + +WARNING! +-------- + +Please make sure you back up all your data (photos, GPS, and Depth logs) before using it in BPS. I haven't seen it happen yet but it is entirely possible that BPS could ruin your files. This is not a commercial product and it does not come with any guarantees. + Tutorial -======== +-------- + +The following instructions will assume that you have followed the Windows Installation instruction on the `BPS Installation Page`_ unless otherwise noted. Only the paths will change for the Linux installation. The other instructions will be the same. + +These steps will lead you through the process of producing a shapefile from data. We will use a few photos, depths, and positions collected off the coast of Great Barrier Island in New Zealand's Hauraki Gulf. These data are included with the BPS installation so, if you've installed BPS, you already have them. The data consist of a GPS log in gpx format, a csv depth log, and 9 photos. + +1. Start BPS by navigating to the `bps_gui` folder and double clicking `bps_gui.exe`. If you are using a Linux installation, you'll navigate to `bps_package` and run `python bps_gui.py` in the terminal. When BPS opens, you'll see something like this: + + .. figure:: images/bps_just_opened.png + :scale: 50 % + :alt: BPS GUI + +2. Set the general preferences for BPS. Go to the file menu in BPS and select "Preferences". You'll see a window with 4 tabs. Each tab will have a help button. Click the help button for information about the options presented in each tab. + + .. figure:: images/bps_prefs.png + :scale: 50 % + :alt: BPS Preferences + + a. Set the working directory. Click the `...` button. If you followed the Windows Installation instructions on the `BPS Installation Page`_, you should set the working directory to `C:\bps_gui\test_data`. If you're using the Linux install, the `test_data` directory will be in the `bps_package` directory and you should set your working directory there. + + b. Set the database path. Use the `...` button next to the Database field and set it to use a file called `raw_log.db` within your working directory. It's fine if the file you specify doesn't currently exist. BPS will create it for you. + + c. We'll come back to the Preferences in a minute but, for now, click the "OK" button to save the changes. + +3. Load the GPS log. Go to the file menu and select "Load GPS Log". If the working directory was set correctly, this should open up a file dialog with the `test_data\gps` directory. Select the file called `gb_island_19092012.gpx` and click "Open". A message will be displayed (briefly) in the status bar at the bottom left of the BPS window telling you how many records were written into the database. During this step positions and time codes are read out of the GPS log and written to the database file specified in the preferences. + +4. Load the depth / temperature log. Select "Load Depth Log" from the file menu. Assuming the working directory was set correctly, this should open the `test_data\sensus` directory. Select the file called `gb_island_19092012.csv`. Another message will be displayed in the status bar and the depths, temperatures, and time stamps will be written to the database. + +5. Load the photos. Select "Load Photos" from the file menu. Navigate into the `test_data\images` directory (this should be the directory that opens by default) and click "Select Folder". On Windows, the actual image files will (annoyingly) be invisible in this dialog but you're selecting the folder rather than the individual images so that's okay. Once the images have been loaded, you'll see something like this: + + .. figure:: images/bps_loaded.png + :scale: 50 % + :alt: BPS Loaded + + - You can use the arrow keys or the "Next" and "Previous" buttons to step through the photos. + - Notice that most of the fields in the "Exif Data" area are initially empty. + +.. sidebar:: Photo Tagging + + During step 6, BPS is looking in the database to find the position, depth, and temperature records that most closely match the time the photo was taken. BPS then pulls the values from these records and assigns them to the photo. This information is written into the Exif portion of the jpeg file. All the information that BPS writes to the Exif (position, depth, habitat, substrate, etc.) becomes a permanent part of the image file. -This document may need to be fleshed out a bit better but this should serve as an outline. +6. Tag the images with location and depth. Click the "Geo Tag" button on the bottom of the BPS window. Notice that the Latitude and Longitude fields of the Exif Data now have values. Click the "Depth/Temp Tag" button and see that the Depth and Temperature fields get filled in. You can tag all the images at once by using the "Actions" menu. In fact, that's probably the better way to do it. + +7. Check the depth plot. Select "Depth Plot" from the "Output" menu. This will display a plot with time along the x axis and depth along the y. The stars represent when and and what depth the photos were taken. This can be very useful for making sure the photo and depth log time codes are lining up correctly. In the case of this test data, they were captured while breath hold diving. You can see that all of the photos were taken at the lowest part of the dive. That suggests that the photo capture times lined up well with the depth log. You can zoom and pan the plot using the controls in the plot window. + + .. figure:: images/bps_depth_plot.png + :scale: 50 % + :alt: BPS Depth Plot + +8. Set up habitat and substrate categories. Open the preferences dialog again via the file menu. Click the "Habitats" tab. Add a couple of habitats. Click the Help button in the Habitat preferences if you need more instructions on how to add a habitat. For this example you should end up with categories of Kelp, Turf, and Sand. Click the "Substrates" tab. The default substrate categories should be fine for this tutorial but, if you'd like to change them, this is where to do it. Again, there's a Help button on this tab that can provide more information. Click "OK" to save your preference changes and notice that the "Habitat" and "Substrate" categories on the bottom right side of the BPS window now match your specifications. + +9. Assign Habitats and Substrates to the photos. Step through the photos (using the arrow keys or the "Next" and "Previous" buttons) and assign habitat and substrate values: + + - For habitats, you assign the proportion of each habitat visible in the photo. If, for instance, you're looking at a photo that is about 30% sand and 70% kelp, you would assign 0.3 to the sand category and 0.7 to the kelp category. To do this, position your cursor over the kelp roll box and turn your mouse wheel until the value is 0.7. Alternatively, you can type a value into the box or click the up and down arrows. The "Save" button will be disabled until the sum of your categories is 1.0. Once your values add to 1.0 and you click the "Save" button, the habitat values will be written to the Exif portion of the image. You will then see the dominant habitat type displayed in the "Exif Data" area. The dominant habitat value is the category with the largest proportion. In the event of a tie, one of the categories with the highest value is randomly chosen as dominant. The dominant habitat is just for convenience of display. All proportions are saved and will be part of the final shapefile output. + + - To assign a substrate to your photo, simply click the "Substrate" tab in the bottom right corner and then double click on the substrate category of your choice. Substrate categorization does not support proportional tagging. It's a one substrate per photo kind of thing. + +10. Export a shapefile. This is the final product that BPS was built to deliver. Choose "Export Shapefile" from the Output menu. Navigate to where you'd like to save your shapefile and enter a file name that ends with ".shp". I need to change the code a little bit so that it's more tolerant but, at the moment, a file name without ".shp" on the end will not work. + +Now that you've gone through all that, you should use a GIS program to take a look at your shapefile. If you're not familiar with GIS, a good place to start is the `QGIS`_ website (where you can download QGIS) and the `QGIS Documentation`_ page. + + +Field Work +---------- + +This section will discuss how to prepare for and conduct field work. This text assumes that you are breath-hold diving or using SCUBA. BPS can be used with a drop camera as well. If you're going to use it that way, just use your imagination to adapt these instructions. Initial Setup -------------- +_____________ -1. You should make sure you have BPS installed, running, and tested as described in :doc:`installation`. +1. You should make sure you have BPS installed, running, and tested as described in :doc:`installation`. It's also probably a good idea to work through the long winded Tutorial section above to make sure you know what will happen with your data once they've been collected. -2. As mentioned in the :doc:`introduction`, you will need a float on which you can tow your GPS. +2. As mentioned in the :doc:`introduction`, you will need a float on which you can tow your GPS. For more information on making a float (and lots of other useful stuff) see the `Photo Transect Manual`_ [RP2009]_. 3. Set your GPS tracking on and make sure the interval is short. I set mine to log position once every 4 seconds. 4. Make sure your GPS datum is set to WGS84. That tends to be the default setting but you should make sure. You can use a different datum but you should make sure that the configuration file is set to match. See `Configuring BPS`_. -4. Set the logging interval on your depth sensor. It needs to be particularly short if you are free diving. I set mine to log every 2 seconds. +5. Set the logging interval on your depth sensor. It needs to be particularly short if you are free diving (or doing anything that involve fast or frequent changes in depth). I set mine to log every 2 seconds. -5. Attach depth sensor to something. I generally attach it to the camera housing. I may need to compensate for the fact that the camera is usually a meter or so above the bottom when I take the photos but that seems preferable to getting the logger full of sediment. +6. Attach depth sensor to something. I generally attach it to the camera housing. I may need to compensate for the fact that the camera is usually a meter or so above the bottom when I take the photos but that seems preferable to getting the logger full of sediment. Clock Synchronization ---------------------- +_____________________ Since BPS will use time codes to find positions and/or depths for each photo it is essential that relevant clocks are all in sync. Before getting in the water, make sure your camera's clock is set to the correct local time. It's easiest to use the time display on your GPS for this purpose. The Panasonic Lumix DMC-TS4 that I use has a built in GPS that is supposed to be able to set the camera's clock to GPS time. If you use this feature make sure to double check it. There camera clock should match the GPS clock within about a second. The depth logger actually sets the time codes when the log is downloaded from the logger. Therefore, the computer that you use to download the depth log needs to have its clock synced to GPS time when the file is downloaded. If your computer's clock is set by the internet, this is usually good enough (in my experience) but you should double check. +NOTE: I've had some problems with time codes on the Sensus Ultra depth tag if I'm downloading records off it that are more than a day or two old. I think there's a bit of drift due to the way time codes are calculated. The bottom line is that it seems to be a good idea to download the data from the depth logger as soon as possible after the field work. If you figure out that there is a time offset problem, you can enable the "Dodgy Features" in the preferences. This will allow you to time shift the depth records and to view depth plots with a time offset. Using these features, you may be able to sync your photos and depth records back up. + While in the Water ------------------- +__________________ Regardless of whether you are on SCUBA or free diving, you should pause for a few seconds before taking a photo and pull down lightly on the rope you have attached to your GPS float. To get the best possible accuracy, you need the float to be directly over you. Pausing at the bottom will also minimize the effect of any clock synchronization problems for both depth and position. Also, don't drown. That's bad for data collection. Back on the Surface -------------------- +___________________ If you're using a Garmin GPS60 like I am, **do not** save the active track. Saving the track and then downloading the saved track gets rid of the timestamp on each position rendering it useless as far as BPS is concerned. Instead, you want to download the active track. I use `GPSbabel`_ to download the track and convert it to a GPX file. Many newer GPS models output GPX files without the need for conversion. You just need to make sure you're getting a GPX file that has a timestamp for each point within the track. You should make backups of your photos before letting BPS operate on them. I've never had a problem but, since BPS is writing to part of the jpeg file, there is a possibility that it could corrupt the photo so you should have a backup. -For convenience, I keep my BPS GPS logs in benthic_photo_survey/data/GPS and my depth logs in benthic_photo_survey/data/sensus. For photos, I create a directory for each set of photos within benthic_photo_survey/data/images. BPS is set up to operate on a directory of photos as a unit. For instance, when creating a shapefile all photos within the currently loaded directory will become a point in the shapefile. +For convenience, I keep my BPS GPS logs in working_directory/GPS and my depth logs in working_directory/sensus. For photos, I create a directory for each set of photos within working_directory/images. BPS is set up to operate on a directory of photos as a unit. For instance, when creating a shapefile all photos within the currently loaded directory will become a point in the shapefile. Configuring BPS --------------- -At some point I'd like to add a graphical interface for configuring BPS but, for now, you'll have to edit configuration.py in a text editor. There are explanatory comments in the file and it should be fairly straight forward. - -You'll want to set LOCAL_TIME_ZONE to the time zone you're collecting data in. You'll probably also want to change the list of habitats and the list of substrates. Just read the comments in the code. - -If you are deploying more than one camera / gps / depth logger set up at a time, you will need to take precautions to avoid confusion. You will need to change the db_path in configuration.py and keep the logs from the two setups separate. For the sake of this tutorial, let's assume you're only using one setup at a time. - -Using BPS ---------- - -1. Launch BPS by navigating to the ``bps_package`` directory and typing: ``python bps_gui.py`` in the command line. Some windows installations will require that you just type ``bps_gui.py``. If you installed bps with git, ``bps_package`` directory will be ``benthic_photo_survey/bps_package`` relative to wherever you put it. - -2. Load your GPS file. Select 'Load GPS Log' from the file menu, select your GPX file and click 'Open'. This will load the positions and time stamps into a database specified in configuration.py. - -3. Load your depth log. Select 'Load Depth Log' from the file menu. This step is optional but it will load depths and temperature readings from the depth log into the database specified in configuration.py. +Configuration is handled through the "Preferences" dialog (found in the BPS file menu). For specific details about the options, click the "Help" buttons found on each tab of the Preferences dialog. -4. Load your photos. Select 'Load Photos' from the file menu and chose the directory that contains the photos you would like to tag and use to create a shapefile. +If you are deploying more than one camera / gps / depth logger set up at a time, you will need to take precautions to avoid confusion. You will need to change the db_path in the preferences and keep the logs from the two setups separate. -5. You can now use the 'Next' and 'Previous' buttons (or the arrow keys on your keyboard) to scroll through your photos. You can tag the photos one at a time with Depth and Temperature or location using the buttons at the bottom of the application or you can use the items in the 'Actions' menu to tag all the loaded photos with location or depth and temperature. Either way, you'll see the assigned attributes in the 'Exif Data' area on the right side of the application window. -6. You can choose 'Depth Plot' from the 'Output' menu. This will use Matplotlib to render a graph of the depth log for the loaded photos with stars that represent where each photo was taken. This plot is particularly useful for data that has been collected while free diving. You can verify that the clocks were adequately synced by making sure that the photos were taken at the deepest parts of the dives. +.. rubric:: References -.. image:: images/depth_graph.png +.. [RP2009] Roelfsema, C., Phinn, S.R., 2009. A Manual for Conducting Georeferenced Photo Transects Surveys to Assess the Benthos of Coral Reef and Seagrass Habitats version 3.0. -7. Export a shapefile using the 'Output' menu. This shapefile can be viewed using most GIS software. I generally use `QGIS`_. .. _GPSbabel: http://www.gpsbabel.org/ .. _QGIS: http://www.qgis.org/ +.. _QGIS Documentation: http://qgis.org/en/docs/index.html +.. _Photo Transect Manual: + http://ww2.gpem.uq.edu.au/CRSSIS/publications/GPS_Photo_Transects_for_Benthic_Cover_Manual.pdf +.. _BPS Installation Page: + http://jkibele.github.io/benthic_photo_survey/installation/ \ No newline at end of file diff --git a/bps_package/docs/build/html/code.html b/bps_package/docs/build/html/code.html index eca8de1..5c5ec06 100644 --- a/bps_package/docs/build/html/code.html +++ b/bps_package/docs/build/html/code.html @@ -6,7 +6,7 @@ - Code Documentation — Benthic Photo Survey 1.0.0 documentation + Code Documentation — Benthic Photo Survey 1.0.1 documentation @@ -14,7 +14,7 @@ - - + + @@ -199,7 +199,7 @@

    Table Of Contents

    Previous topic

    Tutorial

    + title="previous chapter">Learning BPS

    This Page

    @@ -52,9 +52,9 @@

    Navigation

    Welcome to Benthic Photo Survey’s documentation!

    Benthic Photo Survey (BPS) is a software tool (written in Python) that is intended to simplify the task of collecting reference data (sometimes called groundtruth data) for remote sensing of the marine environment. Using a digital camera in a water proof housing, a consumer grade handheld GPS, and (optionally) a depth logger a user can collect data in the field.

    -_images/BPS_overview.png

    The photos and logs (GPS and Depth) are then loaded into BPS. BPS can then tag the photos with position, depth, and temperature (if using the Sensus Ultra depth/temperature logger). The the users can view each photo in BPS and tag each photo with a substrate and habitat type. All data (position, depth, temperature, habitat, and substrate) are stored in the exif portion of the jpeg photos.

    Once the photos are all tagged, BPS can export a GIS Shapefile with habitat, substrate, depth, and temperature attributed points for each photo’s location. This shapefile can then be used to create a training set for supervised classification or as reference data for accuracy assessment.

    +_images/BPS_overview.png

    Contents

    @@ -53,128 +53,9 @@

    Navigation

    -
    -

    IMPORTANT NOTE:

    -

    Most of this information is out of date. Go to the GitHub Repository or BPS page for up to date information. I will update these docs but haven’t had time yet.

    -
    -
    +

    Installation

    -

    Bethic Photo Survey (BPS) can run on Linux, Mac, and Windows operating systems. There are a few different ways to install BPS.

    -
    -

    Requirements

    -

    The following items need to be installed in order for BPS to work. Make sure you read at least to the end of this section before you start installing this stuff. There may be an easier way than installing all these things individually. Then check the section below for your operating system. There may be seperate quirks to the installation process for Windows, Linux, and Mac. I will try to give step-by-step instructions for each operating system below.

    -
      -
    1. Python 2.7 BPS may work on older versions of Python but I wouldn’t bet on it
    2. -
    3. GDAL 1.8 or greater
    4. -
    5. Matplotlib 1.1.1 or greater, can be installed as part of SciPy or with PythonXY (see end of this section).
    6. -
    7. PyQt4
    8. -
    9. pynmea can be installed with pip by typing pip install pynmea at the command prompt (or sudo pip install pynmea if you’re on Linux or Mac and need root privileges to install).
    10. -
    11. pyexiv2 has actually been deprecated now. I will eventually rewrite the code to use a different library but, for now, pyexiv2 is required.
    12. -
    -

    That’s kind of a lot of stuff to have to install. Fortunately, items 1 - 4 can be taken care of with the PythonXY installer. PythonXY is a set of free scientific software tools all bundeled together for easy installation. You can download the PythonXY installer, run it, make sure that items 1 - 4 are selected, and it will take care of all those steps for you. If you decide later that you want some of the other items to be installed as well, you just run the installer again and check more boxes. It makes things much easier, especially on Windows.

    -
    -
    -

    Ways to Get BPS

    -

    There are two different ways to get release versions of BPS and one way to get the latest code from the repository. These are outlines of the steps needed that should be applicable to all operating systems. For a more step-by-step approach, check the OS specfic sections further down the page.

    -
    -

    Installing the Latest Release with pip

    -

    Go to the command line and type pip install BenthicPhotoSurvey. Depending on your OS, you may need to type sudo pip install BenthicPhotoSurvey instead and enter your root password.

    -

    In order to run BPS, you have to figure out where pip installed the code and that can vary according to OS and configuration. If you have version of pip >= 1.2.1.post1, you can figure it out by typing pip show BenthicPhotoSurvey on your command line. The response should contain the location of the benthic_photo_survey directory. To run BPS, navigate to that directory and start BPS by typing python benthic_photo_survey.py (on Windows, you’ll leave off the python and just type benthic_photo_survey.py).

    -

    On my computer it looks somthing like this:

    -
    blah@blahbidyblah:~$ pip show BenthicPhotoSurvey
    ----
    -Name: BenthicPhotoSurvey
    -Version: 0.1
    -Location: /usr/local/lib/python2.7/dist-packages
    -Requires:
    -
    -
    -

    So, to launch, I type:

    -
    blah@blahbidyblah:~$ cd /usr/local/lib/python2.7/dist-packages/benthic_photo_survey
    -blah@blahbidyblah:/usr/local/lib/python2.7/dist-packages/benthic_photo_survey$ python benthic_photo_survey.py
    -
    -
    -

    ...and the program should run and you can move on to the Tutorial. I will, hopefully, get around to packaging BPS a little better so it’s easier to launch after installing but this will have to do for now.

    -
    -
    -

    Downloading and Installing a Release from bitbucket

    -

    Use your web browser to download the code from bitbucket. Unzip that file somewhere. Navigate into the benthic_photo_survey directory that contains benthic_photo_survey.py and type python benthic_photo_survey.py (on Windows, you’ll leave off the python and just type benthic_photo_survey.py).

    -
    -
    -

    Getting the Latest Code from bitbucket

    -

    First, make sure you have git installed. Then open the command line where you’d like to put the code and type git clone https://jkibele@bitbucket.org/jkibele/benthic_photo_survey.git. That will download the latest code which may not be stable. To run it just follw the instructions from the previous subsection.

    -
    -
    -
    -

    Windows

    -

    The following steps will demostrate how to install the software required to run BPS, use the git version control system to download BPS, and then run BPS on Windows.

    -
      -
    • -
      Satisify Install Requirements 1 - 4 with PythonXY
      -
        -
      1. Download the latest PythonXY installer from the PythonXY Windows Download Page. Just click on one of the .exe files listed under ‘Current Release’. The multiple links all lead to the same file, just on different servers.
      2. -
      3. Run the installer, and make sure that Python2.7.x (currently 2.7.3 but that may change, you just don’t want 3.x), GDAL, PyQt4.x, pip, and Matplotlib are selected. These items are listed under the expandable python menu. You can check whatever additional items you’d like installed as well.
      4. -
      5. Click through the dialogs to finish the installation process.
      6. -
      -
      -
      -
    • -
    • -
      Install pynmea with pip
      -
        -
      1. Go to the command prompt and type pip install pynmea. If you installed pip in the previous step, that command should work and you should be able to move on to the ‘installing pyexiv2’ step below. If there was a problem with pip, you can use the sub-steps below to install it.
      2. -
      3. If you get a message that says something about the ‘command pip not found’, then try typing easy_install pip at the command prompt. If that doesn’t work, you’ll need to install python-distribute and pip as described in the next sub-step. If it does work (and it installs pip), just go back to the previous sub-step and it should work.
      4. -
      5. Download the correct installer for your system architecture (32 or 64 bit) from the list of python-distribute installers. We installed python2.7.x so you want the one that matches your system architecture and ends with py2.7.exe. After running that installer, you should be able to type easy_install pip followed by pip install pynmea. The good news is that python-distribute and pip can be used to install all sorts of useful python stuff and, now that you have them installed, that’ll be easy.
      6. -
      -
      -
      -
    • -
    • -
      Install pyexiv2
      -
        -
      1. Go to the pyexiv2 download page, scroll down to the Windows section appropriate to your system (32 or 64 bit) and download the latest installer for Python 2.7. Note that the latest versions are at the bottom of the list rather than the top.
      2. -
      3. Run the installer
      4. -
      -
      -
      -
    • -
    • -
      Install git if you don’t already have it
      -
        -
      1. Go to the git download page, download the installer for your system, and run it.
      2. -
      3. The default list of components on the ‘Select Components’ screen is fine.
      4. -
      5. The choice of ‘Start Menu Folder’ doesn’t really matter. I used the default.
      6. -
      7. On the next screen, choose “Run Git from the Windows command prompt”.
      8. -
      9. On the ‘Configure Line Ending’ screen, select the default of ‘Checkout Windows-style, commit, unix-style’.
      10. -
      -
      -
      -
    • -
    • -
      Use git to get BPS
      -
        -
      1. Open a command prompt and navigate to a directory where you would like to install BPS
      2. -
      3. Type git clone https://jkibele@bitbucket.org/jkibele/benthic_photo_survey.git. This will clone the contents of BPS code repository to your computer.
      4. -
      5. If, after changes have been made to BPS, you want the latest version you can return to a command prompt in this directory and type git pull.
      6. -
      -
      -
      -
    • -
    -

    That should do it. Make sure you make a note of where you installed BPS. Then take a look at the Tutorial. I intend to add a section there specifically about using the test data for a dry run. For now just check out the “Using BPS” section and look for the test_data directory at the same level as the data directory. There are some images, a gps log, and a sensus depth log in there that you can use to get the hang of it.

    -
    -
    -

    Mac

    -

    Need to write up these steps too.

    -
    -
    -

    Ubuntu

    -

    Need to write up these steps too.

    -
    -
    -

    Testing

    -

    I will describe how to run the automated tests and how to use the test data that’s installed with BPS to make sure everything is working.

    -
    +

    Bethic Photo Survey (BPS) can run on Linux, Mac, and Windows operating systems. For installation instructions please see the BPS Installation Page.

    @@ -183,31 +64,12 @@

    Testing

    modules |
  • - next |
  • previous |
  • -
  • Benthic Photo Survey 1.0.0 documentation »
  • +
  • Benthic Photo Survey 1.0.1 documentation »
  • @@ -63,7 +63,7 @@

    What You Need to use BPSPanasonic Lumix DMC-TS4 in an Ikelite housing. This camera has a built in compass that records the direction that the camera is facing when the photo is taken and BPS passes the direction into the shapefile that is created. However, this is not a requirement and any camera that produces jpeg images should be compatible with BPS.
  • A GPS that can be towed by a snorkeler or diver. If you’re working with fairly high resolution imagery, you’ll want a GPS receiver with WAAS capability. I am using a Garmin GPS 60 CSX. I tow mine in a small waterproof plastic box on a float. See GPS Photo Transects for Benthic Cover Manual by Roelfsema and Phinn [RP2010] for details on how to build a float. BPS can import NMEA text files and GPX files.
  • A depth logger is optional but if you’re going to spend the time and money to go in the field, it seems worthwhile. BPS is set up to import log files from the Sensus Ultra depth and temperature logger. It should be fairly easy to adapt it to deal with a different logger but that would require a bit of coding.
  • -
  • A computer to run BPS. BPS was developed on Ubuntu but should work on Windows and Mac as well.
  • +
  • A computer to run BPS. BPS was developed on Ubuntu but is also available for Windows. In theory it will run on Mac as well but has almost no testing there.
  • @@ -71,11 +71,11 @@

    What BPS Actually DoesThere are 4 steps to what BPS does.

    1. It imports your GPS and/or depth and temperature logs into a database.
    2. -
    3. It writes data from those logs to the exif portion of each of your jpeg photos based on the time stamp on each photo and the time stamps in the respective logs.
    4. -
    5. You use BPS to tag each photo with a habitat and/or depth and temperature.
    6. +
    7. It writes data from those logs to the Exif portion of each of your jpeg photos based on the time stamp on each photo and the time stamps in the respective logs.
    8. +
    9. You use BPS to tag each photo with habitat and/or substrate information. This is also written to the Exif portion of each photo.
    10. BPS can export a point shapefile with a point at each location where a photo was taken. Each point is attributed with the habitat, substrate, depth, temperature, direction, and file path to the photo.
    -

    Citations

    +

    References

    @@ -107,7 +107,7 @@

    Previous topic

    title="previous chapter">Welcome to Benthic Photo Survey’s documentation!

    Next topic

    IMPORTANT NOTE:

    + title="next chapter">Installation

    This Page

    @@ -95,7 +95,7 @@

    Navigation

  • modules |
  • -
  • Benthic Photo Survey 1.0.0 documentation »
  • +
  • Benthic Photo Survey 1.0.1 documentation »
  • + + + + +
    [RP2009]Roelfsema, C., Phinn, S.R., 2009. A Manual for Conducting Georeferenced Photo Transects Surveys to Assess the Benthos of Coral Reef and Seagrass Habitats version 3.0.

    @@ -114,20 +187,24 @@

    Using BPS

    Table Of Contents