module: normals.models

class normals.models.ShapeRectifiedNormalLabel(*args, **kwargs)

Bases: shapes.models.MaterialShapeLabelBase

Surface normal obtained by rectifying a material.

The normal is described by a 4x4 uvnb matrix. The top-left uvn matrix is a 3x3 rotation matrix (two vectors uv in the plane and surface normal n), and the rightmost b column is the origin of the plane.

METHODS = (('T', 'continuous normal (thumbtack)'), ('G', 'continuous normal (grid)'), ('V', 'vanishing point'), ('O', 'VP (object name)'), ('A', 'VP (edges in shape)'), ('S', 'VP'))

which method was used to create this normal

angle_degrees(other)

Returns the angle with another normal

automatic = None

if true, this was estimated automatically using vanishing points

axes_svg_path()

Return the SVG path for rendering the two axes

better_than(other)

Return True if self is a better surface normal than other. If the surface normal is determined by vanishing points, it is considered better. Otherwise, the CUBAM score (correct_score) from quality voting is used.

canvas_height = None

height of the kinetic.js canvas (only the portion used)

canvas_width = None

width of the kinetic.js canvas (only the portion used)

correct = None

if true, enough users voted this to be a correct rectification

correct_score = None

further from 0: more confident in assignment of correct

disc_svg_path(nsamples=32)

Return the SVG path for rendering the disc

focal_pixels = None

focal length used to project points

get_entry_dict()
get_method_display(*moreargs, **morekwargs)
get_next_by_added(*moreargs, **morekwargs)
get_previous_by_added(*moreargs, **morekwargs)
get_quality_method_display(*moreargs, **morekwargs)
get_thumb_template()
grid_svg_path(nsamples=32)

Return the SVG path for rendering a grid

image_rectified

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

image_rectified_1024 = <imagekit.models.fields.ImageSpecField object at 0x631abd0>
image_rectified_square_300 = <imagekit.models.fields.ImageSpecField object at 0x631ac50>
image_rectified_square_512 = <imagekit.models.fields.ImageSpecField object at 0x631a910>
mark_invalid(*args, **kwargs)
materialshape_set
method_str()
method_to_str = {'A': 'VP (edges in shape)', 'G': 'continuous normal (grid)', 'O': 'VP (object name)', 'S': 'VP', 'T': 'continuous normal (thumbtack)', 'V': 'vanishing point'}
mturk_assignment
static mturk_submit(user, hit_contents, results, time_ms, time_active_ms, version, mturk_assignment=None, **kwargs)

Add new instances from a mturk HIT after the user clicks [submit]

n()

Returns the normal vector (3rd column of uvnb matrix)

num_vanishing_lines = None

number of vanishing lines contained in the shape when estimating vanishing points

orthogonalize(save=True)

Adjusts the uvnb matrix to be orthogonal

phi_degrees()
pin_svg_path()

Return the SVG path for rendering the pin

pos_x = None

x position / width (place that the user was shown to measure)

pos_y = None

y position / height (place that the user was shown to measure)

proj_matrix()

Returns the disc –> image transform as a numpy matrix. Input domain: disc plane. Output domain: [0,1]x[0,1] image.

qualities
save(*args, **kwargs)
shape
u()

Returns the horizontal vector (1st column of uvnb matrix)

user
uvnb = None

4x4 matrix in column major order, stored as a json array. columns: u axis, v axis, normal, 3d point on plane (b).

[ 0 4  8 12 ] corresponds to [ u v n b ]
[ 1 5  9 13 ]
[ 2 6 10 14 ]
[ 3 7 11 15 ]
uvnb_numpy()

Return the uvnb matrix as a numpy matrix

class normals.models.ShapeRectifiedNormalQuality(*args, **kwargs)

Bases: common.models.ResultBase

Vote on whether or not a rectified normal label matches

get_next_by_added(*moreargs, **morekwargs)
get_previous_by_added(*moreargs, **morekwargs)
get_quality_method_display(*moreargs, **morekwargs)
get_thumb_template()
mturk_assignment
static mturk_submit(user, hit_contents, results, time_ms, time_active_ms, version, mturk_assignment=None, **kwargs)

Add new instances from a mturk HIT after the user clicks [submit]

rectified_normal
user