24 #include "testing/testing.h"
30 void PreformSinglePointTest(
const DetectOptions&
options) {
42 if (detected_features.size() == 1) {
43 Feature& feature = detected_features[0];
50 void PreformCheckerBoardTest(
const DetectOptions &
options) {
53 for (
int y = 0;
y <
image.Height(); ++
y) {
54 for (
int x = 0;
x <
image.Width(); ++
x) {
55 image(
y,
x) = (
x / 10 +
y / 10) % 2 ? 1.0 : 0.0;
76 for (
int i = 0; i < detected_features.size(); ++i) {
77 Feature &feature = detected_features[i];
78 int rounded_x = ((feature.x + 1) / 10) * 10,
79 rounded_y = ((feature.y + 1) / 10) * 10;
80 EXPECT_LE(1,
std::abs(feature.x - rounded_x));
81 EXPECT_LE(1,
std::abs(feature.y - rounded_y));
88 EXPECT_EQ(expected_features.size(), detected_features.size());
93 if (expected_features.size() != detected_features.size()) {
97 for (
int i = 0; i < expected_features.size(); ++i) {
98 const Feature& extected_feature = expected_features[i];
100 for (
int j = 0; j < detected_features.size(); ++j) {
101 const Feature& detected_feature = detected_features[j];
102 if (extected_feature.x == detected_feature.x &&
103 extected_feature.y == detected_feature.y) {
112 void PreformSingleTriangleTest(
const DetectOptions&
options) {
117 int vertex_x = 10, vertex_y = 5;
118 for (
int i = 0; i < 6; ++i) {
119 int current_x = vertex_x - i, current_y = vertex_y + i;
120 for (
int j = 0; j < i * 2 + 1; ++j, ++current_x) {
121 image(current_y, current_x) = 0.0;
131 expected_features.push_back(Feature(6, 10));
132 expected_features.push_back(Feature(14, 10));
133 expected_features.push_back(Feature(10, 6));
135 CheckExpectedFeatures(detected_features, expected_features);
140 #ifndef LIBMV_NO_FAST_DETECTOR
145 options.fast_min_trackness = 1;
147 PreformSinglePointTest(
options);
157 options.fast_min_trackness = 1;
159 PreformCheckerBoardTest(
options);
170 options.fast_min_trackness = 2;
172 PreformSingleTriangleTest(
options);
187 options.moravec_max_count = 10;
189 PreformSinglePointTest(
options);
197 options.moravec_max_count = 10;
199 PreformCheckerBoardTest(
options);
213 PreformSinglePointTest(
options);
224 PreformSingleTriangleTest(
options);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
CCL_NAMESPACE_BEGIN struct Options options
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void Detect(const FloatImage &image, const DetectOptions &options, vector< Feature > *detected_features)
TEST(PolynomialCameraIntrinsics2, ApplyOnFocalCenter)