/home/liu/actions-runner/_work/ccv/ccv/test/unit/transform.tests.c
Line | Count | Source |
1 | | #include "ccv.h" |
2 | | #include "case.h" |
3 | | #include "ccv_case.h" |
4 | | |
5 | | #ifdef HAVE_LIBPNG |
6 | | TEST_CASE("matrix decimal slice") |
7 | 1 | { |
8 | 1 | ccv_dense_matrix_t* image = 0; |
9 | 1 | ccv_read("../../samples/chessbox.png", &image, CCV_IO_ANY_FILE); |
10 | 1 | ccv_dense_matrix_t* b = 0; |
11 | 1 | ccv_decimal_slice(image, &b, 0, 33.5, 41.5, 111, 91); |
12 | 1 | REQUIRE_MATRIX_FILE_EQ(b, "data/chessbox.decimal.slice.bin", "should have data/chessbox.png sliced at (33.5, 41.5) with 111 x 91"); |
13 | 1 | ccv_matrix_free(image); |
14 | 1 | ccv_matrix_free(b); |
15 | 1 | } |
16 | | |
17 | | TEST_CASE("matrix perspective transform") |
18 | 1 | { |
19 | 1 | ccv_dense_matrix_t* image = 0; |
20 | 1 | ccv_read("../../samples/chessbox.png", &image, CCV_IO_ANY_FILE); |
21 | 1 | ccv_dense_matrix_t* b = 0; |
22 | 1 | ccv_perspective_transform(image, &b, 0, cosf(CCV_PI / 6), 0, 0, 0, 1, 0, -sinf(CCV_PI / 6), 0, cosf(CCV_PI / 6)); |
23 | 1 | REQUIRE_MATRIX_FILE_EQ(b, "data/chessbox.perspective.transform.bin", "should have data/chessbox.png rotated along y-axis for 30"); |
24 | 1 | ccv_matrix_free(image); |
25 | 1 | ccv_matrix_free(b); |
26 | 1 | } |
27 | | #endif |
28 | | |
29 | | #include "case_main.h" |