This is a guest post by the incredible Kathryn Ellen Whittey from Cardiff University! The two of us ran a workshop together at the 2017 European Coral Reefs Symposium about how to create and analyse 3D models of coral reefs using PhotoScan and Rhinoceros 3D ("Rhino"). The methods are outlined in my PloS One publication "Cost and time-effective method for multi-scale measures of rugosity, fractal dimension, and vector dispersion from coral reef 3D models," and here they are explained in a slightly friendlier way. If you've issues please comment below and we'll work something out. I've also published 3D modeling teaching notes (link here) and a tutorial on how to rotate and scale models in Rhino (link here).
Onto Kath... !
Onto Kath... !
In this series of video tutorials I have used one of my very own brain coral bommies from my study site in Tobago. The model has been rendered using structure-from-motion techniques with an Olympus tough TG-4 camera and rendered in Agisoft Photoscan. In these demonstrations I show how to rotate, delete, fill holes in the model, scale the model, take measurements and use the python script coded by Grace Young to calculate rugosity. For each video the commands used are highlighted in bold, these can be typed straight into the Rhino interface. Video 1: Rotate & Tidy |
Topics covered:
In this video the coral model has come straight out of Agisoft Photoscan, and as you can see it isn’t perfect, there are abnormalities such as floating pieces of sand and holes in the model mesh which are not representative of the true coral bommie. Before I begin clearing up these abnormalities I first rotate the model in rhino into the correct orientation (this makes it easier to view and also is important for taking measurements such as rugosity later on). To rotate the model, begin by selecting it and typing into the command box the command “rotate”. In the video I rotate my bommie twice, aligning the sandy seabed with the x axis. Alignment is sometimes more fiddly than this example and you may need to be correct orientation several times in the different viewport windows. Once you’re happy with the alignment you can move on to filling the holes in the model. To do this, simply type the command “FillMeshHoles” and rhino automatically fills any holes in the model with ‘artificial’ mesh. Rhino usually figures out where the holes need to be filled pretty accurately but sometimes is creates mesh where you don’t really need it. If you are not familiar with your coral, using still photographs as a reference is useful. To delete any non-representative mesh pieces, we first need to break the model into the constituent meshes by using the command “Explode”. You can now select the individual undesired mesh pieces and delete them, including any incorrect mesh pieces rhino has added. Once you’re happy that the model is tidied up you can then select all (Command: SelAll) and re-join the meshes (Command: Join). |
Note that this video has NO AUDIO. Video 2: Scaling & Measuring Distances |
Topics covered:
To scale your model you will need to use a reference object of a known size (this needs to be in the original video). For my models I used a weighted Lego® cube measuring 64 mm3. Using one edge of the cube I add two points (Command: Point) to each end making sure to select the “OnMesh” command. Usually doing this in top view is best. I then need to get the dimension from one point to another. I use the "DimAligned" command and Rhino generates the artificial length of that measurement. To ensure the maximum accuracy, in settings under Dimensions I select the maximum number of decimal places. As my scale cube length is in mm I also ensure that the units are in mm when scaling. I can then change this to meters afterwards. After creating the dimension I select all and “Group” to make sure rhino uses the measurement I just created to scale the model. Typing “scale” now allows you to scale the model, select a point of origin, a point on the model and then type into the command box the number you wish to scale the model by. For me, as one length of my cube is 64mm I divide 64 by the number previously generated. In the video this is 64/2.0348929. When I then change the units, I can see that the new measurement is displayed as 0.064 m, 64 mm. You may also want to change the spacing of lines in your grid, which makes it easier to see whether the model has been correctly scaled. Now that your model is scaled you can use the same commands “Point” and “DimAligned” to make measurements of your coral (and they will now be real life size). For example you may wish to measure the area of dead coral vs the total “Area” of your coral. Go to town, having a 3D model is like being able to breathe underwater – you can take as many measurements as you want! |
|
Note that this video has NO AUDIO.
Video 3: Measuring Rugosity
Topics covered:
Now that we’re happy with the model we can start to take more complicated measurements. One of the most common measurements of habitat complexity is rugosity. This is classically measured by laying a chain of known length along the sea floor and comparing the distance covered on a flat surface. We can now do this using virtual chains in Rhino! The first step is to create a mesh grid of desired size, or use the template available at https://github.com/gracecalvertyoung/Rhino-Python-3D-Coral-Reefs. Then we simply “Copy” the grid directly on to the model and move it into the desired position. Then using the command “MeshIntersect” rhino calculates where the grid makes contact with the coral and this creates the effect of chains being laid on the reef. We then delete the mesh grid and move the model out the way to isolate the chains. In this example there are overhangs in the coral and so the MeshIntersect command has created extra lines. This means that a little bit of work is needed to isolate the correct chain, once isolated, rotate all the vertical lines by selecting them and typing “Rotate”, click an area in the middle of the lines and the type 90 into the dialog box and rhino will rotate the lines by 90 degrees. Now the lines are horizontal they are ready to be used for rugosity measurements. Type in “RunPythonScript” and select the code for rugostiy available at https://github.com/gracecalvertyoung/Rhino-Python-3D-Coral-Reefs, you will then be prompted to select the chains and press enter. Depending on the number of chains this could take a little processing time. When finished Rhino will create an output of rugosity values which can be copied into excel and you can calculate the average rugosity value for your coral by adding a “=” in front of the copied values. |
|
Note that this video has NO AUDIO.
Questions/comments/something still not working? Comment below and we'll work it out.