aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/ThreadJoggingResponse.pb-c.c
blob: 23fb288ceb7143ef3d7dc7553964afbc30eccf29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: ThreadJoggingResponse.proto */

/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif

#include "ThreadJoggingResponse.pb-c.h"
void   thread_jogging_response__init
                     (ThreadJoggingResponse         *message)
{
  static const ThreadJoggingResponse init_value = THREAD_JOGGING_RESPONSE__INIT;
  *message = init_value;
}
size_t thread_jogging_response__get_packed_size
                     (const ThreadJoggingResponse *message)
{
  assert(message->base.descriptor == &thread_jogging_response__descriptor);
  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t thread_jogging_response__pack
                     (const ThreadJoggingResponse *message,
                      uint8_t       *out)
{
  assert(message->base.descriptor == &thread_jogging_response__descriptor);
  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t thread_jogging_response__pack_to_buffer
                     (const ThreadJoggingResponse *message,
                      ProtobufCBuffer *buffer)
{
  assert(message->base.descriptor == &thread_jogging_response__descriptor);
  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
ThreadJoggingResponse *
       thread_jogging_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data)
{
  return (ThreadJoggingResponse *)
     protobuf_c_message_unpack (&thread_jogging_response__descriptor,
                                allocator, len, data);
}
void   thread_jogging_response__free_unpacked
                     (ThreadJoggingResponse *message,
                      ProtobufCAllocator *allocator)
{
  if(!message)
    return;
  assert(message->base.descriptor == &thread_jogging_response__descriptor);
  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
#define thread_jogging_response__field_descriptors NULL
#define thread_jogging_response__field_indices_by_name NULL
#define thread_jogging_response__number_ranges NULL
const ProtobufCMessageDescriptor thread_jogging_response__descriptor =
{
  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
  "",
  "",
  "",
  "",
  sizeof(ThreadJoggingResponse),
  0,
  thread_jogging_response__field_descriptors,
  thread_jogging_response__field_indices_by_name,
  0,  thread_jogging_response__number_ranges,
  (ProtobufCMessageInit) thread_jogging_response__init,
  NULL,NULL,NULL    /* reserved[123] */
};
paused; static bool selectObjects = false; static bool startSelection = false; Rect2d boundingBox; static const char* keys = { "{@dataset_path || Dataset path }" "{@dataset_id |1| Dataset ID }" }; static void onMouse(int event, int x, int y, int, void*) { if (!selectObjects) { switch (event) { case EVENT_LBUTTONDOWN: //set origin of the bounding box startSelection = true; boundingBox.x = x; boundingBox.y = y; boundingBox.width = boundingBox.height = 0; break; case EVENT_LBUTTONUP: //sei with and height of the bounding box boundingBox.width = std::abs(x - boundingBox.x); boundingBox.height = std::abs(y - boundingBox.y); paused = false; selectObjects = true; startSelection = false; break; case EVENT_MOUSEMOVE: if (startSelection && !selectObjects) { //draw the bounding box Mat currentFrame; image.copyTo(currentFrame); rectangle(currentFrame, Point((int)boundingBox.x, (int)boundingBox.y), Point(x, y), Scalar(255, 0, 0), 2, 1); imshow("GOTURN Tracking", currentFrame); } break; } } } static void help() { cout << "\nThis example is a simple demo of GOTURN tracking on ALOV300++ dataset" "ALOV dataset contains videos with ID range: 1~314\n" "-- pause video [p] and draw a bounding boxes around the targets to start the tracker\n" "Example:\n" "./goturnTracker <dataset_path> <dataset_id>\n" << endl; cout << "\n\nHot keys: \n" "\tq - quit the program\n" "\tp - pause video\n"; } int main(int argc, char *argv[]) { CommandLineParser parser(argc, argv, keys); string datasetRootPath = parser.get<string>(0); int datasetID = parser.get<int>(1); if (datasetRootPath.empty()) { help(); return -1; } Mat frame; paused = false; namedWindow("GOTURN Tracking", 0); setMouseCallback("GOTURN Tracking", onMouse, 0); //Create GOTURN tracker Ptr<Tracker> tracker = TrackerGOTURN::create(); //Load and init full ALOV300++ dataset with a given datasetID, as alternative you can use loadAnnotatedOnly(..) //to load only frames with labled ground truth ~ every 5-th frame Ptr<cv::datasets::TRACK_alov> dataset = TRACK_alov::create(); dataset->load(datasetRootPath); dataset->initDataset(datasetID); //Read first frame dataset->getNextFrame(frame); if (frame.empty()) { cout << "invalid dataset: " << datasetRootPath << endl; return -2; } frame.copyTo(image); rectangle(image, boundingBox, Scalar(255, 0, 0), 2, 1); imshow("GOTURN Tracking", image); bool initialized = false; paused = true; int frameCounter = 0; //Time measurment int64 e3 = getTickCount(); for (;;) { if (!paused) { //Time measurment int64 e1 = getTickCount(); if (initialized){ if (!dataset->getNextFrame(frame)) break; frame.copyTo(image); } if (!initialized && selectObjects) { //Initialize the tracker and add targets if (!tracker->init(frame, boundingBox)) { cout << "Tracker Init Error!!!"; return 0; } rectangle(frame, boundingBox, Scalar(0, 0, 255), 2, 1); initialized = true; } else if (initialized) { //Update all targets if (tracker->update(frame, boundingBox)) { rectangle(frame, boundingBox, Scalar(0, 0, 255), 2, 1); } } imshow("GOTURN Tracking", frame); frameCounter++; //Time measurment int64 e2 = getTickCount(); double t1 = (e2 - e1) / getTickFrequency(); cout << frameCounter << "\tframe : " << t1 * 1000.0 << "ms" << endl; } char c = (char)waitKey(2); if (c == 'q') break; if (c == 'p') paused = !paused; } //Time measurment int64 e4 = getTickCount(); double t2 = (e4 - e3) / getTickFrequency(); cout << "Average Time for Frame: " << t2 * 1000.0 / frameCounter << "ms" << endl; cout << "Average FPS: " << 1.0 / t2*frameCounter << endl; waitKey(0); return 0; } #else // ! HAVE_OPENCV_DNN && HAVE_OPENCV_DATASETS #include <opencv2/core.hpp> int main() { CV_Error(cv::Error::StsNotImplemented , "this sample needs to be built with opencv_datasets and opencv_dnn !"); return -1; } #endif