Before implementing assignment 3, be sure to go to the Resources and Code Description page for tools, data-sets, and descriptions of some of the subtleties of indexing you will need to know about.
To assist you in the implementation of the assignment, an archive of executables has been compiled, containing working implementations of the code.
To help you on your way, a starting code stub is provided for you in
SmoothS2.cpp. You will
need to implement the missing code in the main
part of the
code.
To run the code, you need to specify the input function, a smoothing parameter specifying the extent of the smoothing, and the name of the file to which the output will be written:
% SmoothS2 --in input.sgrid --smooth <smoothing value> --out output.sgrid
To implement the smoothing, you can take an approach of solving the heat equation -- obtaining a spherical function for every point in time. In this context, the smoothing value corresponds to the time step at which you grab the smoothed function from the animation.
To help you on your way, a starting code stub is provided for you in
AxialS2.cpp. You will
need to implement the missing code in the main
part of the
code.
To run the code, you need to specify the input function, and the name of the file to which axial symmetry descriptor should be written:
% AxialS2 --in input.sgrid --out output.sgrid
To implement the axial symmetry detection you will need to compute the spherical harmonic decomposition
of the function. Then, you can set the values of the axial symmetry descriptor by summing the weighted sum
of the squares of the different frequency components.
To help you on your way, a starting code stub is provided for you in
AlignS2.cpp. You will
need to implement the missing code in the main
part of the
code.
To run the code, you need to specify the source and target functions, and the name of the file to which the rotated source function should be written:
% AlignS2 --source source.sgrid --target target.sgrid --out source.transformed.sgrid
To implement the alignment, you will need to compute correlation table, giving the dot-product of the target function with every rotation of the source function. You can do this by appropriately setting the Wigner
D-coefficients in the FourierKeySO3
class and then calling the
WignerTransform::InverseFourier
method. Once you get the table, you will need to find the
index of the rotation maximizing the correlation value and set 3x3 rotation matrix corresponding to this
index.
To help you on your way, a starting code stub is provided for you in
SymmetryS2.cpp. You will
need to implement the missing code in the main
part of the
code.
To run the code, you need to specify the input function, the header for the files to which the symmetry descriptors should be written, and the types of symmetries to be computed:
% SymmetryS2 --in source.sgrid --out header [--axial] [--ref] [--rot <maxK>]
--ref
: If this flag is enabled, the function will compute the reflective symmetry
descriptor and write the output to "header.ref.sgrid".
--rot <maxK>
: If this flag is enabled, the function will compute the rotational symmetry
descriptors for k-fold symmetries in the range [2,maxK], writing the corresponding symmetry descriptors to the file "header.rot.k.sgrid".
--axial
: If this flag is enabled, the function will compute the axial symmetry
descriptor and write the output to "header.axial.sgrid".
To implement the alignment, you will need to compute correlation table, giving the dot-product of the target function with every rotation of the source function. For the rotational and axial symmetries, this will just be the array of auto-correlation values. For the reflective symmetries, you will probably want to use the values of the correlation of the function with its image under antipodal mapping.
Implementing axial symmetry detection can be done by computing the k-fold symmetry descriptor with k set to the resolution of the SphericalGrid
. Note that the results of computing the axial symmetry descriptor in this way should be (nearly) the same as the result that you get from running AxialS2