AVTPikeCam.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #include "../include/cob_camera_sensors/StdAfx.h"
19 
20 #ifdef __LINUX__
22 #include "tinyxml.h"
23 #else
25 #include "cob_vision/windows/src/extern/TinyXml/tinyxml.h"
26 #endif
27 
28 #include <iostream>
29 
30 using namespace std;
31 using namespace ipa_CameraSensors;
32 
33 bool AVTPikeCam::m_OpenExecuted = false;
34 AVTPikeCam::AVTPikeCamDeleter AVTPikeCam::m_Deleter;
35 
37 {
38  return AbstractColorCameraPtr(new AVTPikeCam());
39 }
40 
41 AVTPikeCam::AVTPikeCam()
42 {
43  m_initialized = false;
44  m_open = false;
45  m_BufferSize = 3;
46 
47 #ifdef __LINUX__
48  m_cam = 0;
49  m_IEEE1394Cameras = 0;
50  m_IEEE1394Info = 0;
51  m_Frame = 0;
52 #endif
53 #ifndef __LINUX__
54  m_Frame.pData = 0;
55 #endif
56 
57 }
58 
59 AVTPikeCam::~AVTPikeCam()
60 {
61  if (isOpen())
62  {
63  Close();
64  }
65 
66 #ifdef __LINUX__
67  if (m_IEEE1394Info != 0)
68  {
69  dc1394_free(m_IEEE1394Info);
70  m_IEEE1394Info = 0;
71  }
72 #endif
73 }
74 
75 
76 unsigned long AVTPikeCam::Init(std::string directory, int cameraIndex)
77 {
78  if (isInitialized())
79  {
81  }
82  m_initialized = false;
83  m_CameraType = ipa_CameraSensors::CAM_AVTPIKE;
84 
85  #ifdef __LINUX__
86 
87  // Load parameters from xml initialization file
88  std::string iniFileNameAndPath = directory + "cameraSensorsIni.xml";
89  if (LoadParameters(iniFileNameAndPath.c_str(), cameraIndex) & RET_FAILED)
90  {
92  }
93 
94 
95  // Search for available cameras
96  if (m_IEEE1394Info == 0)
97  {
98  m_IEEE1394Info = dc1394_new();
99  }
100  dc1394error_t err = dc1394_camera_enumerate(m_IEEE1394Info, &m_IEEE1394Cameras);
101  if (err!=DC1394_SUCCESS)
102  {
103  std::cerr << "ERROR - AVTPikeCam::Init:" << std::endl;
104  std::cerr << "\t ... Failed to enumerate cameras" << std::endl;
105  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
106  return RET_FAILED;
107  }
108 
109  if (m_IEEE1394Cameras->num == 0)
110  {
111  std::cerr << "ERROR - AVTPikeCam::Init:" << std::endl;
112  std::cerr << "\t ... No cameras found" << std::endl;
113  return RET_FAILED;
114  }
115 
116  m_initialized = true;
117  return RET_OK;
118 
119  #else
120 
121  std::string iniFileNameAndPath = directory + "cameraSensorsIni.xml";
122  if (LoadParameters(iniFileNameAndPath.c_str(), cameraIndex) & RET_FAILED)
123  {
125  }
126 
127  UINT32 err;
128 
129  // Prepare FireGrab library for use
130  if (m_OpenExecuted == false)
131  {
132  m_OpenExecuted = true;
133  UINT32 err = FGInitModule(NULL);
134  if(err!=FCE_NOERROR) // err=1001 means library is already initialized (i.e. by other Pike camera)
135  {
136  std::cerr << "ERROR - AVTPikeCam::Init:" << std::endl;
137  std::cerr << "\t ... Initialization of FireGrab library failed. ( error " << err << " )" << std::endl;
138  return RET_FAILED;
139  }
140  }
141 
142  // Retrieve a list of all nodes currently connected to the system
143  // At most 5 nodes are retrieved. Actual number is stored in nodeCnt
144  m_NodeCnt = 0;
145  err=FGGetNodeList(m_nodeInfo, 5, &m_NodeCnt);
146  if(err!=FCE_NOERROR)
147  {
148  std::cerr << "ERROR - AVTPikeCam::Init:" << std::endl;
149  std::cerr << "\t ... Retrival of connected IEEE1394 nodes failed. ( error " << err << " )" << std::endl;
150  return RET_FAILED;
151  }
152 
153  if (m_NodeCnt <= 0)
154  {
155  std::cout << "ERROR - AVTPikeCam::Init:" << std::endl;
156  std::cerr << "\t ... No cameras found." << std::endl;
157  return RET_FAILED;
158  }
159  else
160  {
161  std::cout << "INFO - AVTPikeCam::Init:" << std::endl;
162  std::cout << "\t ... Detected '" << m_NodeCnt << "' IEEE1394 node(s)" << std::endl;
163  for(unsigned int i=0; i < m_NodeCnt; i++)
164  {
165  printf ("\t ... GUID of node '%i' is %-#08lX %-#08lX \n", i+1, m_nodeInfo[i].Guid.High, m_nodeInfo[i].Guid.Low);
166  }
167  }
168 
169  m_initialized = true;
170  return RET_OK;
171 
172  #endif
173 }
174 
175 
176 unsigned long AVTPikeCam::Open()
177 {
178  if (!isInitialized())
179  {
180  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
181  std::cerr << "\t ... Camera not initialized." << std::endl;
182  return (RET_FAILED);
183  }
184  m_open = false;
185 
186 
187 #ifdef __LINUX__
188  dc1394error_t err;
189 
190  // Connect with IEEE1394 node
191  unsigned int i=0;
192  for(; i<m_IEEE1394Cameras->num; i++)
193  {
194  uint64_t high = m_GUID.High;
195  uint64_t low = m_GUID.Low;
196  uint64_t guid = (high << 32) + low;
197  if (m_IEEE1394Cameras->ids[i].guid == guid) break;
198  }
199  // Check if specified GUID has been found
200  if (i == m_IEEE1394Cameras->num)
201  {
202  printf ("ERROR - AVTPikeCam::Open: \n\t ... Could not detect specified camera GUID %#08lX %#08lX on IEEE1394 bus\n", m_GUID.High, m_GUID.Low);
203  return RET_FAILED;
204  }
205 
206  m_cam = dc1394_camera_new(m_IEEE1394Info, m_IEEE1394Cameras->ids[i].guid);
207  if (m_cam == 0)
208  {
209  m_open = false;
210  return RET_FAILED;
211  }
212 
213  dc1394_camera_free_list(m_IEEE1394Cameras);
214 
215  // Set Parameters
216  if (SetParameters() & ipa_CameraSensors::RET_FAILED)
217  {
218  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
219  std::cerr << "\t... Error while setting parameters" << std::endl;
220  return RET_FAILED;
221  }
222 
223  err = dc1394_capture_setup(m_cam, m_BufferSize, DC1394_CAPTURE_FLAGS_DEFAULT);
224  // Relase allocated bandwidth and retry
225  if (err!=DC1394_SUCCESS)
226  {
227  std::cout << "INFO - AVTPikeCam::Open:" << std::endl;
228  std::cout << "\t ... Releasing bandwdith and retrying to setup DMA capture" << std::endl;
229  uint32_t bandwidth = -1;
230  err = dc1394_video_get_bandwidth_usage(m_cam, &bandwidth);
231  if (err!=DC1394_SUCCESS)
232  {
233  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
234  std::cerr << "\t ... Failed to get bandwith usage of camera device" << std::endl;
235  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
236  return RET_FAILED;
237  }
238  dc1394_iso_release_bandwidth(m_cam, bandwidth);
239  if (err!=DC1394_SUCCESS)
240  {
241  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
242  std::cerr << "\t ... Failed to relase requested bandwidth '" << bandwidth << "'" << std::endl;
243  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
244  return RET_FAILED;
245  }
246  err = dc1394_capture_setup(m_cam, m_BufferSize, DC1394_CAPTURE_FLAGS_DEFAULT);
247  if (err!=DC1394_SUCCESS)
248  {
249  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
250  std::cerr << "\t ... Failed to setup cameras device" << std::endl;
251  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
252  return RET_FAILED;
253  }
254  }
255 
256 
257  // Start transmission
258  err=dc1394_video_set_transmission(m_cam, DC1394_ON);
259  if (err!=DC1394_SUCCESS)
260  {
261  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
262  std::cerr << "\t ... 'dc1394_video_set_transmission' failed." << std::endl;
263  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
264  return RET_FAILED;
265  }
266 
267 #else
268 
269  UINT32 err;
270 
271  // Connect with IEEE1394 node
272  unsigned int i=0;
273  for(; i<m_NodeCnt; i++)
274  {
275  if (m_nodeInfo[i].Guid.Low - m_GUID.Low == 0 &&
276  m_nodeInfo[i].Guid.High - m_GUID.High == 0) break;
277  }
278  // Check if specified GUID has been found
279  if (i == m_NodeCnt)
280  {
281  printf ("ERROR - AVTPikeCam::Open: \n\t ... Could not detect specified camera GUID %#08lX %#08lX on IEEE1394 bus\n", m_GUID.High, m_GUID.Low);
282  return RET_FAILED;
283  }
284 
285  err=m_cam.Connect(&m_GUID);
286  if(err!=FCE_NOERROR)
287  {
288  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
289  std::cerr << "\t ... Could not connect to camera. ( error " << err << " )" << std::endl;
290  return RET_FAILED;
291  }
292 
293  if (SetParameters() & ipa_CameraSensors::RET_FAILED)
294  {
295  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
296  std::cerr << "\t ... Could not set parameters. ( error " << err << " )" << std::endl;
297  return RET_FAILED;
298  }
299 
300  err = m_cam.SetParameter(FGP_FRAMEBUFFERCOUNT, m_BufferSize);
301  if(err!=FCE_NOERROR)
302  {
303  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
304  std::cerr << "\t ... Could not set DMA buffer size to '"<< m_BufferSize
305  << "' ( error " << err << " )" << std::endl;
306  return RET_FAILED;
307  }
308 
309  // Opens, prepares and activates the image capture logic on the PC side
310  err=m_cam.OpenCapture();
311  if(err!=FCE_NOERROR)
312  {
313  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
314  std::cerr << "\t ... Could not start DMA logic ( error " << err << " )" << std::endl;
315  return RET_FAILED;
316  }
317 
318  // Start image acquisition
319  err=m_cam.StartDevice();
320  if(err!=FCE_NOERROR)
321  {
322  std::cerr << "ERROR - AVTPikeCam::Open:" << std::endl;
323  std::cerr << "\t ... Could not start camera device ( error " << err << " )" << std::endl;
324  return RET_FAILED;
325  }
326 
327 #endif
328  std::cout << "**************************************************" << std::endl;
329  std::cout << "AVTPikeCam::Open: AVT Pike 145C camera device OPEN" << std::endl;
330  std::cout << "**************************************************" << std::endl << std::endl;
331  m_open = true;
332  return RET_OK;
333 }
334 
335 
336 unsigned long AVTPikeCam::SaveParameters(const char* filename)
337 {
338  return RET_FAILED;
339 }
340 
341 
342 
343 
344 
345 unsigned long AVTPikeCam::Close()
346 {
347  if (!isOpen())
348  {
349  return (RET_OK);
350  }
351 
352 #ifdef __LINUX__
353  if (m_cam != 0)
354  {
355  // Stop transmission
356  dc1394error_t err;
357  err=dc1394_video_set_transmission(m_cam, DC1394_OFF);
358  if (err!=DC1394_SUCCESS)
359  {
360  std::cerr << "ERROR - AVTPikeCam::Close:" << std::endl;
361  std::cerr << "\t ... 'dc1394_video_set_transmission' failed." << std::endl;
362  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
363  return RET_FAILED;
364  }
365  dc1394_capture_stop(m_cam);
366  dc1394_camera_free(m_cam);
367  m_cam = 0;
368  }
369 #else
370  // Stops image acquisition
371  UINT32 err;
372  err=m_cam.StopDevice();
373  if(err!=FCE_NOERROR)
374  {
375  std::cerr << "ERROR - AVTPikeCam::Close:" << std::endl;
376  std::cerr << "\t ... Could not stop camera device ( error " << err << " )" << std::endl;
377  }
378 
379  // Close capture logic and frees image buffers.
380  // Also frees all allocated resource on the FireWire bus.
381  err=m_cam.CloseCapture();
382  if(err!=FCE_NOERROR)
383  {
384  std::cerr << "ERROR - AVTPikeCam::Close:" << std::endl;
385  std::cerr << "\t ... Could not close capture logic. ( error " << err << " )" << std::endl; return RET_FAILED;
386  }
387 
388  // Disonnect object from external IEEE1394 node
389  err=m_cam.Disconnect();
390  if(err!=FCE_NOERROR)
391  {
392  std::cerr << "ERROR - AVTPikeCam::Close:" << std::endl;
393  std::cerr << "\t ... Could not disconnect camera. ( error " << err << " )" << std::endl; return RET_FAILED;
394  }
395 
396 
397 #endif
398 
399  m_open = false;
400  return RET_OK;
401 }
402 
403 
404 
405 unsigned long AVTPikeCam::SetPropertyDefaults()
406 {
408 }
409 
410 unsigned long AVTPikeCam::GetProperty(t_cameraProperty* cameraProperty)
411 {
412 #ifdef __LINUX__
413  dc1394error_t err;
414  switch (cameraProperty->propertyID)
415  {
417  cameraProperty->u_integerData = m_BufferSize;
418  return RET_OK;
419  break;
421  if (isOpen())
422  {
423  uint32_t imageWidth = -1;
424  uint32_t imageHeight = -1;
425  dc1394video_mode_t videoMode;
426  err=dc1394_video_get_mode(m_cam, &videoMode);
427  if (err!=DC1394_SUCCESS)
428  {
429  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
430  std::cerr << "\t ... Failed to get video mode." << std::endl;
431  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
432  return RET_FAILED;
433  }
434 
435  err = dc1394_get_image_size_from_video_mode(m_cam, videoMode, &imageWidth, &imageHeight);
436  if (err!=DC1394_SUCCESS)
437  {
438  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
439  std::cerr << "\t ... Failed to get image size." << std::endl;
440  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
441  return RET_FAILED;
442  }
443  cameraProperty->cameraResolution.xResolution = (int) imageWidth;
444  cameraProperty->cameraResolution.yResolution = (int) imageHeight;
445  }
446  else
447  {
448  std::cout << "WARNING - AVTPikeCam::GetProperty:" << std::endl;
449  std::cout << "\t ... Camera not open" << std::endl;
450  std::cout << "\t ... Resetting width and height to '1388'x'1038'" << std::endl;
451  cameraProperty->cameraResolution.xResolution = 1388;
452  cameraProperty->cameraResolution.yResolution = 1038;
453  cameraProperty->propertyType = TYPE_CAMERA_RESOLUTION;
454  }
455 
456  return RET_OK;
457  break;
458  default:
459  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
460  std::cerr << "\t ... Property " << cameraProperty->propertyID << " unspecified" << std::endl;
461  return RET_FAILED;
462  break;
463  }
464  return RET_OK;
465 #endif
466 #ifndef __LINUX__
467  UINT32 err;
468  switch (cameraProperty->propertyID)
469  {
470  case PROP_BRIGHTNESS:
471 
472  break;
473  case PROP_EXPOSURE_TIME:
474 
475  break;
477 
478  break;
480 
481  break;
482  case PROP_HUE:
483 
484  break;
485  case PROP_SATURATION:
486 
487  break;
488  case PROP_GAMMA:
489 
490  break;
491  case PROP_GAIN:
492 
493  break;
495  if (isOpen())
496  {
497  UINT32 x;
498  UINT32 y;
499 
500  err = m_cam.GetParameter(FGP_XSIZE, &x);
501  if(err!=FCE_NOERROR)
502  {
503  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
504  std::cerr << "\t ... Could not read image width ( error " << err << " )" << std::endl;
505  return RET_FAILED;
506  }
507  m_cam.GetParameter(FGP_YSIZE, &y);
508  if(err!=FCE_NOERROR)
509  {
510  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
511  std::cerr << "\t ... Could not read image height ( error " << err << " )" << std::endl;
512  return RET_FAILED;
513  }
514  cameraProperty->cameraResolution.xResolution = x;
515  cameraProperty->cameraResolution.yResolution = y;
516  }
517  else
518  {
519  std::cout << "WARNING - AVTPikeCam::GetProperty:" << std::endl;
520  std::cout << "\t ... Camera not open" << std::endl;
521  std::cout << "\t ... Resetting width and height to '1388'x'1038'" << std::endl;
522  cameraProperty->cameraResolution.xResolution = 1388;
523  cameraProperty->cameraResolution.yResolution = 1038;
524  cameraProperty->propertyType = TYPE_CAMERA_RESOLUTION;
525  }
526 
527  return RET_OK;
528  break;
530  cameraProperty->propertyType = TYPE_STRING;
531  if (m_operationMode_B == false) cameraProperty->stringData == "A";
532  else if (m_operationMode_B == true) cameraProperty->stringData == "B";
533  break;
535  cameraProperty->u_integerData = m_BufferSize;
536  return RET_OK;
537  break;
538  case PROP_ISO_SPEED:
539 
540  break;
541  default:
542  std::cerr << "ERROR - AVTPikeCam::GetProperty:" << std::endl;
543  std::cerr << "\t ... Property " << cameraProperty->propertyID << " unspecified";
544  return RET_FAILED;
545  break;
546 
547  }
548 
549  return RET_OK;
550 #endif
551 }
552 
553 
554 unsigned long AVTPikeCam::GetColorImage(char* colorImageData, bool getLatestFrame)
555 {
556  if (!isOpen())
557  {
558  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
559  std::cerr << "\t ... Color camera not open." << std::endl;
560  return (RET_FAILED | RET_CAMERA_NOT_OPEN);
561  }
562 #ifdef __LINUX__
563 
564  dc1394error_t err;
565 
566  if (m_Frame)
567  {
568  // Release the buffer from previous function call
569  err=dc1394_capture_enqueue(m_cam, m_Frame);
570  if (err!=DC1394_SUCCESS)
571  {
572  std::cerr << "AVTPikeCam::GetColorImage:" << std::endl;
573  std::cerr << "\t ... 'dc1394_capture_enqueue' failed." << std::endl;
574  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
575  return RET_FAILED;
576  }
577  }
578 
579  //std::cout << "INFO - AVTPikeCam::GetColorImage:" << std::endl;
580  //std::cout << "\t ... Flushing DMA" << std::endl;
581 
582  if (getLatestFrame)
583  {
584  // Flush the DMA ring buffer
585  do
586  {
587  m_Frame = 0;
588  err=dc1394_capture_dequeue(m_cam, DC1394_CAPTURE_POLICY_POLL, &m_Frame);
589  if (err!=DC1394_SUCCESS)
590  {
591  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
592  std::cerr << "\t ... 'dc1394_capture_dequeue' failed." << std::endl;
593  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
594  return RET_FAILED;
595  }
596 
597  if (m_Frame == 0)
598  {
599  break;
600  }
601 
602  err=dc1394_capture_enqueue(m_cam, m_Frame);
603  if (err!=DC1394_SUCCESS)
604  {
605  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
606  std::cerr << "\t ... 'dc1394_capture_enqueue' failed." << std::endl;
607  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
608  return RET_FAILED;
609  }
610  }
611  while (true);
612  }
613 
614  //std::cout << "INFO - AVTPikeCam::GetColorImage:" << std::endl;
615  //std::cout << "\t ... Waiting for images" << std::endl;
616 
617  // Capture
618  err=dc1394_capture_dequeue(m_cam, DC1394_CAPTURE_POLICY_WAIT, &m_Frame);
619  if (err!=DC1394_SUCCESS)
620  {
621  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
622  std::cerr << "\t ... 'dc1394_capture_dequeue' failed." << std::endl;
623  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
624  return RET_FAILED;
625  }
626  unsigned char * src = (unsigned char *)m_Frame->image;
627  unsigned char * dst = (unsigned char *)colorImageData;
628 
629  // Convert RGB to BGR
630  int width;
631  int height;
633  cameraProperty.propertyID = PROP_CAMERA_RESOLUTION;
634  if (GetProperty(&cameraProperty) & RET_FAILED) return RET_FAILED;
635  width = cameraProperty.cameraResolution.xResolution;
636  height = cameraProperty.cameraResolution.yResolution;
637 
638  for (int i=0;i<width*height*3;i+=6)
639  {
640  dst[i] = src[i+2];
641  dst[i+1] = src[i+1];
642  dst[i+2] = src[i];
643  dst[i+3] = src[i+5];
644  dst[i+4] = src[i+4];
645  dst[i+5] = src[i+3];
646  }
647 
648  return RET_OK;
649 
650 #else
651 
652  UINT32 err;
653 
654  // Release previously acquired m_Frame
655  if (m_Frame.pData != 0)
656  {
657  // Return m_Frame to module
658  err=m_cam.PutFrame(&m_Frame);
659  if(err!=FCE_NOERROR)
660  {
661  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
662  std::cerr << "\t ... Could not release image buffer ( error " << err << " )" << std::endl;
663  return RET_FAILED;
664  }
665  }
666 
667  if (getLatestFrame)
668  {
669  // One shot mode
670  // Reset image buffer to guarantee, that the latest images are returned
671  err = m_cam.DiscardFrames();
672  if(err!=FCE_NOERROR)
673  {
674  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
675  std::cerr << "\t ... Could not reset image buffers ( error " << err << " )" << std::endl;
676  return RET_FAILED;
677  }
678  }
679 
680 
681  // Blocking-Wait for the next m_Frame
682  err = m_cam.GetFrame(&m_Frame);
683  if(err!=FCE_NOERROR)
684  {
685  std::cerr << "AVTPikeCam::GetColorImage:" << std::endl;
686  std::cerr << "\t ... Could not acquire image ( error " << err << " )" << std::endl;
687  return RET_FAILED;
688  }
689 
690  unsigned char * src = (unsigned char *)m_Frame.pData;
691  unsigned char * dst = (unsigned char *)colorImageData;
692 
693  // Convert RGB to BGR
694  int width;
695  int height;
697  cameraProperty.propertyID = PROP_CAMERA_RESOLUTION;
698  if (GetProperty(&cameraProperty) & RET_FAILED) return RET_FAILED;
699  width = cameraProperty.cameraResolution.xResolution;
700  height = cameraProperty.cameraResolution.yResolution;
701 
702  for (int i=0; i<width*height*3; i+=6)
703  {
704  dst[i] = src[i+2];
705  dst[i+1] = src[i+1];
706  dst[i+2] = src[i];
707  dst[i+3] = src[i+5];
708  dst[i+4] = src[i+4];
709  dst[i+5] = src[i+3];
710  }
711 
712  return RET_OK;
713 
714 #endif
715 }
716 
717 unsigned long AVTPikeCam::GetColorImage(cv::Mat* colorImage, bool getLatestFrame)
718 {
719  if (!isOpen())
720  {
721  std::cerr << "ERROR - AVTPikeCam::GetColorImage:" << std::endl;
722  std::cerr << "\t ... Color camera not open." << std::endl;
723  return (RET_FAILED | RET_CAMERA_NOT_OPEN);
724  }
725 
726  CV_Assert(colorImage != 0);
727 
728  int width;
729  int height;
731  cameraProperty.propertyID = PROP_CAMERA_RESOLUTION;
732  if (GetProperty(&cameraProperty) & RET_FAILED) return RET_FAILED;
733  width = cameraProperty.cameraResolution.xResolution;
734  height = cameraProperty.cameraResolution.yResolution;
735 
736  // Create color image, if necessary
737  colorImage->create(height, width, CV_8UC3);
738  return GetColorImage(colorImage->ptr<char>(0), getLatestFrame);
739 }
740 
741 unsigned long AVTPikeCam::PrintCameraInformation()
742 {
743 #ifndef __LINUX__
744  FGPINFO info;
745  string parameterName;
746  std::cout << "INFO - AVTPikeCam::PrintCameraInformation:" << std::endl;
747 
748  for (int ID = FGP_BRIGHTNESS; ID <= FGP_BRIGHTNESS+10; ID++)
749  {
750  switch (ID)
751  {
752  case 0: parameterName = "FGP_IMAGEFORMAT"; break; // Compact image format
753  case 1: parameterName = "FGP_ENUMIMAGEFORMAT"; break; // Enumeration (Reset,Get)
754  case 2: parameterName = "FGP_BRIGHTNESS"; break; // Set image brightness
755  case 3: parameterName = "FGP_AUTOEXPOSURE"; break; // Set auto exposure
756  case 4: parameterName = "FGP_SHARPNESS"; break; // Set image sharpness
757  case 5: parameterName = "FGP_WHITEBALCB"; break; // Blue
758  case 6: parameterName = "FGP_WHITEBALCR"; break; // Red
759  case 7: parameterName = "FGP_HUE"; break; // Set image hue
760  case 8: parameterName = "FGP_SATURATION"; break; // Set color saturation
761  case 9: parameterName = "FGP_GAMMA"; break; // Set gamma
762  case 10: parameterName = "FGP_SHUTTER"; break; // Shutter time
763  case 11: parameterName = "FGP_GAIN"; break; // Gain
764  case 12: parameterName = "FGP_IRIS"; break; // Iris
765  case 13: parameterName = "FGP_FOCUS"; break; // Focus
766  case 14: parameterName = "FGP_TEMPERATURE"; break; // Color temperature
767  case 15: parameterName = "FGP_TRIGGER"; break; // Trigger
768  case 16: parameterName = "FGP_TRIGGERDLY"; break; // Delay of trigger
769  case 17: parameterName = "FGP_WHITESHD"; break; // Whiteshade
770  case 18: parameterName = "FGP_FRAMERATE"; break; // Frame rate
771  case 19: parameterName = "FGP_ZOOM"; break; // Zoom
772  case 20: parameterName = "FGP_PAN"; break; // Pan
773  case 21: parameterName = "FGP_TILT"; break; // Tilt
774  case 22: parameterName = "FGP_OPTICALFILTER"; break; // Filter
775  case 23: parameterName = "FGP_CAPTURESIZE"; break; // Size of capture
776  case 24: parameterName = "FGP_CAPTUREQUALITY"; break; // Quality
777  case 25: parameterName = "FGP_PHYSPEED"; break; // Set speed for asy/iso
778  case 26: parameterName = "FGP_XSIZE"; break; // Image XSize
779  case 27: parameterName = "FGP_YSIZE"; break; // Image YSize
780  case 28: parameterName = "FGP_XPOSITION"; break; // Image x position
781  case 29: parameterName = "FGP_YPOSITION"; break; // Image y position
782  case 30: parameterName = "FGP_PACKETSIZE"; break; // Packet size
783  case 31: parameterName = "FGP_DMAMODE"; break; // DMA mode (continuous or limp)
784  case 32: parameterName = "FGP_BURSTCOUNT"; break; // Number of images to produce
785  case 33: parameterName = "FGP_FRAMEBUFFERCOUNT"; break; // Number of frame buffers
786  case 34: parameterName = "FGP_USEIRMFORBW"; break; // Allocate bandwidth or not (IsoRscMgr)
787  case 35: parameterName = "FGP_ADJUSTPARAMETERS"; break; // Adjust parameters or fail
788  case 36: parameterName = "FGP_STARTIMMEDIATELY"; break; // Start bursting immediately
789  case 37: parameterName = "FGP_FRAMEMEMORYSIZE"; break; // Read only: Frame buffer size
790  case 38: parameterName = "FGP_COLORFORMAT"; break; // Read only: Colorformat
791  case 39: parameterName = "FGP_IRMFREEBW"; break; // Read only: Free iso bytes for 400MBit
792  case 40: parameterName = "FGP_DO_FASTTRIGGER"; break; // Fast trigger (no ACK)
793  case 41: parameterName = "FGP_DO_BUSTRIGGER"; break; // Broadcast trigger
794  case 42: parameterName = "FGP_RESIZE"; break; // Start/Stop resizing
795  case 43: parameterName = "FGP_USEIRMFORCHN"; break; // Get channel over isochronous resource manager
796  case 44: parameterName = "FGP_CAMACCEPTDELAY"; break; // Delay after writing values
797  case 45: parameterName = "FGP_ISOCHANNEL"; break; // Iso channel
798  case 46: parameterName = "FGP_CYCLETIME"; break; // Read cycle time
799  case 47: parameterName = "FGP_DORESET"; break; // Reset camera
800  case 48: parameterName = "FGP_DMAFLAGS"; break; // Flags for ISO DMA
801  case 49: parameterName = "FGP_R0C"; break; // Ring 0 call gate
802  case 50: parameterName = "FGP_BUSADDRESS"; break; // Exact bus address
803  case 51: parameterName = "FGP_CMDTIMEOUT"; break; // Global bus command timeout
804  case 52: parameterName = "FGP_CARD"; break; // Card number of this camera (set before connect)
805  case 53: parameterName = "FGP_LICENSEINFO"; break; // Query license information
806  case 54: parameterName = "FGP_PACKETCOUNT"; break; // Read only: Packet count
807  case 55: parameterName = "FGP_DO_MULTIBUSTRIGGER"; break;// Do trigger on several busses
808  case 56: parameterName = "FGP_LAST"; break;
809 
810  default: parameterName = "Unknown parameter";
811  }
812 
813  m_cam.GetParameterInfo(ID, &info);
814  std::cout << parameterName << std::endl;
815  std::cout << "\t ... Value: " << info.IsValue << std::endl;
816  std::cout << "\t ... Max: " << info.MaxValue << std::endl;
817  std::cout << "\t ... Min: " << info.MinValue << std::endl;
818  std::cout << "\t ... Unit: " << info.Unit << std::endl;
819  if (info.Specific.Data.FeatureInfo.AutoCap)
820  std::cout << "\t ... Auto state: " << (bool) info.Specific.Data.FeatureInfo.AutoState << std::endl;
821  std::cout << "\n" << std::endl;
822  }
823 #endif
824  return RET_OK;
825 }
826 
827 unsigned long AVTPikeCam::TestCamera(const char* filename)
828 {
829  if (AbstractColorCamera::TestCamera(filename) & RET_FAILED)
830  {
831  return RET_FAILED;
832  }
833 
834  return RET_OK;
835 }
836 
837 
838 unsigned long AVTPikeCam::SetProperty(t_cameraProperty* cameraProperty)
839 
840 {
841 #ifdef __LINUX__
842  dc1394error_t err;
843 #else
844  UINT32 err;
845  FGPINFO info;
846 #endif
847 
848  switch (cameraProperty->propertyID)
849  {
851 // PROP_SHUTTER
855  case PROP_VIDEO_MODE:
856  case PROP_COLOR_MODE:
857  case PROP_VIDEO_FORMAT:
859  case PROP_TIMEOUT:
860  case PROP_REGISTER:
861  case PROP_OPTICAL_FILTER:
862  case PROP_SHARPNESS:
864  // Not implemented
865  break;
866  case PROP_SHUTTER:
867  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
868  {
869  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
870  {
871 #ifdef __LINUX__
872  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_SHUTTER, DC1394_FEATURE_MODE_AUTO);
873  if (err!=DC1394_SUCCESS)
874  {
875  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
876  std::cerr << "\t ... Failed to set shutter to AUTO mode." << std::endl;
877  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
878  return RET_FAILED;
879  }
880 #else
881  err = m_cam.SetParameter(FGP_SHUTTER, PVAL_AUTO);
882  if(err!=FCE_NOERROR)
883  {
884  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
885  std::cerr << "\t ... Could not set shutter time to AUTO mode ( error " << err << " )" << std::endl;
886  return RET_FAILED;
887  }
888 #endif
889  }
890  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
891  {
892  // Void
893  }
894  else
895  {
896  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
897  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
898  return RET_FAILED;
899  }
900  }
902  {
903 #ifdef __LINUX__
904  uint32_t min;
905  uint32_t max;
906  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_SHUTTER, &min, &max);
907  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
908  {
909  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
910  std::cerr << "\t ... Shutter time " << cameraProperty->u_longData
911  << " has to be a value between " << min << " and " << max << "." << std::endl;
912  return RET_FAILED;
913  }
914  else
915  {
916  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_SHUTTER, (uint32_t) cameraProperty->u_longData);
917  if (err!=DC1394_SUCCESS)
918  {
919  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
920  std::cerr << "\t ... Could not set shutter time "
921  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
922  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
923  return RET_FAILED;
924  }
925  }
926 #else
927  m_cam.GetParameterInfo(FGP_SHUTTER, &info);
928  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
929  {
930  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
931  std::cerr << "\t ... Shutter time " << cameraProperty->u_longData
932  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
933  return RET_FAILED;
934  }
935  else
936  {
937  err = m_cam.SetParameter(FGP_SHUTTER, cameraProperty->u_longData);
938  if(err!=FCE_NOERROR)
939  {
940  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
941  std::cerr << "\t ... Could not set shutter time "
942  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
943  return RET_FAILED;
944  }
945  }
946 #endif
947  }
948  else
949  {
950  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
951  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
952  return RET_FAILED;
953  }
954  break;
956 // PROP_BRIGHTNESS
958  case PROP_BRIGHTNESS:
959  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
960  {
961  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
962  {
963 #ifdef __LINUX__
964  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_BRIGHTNESS, DC1394_FEATURE_MODE_AUTO);
965  if (err!=DC1394_SUCCESS)
966  {
967  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
968  std::cerr << "\t ... Failed to set brightness to AUTO mode." << std::endl;
969  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
970  return RET_FAILED;
971  }
972 #else
973  err = m_cam.SetParameter(FGP_BRIGHTNESS, PVAL_AUTO);
974  if(err!=FCE_NOERROR)
975  {
976  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
977  std::cerr << "\t ... Could not set brightness time to AUTO mode ( error " << err << " )" << std::endl;
978  return RET_FAILED;
979  }
980 #endif
981  }
982  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
983  {
984  // Void
985  }
986  else
987  {
988  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
989  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
990  return RET_FAILED;
991  }
992  }
994  {
995 #ifdef __LINUX__
996  uint32_t min;
997  uint32_t max;
998  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_BRIGHTNESS, &min, &max);
999  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1000  {
1001  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1002  std::cerr << "\t ... Brighness " << cameraProperty->u_longData
1003  << " has to be a value between " << min << " and " << max << "." << std::endl;
1004  return RET_FAILED;
1005  }
1006  else
1007  {
1008  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_BRIGHTNESS, (uint32_t) cameraProperty->u_longData);
1009  if (err!=DC1394_SUCCESS)
1010  {
1011  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1012  std::cerr << "\t ... Could not set brighness "
1013  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1014  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1015  return RET_FAILED;
1016  }
1017  }
1018 #else
1019  m_cam.GetParameterInfo(FGP_BRIGHTNESS, &info);
1020  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1021  {
1022  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1023  std::cerr << "\t ... Brigthness " << cameraProperty->u_longData << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1024  return RET_FAILED;
1025  }
1026  else
1027  {
1028  err = m_cam.SetParameter(FGP_BRIGHTNESS, cameraProperty->u_longData);
1029  if(err!=FCE_NOERROR)
1030  {
1031  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1032  std::cerr << "\t ... Could not set brightness ( error " << err << " )" << std::endl;
1033  return RET_FAILED;
1034  }
1035  }
1036 #endif
1037  }
1038  else
1039  {
1040  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1041  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1042  return RET_FAILED;
1043  }
1044  break;
1046 // PROP_EXPOSURE_TIME
1048  case PROP_EXPOSURE_TIME:
1049  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1050  {
1051  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1052  {
1053 #ifdef __LINUX__
1054  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_EXPOSURE, DC1394_FEATURE_MODE_AUTO);
1055  if (err!=DC1394_SUCCESS)
1056  {
1057  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1058  std::cerr << "\t ... Failed to set exposure time to AUTO mode." << std::endl;
1059  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1060  return RET_FAILED;
1061  }
1062 #else
1063  err = m_cam.SetParameter(FGP_AUTOEXPOSURE, PVAL_AUTO);
1064  if(err!=FCE_NOERROR)
1065  {
1066  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1067  std::cerr << "\t ... Could not set exposure time to AUTO mode ( error " << err << " )" << std::endl;
1068  return RET_FAILED;
1069  }
1070 #endif
1071  }
1072  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1073  {
1074  // Void
1075  }
1076  else
1077  {
1078  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1079  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1080  return RET_FAILED;
1081  }
1082  }
1084  {
1085 #ifdef __LINUX__
1086  uint32_t min;
1087  uint32_t max;
1088  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_EXPOSURE, &min, &max);
1089  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1090  {
1091  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1092  std::cerr << "\t ... Exposure time " << cameraProperty->u_longData
1093  << " has to be a value between " << min << " and " << max << "." << std::endl;
1094  return RET_FAILED;
1095  }
1096  else
1097  {
1098  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_EXPOSURE, (uint32_t) cameraProperty->u_longData);
1099  if (err!=DC1394_SUCCESS)
1100  {
1101  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1102  std::cerr << "\t ... Could not set exposure time "
1103  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1104  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1105  return RET_FAILED;
1106  }
1107  }
1108 #else
1109  m_cam.GetParameterInfo(FGP_AUTOEXPOSURE, &info);
1110  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1111  {
1112  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1113  std::cerr << "\t ... Exposure time " << cameraProperty->u_longData
1114  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1115  return RET_FAILED;
1116  }
1117  else
1118  {
1119  err = m_cam.SetParameter(FGP_AUTOEXPOSURE, cameraProperty->u_longData);
1120  if(err!=FCE_NOERROR)
1121  {
1122  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1123  std::cerr << "\t ... Could not set exposure time ( error " << err << " )" << std::endl;
1124  return RET_FAILED;
1125  }
1126  }
1127 #endif
1128  }
1129  else
1130  {
1131  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1132  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1133  return RET_FAILED;
1134  }
1135  break;
1137 // PROP_WHITE_BALANCE_U
1139  case PROP_WHITE_BALANCE_U:
1140  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1141  {
1142  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1143  {
1144 #ifdef __LINUX__
1145  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_WHITE_BALANCE, DC1394_FEATURE_MODE_AUTO);
1146  if (err!=DC1394_SUCCESS)
1147  {
1148  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1149  std::cerr << "\t ... Failed to set white balance U to AUTO mode." << std::endl;
1150  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1151  return RET_FAILED;
1152  }
1153 #else
1154  err = m_cam.SetParameter(FGP_WHITEBALCB, PVAL_AUTO);
1155  if(err!=FCE_NOERROR)
1156  {
1157  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1158  std::cerr << "\t ... Could not set white balance U to AUTO mode ( error " << err << " )" << std::endl;
1159  return RET_FAILED;
1160  }
1161 #endif
1162  }
1163  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1164  {
1165  // Void
1166  }
1167  else
1168  {
1169  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1170  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1171  return RET_FAILED;
1172  }
1173  }
1175  {
1176 #ifdef __LINUX__
1177  uint32_t min;
1178  uint32_t max;
1179  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_WHITE_BALANCE, &min, &max);
1180  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1181  {
1182  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1183  std::cerr << "\t ... White balance U " << cameraProperty->u_longData
1184  << " has to be a value between " << min << " and " << max << "." << std::endl;
1185  return RET_FAILED;
1186  }
1187  else
1188  {
1189  uint32_t whiteU;
1190  uint32_t whiteV;
1191  dc1394_feature_whitebalance_get_value(m_cam, &whiteU, &whiteV);
1192  err=dc1394_feature_whitebalance_set_value(m_cam, (uint32_t) cameraProperty->u_longData, whiteV);
1193  if (err!=DC1394_SUCCESS)
1194  {
1195  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1196  std::cerr << "\t ... Could not set white balance U "
1197  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1198  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1199  return RET_FAILED;
1200  }
1201  }
1202 #else
1203  m_cam.GetParameterInfo(FGP_WHITEBALCB, &info);
1204  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1205  {
1206  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1207  std::cerr << "\t ... White balance U value " << cameraProperty->u_longData
1208  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1209  return RET_FAILED;
1210  }
1211  else
1212  {
1213  err = m_cam.SetParameter(FGP_WHITEBALCB, cameraProperty->u_longData);
1214  if(err!=FCE_NOERROR)
1215  {
1216  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1217  std::cerr << "\t ... Could not set white balance U value ( error " << err << " )" << std::endl;
1218  return RET_FAILED;
1219  }
1220  }
1221 #endif
1222  }
1223  else
1224  {
1225  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1226  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1227  return RET_FAILED;
1228  }
1229  break;
1231 // PROP_WHITE_BALANCE_V
1233  case PROP_WHITE_BALANCE_V:
1234  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1235  {
1236  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1237  {
1238 #ifdef __LINUX__
1239  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_WHITE_BALANCE, DC1394_FEATURE_MODE_AUTO);
1240  if (err!=DC1394_SUCCESS)
1241  {
1242  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1243  std::cerr << "\t ... Failed to set white balance V to AUTO mode." << std::endl;
1244  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1245  return RET_FAILED;
1246  }
1247 #else
1248  err = m_cam.SetParameter(FGP_WHITEBALCR, PVAL_AUTO);
1249  if(err!=FCE_NOERROR)
1250  {
1251  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1252  std::cerr << "\t ... Could not set white balance V to AUTO mode ( error " << err << " )" << std::endl;
1253  return RET_FAILED;
1254  }
1255 #endif
1256  }
1257  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1258  {
1259  // Void
1260  }
1261  else
1262  {
1263  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1264  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1265  return RET_FAILED;
1266  }
1267  }
1269  {
1270 #ifdef __LINUX__
1271  uint32_t min;
1272  uint32_t max;
1273  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_WHITE_BALANCE, &min, &max);
1274  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1275  {
1276  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1277  std::cerr << "\t ... white balance V " << cameraProperty->u_longData
1278  << " has to be a value between " << min << " and " << max << "." << std::endl;
1279  return RET_FAILED;
1280  }
1281  else
1282  {
1283  uint32_t whiteU;
1284  uint32_t whiteV;
1285  dc1394_feature_whitebalance_get_value(m_cam, &whiteU, &whiteV);
1286  err=dc1394_feature_whitebalance_set_value(m_cam, whiteU, (uint32_t) cameraProperty->u_longData);
1287  if (err!=DC1394_SUCCESS)
1288  {
1289  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1290  std::cerr << "\t ... Could not set white balance V "
1291  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1292  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1293  return RET_FAILED;
1294  }
1295  }
1296 #else
1297  m_cam.GetParameterInfo(FGP_WHITEBALCR, &info);
1298  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1299  {
1300  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1301  std::cerr << "\t ... White balance V value " << cameraProperty->u_longData
1302  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1303  return RET_FAILED;
1304  }
1305  else
1306  {
1307  err = m_cam.SetParameter(FGP_WHITEBALCR, cameraProperty->u_longData);
1308  if(err!=FCE_NOERROR)
1309  {
1310  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1311  std::cerr << "\t ... Could not set white balance V value ( error " << err << " )" << std::endl;
1312  return RET_FAILED;
1313  }
1314  }
1315 #endif
1316  }
1317  else
1318  {
1319  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1320  std::cerr << "\t ... Wrong property type. 'unsigned int' or special value 'TYPE_SPECIAL' expected." << std::endl;
1321  return RET_FAILED;
1322  }
1323  break;
1325 // PROP_HUE
1327  case PROP_HUE:
1328  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1329  {
1330  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1331  {
1332 #ifdef __LINUX__
1333  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_HUE, DC1394_FEATURE_MODE_AUTO);
1334  if (err!=DC1394_SUCCESS)
1335  {
1336  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1337  std::cerr << "\t ... Failed to set hue to AUTO mode." << std::endl;
1338  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1339  return RET_FAILED;
1340  }
1341 #else
1342  err = m_cam.SetParameter(FGP_HUE, PVAL_AUTO);
1343  if(err!=FCE_NOERROR)
1344  {
1345  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1346  std::cerr << "\t ... Could not set image hue to AUTO ( error " << err << " )" << std::endl;
1347  return RET_FAILED;
1348  }
1349 #endif
1350  }
1351  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1352  {
1353  // Void
1354  }
1355  else
1356  {
1357  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1358  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1359  return RET_FAILED;
1360  }
1361  }
1363  {
1364 #ifdef __LINUX__
1365  uint32_t min;
1366  uint32_t max;
1367  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_HUE, &min, &max);
1368  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1369  {
1370  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1371  std::cerr << "\t ... Hue " << cameraProperty->u_longData
1372  << " has to be a value between " << min << " and " << max << "." << std::endl;
1373  return RET_FAILED;
1374  }
1375  else
1376  {
1377  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_HUE, (uint32_t) cameraProperty->u_longData);
1378  if (err!=DC1394_SUCCESS)
1379  {
1380  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1381  std::cerr << "\t ... Could not set hue "
1382  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1383  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1384  return RET_FAILED;
1385  }
1386  }
1387 #else
1388  m_cam.GetParameterInfo(FGP_HUE, &info);
1389  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1390  {
1391  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1392  std::cerr << "\t ... Hue " << cameraProperty->u_longData
1393  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1394  }
1395  else
1396  {
1397  err = m_cam.SetParameter(FGP_HUE, cameraProperty->u_longData);
1398  if(err!=FCE_NOERROR)
1399  {
1400  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1401  std::cerr << "\t ... Could not set image hue to " << cameraProperty->u_longData
1402  << " ( error " << err << " )" << std::endl;
1403  return RET_FAILED;
1404  }
1405  }
1406 #endif
1407  }
1408  else
1409  {
1410  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1411  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1412  return RET_FAILED;
1413  }
1414  break;
1416 // PROP_SATURATION
1418  case PROP_SATURATION:
1419  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1420  {
1421  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1422  {
1423 #ifdef __LINUX__
1424  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_SATURATION, DC1394_FEATURE_MODE_AUTO);
1425  if (err!=DC1394_SUCCESS)
1426  {
1427  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1428  std::cerr << "\t ... Failed to set saturation to AUTO mode." << std::endl;
1429  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1430  return RET_FAILED;
1431  }
1432 #else
1433  err = m_cam.SetParameter(FGP_SATURATION, PVAL_AUTO);
1434  if(err!=FCE_NOERROR)
1435  {
1436  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1437  std::cerr << "\t ... << Could not set saturation to AUTO ( error " << err << " )" << std::endl;
1438  return RET_FAILED;
1439  }
1440 #endif
1441  }
1442  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1443  {
1444  // Void
1445  }
1446  else
1447  {
1448  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1449  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1450  return RET_FAILED;
1451  }
1452  }
1454  {
1455 #ifdef __LINUX__
1456  uint32_t min;
1457  uint32_t max;
1458  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_SATURATION, &min, &max);
1459  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1460  {
1461  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1462  std::cerr << "\t ... Saturation " << cameraProperty->u_longData
1463  << " has to be a value between " << min << " and " << max << "." << std::endl;
1464  return RET_FAILED;
1465  }
1466  else
1467  {
1468  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_SATURATION, (uint32_t) cameraProperty->u_longData);
1469  if (err!=DC1394_SUCCESS)
1470  {
1471  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1472  std::cerr << "\t ... Could not set saturation "
1473  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1474  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1475  return RET_FAILED;
1476  }
1477  }
1478 #else
1479  m_cam.GetParameterInfo(FGP_SATURATION, &info);
1480  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1481  {
1482  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1483  std::cerr << "\t ... Saturation has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1484  }
1485  else
1486  {
1487  err = m_cam.SetParameter(FGP_SATURATION, cameraProperty->u_longData);
1488  if(err!=FCE_NOERROR)
1489  {
1490  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1491  std::cerr << "\t ... Could not set saturation ( error " << err << " )" << std::endl;
1492  return RET_FAILED;
1493  }
1494  }
1495 #endif
1496  }
1497  else
1498  {
1499  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1500  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1501  return RET_FAILED;
1502  }
1503  break;
1505 // PROP_GAMMA
1507  case PROP_GAMMA:
1508  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1509  {
1510  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1511  {
1512 #ifdef __LINUX__
1513  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_GAMMA, DC1394_FEATURE_MODE_AUTO);
1514  if (err!=DC1394_SUCCESS)
1515  {
1516  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1517  std::cerr << "\t ... Failed to set gamma to AUTO mode." << std::endl;
1518  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1519  return RET_FAILED;
1520  }
1521 #else
1522  err = m_cam.SetParameter(FGP_GAMMA, PVAL_AUTO);
1523  if(err!=FCE_NOERROR)
1524  {
1525  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1526  std::cerr << "\t ... << Could not set gamma to AUTO ( error " << err << " )" << std::endl;
1527  return RET_FAILED;
1528  }
1529 #endif
1530  }
1531  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1532  {
1533  // Void
1534  }
1535  else
1536  {
1537  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1538  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1539  return RET_FAILED;
1540  }
1541  }
1543  {
1544 #ifdef __LINUX__
1545  uint32_t min;
1546  uint32_t max;
1547  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_GAMMA, &min, &max);
1548  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1549  {
1550  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1551  std::cerr << "\t ... Gamma " << cameraProperty->u_longData
1552  << " has to be a value between " << min << " and " << max << "." << std::endl;
1553  return RET_FAILED;
1554  }
1555  else
1556  {
1557  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_GAMMA, (uint32_t) cameraProperty->u_longData);
1558  if (err!=DC1394_SUCCESS)
1559  {
1560  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1561  std::cerr << "\t ... Could not set gamma "
1562  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1563  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1564  return RET_FAILED;
1565  }
1566  }
1567 #else
1568  m_cam.GetParameterInfo(FGP_GAMMA, &info);
1569  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1570  {
1571  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1572  std::cerr << "\t ... Gamma has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1573  return RET_FAILED;
1574  }
1575  else
1576  {
1577  err = m_cam.SetParameter(FGP_GAMMA, cameraProperty->u_longData);
1578  if(err!=FCE_NOERROR)
1579  {
1580  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1581  std::cerr << "\t ... << Could not set gamma to " << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1582  return RET_FAILED;
1583  }
1584  }
1585 #endif
1586  }
1587  else
1588  {
1589  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1590  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1591  return RET_FAILED;
1592  }
1593  break;
1595 // PROP_GAIN
1597  case PROP_GAIN:
1598  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
1599  {
1600  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
1601  {
1602 #ifdef __LINUX__
1603  err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_GAIN, DC1394_FEATURE_MODE_AUTO);
1604  if (err!=DC1394_SUCCESS)
1605  {
1606  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1607  std::cerr << "\t ... Failed to set gamma to AUTO mode." << std::endl;
1608  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1609  return RET_FAILED;
1610  }
1611 #else
1612  err = m_cam.SetParameter(FGP_GAIN, PVAL_AUTO);
1613  if(err!=FCE_NOERROR)
1614  {
1615  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1616  std::cerr << "\t ... Could not set gain (on auto mode) ( error " << err << " )" << std::endl;
1617  return RET_FAILED;
1618  }
1619 #endif
1620  }
1621  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
1622  {
1623  // Void
1624  }
1625  else
1626  {
1627  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1628  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1629  return RET_FAILED;
1630  }
1631  }
1633  {
1634 #ifdef __LINUX__
1635  uint32_t min;
1636  uint32_t max;
1637  dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_GAIN, &min, &max);
1638  if ((cameraProperty->u_longData < min) | (cameraProperty->u_longData > max))
1639  {
1640  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1641  std::cerr << "\t ... Gamma " << cameraProperty->u_longData
1642  << " has to be a value between " << min << " and " << max << "." << std::endl;
1643  return RET_FAILED;
1644  }
1645  else
1646  {
1647  err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_GAIN, (uint32_t) cameraProperty->u_longData);
1648  if (err!=DC1394_SUCCESS)
1649  {
1650  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1651  std::cerr << "\t ... Could not set gamma "
1652  << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1653  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1654  return RET_FAILED;
1655  }
1656  }
1657 #else
1658  m_cam.GetParameterInfo(FGP_GAIN, &info);
1659  if ((cameraProperty->u_longData < info.MinValue) | (cameraProperty->u_longData > info.MaxValue))
1660  {
1661  std::cerr << "ERROR - AVTPikeCam::SetProperty: " << std::endl;
1662  std::cerr << "\t ... Gain has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
1663  return RET_FAILED;
1664  }
1665  else
1666  {
1667  err = m_cam.SetParameter(FGP_GAIN, cameraProperty->u_longData);
1668  if(err!=FCE_NOERROR)
1669  {
1670  std::cerr << "ERROR - AVTPikeCam::SetProperty: " << std::endl;
1671  std::cerr << "\t ... Could not set gain to value " << cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
1672  return RET_FAILED;
1673  }
1674  }
1675 #endif
1676  }
1677  else
1678  {
1679  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1680  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or special value 'TYPE_SPECIAL' expected." << std::endl;
1681  return RET_FAILED;
1682  }
1683  break;
1685 // VIDEO FORMAT, VIDEO MODE and COLOR CODING
1687  case PROP_VIDEO_ALL:
1688  if (cameraProperty->propertyType ==
1692  {
1693 #ifdef __LINUX__
1694  dc1394color_coding_t colorMode;
1695  dc1394video_mode_t videoMode;
1696  switch(cameraProperty->videoFormat)
1697  {
1698  case FORMAT_0:
1699  switch(cameraProperty->videoMode)
1700  {
1701  case MODE_1:
1702  videoMode = DC1394_VIDEO_MODE_320x240_YUV422;
1703  break;
1704  case MODE_2:
1705  videoMode = DC1394_VIDEO_MODE_640x480_YUV411;
1706  break;
1707  case MODE_3:
1708  videoMode = DC1394_VIDEO_MODE_640x480_YUV422;
1709  break;
1710  case MODE_4:
1711  case MODE_DEFAULT:
1712  videoMode = DC1394_VIDEO_MODE_640x480_RGB8;
1713  break;
1714  case MODE_5:
1715  videoMode = DC1394_VIDEO_MODE_640x480_MONO8;
1716  break;
1717  default:
1718  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1719  std::cerr << "\t ... Specified video mode unknown." << std::endl;
1720  return RET_FAILED;
1721  }
1722 
1723  err=dc1394_video_set_mode(m_cam, videoMode);
1724  if (err!=DC1394_SUCCESS)
1725  {
1726  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1727  std::cerr << "\t ... Failed to setup video mode for format 0" << std::endl;
1728  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1729  return RET_FAILED;
1730  }
1731 
1732  break;
1733  case FORMAT_1:
1734  switch(cameraProperty->videoMode)
1735  {
1736  case MODE_0:
1737  videoMode = DC1394_VIDEO_MODE_800x600_YUV422;
1738  break;
1739  case MODE_1:
1740  videoMode = DC1394_VIDEO_MODE_800x600_RGB8;
1741  break;
1742  case MODE_2:
1743  videoMode = DC1394_VIDEO_MODE_800x600_MONO8;
1744  break;
1745  case MODE_3:
1746  videoMode = DC1394_VIDEO_MODE_1024x768_YUV422;
1747  break;
1748  case MODE_4:
1749  case MODE_DEFAULT:
1750  videoMode = DC1394_VIDEO_MODE_1024x768_RGB8;
1751  break;
1752  case MODE_5:
1753  videoMode = DC1394_VIDEO_MODE_1024x768_MONO8;
1754  break;
1755  default:
1756  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1757  std::cerr << "\t ... Specified video mode not supported." << std::endl;
1758  return RET_FAILED;
1759  }
1760 
1761  err=dc1394_video_set_mode(m_cam, videoMode);
1762  if (err!=DC1394_SUCCESS)
1763  {
1764  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1765  std::cerr << "\t ... Failed to setup video for format 1" << std::endl;
1766  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1767  return RET_FAILED;
1768  }
1769 
1770  break;
1771  case FORMAT_2:
1772  switch(cameraProperty->videoMode)
1773  {
1774  case MODE_0:
1775  videoMode = DC1394_VIDEO_MODE_1280x960_YUV422;
1776  break;
1777  case MODE_1:
1778  case MODE_DEFAULT:
1779  videoMode = DC1394_VIDEO_MODE_1280x960_RGB8;
1780  break;
1781  case MODE_2:
1782  videoMode = DC1394_VIDEO_MODE_1280x960_MONO8;
1783  break;
1784  default:
1785  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1786  std::cerr << "\t ... Specified video mode not supported." << std::endl;
1787  return RET_FAILED;
1788  }
1789 
1790  err=dc1394_video_set_mode(m_cam, videoMode);
1791  if (err!=DC1394_SUCCESS)
1792  {
1793  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1794  std::cerr << "\t ... Failed to setup video for format 1" << std::endl;
1795  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1796  return RET_FAILED;
1797  }
1798 
1799  break;
1800  case FORMAT_DEFAULT:
1801  case FORMAT_7:
1802  switch(cameraProperty->colorMode)
1803  {
1804  case COLOR_YUV411:
1805  colorMode = DC1394_COLOR_CODING_YUV411;
1806  break;
1807  case COLOR_YUV422:
1808  colorMode = DC1394_COLOR_CODING_YUV422;
1809  break;
1810  case COLOR_YUV444:
1811  colorMode = DC1394_COLOR_CODING_YUV444;
1812  break;
1813  case COLOR_DEFAULT:
1814  case COLOR_RGB8:
1815  colorMode = DC1394_COLOR_CODING_RGB8;
1816  break;
1817  case COLOR_RGB16S:
1818  colorMode = DC1394_COLOR_CODING_RGB16S;
1819  break;
1820  case COLOR_RGB16:
1821  colorMode = DC1394_COLOR_CODING_RGB16;
1822  break;
1823  case COLOR_MONO8:
1824  colorMode = DC1394_COLOR_CODING_MONO8;
1825  break;
1826  case COLOR_MONO16S:
1827  colorMode = DC1394_COLOR_CODING_MONO16S;
1828  break;
1829  case COLOR_MONO16:
1830  colorMode = DC1394_COLOR_CODING_MONO16;
1831  break;
1832  case COLOR_RAW8:
1833  colorMode = DC1394_COLOR_CODING_RAW8;
1834  break;
1835  case COLOR_RAW16:
1836  colorMode = DC1394_COLOR_CODING_RAW16;
1837  break;
1838  default:
1839  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1840  std::cerr << "\t ... Specified color mode not supported." << std::endl;
1841  return RET_FAILED;
1842  }
1843 
1844 
1845  switch(cameraProperty->videoMode)
1846  {
1847  case MODE_DEFAULT:
1848  case MODE_0:
1849  videoMode = DC1394_VIDEO_MODE_FORMAT7_0;
1850  break;
1851  case MODE_4:
1852  videoMode = DC1394_VIDEO_MODE_FORMAT7_4;
1853  break;
1854  case MODE_5:
1855  videoMode = DC1394_VIDEO_MODE_FORMAT7_5;
1856  break;
1857  case MODE_6:
1858  videoMode = DC1394_VIDEO_MODE_FORMAT7_6;
1859  break;
1860  default:
1861  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1862  std::cerr << "\t ... Specified video mode not supported." << std::endl;
1863  return RET_FAILED;
1864  }
1865 
1866 
1867  err = dc1394_video_set_mode(m_cam, videoMode);
1868  if (err!=DC1394_SUCCESS)
1869  {
1870  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1871  std::cerr << "\t ... Failed to setup video mode." << std::endl;
1872  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1873  return RET_FAILED;
1874  }
1875  err = dc1394_format7_set_color_coding(m_cam, videoMode, colorMode);
1876  if (err!=DC1394_SUCCESS)
1877  {
1878  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1879  std::cerr << "\t ... Failed to setup color coding." << std::endl;
1880  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
1881  return RET_FAILED;
1882  }
1883 
1884  break;
1885  default:
1886  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1887  std::cerr << "\t ... Specified video format unknown." << std::endl;
1888  return RET_FAILED;
1889  }
1890 #else
1891 
1892  FG_RESOLUTION resolution;
1893  FG_COLORMODE colorMode;
1894  int videoMode = -1;
1895  switch(cameraProperty->videoFormat)
1896  {
1897  case FORMAT_0:
1898  switch(cameraProperty->videoMode)
1899  {
1900  case MODE_1:
1901  resolution = RES_320_240;
1902  colorMode = CM_YUV422;
1903  break;
1904  case MODE_2:
1905  resolution = RES_640_480;
1906  colorMode = CM_YUV411;
1907  break;
1908  case MODE_3:
1909  resolution = RES_640_480;
1910  colorMode = CM_YUV422;
1911  break;
1912  case MODE_4:
1913  case MODE_DEFAULT:
1914  resolution = RES_640_480;
1915  colorMode = CM_RGB8;
1916  break;
1917  case MODE_5:
1918  resolution = RES_640_480;
1919  colorMode = CM_Y8;
1920  break;
1921  default:
1922  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1923  std::cerr << "\t ... Specified video mode unknown." << std::endl;
1924  return RET_FAILED;
1925  }
1926 
1927  err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_30));
1928  if(err!=FCE_NOERROR)
1929  {
1930  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1931  std::cerr << "\t ... Could not set video format and mode ( error " << err << " )" << std::endl;
1932  return RET_FAILED;
1933  }
1934 
1935  break;
1936  case FORMAT_1:
1937  switch(cameraProperty->videoMode)
1938  {
1939  case MODE_0:
1940  resolution = RES_800_600;
1941  colorMode = CM_YUV422;
1942  break;
1943  case MODE_1:
1944  resolution = RES_800_600;
1945  colorMode = CM_RGB8;
1946  break;
1947  case MODE_2:
1948  resolution = RES_800_600;
1949  colorMode = CM_Y8;
1950  break;
1951  case MODE_3:
1952  resolution = RES_1024_768;
1953  colorMode = CM_YUV422;
1954  break;
1955  case MODE_4:
1956  case MODE_DEFAULT:
1957  resolution = RES_1024_768;
1958  colorMode = CM_RGB8;
1959  break;
1960  case MODE_5:
1961  resolution = RES_1024_768;
1962  colorMode = CM_Y8;
1963  break;
1964  default:
1965  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1966  std::cerr << "\t ... Specified video mode not supported." << std::endl;
1967  return RET_FAILED;
1968  }
1969 
1970  err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_15));
1971  if(err!=FCE_NOERROR)
1972  {
1973  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1974  std::cerr << "\t ... Could not set video format and mode ( error " << err << " )" << std::endl;
1975  return RET_FAILED;
1976  }
1977 
1978  break;
1979  case FORMAT_2:
1980  switch(cameraProperty->videoMode)
1981  {
1982  case MODE_0:
1983  resolution = RES_1280_960;
1984  colorMode = CM_YUV422;
1985  break;
1986  case MODE_1:
1987  case MODE_DEFAULT:
1988  resolution = RES_1280_960;
1989  colorMode = CM_RGB8;
1990  break;
1991  case MODE_2:
1992  resolution = RES_1280_960;
1993  colorMode = CM_Y8;
1994  break;
1995  default:
1996  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
1997  std::cerr << "\t ... Specified video mode not supported." << std::endl;
1998  return RET_FAILED;
1999  }
2000 
2001  err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_15));
2002  if(err!=FCE_NOERROR)
2003  {
2004  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2005  std::cerr << "\t ... Could not set video format and mode ( error " << err << " )" << std::endl;
2006  return RET_FAILED;
2007  }
2008 
2009  break;
2010  case FORMAT_DEFAULT:
2011  case FORMAT_7:
2012  switch(cameraProperty->colorMode)
2013  {
2014  case COLOR_YUV444:
2015  colorMode = CM_YUV444;
2016  break;
2017  case COLOR_YUV422:
2018  colorMode = CM_YUV422;
2019  break;
2020  case COLOR_YUV411:
2021  colorMode = CM_YUV411;
2022  break;
2023  case COLOR_DEFAULT:
2024  case COLOR_RGB8:
2025  colorMode = CM_RGB8;
2026  break;
2027  case COLOR_RGB16S:
2028  colorMode = CM_SRGB16;
2029  break;
2030  case COLOR_RGB16:
2031  colorMode = CM_RGB16;
2032  break;
2033  case COLOR_MONO8:
2034  colorMode = CM_Y8;
2035  break;
2036  case COLOR_MONO16S:
2037  colorMode = CM_SY16;
2038  break;
2039  case COLOR_MONO16:
2040  colorMode = CM_Y16;
2041  break;
2042  case COLOR_RAW8:
2043  colorMode = CM_RAW8;
2044  break;
2045  case COLOR_RAW16:
2046  colorMode = CM_RAW16;
2047  break;
2048  default:
2049  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2050  std::cerr << "\t ... Specified color mode not supported." << std::endl;
2051  return RET_FAILED;
2052  }
2053 
2054  switch(cameraProperty->videoMode)
2055  {
2056  case MODE_0:
2057  case COLOR_DEFAULT:
2058  videoMode = 0;
2059  break;
2060  case MODE_4:
2061  videoMode = 4;
2062  break;
2063  case MODE_5:
2064  videoMode = 5;
2065  break;
2066  case MODE_6:
2067  videoMode = 6;
2068  break;
2069  default:
2070  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2071  std::cerr << "\t ... Specified video mode not supported." << std::endl;
2072  return RET_FAILED;
2073  }
2074 
2075  err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEDCAMFORMAT(RES_SCALABLE, videoMode, colorMode));
2076  if(err!=FCE_NOERROR)
2077  {
2078  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2079  std::cerr << "\t ... Could not set video format and mode ( error " << err << " )" << std::endl;
2080  return RET_FAILED;
2081  }
2082 
2083  break;
2084  default:
2085  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2086  std::cerr << "\t ... Specified video format not supported." << std::endl;
2087  return RET_FAILED;
2088  }
2089 #endif
2090  }
2091  else
2092  {
2093  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2094  std::cerr << "\t ... Wrong property type. 'TYPE_VIDEO_MODE' or special value 'TYPE_SPECIAL' expected." << std::endl;
2095  return RET_FAILED;
2096  }
2097  break;
2098 
2100 // PROP_FRAME_RATE
2102  case PROP_FRAME_RATE:
2103 #ifdef __LINUX__
2104  dc1394video_mode_t videoMode;
2105  err=dc1394_video_get_mode(m_cam, &videoMode);
2106  if(err!=DC1394_SUCCESS)
2107  {
2108  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2109  std::cerr << "\t ... Could not get video mode ( error " << err << " )" << std::endl;
2110  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2111  return RET_FAILED;
2112  }
2113 
2114  // Format 7
2115  // Bytes_per_packet = (fps * width * height * ByteDepth * 125microsec)/1000000
2116  if (videoMode==DC1394_VIDEO_MODE_FORMAT7_0 ||
2117  videoMode==DC1394_VIDEO_MODE_FORMAT7_1 ||
2118  videoMode==DC1394_VIDEO_MODE_FORMAT7_2 ||
2119  videoMode==DC1394_VIDEO_MODE_FORMAT7_3 ||
2120  videoMode==DC1394_VIDEO_MODE_FORMAT7_4 ||
2121  videoMode==DC1394_VIDEO_MODE_FORMAT7_5 ||
2122  videoMode==DC1394_VIDEO_MODE_FORMAT7_6 ||
2123  videoMode==DC1394_VIDEO_MODE_FORMAT7_7)
2124  {
2125 #else
2126  UINT32 imageFormat;
2127  FGPINFO packetSizeInfo;
2128  err = m_cam.GetParameter(FGP_IMAGEFORMAT, &imageFormat);
2129  if(err!=FCE_NOERROR)
2130  {
2131  std::cout << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2132  std::cerr << "\t ... Could not read image format ( error " << err << " )" << std::endl;
2133  return RET_FAILED;
2134  }
2135 
2136  // Format 7
2137  // Bytes_per_packet = (fps * width * height * ByteDepth * 125microsec)/1000000
2138  if (IMGRES(imageFormat)==RES_SCALABLE)
2139  {
2140 #endif
2141  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
2142  {
2143  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO ||
2145  {
2146  // Void
2147  }
2148  }
2149  else if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_FLOAT)
2150  {
2151 #ifdef __LINUX__
2152  uint64_t bytesPerFrame;
2153 
2154  err = dc1394_format7_get_total_bytes(m_cam, videoMode, &bytesPerFrame);
2155  if (err!=DC1394_SUCCESS)
2156  {
2157  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2158  std::cerr << "\t ... Could not get bytes per image ( error " << err << " )" << std::endl;
2159  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2160  return RET_FAILED;
2161  }
2162 
2163  if (cameraProperty->floatData > 0 && cameraProperty->floatData <= 60)
2164  {
2165  double fps = cameraProperty->floatData;
2166  uint32_t min = 0;
2167  uint32_t max = 0;
2168  uint64_t bytesPerFrame = 0;
2169  uint32_t bytesPerPacket = 0;
2170  unsigned long packetsPerFrame = 0;
2171  double busPeriodInSeconds = 0;
2172  dc1394speed_t isoSpeed;
2173 
2174  err = dc1394_format7_get_packet_parameters(m_cam, videoMode, &min, &max);
2175  if (err!=DC1394_SUCCESS)
2176  {
2177  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2178  std::cerr << "\t ... Could not get min/max bytes per packet ( error " << err << " )" << std::endl;
2179  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2180  return RET_FAILED;
2181  }
2182  err = dc1394_format7_get_total_bytes(m_cam, videoMode, &bytesPerFrame);
2183  if (err!=DC1394_SUCCESS)
2184  {
2185  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2186  std::cerr << "\t ... Could not get total bytes per frame ( error " << err << " )" << std::endl;
2187  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2188  return RET_FAILED;
2189  }
2190 
2191  err = dc1394_video_get_iso_speed(m_cam, &isoSpeed);
2192  if (err!=DC1394_SUCCESS)
2193  {
2194  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2195  std::cerr << "\t ... Could not get iso speed ( error " << err << " )" << std::endl;
2196  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2197  return RET_FAILED;
2198  }
2199 
2200  if (isoSpeed == DC1394_ISO_SPEED_100)
2201  {
2202  busPeriodInSeconds = 500.0/1000000.0;
2203  }
2204  else if(isoSpeed == DC1394_ISO_SPEED_200)
2205  {
2206  busPeriodInSeconds = 250.0/1000000.0;
2207  }
2208  else if(isoSpeed == DC1394_ISO_SPEED_400)
2209  {
2210  busPeriodInSeconds = 125.0/1000000.0;
2211  }
2212  else
2213  {
2214  busPeriodInSeconds = 62.5/1000000.0;
2215  }
2216 
2217  packetsPerFrame = (int) (1.0/(busPeriodInSeconds*fps) + 0.5);
2218  bytesPerPacket = (uint32_t) ((bytesPerFrame + packetsPerFrame - 1)/(packetsPerFrame));
2219 
2220  if (bytesPerPacket < min || bytesPerPacket > max)
2221  {
2222  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2223  std::cout << "\t ... Desired packet size out of bounds. Resetting packet size to max value" << std::endl;
2224  bytesPerPacket = max;
2225  }
2226 
2227  // Bytes per packet must be a multiple of min bytes
2228  bytesPerPacket = ((int)(bytesPerPacket/min))*min;
2229 
2230  err = dc1394_format7_set_packet_size(m_cam, videoMode, bytesPerPacket);
2231  if (err!=DC1394_SUCCESS)
2232  {
2233  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2234  std::cerr << "\t ... Could not set packet size " << bytesPerPacket << " ( error " << err << " )" << std::endl;
2235  return RET_FAILED;
2236  }
2237  }
2238 #else
2239  UINT32 bytesPerImage = 0;
2240  UINT32 isoSpeed = 0;
2241  double busPeriodInSeconds = 0;
2242  err = m_cam.GetParameter(FGP_FRAMEMEMORYSIZE, &bytesPerImage);
2243  if(err!=FCE_NOERROR)
2244  {
2245  std::cout << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2246  std::cerr << "\t ... Could not read image size ( error " << err << " )" << std::endl;
2247  return RET_FAILED;
2248  }
2249 
2250  err = m_cam.GetParameter(FGP_PHYSPEED, &isoSpeed);
2251  if (err!=FCE_NOERROR)
2252  {
2253  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2254  std::cerr << "\t ... Could not read iso speed info ( error " << err << " )" << std::endl;
2255  return RET_FAILED;
2256  }
2257 
2258  if (isoSpeed == PS_100MBIT)
2259  {
2260  busPeriodInSeconds = 500.0/1000000.0;
2261  }
2262  else if(isoSpeed == PS_200MBIT)
2263  {
2264  busPeriodInSeconds = 250.0/1000000.0;
2265  }
2266  else if(isoSpeed == PS_400MBIT)
2267  {
2268  busPeriodInSeconds = 125.0/1000000.0;
2269  }
2270  else
2271  {
2272  busPeriodInSeconds = 62.5/1000000.0;
2273  }
2274 
2275  if (cameraProperty->floatData > 0 && cameraProperty->floatData <= 60)
2276  {
2277  double fps = cameraProperty->floatData;
2278  UINT32 bytesPerPacket = (UINT32) (fps * busPeriodInSeconds * (double)bytesPerImage);
2279 
2280  err = m_cam.GetParameterInfo(FGP_PACKETSIZE, &packetSizeInfo);
2281  if(err!=FCE_NOERROR)
2282  {
2283  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2284  std::cerr << "\t ... Could not read packet size info ( error " << err << " )" << std::endl;
2285  return RET_FAILED;
2286  }
2287 
2288  if (bytesPerPacket < packetSizeInfo.MinValue || bytesPerPacket > packetSizeInfo.MaxValue)
2289  {
2290  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2291  std::cout << "\t ... Desired packet size out of bounds. Resetting packet size to max value" << std::endl;
2292  bytesPerPacket = packetSizeInfo.MaxValue;
2293  }
2294 
2295  // Bytes per packet must be a multiple of min bytes
2296  bytesPerPacket = ((int)(bytesPerPacket/packetSizeInfo.MinValue))*packetSizeInfo.MinValue;
2297 
2298  err = m_cam.SetParameter(FGP_PACKETSIZE, bytesPerPacket);
2299  if(err!=FCE_NOERROR)
2300  {
2301  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2302  std::cerr << "\t ... Could not set packet size " << bytesPerPacket << " ( error " << err << " )" << std::endl;
2303  return RET_FAILED;
2304  }
2305  }
2306 #endif
2307 
2308  else
2309  {
2310  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2311  std::cerr << "\t ... Specified framerate out of range ( error " << err << " )" << std::endl;
2312  return RET_FAILED;
2313  }
2314  }
2315  else
2316  {
2317  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2318  std::cerr << "\t ... Wrong property type. 'TYPE_FLOAT' or special values 'TYPE_SPECIAL' expected." << std::endl;
2319  return RET_FAILED;
2320  }
2321  }
2322  // Other formats than Format 7
2323  else
2324  {
2325  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
2326  {
2327  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
2328  {
2329 #ifdef __LINUX__
2330  err=dc1394_video_set_framerate(m_cam, DC1394_FRAMERATE_7_5);
2331  if (err!=DC1394_SUCCESS)
2332  {
2333  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2334  std::cerr << "\t ... Failed to set framerate to AUTO mode." << std::endl;
2335  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2336  return RET_FAILED;
2337  }
2338 #else
2339  err = m_cam.SetParameter(FGP_FRAMERATE, PVAL_AUTO);
2340  if(err!=FCE_NOERROR)
2341  {
2342  std::cout << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2343  std::cerr << "\t ... Could not set framerate to AUTO ( error " << err << " )" << std::endl;
2344  return RET_FAILED;
2345  }
2346 #endif
2347  }
2348  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
2349  {
2350  // Void
2351  }
2352  else
2353  {
2354  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2355  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2356  return RET_FAILED;
2357  }
2358  }
2359  else if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_FLOAT)
2360  {
2361 #ifdef __LINUX__
2362  dc1394framerate_t framerate;
2363  if (cameraProperty->floatData <= 1.875)
2364  {
2365  framerate = DC1394_FRAMERATE_1_875;
2366  }
2367  else if (cameraProperty->floatData <= 3.75)
2368  {
2369  framerate = DC1394_FRAMERATE_3_75;
2370  }
2371  else if (cameraProperty->floatData <= 7.5)
2372  {
2373  framerate = DC1394_FRAMERATE_7_5;
2374  }
2375  else if (cameraProperty->floatData <= 15)
2376  {
2377  framerate = DC1394_FRAMERATE_15;
2378  }
2379  else if (cameraProperty->floatData <= 30)
2380  {
2381  framerate = DC1394_FRAMERATE_30;
2382  }
2383  else if (cameraProperty->floatData <= 60)
2384  {
2385  framerate = DC1394_FRAMERATE_60;
2386  }
2387  else
2388  {
2389  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2390  std::cerr << "\t ... Specified framerate " << cameraProperty->floatData << " out of range ( error " << err << " )" << std::endl;
2391  return RET_FAILED;
2392  }
2393  err=dc1394_video_set_framerate(m_cam, framerate);
2394  if (err!=DC1394_SUCCESS)
2395  {
2396  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2397  std::cerr << "\t ... Could not set specified framerate " << cameraProperty->floatData << " ( error " << err << " )" << std::endl;
2398  return RET_FAILED;
2399  }
2400 #else
2401  UINT32 framerate;
2402  if (cameraProperty->floatData <= 1.875)
2403  {
2404  framerate = FR_1_875;
2405  }
2406  else if (cameraProperty->floatData <= 3.75)
2407  {
2408  framerate = FR_3_75;
2409  }
2410  else if (cameraProperty->floatData <= 7.5)
2411  {
2412  framerate = FR_7_5;
2413  }
2414  else if (cameraProperty->floatData <= 15)
2415  {
2416  framerate = FR_15;
2417  }
2418  else if (cameraProperty->floatData <= 30)
2419  {
2420  framerate = FR_30;
2421  }
2422  else if (cameraProperty->floatData <= 60)
2423  {
2424  framerate = FR_60;
2425  }
2426  else
2427  {
2428  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2429  std::cerr << "\t ... Specified framerate " << cameraProperty->floatData << " out of range ( error " << err << " )" << std::endl;
2430  return RET_FAILED;
2431  }
2432  err = m_cam.SetParameter(FGP_FRAMERATE, framerate);
2433  if(err!=FCE_NOERROR)
2434  {
2435  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2436  std::cerr << "\t ... Could not set specified framerate " << cameraProperty->floatData << " ( error " << err << " )" << std::endl;
2437  return RET_FAILED;
2438  }
2439 #endif
2440  }
2441  else
2442  {
2443  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2444  std::cerr << "\t ... Wrong property type. 'TYPE_FLOAT' or special values 'TYPE_SPECIAL' expected." << std::endl;
2445  return RET_FAILED;
2446  }
2447  }
2448  return RET_OK;
2449  break;
2451 // PROP_FW_OPERATION_MODE
2454  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
2455  {
2456  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
2457  {
2458  m_operationMode_B = false;
2459  return RET_OK;
2460  }
2461  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
2462  {
2463  m_operationMode_B = false;
2464  return RET_OK;
2465  }
2466  else
2467  {
2468  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2469  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2470  return RET_FAILED;
2471  }
2472 
2473  }
2474  else if (cameraProperty->propertyType & TYPE_STRING)
2475  {
2476  if (cameraProperty->stringData == "A")
2477  {
2478  m_operationMode_B = false;
2479  return RET_OK;
2480  }
2481  else if (cameraProperty->stringData == "B")
2482  {
2483  m_operationMode_B = true;
2484  return RET_OK;
2485  }
2486  else
2487  {
2488  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2489  std::cerr << "\t ... FireWire operation mode " << cameraProperty->stringData << " unknown." << std::endl;
2490  return RET_FAILED;
2491  }
2492  }
2493  else
2494  {
2495  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2496  std::cerr << "\t ... Wrong property type. 'TYPE_STRING' or special values 'TYPE_SPECIAL' expected." << std::endl;
2497  return RET_FAILED;
2498  }
2499  break;
2501 // PROP_ISO_SPEED
2503  case PROP_ISO_SPEED:
2504  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
2505  {
2506  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
2507  {
2508 #ifdef __LINUX__
2509  err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_400);
2510  if (err!=DC1394_SUCCESS)
2511  {
2512  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2513  std::cerr << "\t ... Failed to setup iso speed." << std::endl;
2514  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2515  return RET_FAILED;
2516  }
2517 #else
2518  err = m_cam.SetParameter(FGP_PHYSPEED, PS_AUTO);
2519  if(err!=FCE_NOERROR)
2520  {
2521  std::cerr<< "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2522  std::cerr << "\t ... Could not set iso speed to AUTO mode ( error " << err << " )" << std::endl;
2523  return RET_FAILED;
2524  }
2525 #endif
2526  }
2527  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
2528  {
2529 #ifdef __LINUX__
2530 #else
2531  err = m_cam.SetParameter(FGP_PHYSPEED, PS_LAST);
2532  if(err!=FCE_NOERROR)
2533  {
2534  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2535  std::cerr << "\t ... Could not set iso speed to DEFAULT mode ( error " << err << " )" << std::endl;
2536  return RET_FAILED;
2537  }
2538 #endif
2539  }
2540  else
2541  {
2542  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2543  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2544  return RET_FAILED;
2545  }
2546  }
2548  {
2549 #ifdef __LINUX__
2550  err = DC1394_FAILURE;
2551  if (cameraProperty->u_longData <= 100)
2552  {
2553  err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_100);
2554  }
2555  else if (cameraProperty->u_longData <= 200)
2556  {
2557  err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_200);
2558  }
2559  else if (cameraProperty->u_longData <= 400)
2560  {
2561  err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_400);
2562  }
2563  else if (cameraProperty->u_longData <= 800)
2564  {
2565  err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_800);
2566  }
2567  if (err!=DC1394_SUCCESS)
2568  {
2569  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2570  std::cerr << "\t ... Failed to setup iso speed " << cameraProperty->u_longData << std::endl;
2571  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2572  return RET_FAILED;
2573  }
2574 #else
2575  err = 1;
2576  if (cameraProperty->u_longData <= 100)
2577  {
2578  err = m_cam.SetParameter(FGP_PHYSPEED, PS_100MBIT);
2579  }
2580  else if (cameraProperty->u_longData <= 200)
2581  {
2582  err = m_cam.SetParameter(FGP_PHYSPEED, PS_200MBIT);
2583  }
2584  else if (cameraProperty->u_longData <= 400)
2585  {
2586  err = m_cam.SetParameter(FGP_PHYSPEED, PS_400MBIT);
2587  }
2588  else if (cameraProperty->u_longData <= 800)
2589  {
2590  err = m_cam.SetParameter(FGP_PHYSPEED, PS_800MBIT);
2591  }
2592  if(err!=FCE_NOERROR)
2593  {
2594  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2595  std::cerr << "\t ... Could not set iso speed to " <<
2596  cameraProperty->u_longData << " ( error " << err << " )" << std::endl;
2597  return RET_FAILED;
2598  }
2599 #endif
2600  }
2601  else
2602  {
2603  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2604  std::cerr << "\t ... Wrong property type. '(TYPE_LONG|TYPE_UNSIGNED)' or 'TYPE_SPECIAL' expected." << std::endl;
2605  return RET_FAILED;
2606  }
2607  break;
2609 // PROP_RESOLUTION
2611  case PROP_RESOLUTION:
2612  if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_SPECIAL)
2613  {
2614  if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_AUTO)
2615  {
2616 #ifdef __LINUX__
2617 #else
2618  err = m_cam.SetParameter(FGP_XSIZE, PVAL_AUTO);
2619  if(err!=FCE_NOERROR)
2620  {
2621  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2622  std::cerr << "\t ... Could not set x resolution to AUTO mode ( error " << err << " )" << std::endl;
2623  return RET_FAILED;
2624  }
2625  err = m_cam.SetParameter(FGP_YSIZE, PVAL_AUTO);
2626  if(err!=FCE_NOERROR)
2627  {
2628  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2629  std::cerr << "\t ... Could not set y resolution to AUTO mode ( error " << err << " )" << std::endl;
2630  return RET_FAILED;
2631  }
2632 #endif
2633  }
2634  else if(cameraProperty->specialValue == ipa_CameraSensors::VALUE_DEFAULT)
2635  {
2636  // Void
2637  }
2638  else
2639  {
2640  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2641  std::cerr << "\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2642  return RET_FAILED;
2643  }
2644  }
2645  else if (cameraProperty->propertyType & ipa_CameraSensors::TYPE_CAMERA_RESOLUTION)
2646  {
2647 #ifdef __LINUX__
2648 #else
2649  m_cam.GetParameterInfo(FGP_XSIZE, &info);
2650  if (((unsigned int) cameraProperty->cameraResolution.xResolution < info.MinValue) ||
2651  ((unsigned int) cameraProperty->cameraResolution.xResolution > info.MaxValue))
2652  {
2653  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2654  std::cout << "\t ... x resolution " << cameraProperty->cameraResolution.xResolution
2655  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
2656  std::cout << "\t ... Setting maximal x resolution" << std::endl;
2657  }
2658  m_cam.GetParameterInfo(FGP_YSIZE, &info);
2659  if (((unsigned int) cameraProperty->cameraResolution.yResolution < info.MinValue) ||
2660  ((unsigned int) cameraProperty->cameraResolution.yResolution > info.MaxValue))
2661  {
2662  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2663  std::cout << "\t ... y resolution " << cameraProperty->cameraResolution.yResolution
2664  << " has to be a value between " << info.MinValue << " and " << info.MaxValue << "." << std::endl;
2665  std::cout << "\t ... Setting maximal y resolution" << std::endl;
2666  }
2667 
2668  // Set x/y resolution. If values are out of range,
2669  // the maximal possible reolution is set through the AVT library
2670  err = m_cam.SetParameter(FGP_XSIZE, cameraProperty->cameraResolution.xResolution);
2671  if(err!=FCE_NOERROR)
2672  {
2673  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2674  std::cout << "\t ... Could not set image width ( error " << err << " )" << std::endl;
2675  }
2676 
2677  err = m_cam.SetParameter(FGP_YSIZE, cameraProperty->cameraResolution.yResolution);
2678  if(err!=FCE_NOERROR)
2679  {
2680  std::cout << "WARNING - AVTPikeCam::SetProperty:" << std::endl;
2681  std::cout << "\t ... Could not set image height ( error " << err << " )" << std::endl;
2682  }
2683 #endif
2684 
2685  }
2686  else
2687  {
2688  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2689  std::cerr << "\t ... Wrong property type. 'TYPE_CAMERA_RESOLUTION' or 'TYPE_SPECIAL' expected." << std::endl;
2690  return RET_FAILED;
2691  }
2692  break;
2694 // DEFAULT
2696  default:
2697  std::cerr << "ERROR - VTPikeCam::SetProperty:" << std::endl;
2698  std::cerr << "\t ... Property " << cameraProperty->propertyID << " unspecified." << std::endl;
2699  return RET_FAILED;
2700  break;
2701  }
2702 
2703  return RET_OK;
2704 }
2705 
2706 unsigned long AVTPikeCam::SetParameters()
2707 {
2708  ipa_CameraSensors::t_cameraProperty cameraProperty;
2709 
2710 // -----------------------------------------------------------------
2711 // Setup trigger
2712 // -----------------------------------------------------------------
2713  if (m_ColorCameraParameters.m_CameraRole == MASTER)
2714  {
2715  std::cout << "Info - AVTPikeCam::SetProperty:" << std::endl;
2716  std::cout << "\t ... Setting camera in MASTER mode." << std::endl;
2717 #ifdef __LINUX__
2718  // Trigger OFF, Trigger mode 3 -> Edge mode 0, falling
2719  // Trigger OFF -> Edge mode 0, falling
2720  dc1394error_t err;
2721  err = dc1394_external_trigger_set_power(m_cam, DC1394_OFF);
2722  if (err!=DC1394_SUCCESS)
2723  {
2724  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2725  std::cerr << "\t ... Failed to deactivate external trigger." << std::endl;
2726  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2727  return RET_FAILED;
2728  }
2729  err = dc1394_external_trigger_set_mode(m_cam, DC1394_TRIGGER_MODE_3);
2730  if (err!=DC1394_SUCCESS)
2731  {
2732  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2733  std::cerr << "\t ... Failed to set trigger mode." << std::endl;
2734  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2735  return RET_FAILED;
2736  }
2737 #else
2738  UINT32 err;
2739  // Use internal trigger
2740  UINT32 triggerValue;
2741  triggerValue=MAKETRIGGER(0, 0, 0, 0, 0);
2742  err = m_cam.SetParameter(FGP_TRIGGER,triggerValue);
2743  if(err!=FCE_NOERROR)
2744  {
2745  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2746  std::cerr << "\t ... Could not set Slave trigger mode ( error " << err << " )" << std::endl;
2747  return RET_FAILED;
2748  }
2749 #endif
2750  }
2751  else if (m_ColorCameraParameters.m_CameraRole == SLAVE)
2752  {
2753  std::cout << "Info - AVTPikeCam::SetProperty:" << std::endl;
2754  std::cout << "\t ... Setting camera in SLAVE mode." << std::endl;
2755 #ifdef __LINUX__
2756  // Trigger ON, Trigger mode 0, low -> Edge mode 0, rizing
2757  dc1394error_t err;
2758  err = dc1394_external_trigger_set_power(m_cam, DC1394_ON);
2759  if (err!=DC1394_SUCCESS)
2760  {
2761  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2762  std::cerr << "\t ... Failed to activate external trigger." << std::endl;
2763  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2764  return RET_FAILED;
2765  }
2766 
2767  err = dc1394_external_trigger_set_polarity(m_cam, DC1394_TRIGGER_ACTIVE_HIGH);
2768  if (err!=DC1394_SUCCESS)
2769  {
2770  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2771  std::cerr << "\t ... Failed to set trigger polarity." << std::endl;
2772  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2773  return RET_FAILED;
2774  }
2775 
2776  err = dc1394_external_trigger_set_mode(m_cam, DC1394_TRIGGER_MODE_0);
2777  if (err!=DC1394_SUCCESS)
2778  {
2779  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2780  std::cerr << "\t ... Failed to set trigger mode." << std::endl;
2781  std::cerr << "\t ... " << dc1394_error_get_string(err) << std::endl;
2782  return RET_FAILED;
2783  }
2784 #else
2785  UINT32 err;
2786  UINT32 nOn=1; // 0=ext. trigger off, 1=ext. trigger on
2787  UINT32 nPolarity=1; // 0=low active input, 1=high active input
2788  UINT32 nSrc=0; // not currently applicable to AVT cameras
2789  UINT32 nMode=0; // 0=edge mode, 1=level mode, 15=bulk mode
2790  UINT32 nParm=0; // not currently applicable to AVT cameras
2791  UINT32 triggerValue;
2792  triggerValue=MAKETRIGGER(nOn, nPolarity, nSrc, nMode, nParm);
2793  err = m_cam.SetParameter(FGP_TRIGGER,triggerValue);
2794  if(err!=FCE_NOERROR)
2795  {
2796  std::cerr << "ERROR - AVTPikeCam::SetProperty:" << std::endl;
2797  std::cerr << "\t ... Could not set Slave trigger mode ( error " << err << " )" << std::endl;
2798  return RET_FAILED;
2799  }
2800 #endif
2801  }
2802 
2803 // -----------------------------------------------------------------
2804 // Set isochronous speed
2805 // -----------------------------------------------------------------
2807  std::string sIsoSpeed = "";
2808  m_ColorCameraParameters.m_IsoSpeed.clear(); // Clear flags within stringstream
2809  m_ColorCameraParameters.m_IsoSpeed.seekg(0); // Set Pointer to position 0 within stringstream
2810  m_ColorCameraParameters.m_IsoSpeed >> sIsoSpeed;
2811  if (sIsoSpeed == "AUTO")
2812  {
2814  cameraProperty.specialValue = VALUE_AUTO;
2815  }
2816  else if (sIsoSpeed == "DEFAULT")
2817  {
2819  cameraProperty.specialValue = VALUE_DEFAULT;
2820  }
2821  else
2822  {
2824  m_ColorCameraParameters.m_IsoSpeed.clear(); // Clear flags within stringstream
2825  m_ColorCameraParameters.m_IsoSpeed.seekg(0); // Set Pointer to position 0 within stringstream
2826  m_ColorCameraParameters.m_IsoSpeed >> cameraProperty.u_longData;
2827  }
2828 
2829  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
2830  {
2831  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
2832  std::cout << "\t ... Could not set ISO speed." << std::endl;
2833  }
2834 
2835 // -----------------------------------------------------------------
2836 // Set video mode, video format and color mode
2837 // -----------------------------------------------------------------
2842  std::string sVideoFormat = "";
2843  std::string sVideoMode = "";
2844  std::string sColorMode = "";
2845 
2846  m_ColorCameraParameters.m_VideoFormat.clear(); // Clear flags within stringstream
2847  m_ColorCameraParameters.m_VideoFormat.seekg(0); // Set Pointer to position 0 within stringstream
2848  m_ColorCameraParameters.m_VideoFormat >> sVideoFormat;
2849  if (sVideoFormat == "FORMAT_DEFAULT")
2850  {
2851  cameraProperty.videoFormat = FORMAT_DEFAULT;
2852  }
2853  else if (sVideoFormat == "FORMAT_0")
2854  {
2855  cameraProperty.videoFormat = FORMAT_0;
2856  }
2857  else if (sVideoFormat == "FORMAT_1")
2858  {
2859  cameraProperty.videoFormat = FORMAT_1;
2860  }
2861  else if (sVideoFormat == "FORMAT_2")
2862  {
2863  cameraProperty.videoFormat = FORMAT_2;
2864  }
2865  else if (sVideoFormat == "FORMAT_7")
2866  {
2867  cameraProperty.videoFormat = FORMAT_7;
2868  }
2869 
2870  m_ColorCameraParameters.m_VideoMode.clear(); // Clear flags within stringstream
2871  m_ColorCameraParameters.m_VideoMode.seekg(0); // Set Pointer to position 0 within stringstream
2872  m_ColorCameraParameters.m_VideoMode >> sVideoMode;
2873  if (sVideoMode == "MODE_DEFAULT")
2874  {
2875  cameraProperty.videoMode = MODE_DEFAULT;
2876  }
2877  else if (sVideoMode == "MODE_0")
2878  {
2879  cameraProperty.videoMode = MODE_0;
2880  }
2881  else if (sVideoMode == "MODE_1")
2882  {
2883  cameraProperty.videoMode = MODE_1;
2884  }
2885  else if (sVideoMode == "MODE_2")
2886  {
2887  cameraProperty.videoMode = MODE_2;
2888  }
2889  else if (sVideoMode == "MODE_3")
2890  {
2891  cameraProperty.videoMode = MODE_3;
2892  }
2893  else if (sVideoMode == "MODE_4")
2894  {
2895  cameraProperty.videoMode = MODE_4;
2896  }
2897  else if (sVideoMode == "MODE_5")
2898  {
2899  cameraProperty.videoMode = MODE_5;
2900  }
2901  else if (sVideoMode == "MODE_6")
2902  {
2903  cameraProperty.videoMode = MODE_6;
2904  }
2905  else if (sVideoMode == "MODE_7")
2906  {
2907  cameraProperty.videoMode = MODE_7;
2908  }
2909 
2910  m_ColorCameraParameters.m_ColorMode.clear(); // Clear flags within stringstream
2911  m_ColorCameraParameters.m_ColorMode.seekg(0); // Set Pointer to position 0 within stringstream
2912  m_ColorCameraParameters.m_ColorMode >> sColorMode;
2913  if (sColorMode == "COLOR_DEFAULT")
2914  {
2915  cameraProperty.colorMode = COLOR_DEFAULT;
2916  }
2917  else if (sColorMode == "COLOR_YUV422")
2918  {
2919  cameraProperty.colorMode = COLOR_YUV422;
2920  }
2921  else if (sColorMode == "COLOR_YUV411")
2922  {
2923  cameraProperty.colorMode = COLOR_YUV411;
2924  }
2925  else if (sColorMode == "COLOR_RGB8")
2926  {
2927  cameraProperty.colorMode = COLOR_RGB8;
2928  }
2929  else if (sColorMode == "COLOR_RGB16S")
2930  {
2931  cameraProperty.colorMode = COLOR_RGB16S;
2932  }
2933  else if (sColorMode == "COLOR_RGB16")
2934  {
2935  cameraProperty.colorMode = COLOR_RGB16;
2936  }
2937  else if (sColorMode == "COLOR_MONO8")
2938  {
2939  cameraProperty.colorMode = COLOR_MONO8;
2940  }
2941  else if (sColorMode == "COLOR_MONO16")
2942  {
2943  cameraProperty.colorMode = COLOR_MONO16;
2944  }
2945  else if (sColorMode == "COLOR_MONO16S")
2946  {
2947  cameraProperty.colorMode = COLOR_MONO16S;
2948  }
2949  else if (sColorMode == "COLOR_RAW8")
2950  {
2951  cameraProperty.colorMode = COLOR_RAW8;
2952  }
2953  else if (sColorMode == "COLOR_RAW16")
2954  {
2955  cameraProperty.colorMode = COLOR_RAW16;
2956  }
2957 
2958  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
2959  {
2960  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
2961  std::cout << "\t ... Could not set video format, video mode and color mode" << std::endl;
2962  }
2963 
2964 
2965 // -----------------------------------------------------------------
2966 // Set resolution
2967 // -----------------------------------------------------------------
2969  std::string sImageWidth = "";
2970  std::string sImageHeight = "";
2971  int iImageWidth = -1;
2972  int iImageHeight = -1;
2973 
2974  m_ColorCameraParameters.m_ImageWidth.clear(); // Clear flags within stringstream
2975  m_ColorCameraParameters.m_ImageWidth.seekg(0); // Set Pointer to position 0 within stringstream
2976  m_ColorCameraParameters.m_ImageWidth >> sImageWidth;
2977  m_ColorCameraParameters.m_ImageHeight.clear(); // Clear flags within stringstream
2978  m_ColorCameraParameters.m_ImageHeight.seekg(0); // Set Pointer to position 0 within stringstream
2979  m_ColorCameraParameters.m_ImageHeight >> sImageHeight;
2980 
2981  if (sImageWidth == "AUTO" || sImageHeight == "Auto")
2982  {
2984  cameraProperty.specialValue = VALUE_AUTO;
2985  }
2986  else if (sImageWidth == "DEFAULT" || sImageHeight == "DEFAULT")
2987  {
2989  cameraProperty.specialValue = VALUE_DEFAULT;
2990  }
2991  else
2992  {
2994  m_ColorCameraParameters.m_ImageWidth.clear(); // Clear flags within stringstream
2995  m_ColorCameraParameters.m_ImageWidth.seekg(0); // Set Pointer to position 0 within stringstream
2996  m_ColorCameraParameters.m_ImageWidth >> iImageWidth;
2997  m_ColorCameraParameters.m_ImageHeight.clear(); // Clear flags within stringstream
2998  m_ColorCameraParameters.m_ImageHeight.seekg(0); // Set Pointer to position 0 within stringstream
2999  m_ColorCameraParameters.m_ImageHeight >> iImageHeight;
3000  }
3001 
3002  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3003  {
3004  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3005  std::cout << "\t ... Could not set resolution." << std::endl;
3006  }
3007 
3008 
3009 // -----------------------------------------------------------------
3010 // Set exposure time
3011 // -----------------------------------------------------------------
3013  std::string sExposureTime = "";
3014 
3015  m_ColorCameraParameters.m_ExposureTime.clear(); // Clear flags within stringstream
3016  m_ColorCameraParameters.m_ExposureTime.seekg(0); // Set Pointer to position 0 within stringstream
3017  m_ColorCameraParameters.m_ExposureTime >> sExposureTime;
3018 
3019  if (sExposureTime == "AUTO")
3020  {
3022  cameraProperty.specialValue = VALUE_AUTO;
3023  }
3024  else if (sExposureTime == "DEFAULT")
3025  {
3027  cameraProperty.specialValue = VALUE_DEFAULT;
3028  }
3029  else
3030  {
3032  m_ColorCameraParameters.m_ExposureTime.clear(); // Clear flags within stringstream
3033  m_ColorCameraParameters.m_ExposureTime.seekg(0); // Set Pointer to position 0 within stringstream
3034  m_ColorCameraParameters.m_ExposureTime >> cameraProperty.u_longData;
3035  }
3036 
3037  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3038  {
3039  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3040  std::cout << "\t ... Could not set auto exposure." << std::endl;
3041  }
3042 
3043 // -----------------------------------------------------------------
3044 // Set frame rate
3045 // -----------------------------------------------------------------
3047  std::string sFrameRate = "";
3048 
3049  m_ColorCameraParameters.m_FrameRate.clear(); // Clear flags within stringstream
3050  m_ColorCameraParameters.m_FrameRate.seekg(0); // Set Pointer to position 0 within stringstream
3051  m_ColorCameraParameters.m_FrameRate >> sFrameRate;
3052 
3053  if (sFrameRate == "AUTO")
3054  {
3056  cameraProperty.specialValue = VALUE_AUTO;
3057  }
3058  else if (sFrameRate == "DEFAULT")
3059  {
3061  cameraProperty.specialValue = VALUE_DEFAULT;
3062  }
3063  else
3064  {
3066  m_ColorCameraParameters.m_FrameRate.clear(); // Clear flags within stringstream
3067  m_ColorCameraParameters.m_FrameRate.seekg(0); // Set Pointer to position 0 within stringstream
3068  m_ColorCameraParameters.m_FrameRate >> cameraProperty.floatData;
3069  }
3070 
3071  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3072  {
3073  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3074  std::cout << "\t ... Could not set frame rate." << std::endl;
3075  }
3076 
3077 
3078 // -----------------------------------------------------------------
3079 // Set shutter
3080 // -----------------------------------------------------------------
3082  std::string sShutter = "";
3083 
3084  m_ColorCameraParameters.m_Shutter.clear(); // Clear flags within stringstream
3085  m_ColorCameraParameters.m_Shutter.seekg(0); // Set Pointer to position 0 within stringstream
3086  m_ColorCameraParameters.m_Shutter >> sShutter;
3087 
3088  if (sShutter == "AUTO")
3089  {
3091  cameraProperty.specialValue = VALUE_AUTO;
3092  }
3093  else if (sShutter == "DEFAULT")
3094  {
3096  cameraProperty.specialValue = VALUE_DEFAULT;
3097  }
3098  else
3099  {
3101  m_ColorCameraParameters.m_Shutter.clear(); // Clear flags within stringstream
3102  m_ColorCameraParameters.m_Shutter.seekg(0);
3103  m_ColorCameraParameters.m_Shutter >> cameraProperty.u_longData;
3104  }
3105 
3106  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3107  {
3108  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3109  std::cout << "\t ... Could not set shutter." << std::endl;
3110  }
3111 
3112 // -----------------------------------------------------------------
3113 // Set brightness
3114 // -----------------------------------------------------------------
3116  std::string sBrightness = "";
3117 
3118  m_ColorCameraParameters.m_Brightness.clear(); // Clear flags within stringstream
3119  m_ColorCameraParameters.m_Brightness.seekg(0); // Set Pointer to position 0 within stringstream
3120  m_ColorCameraParameters.m_Brightness >> sBrightness;
3121 
3122  if (sBrightness == "AUTO")
3123  {
3125  cameraProperty.specialValue = VALUE_AUTO;
3126  }
3127  else if (sBrightness == "DEFAULT")
3128  {
3130  cameraProperty.specialValue = VALUE_DEFAULT;
3131  }
3132  else
3133  {
3135  m_ColorCameraParameters.m_Brightness.clear(); // Clear flags within stringstream
3136  m_ColorCameraParameters.m_Brightness.seekg(0); // Set Pointer to position 0 within stringstream
3137  m_ColorCameraParameters.m_Brightness >> cameraProperty.u_longData;
3138  }
3139 
3140  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3141  {
3142  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3143  std::cout << "\t ... Could not set brightness." << std::endl;
3144  }
3145 
3146 // -----------------------------------------------------------------
3147 // Set gain
3148 // -----------------------------------------------------------------
3149  cameraProperty.propertyID = ipa_CameraSensors::PROP_GAIN;
3150  std::string sGain = "";
3151 
3152  m_ColorCameraParameters.m_Gain.clear(); // Clear flags within stringstream
3153  m_ColorCameraParameters.m_Gain.seekg(0); // Set Pointer to position 0 within stringstream
3154  m_ColorCameraParameters.m_Gain >> sGain;
3155 
3156  if (sGain == "AUTO")
3157  {
3159  cameraProperty.specialValue = VALUE_AUTO;
3160  }
3161  else if (sGain == "DEFAULT")
3162  {
3164  cameraProperty.specialValue = VALUE_DEFAULT;
3165  }
3166  else
3167  {
3169  m_ColorCameraParameters.m_Gain.clear(); // Clear flags within stringstream
3170  m_ColorCameraParameters.m_Gain.seekg(0); // Set Pointer to position 0 within stringstream
3171  m_ColorCameraParameters.m_Gain >> cameraProperty.u_longData;
3172  }
3173 
3174  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3175  {
3176  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3177  std::cout << "\t ... Could not set gain." << std::endl;
3178  }
3179 
3180 // -----------------------------------------------------------------
3181 // Set gamma
3182 // -----------------------------------------------------------------
3183  cameraProperty.propertyID = ipa_CameraSensors::PROP_GAMMA;
3184  std::string sGamma = "";
3185 
3186  m_ColorCameraParameters.m_Gamma.clear(); // Clear flags within stringstream
3187  m_ColorCameraParameters.m_Gamma.seekg(0); // Set Pointer to position 0 within stringstream
3188  m_ColorCameraParameters.m_Gamma >> sGamma;
3189 
3190  if (sGamma == "AUTO")
3191  {
3193  cameraProperty.specialValue = VALUE_AUTO;
3194  }
3195  else if (sGamma == "DEFAULT")
3196  {
3198  cameraProperty.specialValue = VALUE_DEFAULT;
3199  }
3200  else
3201  {
3203  m_ColorCameraParameters.m_Gamma.clear(); // Clear flags within stringstream
3204  m_ColorCameraParameters.m_Gamma.seekg(0); // Set Pointer to position 0 within stringstream
3205  m_ColorCameraParameters.m_Gamma >> cameraProperty.u_longData;
3206  }
3207 
3208  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3209  {
3210  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3211  std::cout << "\t ... Could not set gamma." << std::endl;
3212  }
3213 
3214 // -----------------------------------------------------------------
3215 // Set hue
3216 // -----------------------------------------------------------------
3217  cameraProperty.propertyID = ipa_CameraSensors::PROP_HUE;
3218  std::string sHue = "";
3219 
3220  m_ColorCameraParameters.m_Hue.clear(); // Clear flags within stringstream
3221  m_ColorCameraParameters.m_Hue.seekg(0); // Set Pointer to position 0 within stringstream
3222  m_ColorCameraParameters.m_Hue >> sHue;
3223 
3224  if (sHue == "AUTO")
3225  {
3227  cameraProperty.specialValue = VALUE_AUTO;
3228  }
3229  else if (sHue == "DEFAULT")
3230  {
3232  cameraProperty.specialValue = VALUE_DEFAULT;
3233  }
3234  else
3235  {
3237  m_ColorCameraParameters.m_Hue.clear(); // Clear flags within stringstream
3238  m_ColorCameraParameters.m_Hue.seekg(0); // Set Pointer to position 0 within stringstream
3239  m_ColorCameraParameters.m_Hue >> cameraProperty.u_longData;
3240  }
3241 
3242  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3243  {
3244  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3245  std::cout << "\t ... Could not set hue." << std::endl;
3246  }
3247 
3248 // -----------------------------------------------------------------
3249 // Set saturation
3250 // -----------------------------------------------------------------
3252  std::string sSaturation = "";
3253 
3254  m_ColorCameraParameters.m_Saturation.clear(); // Clear flags within stringstream
3255  m_ColorCameraParameters.m_Saturation.seekg(0); // Set Pointer to position 0 within stringstream
3256  m_ColorCameraParameters.m_Saturation >> sSaturation;
3257 
3258  if (sSaturation == "AUTO")
3259  {
3261  cameraProperty.specialValue = VALUE_AUTO;
3262  }
3263  else if (sSaturation == "DEFAULT")
3264  {
3266  cameraProperty.specialValue = VALUE_DEFAULT;
3267  }
3268  else
3269  {
3271  m_ColorCameraParameters.m_Saturation.clear(); // Clear flags within stringstream
3272  m_ColorCameraParameters.m_Saturation.seekg(0); // Set Pointer to position 0 within stringstream
3273  m_ColorCameraParameters.m_Saturation >> cameraProperty.u_longData;
3274  }
3275 
3276  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3277  {
3278  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3279  std::cout << "\t ... Could not set saturation." << std::endl;
3280  }
3281 
3282 // -----------------------------------------------------------------
3283 // Set white balance U
3284 // -----------------------------------------------------------------
3286  std::string sWhiteBalanceU = "";
3287 
3288  m_ColorCameraParameters.m_WhiteBalanceU.clear(); // Clear flags within stringstream
3289  m_ColorCameraParameters.m_WhiteBalanceU.seekg(0); // Set Pointer to position 0 within stringstream
3290  m_ColorCameraParameters.m_WhiteBalanceU >> sWhiteBalanceU;
3291 
3292  if (sWhiteBalanceU == "AUTO")
3293  {
3295  cameraProperty.specialValue = VALUE_AUTO;
3296  }
3297  else if (sWhiteBalanceU == "DEFAULT")
3298  {
3300  cameraProperty.specialValue = VALUE_DEFAULT;
3301  }
3302  else
3303  {
3305  m_ColorCameraParameters.m_WhiteBalanceU.clear(); // Clear flags within stringstream
3306  m_ColorCameraParameters.m_WhiteBalanceU.seekg(0); // Set Pointer to position 0 within stringstream
3307  m_ColorCameraParameters.m_WhiteBalanceU >> cameraProperty.u_longData;
3308  }
3309 
3310  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3311  {
3312  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3313  std::cout << "\t ... Could not set white balance U." << std::endl;
3314  }
3315 
3316 // -----------------------------------------------------------------
3317 // Set white balance V
3318 // -----------------------------------------------------------------
3320  std::string sWhiteBalanceV = "";
3321 
3322  m_ColorCameraParameters.m_WhiteBalanceV.clear(); // Clear flags within stringstream
3323  m_ColorCameraParameters.m_WhiteBalanceV.seekg(0); // Set Pointer to position 0 within stringstream
3324  m_ColorCameraParameters.m_WhiteBalanceV >> sWhiteBalanceV;
3325 
3326  if (sWhiteBalanceV == "AUTO")
3327  {
3329  cameraProperty.specialValue = VALUE_AUTO;
3330  }
3331  else if (sWhiteBalanceV == "DEFAULT")
3332  {
3334  cameraProperty.specialValue = VALUE_DEFAULT;
3335  }
3336  else
3337  {
3339  m_ColorCameraParameters.m_WhiteBalanceV.clear(); // Clear flags within stringstream
3340  m_ColorCameraParameters.m_WhiteBalanceV.seekg(0); // Set Pointer to position 0 within stringstream
3341  m_ColorCameraParameters.m_WhiteBalanceV >> cameraProperty.u_longData;
3342  }
3343 
3344  if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3345  {
3346  std::cout << "WARNING - AVTPikeCam::SetParameters:" << std::endl;
3347  std::cout << "\t ... Could not set white balance V." << std::endl;
3348  }
3349  return RET_OK;
3350 }
3351 
3352 unsigned long AVTPikeCam::LoadParameters(const char* filename, int cameraIndex)
3353 {
3354  boost::shared_ptr<TiXmlDocument> p_configXmlDocument (new TiXmlDocument( filename ));
3355 
3356  if (!p_configXmlDocument->LoadFile())
3357  {
3358  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3359  std::cerr << "\t ... Error while loading xml configuration file (Check filename and syntax of the file):\n";
3360  std::cerr << "\t ... '" << filename << "'" << std::endl;
3361  return (RET_FAILED | RET_FAILED_OPEN_FILE);
3362  }
3363  std::cout << "INFO - AVTPikeCam::LoadParameters:" << std::endl;
3364  std::cout << "\t ... Parsing xml configuration file:" << std::endl;
3365  std::cout << "\t ... '" << filename << "'" << std::endl;
3366 
3367  if ( p_configXmlDocument )
3368  {
3369 
3370 //************************************************************************************
3371 // BEGIN LibCameraSensors
3372 //************************************************************************************
3373  // Tag element "LibCameraSensors" of Xml Inifile
3374  TiXmlElement *p_xmlElement_Root = NULL;
3375  p_xmlElement_Root = p_configXmlDocument->FirstChildElement( "LibCameraSensors" );
3376  if ( p_xmlElement_Root )
3377  {
3378 
3379 //************************************************************************************
3380 // BEGIN LibCameraSensors->AVTPikeCam
3381 //************************************************************************************
3382  // Tag element "AVTPikeCam" of Xml Inifile
3383  TiXmlElement *p_xmlElement_Root_AVTPikeCam = NULL;
3384  std::stringstream ss;
3385  ss << "AVTPikeCam_" << cameraIndex;
3386  p_xmlElement_Root_AVTPikeCam = p_xmlElement_Root->FirstChildElement( ss.str() );
3387  if ( p_xmlElement_Root_AVTPikeCam )
3388  {
3389 
3390 //************************************************************************************
3391 // BEGIN LibCameraSensors->AVTPikeCam->GUID
3392 //************************************************************************************
3393  // Subtag element "SerialNumber" of Xml Inifile
3394  TiXmlElement *p_xmlElement_Child = NULL;
3395  std::string tempString;
3396  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "GUID" );
3397  if ( p_xmlElement_Child )
3398  {
3399  // read and save value of attribute
3400  if ( p_xmlElement_Child->QueryValueAttribute( "high", &tempString ) != TIXML_SUCCESS)
3401  {
3402  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3403  std::cerr << "\t ... Can't find attribute 'high' of tag 'GUID'." << std::endl;
3405  }
3406  m_GUID.High = strtoul(tempString.c_str(),NULL,16);
3407 
3408  // read and save value of attribute
3409  if ( p_xmlElement_Child->QueryValueAttribute( "low", &tempString ) != TIXML_SUCCESS)
3410  {
3411  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3412  std::cerr << "\t ... Can't find attribute 'low' of tag 'GUID'." << std::endl;
3414  }
3415  m_GUID.Low = strtoul(tempString.c_str(),NULL,16);
3416  }
3417  else
3418  {
3419  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3420  std::cerr << "\t ... Can't find tag 'GUID'." << std::endl;
3421  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3422  }
3423 //************************************************************************************
3424 // BEGIN LibCameraSensors->AVTPikeCam->Role
3425 //************************************************************************************
3426  // Subtag element "Role" of Xml Inifile
3427  p_xmlElement_Child = NULL;
3428  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "Role" );
3429  if ( p_xmlElement_Child )
3430  {
3431  // read and save value of attribute
3432  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString ) != TIXML_SUCCESS)
3433  {
3434  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3435  std::cerr << "\t ... Can't find attribute 'value' of tag 'Role'." << std::endl;
3437  }
3438 
3439  if (tempString == "MASTER") m_ColorCameraParameters.m_CameraRole = MASTER;
3440  else if (tempString == "SLAVE") m_ColorCameraParameters.m_CameraRole = SLAVE;
3441  else
3442  {
3443  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3444  std::cerr << "\t ... Role " << tempString << " unspecified." << std::endl;
3445  return (RET_FAILED);
3446  }
3447 
3448  }
3449  else
3450  {
3451  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3452  std::cerr << "\t ... Can't find tag 'Role'." << std::endl;
3453  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3454  }
3455 
3456 //************************************************************************************
3457 // BEGIN LibCameraSensors->AVTPikeCam->VideoFormat
3458 //************************************************************************************
3459  // Subtag element "ImageFormat" of Xml Inifile
3460  p_xmlElement_Child = NULL;
3461  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "VideoFormat" );
3462  if ( p_xmlElement_Child )
3463  {
3464  // read and save value of attribute
3465  if ( p_xmlElement_Child->QueryValueAttribute( "type", &tempString) != TIXML_SUCCESS)
3466  {
3467  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3468  std::cerr << "\t ... Can't find attribute 'type' of tag 'VideoFormat'." << std::endl;
3470  }
3471  else
3472  {
3473  m_ColorCameraParameters.m_VideoFormat.str( " " ); // Clear stringstream
3474  m_ColorCameraParameters.m_VideoFormat.clear(); // Reset flags
3475  m_ColorCameraParameters.m_VideoFormat << tempString;
3476  }
3477  }
3478  else
3479  {
3480  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3481  std::cerr << "\t ... Can't find tag 'VideoFormat'." << std::endl;
3482  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3483  }
3484 
3485 //************************************************************************************
3486 // BEGIN LibCameraSensors->AVTPikeCam->VideoMode
3487 //************************************************************************************
3488  // Subtag element "ColorFormat" of Xml Inifile
3489  p_xmlElement_Child = NULL;
3490  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "VideoMode" );
3491  if ( p_xmlElement_Child )
3492  {
3493  // read and save value of attribute
3494  if ( p_xmlElement_Child->QueryValueAttribute( "type", &tempString ) != TIXML_SUCCESS)
3495  {
3496  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3497  std::cerr << "\t ... Can't find attribute 'type' of tag 'VideoMode'." << std::endl;
3499  }
3500  else
3501  {
3502  m_ColorCameraParameters.m_VideoMode.str( " " ); // Clear stringstream
3503  m_ColorCameraParameters.m_VideoMode.clear(); // Reset flags
3504  m_ColorCameraParameters.m_VideoMode << tempString;
3505  }
3506 
3507  }
3508  else
3509  {
3510  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3511  std::cerr << "\t ... Can't find tag 'VideoMode'." << std::endl;
3512  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3513  }
3514 
3515 //************************************************************************************
3516 // BEGIN LibCameraSensors->AVTPikeCam->Resolution
3517 //************************************************************************************
3518  // Subtag element "XSize" of Xml Inifile
3519  p_xmlElement_Child = NULL;
3520  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "Resolution" );
3521  if ( p_xmlElement_Child )
3522  {
3523  // read and save value of attribute
3524  if ( p_xmlElement_Child->QueryValueAttribute("width", &tempString) != TIXML_SUCCESS)
3525  {
3526  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3527  std::cerr << "\t ... Can't find attribute 'width' of tag 'Resolution'." << std::endl;
3529  }
3530  else
3531  {
3532  m_ColorCameraParameters.m_ImageWidth.str( " " ); // Clear stringstream
3533  m_ColorCameraParameters.m_ImageWidth.clear(); // Reset flags
3534  m_ColorCameraParameters.m_ImageWidth << tempString;
3535  }
3536  // read and save value of attribute
3537  if ( p_xmlElement_Child->QueryValueAttribute("height", &tempString) != TIXML_SUCCESS)
3538  {
3539  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3540  std::cerr << "\t ... Can't find attribute 'height' of tag 'Resolution'." << std::endl;
3542  }
3543  else
3544  {
3545  m_ColorCameraParameters.m_ImageHeight.str( " " ); // Clear stringstream
3546  m_ColorCameraParameters.m_ImageHeight.clear(); // Reset flags
3547  m_ColorCameraParameters.m_ImageHeight << tempString;
3548  }
3549  }
3550  else
3551  {
3552  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3553  std::cerr << "\t ... Can't find tag 'Resolution'." << std::endl;
3554  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3555  }
3556 
3557 //************************************************************************************
3558 // BEGIN LibCameraSensors->AVTPikeCam->FrameRate
3559 //************************************************************************************
3560  // Subtag element "FrameRate" of Xml Inifile
3561  p_xmlElement_Child = NULL;
3562  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "FrameRate" );
3563  if ( p_xmlElement_Child )
3564  {
3565  // read and save value of attribute
3566  if ( p_xmlElement_Child->QueryValueAttribute("fps", &tempString) != TIXML_SUCCESS)
3567  {
3568  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3569  std::cerr << "\t ... Can't find attribute 'fps' of tag 'FrameRate'." << std::endl;
3571  }
3572  else
3573  {
3574  m_ColorCameraParameters.m_FrameRate.str( " " ); // Clear stringstream
3575  m_ColorCameraParameters.m_FrameRate.clear(); // Reset flags
3576  m_ColorCameraParameters.m_FrameRate << tempString;
3577  }
3578 
3579  }
3580  else
3581  {
3582  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3583  std::cerr << "\t ... Can't find tag 'FrameRate'." << std::endl;
3584  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3585  }
3586 
3587 
3588 //************************************************************************************
3589 // BEGIN LibCameraSensors->AVTPikeCam->ColorMode
3590 //************************************************************************************
3591  // Subtag element "ColorFormat" of Xml Inifile
3592  p_xmlElement_Child = NULL;
3593  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "ColorMode" );
3594  if ( p_xmlElement_Child )
3595  {
3596  // read and save value of attribute
3597  if ( p_xmlElement_Child->QueryValueAttribute( "type", &tempString ) != TIXML_SUCCESS)
3598  {
3599  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3600  std::cerr << "\t ... Can't find attribute 'type' of tag 'ColorMode'." << std::endl;
3602  }
3603  else
3604  {
3605  m_ColorCameraParameters.m_ColorMode.str( " " ); // Clear stringstream
3606  m_ColorCameraParameters.m_ColorMode.clear(); // Reset flags
3607  m_ColorCameraParameters.m_ColorMode << tempString;
3608  }
3609 
3610  }
3611  else
3612  {
3613  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3614  std::cerr << "\t ... Can't find tag 'ColorMode'." << std::endl;
3615  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3616  }
3617 
3618 //************************************************************************************
3619 // BEGIN LibCameraSensors->AVTPikeCam->IsoSpeed
3620 //************************************************************************************
3621  // Subtag element "IsoSpeed " of Xml Inifile
3622  p_xmlElement_Child = NULL;
3623  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "IsoSpeed" );
3624  if ( p_xmlElement_Child )
3625  {
3626  // read and save value of attribute
3627  if ( p_xmlElement_Child->QueryValueAttribute( "speed", &tempString ) != TIXML_SUCCESS)
3628  {
3629  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3630  std::cerr << "\t ... Can't find attribute 'speed' of tag 'IsoSpeed'." << std::endl;
3632  }
3633  else
3634  {
3635  m_ColorCameraParameters.m_IsoSpeed.str( " " ); // Clear stringstream
3636  m_ColorCameraParameters.m_IsoSpeed.clear(); // Reset flags
3637  m_ColorCameraParameters.m_IsoSpeed << tempString;
3638  }
3639 
3640  }
3641  else
3642  {
3643  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3644  std::cerr << "\t ... Can't find tag 'IsoSpeed'." << std::endl;
3645  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3646  }
3647 
3648 //************************************************************************************
3649 // BEGIN LibCameraSensors->AVTPikeCam->OperationMode
3650 //************************************************************************************
3651  // Subtag element "OperationMode" of Xml Inifile
3652  p_xmlElement_Child = NULL;
3653  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "OperationMode" );
3654  if ( p_xmlElement_Child )
3655  {
3656  // read and save value of attribute
3657  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString ) != TIXML_SUCCESS)
3658  {
3659  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3660  std::cerr << "\t ... Can't find attribute 'value' of tag 'OperationMode'." << std::endl;
3662  }
3663  if (tempString == "A") m_operationMode_B = false;
3664  else if (tempString == "B") m_operationMode_B = true;
3665  else
3666  {
3667  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3668  std::cerr << "\t ... FireWire operation mode " << tempString << " unspecified." << std::endl;
3669  return (RET_FAILED);
3670  }
3671  }
3672  else
3673  {
3674  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3675  std::cerr << "\t ... Can't find tag 'OperationMode'." << std::endl;
3676  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3677  }
3678 
3679 //************************************************************************************
3680 // BEGIN LibCameraSensors->AVTPikeCam->PROP_SHUTTER
3681 //************************************************************************************
3682  // Subtag element "PROP_SHUTTER" of Xml Inifile
3683  p_xmlElement_Child = NULL;
3684  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_SHUTTER" );
3685  if ( p_xmlElement_Child )
3686  {
3687  // read and save value of attribute
3688  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3689  {
3690  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3691  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_SHUTTER'." << std::endl;
3693  }
3694  else
3695  {
3696  m_ColorCameraParameters.m_Shutter.str( " " ); // Clear stringstream
3697  m_ColorCameraParameters.m_Shutter.clear(); // Reset flags
3698  m_ColorCameraParameters.m_Shutter << tempString;
3699  }
3700  }
3701  else
3702  {
3703  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3704  std::cerr << "\t ... Can't find tag 'PROP_SHUTTER'." << std::endl;
3705  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3706  }
3707 
3708 //************************************************************************************
3709 // BEGIN LibCameraSensors->AVTPikeCam->PROP_BRIGHTNESS
3710 //************************************************************************************
3711  // Subtag element "SerialNumber" of Xml Inifile
3712  p_xmlElement_Child = NULL;
3713  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_BRIGHTNESS" );
3714  if ( p_xmlElement_Child )
3715  {
3716  // read and save value of attribute
3717  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3718  {
3719  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3720  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_BRIGHTNESS'." << std::endl;
3722  }
3723  else
3724  {
3725  m_ColorCameraParameters.m_Brightness.str( " " ); // Clear stringstream
3726  m_ColorCameraParameters.m_Brightness.clear(); // Reset flags
3727  m_ColorCameraParameters.m_Brightness << tempString;
3728  }
3729 
3730  }
3731  else
3732  {
3733  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3734  std::cerr << "\t ... Can't find tag 'PROP_BRIGHTNES'." << std::endl;
3735  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3736  }
3737 
3738 //************************************************************************************
3739 // BEGIN LibCameraSensors->AVTPikeCam->PROP_EXPOSURE_TIME
3740 //************************************************************************************
3741  // Subtag element "SerialNumber" of Xml Inifile
3742  p_xmlElement_Child = NULL;
3743  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_EXPOSURE_TIME" );
3744  if ( p_xmlElement_Child )
3745  {
3746  // read and save value of attribute
3747  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3748  {
3749  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3750  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_EXPOSURE_TIME'." << std::endl;
3752  }
3753  else
3754  {
3755  m_ColorCameraParameters.m_ExposureTime.str( " " ); // Clear stringstream
3756  m_ColorCameraParameters.m_ExposureTime.clear(); // Reset flags
3757  m_ColorCameraParameters.m_ExposureTime << tempString;
3758  }
3759 
3760  }
3761  else
3762  {
3763  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3764  std::cerr << "\t ... Can't find tag 'PROP_EXPOSURE_TIME'." << std::endl;
3765  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3766  }
3767 
3768 //************************************************************************************
3769 // BEGIN LibCameraSensors->AVTPikeCam->PROP_WHITE_BALANCE_U
3770 //************************************************************************************
3771  // Subtag element "SerialNumber" of Xml Inifile
3772  p_xmlElement_Child = NULL;
3773  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement("PROP_WHITE_BALANCE_U");
3774  if ( p_xmlElement_Child )
3775  {
3776  // read and save value of attribute
3777  if ( p_xmlElement_Child->QueryValueAttribute("value", &tempString) != TIXML_SUCCESS)
3778  {
3779  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3780  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_WHITE_BALANCE_U'." << std::endl;
3782  }
3783  else
3784  {
3785  m_ColorCameraParameters.m_WhiteBalanceU.str( " " ); // Clear stringstream
3786  m_ColorCameraParameters.m_WhiteBalanceU.clear(); // Reset flags
3787  m_ColorCameraParameters.m_WhiteBalanceU << tempString;
3788  }
3789  }
3790  else
3791  {
3792  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3793  std::cerr << "\t ... Can't find tag 'PROP_WHITE_BALANCE_U'." << std::endl;
3794  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3795  }
3796 
3797 //************************************************************************************
3798 // BEGIN LibCameraSensors->AVTPikeCam->PROP_WHITE_BALANCE_V
3799 //************************************************************************************
3800  // Subtag element "SerialNumber" of Xml Inifile
3801  p_xmlElement_Child = NULL;
3802  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_WHITE_BALANCE_V" );
3803  if ( p_xmlElement_Child )
3804  {
3805  // read and save value of attribute
3806  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3807  {
3808  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3809  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_WHITE_BALANCE_V'." << std::endl;
3811  }
3812  else
3813  {
3814  m_ColorCameraParameters.m_WhiteBalanceV.str( " " ); // Clear stringstream
3815  m_ColorCameraParameters.m_WhiteBalanceV.clear(); // Reset flags
3816  m_ColorCameraParameters.m_WhiteBalanceV << tempString;
3817  }
3818  }
3819  else
3820  {
3821  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3822  std::cerr << "\t ... Can't find tag 'PROP_WHITE_BALANCE_V'." << std::endl;
3823  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3824  }
3825 
3826 //************************************************************************************
3827 // BEGIN LibCameraSensors->AVTPikeCam->PROP_HUE
3828 //************************************************************************************
3829  // Subtag element "SerialNumber" of Xml Inifile
3830  p_xmlElement_Child = NULL;
3831  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_HUE" );
3832  if ( p_xmlElement_Child )
3833  {
3834  // read and save value of attribute
3835  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3836  {
3837  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3838  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_HUE'." << std::endl;
3840  }
3841  else
3842  {
3843  m_ColorCameraParameters.m_Hue.str( " " ); // Clear stringstream
3844  m_ColorCameraParameters.m_Hue.clear(); // Reset flags
3845  m_ColorCameraParameters.m_Hue << tempString;
3846  }
3847  }
3848  else
3849  {
3850  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3851  std::cerr << "\t ... Can't find tag 'PROP_HUE'." << std::endl;
3852  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3853  }
3854 
3855 //************************************************************************************
3856 // BEGIN LibCameraSensors->AVTPikeCam->PROP_SATURATION
3857 //************************************************************************************
3858  // Subtag element "SerialNumber" of Xml Inifile
3859  p_xmlElement_Child = NULL;
3860  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_SATURATION" );
3861  if ( p_xmlElement_Child )
3862  {
3863  // read and save value of attribute
3864  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3865  {
3866  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3867  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_SATURATION'." << std::endl;
3869  }
3870  else
3871  {
3872  m_ColorCameraParameters.m_Saturation.str( " " ); // Clear stringstream
3873  m_ColorCameraParameters.m_Saturation.clear(); // Reset flags
3874  m_ColorCameraParameters.m_Saturation << tempString;
3875  }
3876  }
3877  else
3878  {
3879  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3880  std::cerr << "\t ... Can't find tag 'PROP_SATURATION'." << std::endl;
3881  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3882  }
3883 
3884 //************************************************************************************
3885 // BEGIN LibCameraSensors->AVTPikeCam->PROP_GAMMA
3886 //************************************************************************************
3887  // Subtag element "SerialNumber" of Xml Inifile
3888  p_xmlElement_Child = NULL;
3889  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_GAMMA" );
3890  if ( p_xmlElement_Child )
3891  {
3892  // read and save value of attribute
3893  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3894  {
3895  std::cerr << "AVTPikeCam::LoadParameters:" << std::endl;
3896  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_GAMMA'." << std::endl;
3898  }
3899  else
3900  {
3901  m_ColorCameraParameters.m_Gamma.str( " " ); // Clear stringstream
3902  m_ColorCameraParameters.m_Gamma.clear(); // Reset flags
3903  m_ColorCameraParameters.m_Gamma << tempString;
3904  }
3905  }
3906  else
3907  {
3908  std::cerr << "AVTPikeCam::LoadParameters:" << std::endl;
3909  std::cerr << "\t ... Can't find tag 'PROP_GAMMA'." << std::endl;
3910  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3911  }
3912 
3913 //************************************************************************************
3914 // BEGIN LibCameraSensors->AVTPikeCam->PROP_GAIN
3915 //************************************************************************************
3916  // Subtag element "PROP_GAIN" of Xml Inifile
3917  p_xmlElement_Child = NULL;
3918  p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement( "PROP_GAIN" );
3919  if ( p_xmlElement_Child )
3920  {
3921  // read and save value of attribute
3922  if ( p_xmlElement_Child->QueryValueAttribute( "value", &tempString) != TIXML_SUCCESS)
3923  {
3924  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3925  std::cerr << "\t ... Can't find attribute 'value' of tag 'PROP_GAIN '." << std::endl;
3927  }
3928  else
3929  {
3930  m_ColorCameraParameters.m_Gain.str( " " ); // Clear stringstream
3931  m_ColorCameraParameters.m_Gain.clear(); // Reset flags
3932  m_ColorCameraParameters.m_Gain << tempString;
3933  }
3934  }
3935  else
3936  {
3937  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3938  std::cerr << "\t ... Can't find tag 'PROP_EXPOSURE_TIME'." << std::endl;
3939  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3940  }
3941  }
3942 
3943 //************************************************************************************
3944 // END LibCameraSensors->AVTPikeCam
3945 //************************************************************************************
3946  else
3947  {
3948  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3949  std::cerr << "\t ... Can't find tag '" << ss.str() << "'" << std::endl;
3950  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3951  }
3952  }
3953 
3954 //************************************************************************************
3955 // END LibCameraSensors
3956 //************************************************************************************
3957  else
3958  {
3959  std::cerr << "ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3960  std::cerr << "\t ... Can't find tag 'LibCameraSensors'." << std::endl;
3961  return (RET_FAILED | RET_XML_TAG_NOT_FOUND);
3962  }
3963  }
3964 
3965 
3966 
3967  return RET_OK;
3968 }
3969 
PROP_MODULATION_FREQUENCY
PROP_DMA_BUFFER_SIZE
PROP_VIDEO_FORMAT
RET_FAILED
FORMAT_0
COLOR_YUV422
PROP_WHITE_BALANCE_V
COLOR_DEFAULT
PROP_CAMERA_RESOLUTION
PROP_GAMMA
SLAVE
MODE_3
COLOR_MONO16
PROP_COLOR_MODE
FORMAT_1
COLOR_RAW16
PROP_WHITE_BALANCE_U
boost::shared_ptr< AbstractColorCamera > AbstractColorCameraPtr
RET_CAMERA_NOT_OPEN
RET_FUNCTION_NOT_IMPLEMENTED
PROP_BRIGHTNESS
PROP_SHARPNESS
TYPE_STRING
COLOR_RGB16
COLOR_RGB16S
FORMAT_7
PROP_VIDEO_ALL
COLOR_MONO16S
PROP_SHUTTER
COLOR_RAW8
PROP_VIDEO_MODE
PROP_REGISTER
RET_XML_TAG_NOT_FOUND
FORMAT_2
TYPE_CAMERA_RESOLUTION
FORMAT_DEFAULT
PROP_GAIN
COLOR_YUV411
PROP_FRAME_RATE
MODE_6
COLOR_MONO8
MODE_4
PROP_EXPOSURE_TIME
MODE_7
MODE_1
MODE_0
RET_XML_ATTR_NOT_FOUND
PROP_AMPLITUDE_THRESHOLD
RET_CAMERA_ALREADY_INITIALIZED
PROP_ISO_SPEED
MASTER
PROP_RESOLUTION
RET_INIT_CAMERA_FAILED
PROP_FW_OPERATION_MODE
RET_FAILED_OPEN_FILE
RET_OK
MODE_2
COLOR_RGB8
PROP_SATURATION
MODE_5
PROP_OPTICAL_FILTER
MODE_DEFAULT
PROP_HUE
PROP_TIMEOUT
PROP_INTEGRATION_TIME
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam()
Definition: AVTPikeCam.cpp:36
#define __DLL_LIBCAMERASENSORS__
COLOR_YUV444


cob_camera_sensors
Author(s): Jan Fischer , Richard Bormann
autogenerated on Thu Mar 19 2020 03:23:05