Commit 52d6f660 authored by karius's avatar karius

further towards a complete quadrature

parent fe8e826f
This diff is collapsed.
......@@ -52,9 +52,9 @@ class TransformationGrid{
public:
__device__ static void d_euler_to_quat(const float3 &euler,float4 &quat);
__host__ static void h_euler_to_quat(const float3 &euler,float4 &quat);
__host__ static void h_quat_to_euler(const float4 & rotations_quat,float3 &rotations_euler);
__host__ static void h_quat_to_euler(const float4 & rotations_quat,float3* const& euler);
__host__ static void h_matrix_to_quat(float * const& m,float4 & quaternion);
__host__ static void read_matrix_SO3_sampling(const char * file_name,float4 *& h_rotations, uint *& h_num_rotations);
__host__ static void read_matrix_SO3_sampling(const char * file_name,float4 *& h_rotations, float3 *& h_rotations_euler, uint *& h_num_rotations);
__host__ static void shift_and_scale_envelope_score(float * d_score, float * d_normalized_score,float *d_min, float *d_max, size_t num_scores);
__host__ static void shift_and_scale_chamfer_score(float * d_score, float * d_normalized_score,float *d_min, float *d_max, size_t num_scores);
TransformationGrid(const std::pair<float3,float3> bounding_box, const float tau, float * const& translation_offset);
......@@ -73,11 +73,14 @@ public:
float4 * h_translation_offset;
float4 * d_translation_offset;
float4 * h_rotations;
float3 * h_rotations_euler;
float4 * d_rotations;
float * h_chebychev_nodes;
float * d_chebychev_nodes;
float * h_chebychev_weights;
float * d_chebychev_weights;
// float * h_tmp_rot_quadrature_scores;
float * d_tmp_rot_quadrature_scores;
float * h_scores;
float * d_scores;
uint * h_num_transformations;
......@@ -92,6 +95,7 @@ public:
__host__ void refine_translation_grid(uint & i, float * h_translation);
__host__ void calculate_current_chebychev_nodes(void);
__host__ void gaussian(void);
__host__ void quadrature_test_function(void);
__host__ void quadrature(float* const &result);
__host__ void print_quadrature_weights(void);
__host__ void print_quadrature_nodes(void);
......
No preview for this file type
......@@ -635,10 +635,10 @@ BOOST_AUTO_TEST_CASE(translational_quadrature)
float tau = 0.1;
float * quadrature_result = (float *) malloc(sizeof(*quadrature_result));
TransformationGrid transformation_grid(effective_translational_shift,tau,&trans_offset[0]);
transformation_grid.gaussian();
transformation_grid.quadrature_test_function();
transformation_grid.quadrature(quadrature_result);
CudaCheckError();
transformation_grid.print_quadrature_nodes();
// transformation_grid.print_quadrature_nodes();
printf("Transformation num: %u\n",transformation_grid.h_num_transformations[0]);
printf("Translation num: %u\n",transformation_grid.h_num_translations[0]);
printf("Rotation num: %u\n",transformation_grid.h_num_rotations[0]);
......
9
4
1. 0 0 0 1. 0 0 0 1.
1. 0 0 0 -1. 0 0 0 -1.
-1. 0 0 0 1. 0 0 0 -1.
-1. 0 0 0 -1. 0 0 0 1.
9
57
0.018677892262 0.99415106377 0.10637104284 -0.86156069083 -0.037978419027 0.50623197816 0.50731086364 -0.1011004555 0.85581212046
0.078805566248 -0.92421341407 0.37365659097 0.2024017931 0.38184911538 0.90178975778 -0.97612662953 0.0045627115192 0.21715428798
0.52119723798 0.67993638109 0.51579061333 -0.6899798126 0.69140199004 -0.21422218927 -0.50227611662 -0.24423309736 0.82949918434
-0.026122271804 0.95990448679 -0.27910751181 -0.78313991037 -0.19317752072 -0.59107895096 -0.62129663423 0.20313990677 0.75678574945
0.35153968475 -0.13074528695 -0.92699812297 0.31314887963 0.94958276761 -0.015177175295 0.88224578731 -0.2849530442 0.3747587669
0.78206462224 0.60602842234 -0.14527380344 0.40411206406 -0.67061529533 -0.62206797487 -0.47441370799 0.42779045921 -0.76936789423
0.47905579875 -0.85395164092 -0.2031554495 0.87664975473 0.45368229429 0.16017984695 -0.04461781272 -0.25483125951 0.96595563043
0.89687996942 -0.21028314093 0.38908523627 -0.11361845607 0.74066498316 0.66219802866 -0.42743089136 -0.63811941152 0.64039554164
0.23784311078 0.88555799433 0.39902091842 0.21493593625 0.35264015187 -0.91074006533 -0.94722394288 0.30237718493 -0.10646520591
-0.51192895885 -0.72518721113 -0.46046959716 0.82319263079 -0.56734814058 -0.021679022165 -0.24552522012 -0.39015329833 0.88741071105
-0.4662613046 0.86495227546 -0.18562854577 0.5784822516 0.13935289964 -0.80370333703 -0.66929715405 -0.48211858555 -0.56533440462
-0.77306080632 -0.061728054258 -0.63132134215 0.027526197213 0.99105199578 -0.13060723609 0.63373440667 -0.11834521101 -0.76444431637
-0.83251279517 0.36266190389 -0.41880638647 0.10199491643 -0.64270565311 -0.7592934087 -0.54453602534 -0.67483760042 0.49807100916
0.98387495717 -0.16067055657 0.078581428445 -0.14035698022 -0.42125700934 0.89601476002 -0.11086021265 -0.89259593564 -0.43701545616
0.022194667395 0.15052506786 0.98835702086 0.86248155355 0.49707831759 -0.095072161897 -0.50560158872 0.85454979383 -0.11879260645
-0.48062695212 0.58342491192 0.65468550087 0.11658870015 -0.6974284876 0.70710719108 0.8691402694 0.41618370563 0.2671821762
0.35792705261 -0.92452145405 0.13095154074 0.57049340765 0.10549806085 -0.81449826948 0.7392059908 0.36623795566 0.56519400474
-0.93833766137 -0.25141727288 0.23730104961 -0.32657448886 0.41934490553 -0.84705309954 0.11345279404 -0.87231829346 -0.47559358535
-0.79286136347 -0.36368669481 -0.48898143762 0.041260245768 -0.83259097402 0.55234940219 -0.60800365988 0.41776100584 0.67513501728
-0.59741912357 -0.3982317789 0.6960616647 0.58092559546 -0.81327489543 0.033307611859 0.55282532805 0.42425864133 0.71720900854
-0.34592542786 -0.67031535618 0.65651574363 0.89606079622 -0.028531091368 0.44301357351 -0.27822769065 0.74152767993 0.61051294176
0.12765100137 0.43232030715 -0.89263899415 -0.35938012738 -0.81868018123 -0.4478936089 -0.92441935608 0.37797078311 0.050861982113
0.73229665636 -0.55041336393 -0.40098221394 -0.62288123372 -0.30338717617 -0.72109305226 0.27524639102 0.77781832721 -0.56501156987
0.82291080539 0.23992446989 -0.51502820808 -0.37249421768 0.9122977477 -0.17017895681 0.42902897823 0.33188713186 0.84011015203
-0.62435004508 0.75479775057 0.20116504904 0.77165252398 0.63598544693 0.008654104719 -0.12140594484 0.1606327085 -0.97951913178
-0.36042226697 0.66882045561 -0.65021149453 -0.3516740638 0.54819342665 0.75882100645 0.8639566785 0.50215850599 0.037625690008
-0.0073320922623 0.30472591047 0.95241186464 -0.91756930258 -0.38066215105 0.11472968978 0.39750825826 -0.87306268174 0.28239819116
0.2825231553 0.63145246836 0.72211387393 0.9031835063 -0.42871467989 0.021523875087 0.32317212236 0.6461203475 -0.69143927852
-0.024541002974 0.90706989952 -0.42026412715 0.5727290232 0.3573192769 0.73776988305 0.81937732771 -0.22259185013 -0.52827423096
-0.18822339761 -0.95912947689 0.21128795319 -0.84357837265 0.047717329947 -0.53488184267 0.50293884498 -0.27891522546 -0.81808240124
0.57526443101 -0.14055147538 -0.8058015371 0.81654461503 0.15675698072 0.5555917032 0.048225782419 -0.97758505091 0.20494326567
0.58474733214 -0.30103033136 0.75329363276 0.56433588534 -0.51611851671 -0.64431877609 0.58274828706 0.80187431453 -0.13191670716
-0.86349799945 -0.50256544778 0.042416690684 -0.095179097437 0.244968323 0.96484789482 -0.49528995988 0.82910704461 -0.25936338256
0.77621108458 0.62229158479 -0.10123999048 -0.18938314425 0.38329674437 0.90400090179 0.60135711258 -0.68252237272 0.41537071863
0.13083000709 -0.79671047554 -0.59003044618 -0.27777651744 0.54185004625 -0.7932456957 0.95169517998 0.26767694251 -0.15041721591
0.27813495133 -0.38378144661 0.88054116888 -0.91815640134 0.16308715765 0.36109749609 -0.28218747584 -0.90890834535 -0.30701115327
-0.62398697625 -0.69688622074 -0.35353903436 0.51599855854 -0.027690090216 -0.85614177943 0.58684388133 -0.71664695231 0.37687054104
-0.84816133125 0.40556957028 0.34078685396 0.44348927085 0.19179250848 0.87551864648 0.28972335564 0.89371637411 -0.34253674232
0.30667867017 -0.77522773654 -0.55224102506 0.18849655631 -0.51924091894 0.83358137957 -0.93296154343 -0.35973716045 -0.013112355824
0.22632393146 0.28849580059 -0.93034813435 -0.96136184779 0.21983448037 -0.16569912148 0.15671909797 0.93190287814 0.3271026598
0.031029613893 -0.53881816027 -0.841850434 -0.75973152284 -0.56001997066 0.33043251301 -0.64949609411 0.62932711894 -0.4267343449
0.83860433474 -0.24321839345 0.48742956706 0.457162984 0.80079434621 -0.3869501533 -0.29621744685 0.54733283126 0.78274005648
-0.48241610045 -0.54276998227 0.68751396523 -0.20908791196 -0.69084303026 -0.69211137298 0.85062150872 -0.47763652906 0.21978715841
-0.088440679206 -0.049237582758 0.99486376289 -0.091977075393 0.99491406743 0.041063560898 -0.99182582335 -0.087872970108 -0.092519604737
-0.88199311297 0.37321265953 0.28775068973 -0.44697443326 -0.85598125381 -0.25982676754 0.14933855725 -0.357782621 0.92178608767
-0.54791113832 -0.42515874117 -0.72043974717 -0.79238356249 0.53986537358 0.28403110445 0.26818216643 0.72648841918 -0.63268704934
0.53921306113 0.76158449243 -0.3594973374 0.83984322409 -0.45456511794 0.2967050935 0.06255104846 -0.46190866461 -0.88471902427
0.10306123426 0.16429195873 -0.98101301433 0.61246626978 -0.78760456143 -0.067558294768 -0.78374960949 -0.59387474025 -0.18179478133
0.54007710531 -0.41525199112 0.73203996078 -0.34112277702 -0.90315939175 -0.26064988796 0.76938415068 -0.10894446732 -0.62942762231
0.97142575279 0.22569742022 -0.073434878064 -0.10952724185 0.15179938414 -0.98232414725 -0.21056065659 0.96229809388 0.17218184694
-0.017362181898 -0.98816811394 0.15238875691 -0.87226346625 0.089468823507 0.48078246128 -0.48872794077 -0.12457571277 -0.86349631829
0.48878167013 0.59873911158 0.63451079992 0.012152462769 -0.73191350359 0.68128917569 0.87232149842 -0.32529079226 -0.36502205943
-0.5707571317 0.47883914616 0.66704525237 -0.60342543968 0.306341698 -0.73622856696 -0.55687883364 -0.82271977986 0.11409701344
-0.46754540195 0.16250664486 -0.86890326705 0.84852556741 0.35805672308 -0.38961486691 0.24780165166 -0.91944927725 -0.30529881755
0.92979982866 -0.3146692852 -0.19093328568 -0.29880977614 -0.9482271222 0.10760131226 -0.21490694803 -0.042994949349 -0.97568767442
-0.79368066353 0.41583189171 -0.44402121815 -0.60772018176 -0.50918177295 0.60943424811 0.027334685182 0.75353683382 0.65683716023
-0.85994703902 -0.22477386805 0.45822243324 -0.19914710012 0.97440962214 0.10424164618 -0.46992714605 -0.0016113738128 -0.88270373335
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment