YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IFrameGrabberImageTest.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef IFRAMEGRABBERIMAGETEST_H
7#define IFRAMEGRABBERIMAGETEST_H
8
9#include <array>
11#include <catch2/catch_amalgamated.hpp>
12
13using namespace yarp::dev;
14using namespace yarp::sig;
15using namespace yarp::os;
16
17namespace yarp::dev::tests
18{
19 constexpr int default_height = 240;
20 constexpr int default_width = 320;
21 constexpr double default_hfov = 1.0;
22 constexpr double default_vfov = 2.0;
23 constexpr double default_physFocalLength = 3.0;
24 constexpr double default_focalLengthX = 4.0;
25 constexpr double default_focalLengthY = 5.0;
26 constexpr double default_principalPointX = 6.0;
27 constexpr double default_principalPointY = 7.0;
28 constexpr double default_k1 = 8.0;
29 constexpr double default_k2 = 9.0;
30 constexpr double default_k3 = 10.0;
31 constexpr double default_t1 = 11.0;
32 constexpr double default_t2 = 12.0;
33 const std::string default_distortionModel = "FishEye";
34 constexpr std::array<double, 9> default_rectificationMatrix = { 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0 };
35
36 constexpr size_t crop_h = 24;
37 constexpr size_t crop_w = 32;
38
40
42 {
43 // Check width()
44 CHECK(iframe->width() == default_width);
45
46 // Check height()
47 CHECK(iframe->height() == default_height);
48
49 // Check getImage()
51 iframe->getImage(img);
52 CHECK(img.width() == default_width);
53 CHECK(img.height() == default_height);
54
55 // Check getImageCrop()
57 CHECK(iframe->getImageCrop(YARP_CROP_RECT, vertices, crop));
58 CHECK(crop.width() == crop_w);
59 CHECK(crop.height() == crop_h);
60 }
61}
62
63#endif
@ YARP_CROP_RECT
A mini-server for performing network communication in the background.
constexpr double default_t2
constexpr std::array< double, 9 > default_rectificationMatrix
constexpr double default_t1
constexpr double default_k1
constexpr double default_hfov
constexpr double default_k2
constexpr size_t crop_w
constexpr double default_focalLengthX
constexpr double default_vfov
const std::string default_distortionModel
constexpr size_t crop_h
constexpr double default_principalPointX
constexpr double default_principalPointY
const yarp::sig::VectorOf< std::pair< int, int > > vertices
constexpr double default_k3
constexpr double default_focalLengthY
constexpr double default_physFocalLength
void exec_IFrameGrabberImage_test_1(IFrameGrabberImage *iframe)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.