cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
harris_host.cpp
Go to the documentation of this file.
1 
17 
33 #include <stdio.h>
34 #include <iostream> // For cout and cerr
35 #include <cstdlib> // For atoi()
36 #include <assert.h> // For assert()
37 #include <string> // For to_string
38 #include <string.h> // For memcpy()
39 #include "../../../../../PracticalSockets/src/PracticalSockets.h" // For UDPSocket and SocketException
40 #include "../include/config.h"
41 
42 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
43 #include "opencv2/opencv.hpp"
44 #include "../../../../../../ROLE/vision/hls/harris/include/xf_ocv_ref.hpp" // For SW reference Harris from OpenCV
45 using namespace cv;
46 #endif
47 
48 using namespace std;
49 
50 
51 void delay(unsigned int mseconds)
52 {
53  clock_t goal = mseconds + clock();
54  while (goal > clock());
55 }
56 
57 void print_cFpZoo(void)
58 {
59  cout << " " << endl;
60  cout << "...build with: " << endl;
61  cout << " ██████╗███████╗██████╗ ███████╗ ██████╗ ██████╗ " << endl;
62  cout << "██╔════╝██╔════╝██╔══██╗ ╚══███╔╝██╔═══██╗██╔═══██╗ " << endl;
63  cout << "██║ █████╗ ██████╔╝ ███╔╝ ██║ ██║██║ ██║ " << endl;
64  cout << "██║ ██╔══╝ ██╔═══╝ ███╔╝ ██║ ██║██║ ██║ " << endl;
65  cout << "╚██████╗██║ ██║███████╗███████╗╚██████╔╝╚██████╔╝ " << endl;
66  cout << " ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ " << endl;
67  cout << "A cloudFPGA project from IBM ZRL v1.0 " << endl;
68  cout << "Quantitative Finance Monte-Carlo European Pricing Engine " << endl;
69 }
70 
71 
82 void resizeCropSquare(const cv::Mat &input, const cv::Mat &output, const cv::Size &dstSize, int interpolation = INTER_LINEAR)
83 {
84  int h = input.rows;
85  int w = input.cols;
86  int min_size = min(h, w);
87  int x = w/2-min_size/2;
88  int y = h/2-min_size/2;
89  // printf("w=%d, h=%d, min_size=%d, x=%d, y=%d, width=%d, height=%d\n", w, h, min_size, x, y, width, height);
90  cv::Mat crop_img = input(Rect(x, y, min_size, min_size));
91  resize(crop_img, output, Size(dstSize.width, dstSize.height), 0, 0, interpolation);
92 }
93 
94 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
95 
96 
101 void markPointsOnImage(Mat& imgOutput,
102  Mat& in_img,
103  Mat& out_img,
104  vector<Point>& hw_points)
105 {
106 
107  for (int j = 0; j < imgOutput.rows; j++) {
108  for (int i = 0; i < (imgOutput.cols); i++) {
109  //for CV_8UC1
110  unsigned char pix = imgOutput.at<unsigned char>(j,i); //.read(j * (imgOutput.cols) + i);
111  if (pix != 0) {
112  Point tmp;
113  tmp.x = i;
114  tmp.y = j;
115  if ((tmp.x < in_img.cols) && (tmp.y < in_img.rows) && (j > 0)) {
116  hw_points.push_back(tmp);
117  }
118  short int y, x;
119  y = j;
120  x = i;
121  if (j > 0) circle(out_img, Point(x, y), 2, Scalar(0, 0, 255, 255), 1, 8, 0);
122  }
123  }
124  }
125 }
126 
127 #endif
128 
129 #ifdef PY_WRAP
130 #if PY_WRAP == PY_WRAP_HARRIS_FILENAME
131 void harris(char *s_servAddress, char *s_servPort, char *input_str, char *output_img_str, char *output_points_str)
132 #elif PY_WRAP == PY_WRAP_HARRIS_NUMPI
133 void harris(int total_size, unsigned char *input_img, int total_size2, unsigned char *output_img, char *s_servAddress, char *s_servPort)
134 #endif // PY_WRAP value
135 {
136 #else // !PY_WRAP
141 int main(int argc, char * argv[]) {
142  if ((argc < 3) || (argc > 4)) { // Test for correct number of arguments
143  cerr << "Usage: " << argv[0] << " <Server> <Server Port> <optional input image>\n";
144  exit(1);
145  }
146 #endif // PY_WRAP
147 
148  //------------------------------------------------------
149  //-- STEP-1 : Socket and variables definition
150  //------------------------------------------------------
151 
152  #ifndef PY_WRAP
153  assert ((argc == 3) || (argc == 4));
154  string s_servAddress = argv[1]; // First arg: server address
155  char *s_servPort = argv[2];
156  #endif
157 
158  string servAddress = s_servAddress;
159  unsigned short servPort;
160  bool net_type = NET_TYPE;
161  if (net_type == udp) {
162  servPort = Socket::resolveService(s_servPort, "udp");
163  }
164  else if (net_type == tcp) {
165  servPort = atoi(s_servPort);
166  }
167  else {
168  cout << "ERROR: Invalid type of socket type provided: " << net_type << " Choosed one of (tcp=0 or udp=1)" << endl;
169  }
170 
171  unsigned char buffer[BUF_LEN]; // Buffer for echo string
172  unsigned int recvMsgSize; // Size of received message
173  string input_string;
174 #ifdef INPUT_FROM_CAMERA
175  int input_num;
176 #ifdef PY_WRAP
177 #if PY_WRAP == PY_WRAP_HARRIS_FILENAME
178  input_num = atoi(input_str);
179  input_string = "./cam"+to_string(input_num);
180 #endif // PY_WRAP == PY_WRAP_HARRIS_FILENAME
181 #else // !PY_WRAP
182  if (argc == 3) {
183  input_num = 0;
184  }
185  else if (argc == 4) {
186  input_num = atoi(argv[3]);
187  }
188  input_string = "./cam"+to_string(input_num);
189 #endif // PY_WRAP
190 #else // !INPUT_FROM_CAMERA
191 #ifdef PY_WRAP
192 #if PY_WRAP == PY_WRAP_HARRIS_FILENAME
193  input_string.assign(input_str);
194 #endif // PY_WRAP == PY_WRAP_HARRIS_FILENAME
195 #else // !PY_WRAP
196  if (argc == 3) {
197  // Give a default image
198  input_string.assign("../../../../../../ROLE/vision/hls/harris/test/8x8.png");
199  }
200  else if (argc == 4) {
201  input_string.assign(argv[3]);
202  }
203 #endif // PY_WRAP
204 #endif // INPUT_FROM_CAMERA
205 
206 
207 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
208 
209 
210  float Th;
211  if (FILTER_WIDTH == 3) {
212  Th = 30532960.00;
213  } else if (FILTER_WIDTH == 5) {
214  Th = 902753878016.0;
215  } else if (FILTER_WIDTH == 7) {
216  Th = 41151168289701888.000000;
217  }
218  string out_img_file, out_points_file;
219  string out_video_file, out_video_points_file;
220  // Define the codec and create VideoWriter object.The output is stored in 'outcpp.avi' file.
221  //#ifdef PY_WRAP
222  //out_video_file.assign(output_str);
223  //#else // !PY_WRAP
224  out_video_file.assign(input_string);
225  out_video_file += "_fpga_video_out.avi";
226  out_video_points_file.assign(input_string);
227  out_video_points_file += "_fpga_video_points_out.avi";
228  //#endif // PY_WRAP
229 #if CV_MAJOR_VERSION < 4
230  VideoWriter video(out_video_file,CV_FOURCC('M','J','P','G'),10, Size(FRAME_WIDTH,FRAME_HEIGHT));
231  VideoWriter videop(out_video_points_file,CV_FOURCC('M','J','P','G'),10, Size(FRAME_WIDTH,FRAME_HEIGHT));
232 #else
233  VideoWriter video(out_video_file,cv::VideoWriter::fourcc('M','J','P','G'),10, Size(FRAME_WIDTH,FRAME_HEIGHT));
234  VideoWriter videop(out_video_points_file,cv::VideoWriter::fourcc('M','J','P','G'),10, Size(FRAME_WIDTH,FRAME_HEIGHT));
235 #endif
236 
237 #endif // #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
238 
239  print_cFpZoo();
240 
241  try {
242 
243  //------------------------------------------------------
244  //-- STEP-2 : Initialize socket connection
245  //------------------------------------------------------
246  #if NET_TYPE == udp
247  #ifndef TB_SIM_CFP_VITIS
248  UDPSocket sock(servPort); // NOTE: It is very important to set port here in order to call
249  // bind() in the UDPSocket constructor
250  #else // TB_SIM_CFP_VITIS
251  UDPSocket sock; // NOTE: In HOST TB the port is already binded by harris_host_fwd_tb.cpp
252  #endif // TB_SIM_CFP_VITIS
253  #else // tcp
254  TCPSocket sock(servAddress, servPort);
255  #endif // udp/tcp
256 
257 
258 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
259 
260 
261  //------------------------------------------------------------------------------------
262  //-- STEP-3 : Initialize a Greyscale OpenCV Mat either from image or from video/camera
263  //------------------------------------------------------------------------------------
264  Mat frame, send(FRAME_WIDTH, FRAME_HEIGHT, INPUT_TYPE_HOST, Scalar(0)), ocv_out_img;
265  vector < uchar > encoded;
266 
267  #ifdef INPUT_FROM_CAMERA
268 
269  VideoCapture cap(input_num); // Grab the camera
270  if (!cap.isOpened()) {
271  cerr << "OpenCV Failed to open camera " + input_num << endl;
272  exit(1);
273  }
274 
275  #else // INPUT_FROM_CAMERA
276 
277  VideoCapture cap(input_string); // Grab the image
278  if (!cap.isOpened()) {
279  cerr << "OpenCV Failed to open file " + input_string << endl;
280  exit(1);
281  }
282 
283  #endif // INPUT_FROM_CAMERA
284 
285  //frame = cv::imread(argv[3], cv::IMREAD_GRAYSCALE); // reading in the image in grey scale
286  unsigned int num_frame = 0;
287 
288  while (1) {
289  clock_t start_cycle_main = clock();
290  cap >> frame;
291  if (frame.empty()) break; // if input is an image, the loop will be executed once
292  if(frame.size().width==0) continue; //simple integrity check; skip erroneous data...
293  cout << " ___________________________________________________________________ " << endl;
294  cout << "/ \\" << endl;
295  cout << "INFO: Frame # " << ++num_frame << endl;
296 #if CV_MAJOR_VERSION < 4
297  cv::cvtColor(frame,frame,CV_BGR2GRAY);
298 #else
299  cv::cvtColor(frame,frame,cv::COLOR_BGR2GRAY);
300 #endif
301  resizeCropSquare(frame, send, Size(FRAME_WIDTH, FRAME_HEIGHT), INTER_LINEAR);
302  if ((frame.cols != FRAME_WIDTH) || (frame.rows != FRAME_HEIGHT)) {
303  cout << "WARNING: Input frame was resized from " << frame.cols << "x"
304  << frame.rows << " to " << send.cols << "x" << send.rows << endl;
305  }
306  assert(send.total() == FRAME_WIDTH * FRAME_HEIGHT);
307  // Ensure that the selection of MTU is a multiple of 8 (Bytes per transaction)
308  assert(PACK_SIZE % 8 == 0);
309 
310 #ifdef SHOW_WINDOWS
311 
312  namedWindow("host_send", CV_WINDOW_NORMAL);
313  imshow("host_send", send);
314 
315 #endif // SHOW_WINDOWS
316 
317  // Ensure that the send Mat is in continuous memory space. Typically, imread or resize
318  // will return such a continuous Mat, but we should check it.
319  assert(send.isContinuous());
320 
321  unsigned int send_total = send.total();
322  unsigned int send_channels = send.channels();
323 
324 #else // PY_WRAP == PY_WRAP_HARRIS_NUMPI
325 
326  unsigned int send_total = (unsigned int)total_size;
327  unsigned int send_channels = 1; // FIXME: It is ok only for 1-d array, i.e. CV_8UC1
328  unsigned char * sendarr = input_img;
329 #endif // #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
330 
331 
332 
333  unsigned int total_pack = 1 + (send_total * send_channels - 1) / PACK_SIZE;
334  unsigned int total_bytes = total_pack * PACK_SIZE;
335  unsigned int bytes_in_last_pack = send_total * send_channels - (total_pack - 1) * PACK_SIZE;
336  assert(total_pack == TOT_TRANSFERS);
337 
338  cout << "INFO: FPGA destination : " << servAddress << ":" << servPort << endl;
339  cout << "INFO: Network socket : " << ((NET_TYPE == tcp) ? "TCP" : "UDP") << endl;
340  cout << "INFO: Total packets to send/receive = " << total_pack << endl;
341  cout << "INFO: Total bytes to send/receive = " << send_total * send_channels << endl;
342  cout << "INFO: Total bytes in " << total_pack << " packets = " << total_bytes << endl;
343  cout << "INFO: Bytes in last packet = " << bytes_in_last_pack << endl;
344  cout << "INFO: Packet size (custom MTU) = " << PACK_SIZE << endl;
345 
346 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
347 
348  //--------------------------------------------------------
349  //-- STEP-4 : RUN HARRIS DETECTOR FROM OpenCV LIBRARY (SW)
350  //--------------------------------------------------------
351  clock_t start_cycle_harris_sw = clock();
352  ocv_out_img.create(send.rows, send.cols, INPUT_TYPE_HOST); // create memory for opencv output image
353  ocv_ref(send, ocv_out_img, Th);
354  clock_t end_cycle_harris_sw = clock();
355  double duration_harris_sw = (end_cycle_harris_sw - start_cycle_harris_sw) /
356  (double) CLOCKS_PER_SEC;
357  cout << "INFO: SW exec. time:" << duration_harris_sw << " seconds" << endl;
358  cout << "INFO: Effective FPS SW:" << (1 / duration_harris_sw) << " \tkbps:" <<
359  (PACK_SIZE * total_pack / duration_harris_sw / 1024 * 8) << endl;
360 
361  //------------------------------------------------------
362  //-- STEP-5 : RUN HARRIS DETECTOR FROM cF (HW)
363  //------------------------------------------------------
364 
365  //------------------------------------------------------
366  //-- STEP-5.1 : Preparation
367  //------------------------------------------------------
368 
369  // Anchor a pointer on cvMat raw data
370  unsigned char * sendarr = send.isContinuous()? send.data: send.clone().data;
371 
372  clock_t start_cycle_harris_hw = clock();
373 
374 #endif // !PY_WRAP_HARRIS_NUMPI
375 
376 
377  //------------------------------------------------------
378  //-- STEP-5.2 : TX Loop
379  //------------------------------------------------------
380  clock_t last_cycle_tx = clock();
381  unsigned int sending_now = PACK_SIZE;
382  for (unsigned int i = 0; i < total_pack; i++) {
383  if ( i == total_pack - 1 ) {
384  sending_now = bytes_in_last_pack;
385  }
386  #if NET_TYPE == udp
387  sock.sendTo( & sendarr[i * PACK_SIZE], sending_now, servAddress, servPort);
388  #else
389  sock.send( & sendarr[i * PACK_SIZE], sending_now);
390  #endif
391  //delay(1);
392  }
393 
394  clock_t next_cycle_tx = clock();
395  double duration_tx = (next_cycle_tx - last_cycle_tx) / (double) CLOCKS_PER_SEC;
396  cout << "INFO: Effective FPS TX:" << (1 / duration_tx) << " \tkbps:" << (PACK_SIZE *
397  total_pack / duration_tx / 1024 * 8) << endl;
398  last_cycle_tx = next_cycle_tx;
399 
400 
401  //------------------------------------------------------
402  //-- STEP-5.3 : RX Loop
403  //------------------------------------------------------
404 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
405  clock_t last_cycle_rx = clock();
406 #endif
407  unsigned int receiving_now = PACK_SIZE;
408  cout << "INFO: Expecting length of packs:" << total_pack << " from " << servAddress << ":" << servPort << endl;
409  unsigned char * longbuf = new unsigned char[PACK_SIZE * total_pack];
410  for (unsigned int i = 0; i < send_total; ) {
411  //cout << "DEBUG: " << i << endl;
412  //if ( i == total_pack - 1 ) {
413  // receiving_now = bytes_in_last_pack;
414  //}
415  #if NET_TYPE == udp
416  recvMsgSize = sock.recvFrom(buffer, BUF_LEN, servAddress, servPort);
417  #else
418  recvMsgSize = sock.recv(buffer, BUF_LEN);
419  #endif
420  if (recvMsgSize != receiving_now) {
421  cerr << "WARNING: at i=" << i << " received unexpected size pack:" << recvMsgSize << ". Expected: " <<
422  receiving_now << endl;
423  //continue;
424  }
425  memcpy( & longbuf[i], buffer, recvMsgSize);
426  //cout << "DEBUG: i=" << i << " recvMsgSize=" << recvMsgSize << endl;
427  i += recvMsgSize;
428  }
429 
430  cout << "INFO: Received packet from " << servAddress << ":" << servPort << endl;
431 
432 #if !defined(PY_WRAP) || (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
433 
434  frame = cv::Mat(FRAME_HEIGHT, FRAME_WIDTH, INPUT_TYPE_HOST, longbuf); // OR vec.data() instead of ptr
435  if (frame.size().width == 0) {
436  cerr << "receive failure!" << endl;
437  continue;
438 
439  }
440 #ifdef SHOW_WINDOWS
441  namedWindow("host_recv", CV_WINDOW_NORMAL);
442  imshow("host_recv", frame);
443 #endif
444  clock_t next_cycle_rx = clock();
445  double duration_rx = (next_cycle_rx - last_cycle_rx) / (double) CLOCKS_PER_SEC;
446  cout << "INFO: Effective FPS RX:" << (1 / duration_rx) << " \tkbps:" << (PACK_SIZE *
447  total_pack / duration_rx / 1024 * 8) << endl;
448  last_cycle_rx = next_cycle_rx;
449 
450  clock_t end_cycle_harris_hw = next_cycle_rx;
451 
452  double duration_harris_hw = (end_cycle_harris_hw - start_cycle_harris_hw) /
453  (double) CLOCKS_PER_SEC;
454  cout << "INFO: HW exec. time:" << duration_harris_hw << " seconds" << endl;
455  cout << "INFO: Effective FPS HW:" << (1 / duration_harris_hw) << " \tkbps:" <<
456  (PACK_SIZE * total_pack / duration_harris_hw / 1024 * 8) << endl;
457 
458  //------------------------------------------------------
459  //-- STEP-6 : Write output files and show in windows
460  //------------------------------------------------------
461  Mat out_img;
462  out_img = send.clone();
463  vector<Point> hw_points;
464 
465  /* Mark HLS points on the image */
466  markPointsOnImage(frame, send, out_img, hw_points);
467 
468  ostringstream oss;
469  oss << "cFp_Vitis E2E:" << "INFO: Effective FPS HW:" << (1 / duration_harris_hw) <<
470  " \tkbps:" << (PACK_SIZE * total_pack / duration_harris_hw / 1024 * 8);
471  string windowName = "cFp_Vitis End2End"; //oss.str();
472  /*
473  string msg = "cFp_Vitis";
474  Scalar color(255, 0, 0);
475  int fontFace = FONT_HERSHEY_DUPLEX;
476  double fontScale = 0.5;
477  int thickness = 1;
478  putText(out_img,
479  msg, //text
480  Point(10, out_img.rows / 2), //top-left position
481  fontFace,
482  fontScale,
483  color, //font color
484  thickness);
485  */
486 #ifdef SHOW_WINDOWS
487  namedWindow(windowName, CV_WINDOW_NORMAL);
488  imshow(windowName, out_img);
489 #endif
490  //moveWindow(windowName, 0, 0);
491 #ifdef WRITE_OUTPUT_FILE
492  if (num_frame == 1) {
493  out_img_file.assign(input_string);
494  out_img_file += "_fpga_img_out_frame_" + to_string(num_frame) + ".png";
495  out_points_file.assign(input_string);
496  out_points_file += "_fpga_points_out_frame_" + to_string(num_frame) + ".png";
497 #if defined(PY_WRAP) && (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
498 
499  if (!strcpy(output_img_str, &out_img_file[0])) {
500  cerr << "ERROR: Cannot write to output image string." << endl;
501  }
502  if (!strcpy(output_points_str, &out_points_file[0])) {
503  cerr << "ERROR: Cannot write to output points string." << endl;
504  }
505 #endif // defined(PY_WRAP) && (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
506  cout << "INFO: The output image file is stored at : " << out_img_file << endl;
507  cout << "INFO: The output points file is stored at : " << out_points_file << endl;
508  // We save the image received from network after being processed by Harris HW or HOST TB
509  imwrite(out_img_file, out_img);
510  imwrite(out_points_file, frame);
511  }
512  else if (num_frame > 1) {
513  // If the frame is empty, break immediately
514  if (frame.empty()) {
515  break;
516  }
517  cout << "INFO: The output video file is stored at : " << out_video_file << endl;
518  cout << "INFO: The output video -only points- file is stored at : " << out_video_points_file << endl;
519  Mat tovideo, tovideop;
520  if (frame.channels() != 1) {
521  tovideo = out_img;
522  tovideop = frame;
523  }
524  else {
525  cvtColor(out_img, tovideo, COLOR_GRAY2BGR);
526  cvtColor(frame, tovideop, COLOR_GRAY2BGR);
527  }
528  video.write(tovideo);
529  videop.write(tovideop);
530  }
531 #endif // WRITE_OUTPUT_FILE
532  waitKey(FRAME_INTERVAL);
533  double duration_main = (clock() - start_cycle_main) / (double) CLOCKS_PER_SEC;
534  cout << "INFO: Effective FPS E2E:" << (1 / duration_main) << endl;
535  cout << "\\___________________________________________________________________/" << endl
536  << endl;
537  } // while loop
538 
539  // When everything done, release the video capture and write object
540  cap.release();
541  video.release();
542  videop.release();
543 
544  // Closes all the windows
545  destroyAllWindows();
546 
547 #else
548  //output_img = longbuf;
549  memcpy( output_img, longbuf, total_size);
550  delete(longbuf);
551 #endif // defined(PY_WRAP) && (PY_WRAP == PY_WRAP_HARRIS_FILENAME)
552 
553  // Destructor closes the socket
554  } catch (SocketException & e) {
555  cerr << e.what() << endl;
556  exit(1);
557  }
558 
559 #ifndef PY_WRAP
560  return 0;
561 #endif
562 }
563 
564 
565 
566 
cat GET request dos socat stdio tcp
Definition: commands.txt:1
#define FILTER_WIDTH
void ocv_ref(cv::Mat img_gray, cv::Mat &ocv_out_img, float Th)
Definition: xf_ocv_ref.hpp:552
#define FRAME_INTERVAL
Definition: config.h:48
#define INPUT_TYPE_HOST
Definition: config.h:68
#define FRAME_HEIGHT
Definition: config.h:43
#define FRAME_WIDTH
Definition: config.h:46
void harris(ap_uint< 32 > *pi_rank, ap_uint< 32 > *pi_size, stream< NetworkWord > &siSHL_This_Data, stream< NetworkWord > &soTHIS_Shl_Data, stream< NetworkMetaStream > &siNrc_meta, stream< NetworkMetaStream > &soNrc_meta, ap_uint< 32 > *po_rx_ports)
Main process of the Harris Application directives.
Definition: harris.cpp:918
void print_cFpZoo(void)
Definition: harris_host.cpp:57
void resizeCropSquare(const cv::Mat &input, const cv::Mat &output, const cv::Size &dstSize, int interpolation=INTER_LINEAR)
Resize an image and crop if necessary in order to keep a rectangle area in the middle of the image.
Definition: harris_host.cpp:82
void delay(unsigned int mseconds)
Definition: harris_host.cpp:51
void markPointsOnImage(Mat &imgOutput, Mat &in_img, Mat &out_img, vector< Point > &hw_points)
Mark the points found by Harris into the image.
#define TOT_TRANSFERS
Definition: config.h:70
#define udp
Definition: config.h:66
#define NET_TYPE
Definition: config.h:60
#define BUF_LEN
Definition: config.h:54
#define PACK_SIZE
Definition: config.h:51
def send(cFcluster cluster, node_id, data_obj, proto='udp', port=CF_DEFAULT_PORT)
Definition: comm.py:41
string input
Definition: test.py:9
string output
Definition: test.py:10
def clock()
Definition: common.py:174