GithubHelp home page GithubHelp logo

aaronolsen / stereomorph Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 4.0 109.48 MB

R package for the collection of shape data using a stereo camera setup

Home Page: https://aaronolsen.github.io/software/stereomorph.html

License: Other

R 84.10% C++ 15.34% C 0.56%
camera-calibration shape-analysis

stereomorph's Introduction

StereoMorph

StereoMorph is an R package for the collection of shape data using a stereo camera setup.

Introduction

Standard digital cameras are commonly used to collect 2D landmarks and curves from relatively flat objects. But if the objects are more three-dimensional, users often have to resort to methods such as microscribes or surface scanning. The StereoMorph R package allows users to collect 3D landmarks and curves from objects using two standard digital cameras. Owing to its low cost, portability and speed, stereo camera reconstruction is an ideal method for collecting data from a large number of specimens or objects.

The StereoMorph package includes tools for automatically calibrating a set of two cameras using a checkerboard pattern and a digitizing application for digitizing landmarks and curves. Once the cameras are calibrated, StereoMorph allows users to reconstruct any landmarks and curves digitized in both camera views into 3D. Those interested in using StereoMorph will find several useful resources at https://aaronolsen.github.io/software/stereomorph.html, including step-by-step tutorials and accompanying project folders with all the files needed for the tutorial.

Citing StereoMorph

To cite StereoMorph in a publication, please use:

  • Olsen Aaron M, Mark W Westneat. 2015. StereoMorph: an R package for the collection of 3D landmarks and curves using a stereo camera set-up. Methods in Ecology and Evolution 6:351-356. DOI: 10.1111/2041-210X.12326.

  • Olsen, AM & A Haber (2017). StereoMorph: Stereo Camera Calibration and Reconstruction. Version 1.6.1. https://CRAN.R-project.org/package=StereoMorph.

License

Shield: CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

stereomorph's People

Contributors

aaronolsen avatar ax3man avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

stereomorph's Issues

NaN landmark values in digitizeImages Shiny app when reading saved shape file

Description
As of the latest update to the package, the Shiny app called by the digitizeImages function fails to read landmark and curve values from the shape files it creates. It still creates shape files without issue and reads the tutorial shape files without issue.

My system
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit) (Ubuntu 20.04.4 LTS)
StereoMorph version: 1.6.5 (built under R 4.2.0)

Steps to reproduce

  1. Download the Mug Project zip from the StereoMorph site
  2. Extract, create a new RStudio session in .../Mug project/Mug project/
  3. Run digitizeImages with: digitizeImages(image.file='Mugs', shapes.file='Shapes', landmarks.ref='landmarks.txt')
    Here you can see that the app reads the included shape data just fine.
    image
  4. Assign a new point to Handle_Cup_Out_Top (or any landmark). The new value is assigned without problem.
    image
  5. Save the shape file. No sign of error.
  6. Advance to the next image and then return to mug_001.jpg. All landmark values will have changed to NaN and will not display on the image.
    image

Original shape file contents:
image

Contents of shape file saved on Step 5:
image

Speculation
It seems the error was created when the package was updated so that digitizeImages saves the shape file in a new format but it hasn't been updated to read that new format. It expects the old format and so it throws NaN values when opening a new-format file.

digitizeImages broken in R 4.2.0

In R 4.2.0, if() statements with a condition of length greater than one give an error rather than a warning.

This means digitizeImages no longer saves landmarks to disk, since list2XML4R is now broken. This is caused by the same problem as #8. Checking for classes using class(x) == "logical" will yield a logical vector of length 2 when x is e.g. a matrix (since matrices have both the "matrix" and "array" class). The solution is to check for classes using is. functions (like is.logical, is.character etc.) or to use inherits(x, 'logical').

Installing #9 solves the problem for me.

Trouble Saving in Digitizing Window

Hi, I'm having an issue working in RStudio on PC. When I open the image digitizing window, the save button is not available to select and automatically saving any landmark edits doesn't work either. I don't believe it's an issue with my working directory because saving works correctly for a tutorial I have saved under the same Box folder. Also, I've tried downloading the images from Box and moving them to a local folder to attempt saving that way with no luck.

Submit landmarks?

I'm trying to work through the tutorial and am not seeing a "Submit all" or "Submit landmarks" button in the bottom right corner of the control panel as is shown on page 10 of the tutorial. Am I missing something? When I save the landmarks, I get

Warning in if (class(list[[name]]) == "array") { :
the condition has length > 1 and only the first element will be used

Thanks for your help.

Warning in readShapes()

Hi, so I'm getting a warning in R 4.0.2 using readShapes()

In if (class(read_shapes[[i]][[name]]) %in% c("character", ...:
the condition has length > 1 and only the first element will be used
In if (class(read_shapes[[i]][[name]]) %in% c("matrix", ...:
the condition has length > 1 and only the first element will be used

I presume this is because matrix objects now have two classes in R 4: c("matrix", "array"), if I'm not mistaken?

Add readme

Readme does not exist. Highly recommend adding one.

TPSToShapes file format and question

Hi Aaron, I'm sorry if this question has already been addressed elsewhere. I am trying to use the TPSToShapes code on a dataset of about 800 specimen images (which is why I would prefer not to have to set landmarks on every image again in StereoMorph). The homologous landmark coordinates in my TPS output files, as far as I can tell, are never named, but the conversion code requires the names of each landmark, understandable for the conversion process. My first question is, am I missing something from TPS that allows the naming of landmarks, or should I manually name them? My second question is, if I have to perform this manually, what should the format be (names delimited by tabs before X and Y coordinates, some other method)?

I am really looking forward to using StereoMorph in the future and will use it regardless of if I need to re-digitize all 800 images in the process, but wanted to see if you had any input.

Thanks in advance!

Rene

lite StereoMorph

Hi Aaron,

following our discussions, I'm wondering how to implement StereoMorph beforehand Momocs.
I came to the opinion that maybe we (or I) would benefit having something lighter, ie just to digitize landmarks, curves and possibly outlines and return .txt files. First of all, what do you think of the idea ?

Also I'm considering recoding something from scratch using pure R+Shiny or seriously trim StereoMorph. What do you think?

All the best,
v

Use jsonlite

If you're going to be converting strings into JSON, you might want to use the jsonlite package:

listToJSONStr(list(foo = "foo"))
[1] "{"foo":["foo"]}"

jsonlite::toJSON(list(foo = "foo"))
{"foo":["foo"]}

Missing documentation for `btShapes`

Hi there,
Thanks for making this package! It has been really helpful for a morphometric analysis that I'm helping with.

I noticed that documentation for the btShapes function isn't included in the R manual, and help(btShapes) doesn't turn up any documentation for that function. In my case, this is making it hard to understand my collaborator's code, and hard to document my own code to make sure what I'm doing will be reproducible by someone who knows very little about the package.

Would you consider adding a .Rd documentation file to the man/ folder and the R manual?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.