Git Product home page Git Product logo

kevin4998 / mr-shape-database Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 0.0 218.8 MB

A content-based 3D shape retrieval system that, given a 3D shape, finds the most similar shapes in a given 3D shape database build for the University of Utrecht Multimedia Retrieval course.

License: Apache License 2.0

C# 98.69% JavaScript 0.48% GLSL 0.10% Batchfile 0.73%
3d-shape-recognition 3d-shapes comparison-tool csharp csharp-code shape-database utrecht-university

mr-shape-database's People

Contributors

guusdejonge avatar kevin4998 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mr-shape-database's Issues

[S2] Database implemenetion

Get all the shapes from the Princeton and Labeled PSB Dataset into the project.

Processing the entire Princeton or PSB databases can be very challenging! These contain hundreds of shapes in multiple classes. A good way to proceed with the assignment is to first consider a reduced database. The key constraints here are that:

  • The reduced database should contain at least 200 shapes;
  • You should have shapes of most (ideally all) of the 19 class types;
  • Try to balance the classes, i.e., do not use tens of models of one class and only a handful of models of another class.

[S5] Modify The Query Mechanism To Use ANN

Given a query shape, modify the simple query mechanism built in Step 4 to return the K-nearest neighbors or the R-nearest neighbors (where K and R are user-supplied parameters), using ANN.

[Setup] Example Shapes

Get 4 3D shapes from the Princeston Shape Benchmarks and Labeled PSB Dataset

  • 2 PLY Shapes
  • 2 OFF Shapes

[S1] Shape Visualiser

Display a read-in shape with shading using OpenGL. Drawing Cell-Edges is optional but advised. If you do this make sure that you can turn it on or off by keystrokes.

Requires #4

[S3] Shape Descriptor: Simple computations

Create a method to calculate each of the following properties of objects:

  • Compactness (with respect to a sphere)
  • Axis-Aligned Bounding-Box volume
  • Diameter
  • Eccentricity (Ratio between largest and smallest eigenvalues of covariance matrix)

Load in Feature Vectors.

When using the internal shapedatabase, it would be useful to also load in their feature vectors rather than recalculating it.

[S2] Outlier normalising

Refine the outliers so that it can be used for real feature extraction later on. (splitting larger faces into smaller ones and visa versa).

These meshes can be refined with different tools such as GeomView or OFF mesh tools package.

[S1] Shape Inspector

Have the program be able to:

  • Rotate Shapes (around viewpoint)
  • Zoom in/out
  • Pan/Translate Shapes

Requires #6

[S1] Shape Reader

Read in PLY or OFF shapes from a file into a datastructure. Only 1 structure needs to be read. Check out which one is the easiest to work with, not the easiest to convert.

[S4] Ini configuration

Allow for values which will easily change, like the weights and number of returned results, to be able to be read and changed from ini files.

  • Ini file outline: Which variables to implement and how.
  • Ini file reading in custom object
  • Ini object conversion to Settings

[S2] Extract Filters

Extract 4 basic features from the databases:

  • The class of the shape (specified in file)
  • The number of faces and vertices
  • The type of faces (triangles, quads, mix)
  • The axis-aligned 3D bounding box

[S1] Test Run

Test all the previous requirement to make sure tthat we can move on.

  • #5 Converting Shapes from one format to the other
  • #4 Reading Shapes into a datastructure
  • #6 Visualising Shapes onto the screen
  • #7 Inspecting Shapes in a variation of ways

[S2/S3] Writer problems

The current writer works incorrectly on some systems and writes out decimal values with a ',' rather than '.' making our java systems and our own unable to read the files back in. Furthermore multiple exceptions occure within those java environments because of this process. So somewhere something goes wrong, find it and eliminate it.

  • Discover source of the ','/'.' issue
  • Rewrite writer to be able to only output points
  • Discover source of errors for the java processes
  • Make a fail-safe and fix/prevent it from happening.

[S3/S4] Local Shape Descriptor: Histogram Setup

A local of local descriptors need to be calculated later on. However it is not easy to compare local descriptors between shape. It make this process easier, a class should be made which contains a histogram of all the local descriptors (of one type) and is able to compare a histogram of the same type between two shapes.

  • Create generic histogram which can contain values of local descriptors
  • Normalise histogram values so amount of samples does not matter.
  • Allow comparison of the same descriptor types in the class

[Setup] Github Conventions

Add all the basic files requested by github to define your project:

  • README.md: Explaining the repository and assignment requirements.
    • Description
    • Getting Started: Prerequisites, Installing
    • Deployment
    • Built With
    • Contributions
    • Authors
    • License
    • Acknowledgements
  • LICENSE.md: Give it a license to call this project our own.
  • CODEOWNERS: The participants and responsible owners of the repository.

[S2] Full normalisation

Design a simple normalization tool, the tool should read each shape, translate it so that its barycenter coincides with the coordinate-frame origin, and scale it uniformly so that it tightly fits in a unit-sized cube centered in the origin.

  • Scale up or down to the [-1,1] region
  • Move to the barycenter point

[S1] Shape Converter

Convert PLY to OFF or OFF to PLY formats to have 1 consistent collection of shapes.

[S3] Local Shape Descriptor: Distances

Create an instance of the histogram class which can calculate the follow for each shape:

  • Distance between the barycenter and a random vertex
  • Distance between 2 random vertices
  • Square root of an area of a triangle given by 3 random vertices
  • Cube root of volume of tetrahedron formed by 4 random vertices

A (large) number of random points should be used for these properties, the exact amount should be figured out through testing, so make sure we can modify a property to determine the random amount. It is best to place this value in the Settings.

[S3] Descriptor Generation

Use the variaty of methods which we made to calculate descriptors for all the shapes and store these in a seperate file for quick reloading so we don't need recalculate them all.

  • Be able to calculate descriptors
  • Make the generation automatic
  • Save the data to a seperate file
  • Load in all descriptors for shapes

[S6] Implement All Quality Metrics

Implement all quality metric. Motivate your choice and describe how you implement the respective metric based on how the query system works (you provide a query shape and number K, you get K shapes in return).

All Relevant All Irrelevant Total
True Positive False Positive All Correct
False Negative True Negative All Incorrect

Metrics

  • Accuracy: (Correct Relevant + False Irrelevant) / Total
  • Precision: Correct Relevant / All Correct
  • Recall: Correct Relevant / All Relevant
  • Specificity: Incorrect Irrelevant / All Irrelevant
  • Sensitivity: Correct Relevant / All Irrelevant

[S3] Local Shape Descriptor: Angles

Use the histogram class to create an instance which contains the angle between 3 random vertices in the shape.

A (large) number of random points should be used for these properties, the exact amount should be figured out through testing, so make sure we can modify a property to determine the random amount. It is best to place this value in the Settings.

[S3] 4 Step normalisation

Rework the normalisation processing to be a refinement operation which will:

  • Center the figure at its barycenter
  • Align the shape via the eigenvectors (Use PCA)
  • Scale the shape to fit a [-1,1] range
  • Flip the shape with the momentum test along 3 axis.

[S2] Shape simplification

The previous java file does not simplify shapes but only combine points. We need to write either our own program or find one online which reduces the amount of vertices for our shape.

[S4] Calculate average and standard deviation for all elementary descriptors

In the FeatureManager which contains all the featurevectors should these 2 methods be added and the data needs to be saved in DescriptionProperties (The ini manager).

  • Calculate Average for all vectors
  • Calculate Standard deviation for all vectors
  • Normalise all featurevectors (in particular the elementary descriptors)
    • Give decision to calculate new or get them from ini file.

[S6] Verb handling

Currently the Controller makes use of a single Options object with all the variables which can be changed, however this should be improved with special modes called: "Verbs". The Console Line Reader package has explanations about Verbs and how we can best implement it.

  • Requirement: Issue concerning caching needs to be solved.
  • New UI directory for all the console classes.
  • Verb for viewing files
  • Verb for Refining files
  • Verb for Measuring/Analysing shapes
  • Verb for Feature Extraction
  • Verb for Querying
  • Verb for Evaluation/Analysing results
  • Ensure multiple verbs can be called at the same time.

[S2] Feature Export

Export all the different features from the shapes into a seperate file such as an excel sheet. On this sheet find the:

  • Average shape in the database (in terms of size and cell types)
  • The significant outliers from the averages (very large or very small sizes)
  • Visualise these outliers and note them down

[S5] Construct A Spatial Using An ANN Library

Take the feature database (all feature vectors computed for all shapes in the database, already constructed in Step 3) and construct a spatial search structure for it. For this, use the Approximate Nearest Neighbor (ANN) library (see Pointers on Website).

[S2] Statistic measurement

Define some statistics for the shapes and extract these during the different design phases:

  • Original shapes
  • Outlier normalisation
  • Full normalisation

[S4] Convert PSB library to our standard

The Princeton Shape Library makes us of specific .cla files to determine the classification. We need to convert this classification to our map structure where each map is a class.

[S6] Report

Write in Google Drive the final report with 25 pages.

  • General layout of report
  • Task Division
  • Writing Each Chapter

[S6] Correct Caching handling

Currently the application sometimes load cache values and othertimes not. It should be improved so that it can be specified if cached data should be loaded or recalculated. Our default usage should be loading previous data.

  • Load cache variable
  • Every file should be behind this if statement
  • Correct Reading and Writing of cache data

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.