51 auto j = pixel_variances.begin();
52 for (
auto pixel_coord : coordinates) {
54 SeFloat x_pos = pixel_coord.m_x - centroid_x;
55 SeFloat y_pos = pixel_coord.m_y - centroid_y;
57 x_2_error += x_pos * x_pos * variance;
58 y_2_error += y_pos * y_pos * variance;
59 x_y_error += x_pos * y_pos * variance;
61 total_variance += variance;
64 SeFloat total_intensity_2 = total_intensity * total_intensity;
65 x_2_error /= total_intensity_2;
66 y_2_error /= total_intensity_2;
67 x_y_error /= total_intensity_2;
70 total_variance *= 0.08333/total_intensity_2;
72 if (singu && (x_2_error*y_2_error-x_y_error*x_y_error)<total_variance*total_variance) {
73 x_2_error += total_variance;
74 y_2_error += total_variance;
99 SeFloat theta_error, a_error, b_error;
102 theta_error =
atan2(2.0*x_y_error, temp_error);
104 theta_error = M_PI /4.0;
107 temp_error =
sqrt(0.25*temp_error*temp_error+x_y_error*x_y_error);
108 a_error = 0.5*(x_2_error+y_2_error);
110 a_error =
sqrt(a_error+temp_error);
111 b_error =
sqrt(b_error-temp_error);