46 #include <Base/Image/Image.hh>
47 #include <Base/Image/ImageIO.hh>
48 #include <Base/ImageUtils/ImageDraw.hh>
50 #include <Base/Geometry/HomgPoint2D.hh>
51 #include <Base/Geometry/HomgPoint3D.hh>
52 #include <Geometry/RMatrix.hh>
59 int main(
int argc,
char** argv) {
62 unsigned int steps = 90;
67 unsigned char bgCol[] = {127, 0, 127};
69 std::vector<unsigned char> red, green, blue, white, gray, none;
86 HomgPoint2D clockCenter(image.GetWidth() / 2, image.GetHeight() / 2);
87 HomgPoint2D clockOuter(image.GetWidth() / 2, image.GetHeight() / 4);
94 HomgPoint2D staticEnd(image.GetWidth() - 10, image.GetHeight() / 8 + 2);
95 HomgPoint2D clippedStart(image.GetWidth() / 2, image.GetHeight() + 20);
96 HomgPoint2D clippedEnd(image.GetWidth() + 20, image.GetHeight() / 2);
97 HomgPoint2D clippedStart2(image.GetWidth() / 2, image.GetHeight() * 2 / 3);
98 HomgPoint2D clippedEnd2(image.GetWidth() + 20, image.GetHeight() * 2 / 3);
100 HomgPoint2D crossedEnd(image.GetWidth(), image.GetHeight());
102 float angle = 2.0f * float(M_PI) / float(steps);
104 ostringstream filename;
106 for (
unsigned int i = 0; i < steps; i++) {
107 cout << endl << endl <<
"step: " << (i + 1) <<
"/" << steps << endl;
110 image.GetROI()->UnsetROI();
111 image.FillImageWithConstValue(bgCol);
112 image.SetROICorners(0, 0, image.GetWidth() - 50, image.GetHeight() - 50);
115 filename <<
"clock_";
122 filename << i <<
".mip";
127 unsigned char col[] = {255, 255, 255};
129 image.GetWidth() / 2,
130 image.GetHeight() / 2,
140 clockOuterRunner[0] = clockOuter[0];
141 clockOuterRunner[1] = clockOuter[1];
144 clockOuterRunner[0] -= clockCenter[0];
145 clockOuterRunner[1] -= clockCenter[1];
151 R.
SetXYZ(0.0, 0.0, i * angle);
153 clockOuterRunner[0] = p3D2[0];
154 clockOuterRunner[1] = p3D2[1];
157 clockOuterRunner[0] += clockCenter[0];
158 clockOuterRunner[1] += clockCenter[1];
170 moveStartRunner[0] = moveStart[0];
171 moveStartRunner[0] += (HOMGPOINT2D_TYPE)i / (HOMGPOINT2D_TYPE)steps;
172 moveStartRunner[1] = moveStart[1] + i / steps;
173 moveStartRunner[1] += (HOMGPOINT2D_TYPE)i / (HOMGPOINT2D_TYPE)steps;
175 moveEndRunner[0] = moveEnd[0] + i / steps;
176 moveEndRunner[0] += (HOMGPOINT2D_TYPE)i / (HOMGPOINT2D_TYPE)steps;
177 moveEndRunner[1] = moveEnd[1] + i / steps;
178 moveEndRunner[1] += (HOMGPOINT2D_TYPE)i / (HOMGPOINT2D_TYPE)steps;
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
void SetXYZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY, ROTATION_MATRIX_TYPE PhiZ)
Set Euler angles (in rad) in order XYZ.
static int CircleCenterFilled(Image< StorageType > &im, unsigned int CenterX, unsigned int CenterY, unsigned int Radius, const StorageType Value[])
draws a filled circle using Value
void Mult(const Vector3< T > &argvec, Vector3< T > &destvec) const
matrix - vector multiplicate this matrix with Vector3, storing the result in destvec calculates: dest...
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
class Vector3 contains a Vector of fixed dim.