18 #include "../include/cob_camera_sensors/StdAfx.h" 25 #include "cob_vision/windows/src/extern/TinyXml/tinyxml.h" 33 bool AVTPikeCam::m_OpenExecuted =
false;
41 AVTPikeCam::AVTPikeCam()
43 m_initialized =
false;
49 m_IEEE1394Cameras = 0;
59 AVTPikeCam::~AVTPikeCam()
67 if (m_IEEE1394Info != 0)
69 dc1394_free(m_IEEE1394Info);
76 unsigned long AVTPikeCam::Init(std::string directory,
int cameraIndex)
82 m_initialized =
false;
88 std::string iniFileNameAndPath = directory +
"cameraSensorsIni.xml";
89 if (LoadParameters(iniFileNameAndPath.c_str(), cameraIndex) &
RET_FAILED)
96 if (m_IEEE1394Info == 0)
98 m_IEEE1394Info = dc1394_new();
100 dc1394error_t err = dc1394_camera_enumerate(m_IEEE1394Info, &m_IEEE1394Cameras);
101 if (err!=DC1394_SUCCESS)
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;
109 if (m_IEEE1394Cameras->num == 0)
111 std::cerr <<
"ERROR - AVTPikeCam::Init:" << std::endl;
112 std::cerr <<
"\t ... No cameras found" << std::endl;
116 m_initialized =
true;
121 std::string iniFileNameAndPath = directory +
"cameraSensorsIni.xml";
122 if (LoadParameters(iniFileNameAndPath.c_str(), cameraIndex) &
RET_FAILED)
130 if (m_OpenExecuted ==
false)
132 m_OpenExecuted =
true;
133 UINT32 err = FGInitModule(NULL);
136 std::cerr <<
"ERROR - AVTPikeCam::Init:" << std::endl;
137 std::cerr <<
"\t ... Initialization of FireGrab library failed. ( error " << err <<
" )" << std::endl;
145 err=FGGetNodeList(m_nodeInfo, 5, &m_NodeCnt);
148 std::cerr <<
"ERROR - AVTPikeCam::Init:" << std::endl;
149 std::cerr <<
"\t ... Retrival of connected IEEE1394 nodes failed. ( error " << err <<
" )" << std::endl;
155 std::cout <<
"ERROR - AVTPikeCam::Init:" << std::endl;
156 std::cerr <<
"\t ... No cameras found." << std::endl;
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++)
165 printf (
"\t ... GUID of node '%i' is %-#08lX %-#08lX \n", i+1, m_nodeInfo[i].Guid.High, m_nodeInfo[i].Guid.Low);
169 m_initialized =
true;
176 unsigned long AVTPikeCam::Open()
178 if (!isInitialized())
180 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
181 std::cerr <<
"\t ... Camera not initialized." << std::endl;
192 for(; i<m_IEEE1394Cameras->num; i++)
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;
200 if (i == m_IEEE1394Cameras->num)
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);
206 m_cam = dc1394_camera_new(m_IEEE1394Info, m_IEEE1394Cameras->ids[i].guid);
213 dc1394_camera_free_list(m_IEEE1394Cameras);
218 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
219 std::cerr <<
"\t... Error while setting parameters" << std::endl;
223 err = dc1394_capture_setup(m_cam, m_BufferSize, DC1394_CAPTURE_FLAGS_DEFAULT);
225 if (err!=DC1394_SUCCESS)
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)
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;
238 dc1394_iso_release_bandwidth(m_cam, bandwidth);
239 if (err!=DC1394_SUCCESS)
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;
246 err = dc1394_capture_setup(m_cam, m_BufferSize, DC1394_CAPTURE_FLAGS_DEFAULT);
247 if (err!=DC1394_SUCCESS)
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;
258 err=dc1394_video_set_transmission(m_cam, DC1394_ON);
259 if (err!=DC1394_SUCCESS)
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;
273 for(; i<m_NodeCnt; i++)
275 if (m_nodeInfo[i].Guid.Low - m_GUID.Low == 0 &&
276 m_nodeInfo[i].Guid.High - m_GUID.High == 0)
break;
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);
285 err=m_cam.Connect(&m_GUID);
288 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
289 std::cerr <<
"\t ... Could not connect to camera. ( error " << err <<
" )" << std::endl;
295 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
296 std::cerr <<
"\t ... Could not set parameters. ( error " << err <<
" )" << std::endl;
300 err = m_cam.SetParameter(FGP_FRAMEBUFFERCOUNT, m_BufferSize);
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;
310 err=m_cam.OpenCapture();
313 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
314 std::cerr <<
"\t ... Could not start DMA logic ( error " << err <<
" )" << std::endl;
319 err=m_cam.StartDevice();
322 std::cerr <<
"ERROR - AVTPikeCam::Open:" << std::endl;
323 std::cerr <<
"\t ... Could not start camera device ( error " << err <<
" )" << std::endl;
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;
336 unsigned long AVTPikeCam::SaveParameters(
const char* filename)
345 unsigned long AVTPikeCam::Close()
357 err=dc1394_video_set_transmission(m_cam, DC1394_OFF);
358 if (err!=DC1394_SUCCESS)
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;
365 dc1394_capture_stop(m_cam);
366 dc1394_camera_free(m_cam);
372 err=m_cam.StopDevice();
375 std::cerr <<
"ERROR - AVTPikeCam::Close:" << std::endl;
376 std::cerr <<
"\t ... Could not stop camera device ( error " << err <<
" )" << std::endl;
381 err=m_cam.CloseCapture();
384 std::cerr <<
"ERROR - AVTPikeCam::Close:" << std::endl;
385 std::cerr <<
"\t ... Could not close capture logic. ( error " << err <<
" )" << std::endl;
return RET_FAILED;
389 err=m_cam.Disconnect();
392 std::cerr <<
"ERROR - AVTPikeCam::Close:" << std::endl;
393 std::cerr <<
"\t ... Could not disconnect camera. ( error " << err <<
" )" << std::endl;
return RET_FAILED;
405 unsigned long AVTPikeCam::SetPropertyDefaults()
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)
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;
435 err = dc1394_get_image_size_from_video_mode(m_cam, videoMode, &imageWidth, &imageHeight);
436 if (err!=DC1394_SUCCESS)
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;
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;
459 std::cerr <<
"ERROR - AVTPikeCam::GetProperty:" << std::endl;
460 std::cerr <<
"\t ... Property " << cameraProperty->
propertyID <<
" unspecified" << std::endl;
500 err = m_cam.GetParameter(FGP_XSIZE, &x);
503 std::cerr <<
"ERROR - AVTPikeCam::GetProperty:" << std::endl;
504 std::cerr <<
"\t ... Could not read image width ( error " << err <<
" )" << std::endl;
507 m_cam.GetParameter(FGP_YSIZE, &y);
510 std::cerr <<
"ERROR - AVTPikeCam::GetProperty:" << std::endl;
511 std::cerr <<
"\t ... Could not read image height ( error " << err <<
" )" << std::endl;
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;
531 if (m_operationMode_B ==
false) cameraProperty->
stringData ==
"A";
532 else if (m_operationMode_B ==
true) cameraProperty->
stringData ==
"B";
542 std::cerr <<
"ERROR - AVTPikeCam::GetProperty:" << std::endl;
543 std::cerr <<
"\t ... Property " << cameraProperty->
propertyID <<
" unspecified";
554 unsigned long AVTPikeCam::GetColorImage(
char* colorImageData,
bool getLatestFrame)
558 std::cerr <<
"ERROR - AVTPikeCam::GetColorImage:" << std::endl;
559 std::cerr <<
"\t ... Color camera not open." << std::endl;
569 err=dc1394_capture_enqueue(m_cam, m_Frame);
570 if (err!=DC1394_SUCCESS)
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;
588 err=dc1394_capture_dequeue(m_cam, DC1394_CAPTURE_POLICY_POLL, &m_Frame);
589 if (err!=DC1394_SUCCESS)
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;
602 err=dc1394_capture_enqueue(m_cam, m_Frame);
603 if (err!=DC1394_SUCCESS)
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;
618 err=dc1394_capture_dequeue(m_cam, DC1394_CAPTURE_POLICY_WAIT, &m_Frame);
619 if (err!=DC1394_SUCCESS)
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;
626 unsigned char * src = (
unsigned char *)m_Frame->image;
627 unsigned char * dst = (
unsigned char *)colorImageData;
638 for (
int i=0;i<width*height*3;i+=6)
655 if (m_Frame.pData != 0)
658 err=m_cam.PutFrame(&m_Frame);
661 std::cerr <<
"ERROR - AVTPikeCam::GetColorImage:" << std::endl;
662 std::cerr <<
"\t ... Could not release image buffer ( error " << err <<
" )" << std::endl;
671 err = m_cam.DiscardFrames();
674 std::cerr <<
"ERROR - AVTPikeCam::GetColorImage:" << std::endl;
675 std::cerr <<
"\t ... Could not reset image buffers ( error " << err <<
" )" << std::endl;
682 err = m_cam.GetFrame(&m_Frame);
685 std::cerr <<
"AVTPikeCam::GetColorImage:" << std::endl;
686 std::cerr <<
"\t ... Could not acquire image ( error " << err <<
" )" << std::endl;
690 unsigned char * src = (
unsigned char *)m_Frame.pData;
691 unsigned char * dst = (
unsigned char *)colorImageData;
702 for (
int i=0; i<width*height*3; i+=6)
717 unsigned long AVTPikeCam::GetColorImage(cv::Mat* colorImage,
bool getLatestFrame)
721 std::cerr <<
"ERROR - AVTPikeCam::GetColorImage:" << std::endl;
722 std::cerr <<
"\t ... Color camera not open." << std::endl;
726 CV_Assert(colorImage != 0);
732 if (GetProperty(&cameraProperty) &
RET_FAILED)
return RET_FAILED;
737 colorImage->create(height, width, CV_8UC3);
738 return GetColorImage(colorImage->ptr<
char>(0), getLatestFrame);
741 unsigned long AVTPikeCam::PrintCameraInformation()
745 string parameterName;
746 std::cout <<
"INFO - AVTPikeCam::PrintCameraInformation:" << std::endl;
748 for (
int ID = FGP_BRIGHTNESS; ID <= FGP_BRIGHTNESS+10; ID++)
752 case 0: parameterName =
"FGP_IMAGEFORMAT";
break;
753 case 1: parameterName =
"FGP_ENUMIMAGEFORMAT";
break;
754 case 2: parameterName =
"FGP_BRIGHTNESS";
break;
755 case 3: parameterName =
"FGP_AUTOEXPOSURE";
break;
756 case 4: parameterName =
"FGP_SHARPNESS";
break;
757 case 5: parameterName =
"FGP_WHITEBALCB";
break;
758 case 6: parameterName =
"FGP_WHITEBALCR";
break;
759 case 7: parameterName =
"FGP_HUE";
break;
760 case 8: parameterName =
"FGP_SATURATION";
break;
761 case 9: parameterName =
"FGP_GAMMA";
break;
762 case 10: parameterName =
"FGP_SHUTTER";
break;
763 case 11: parameterName =
"FGP_GAIN";
break;
764 case 12: parameterName =
"FGP_IRIS";
break;
765 case 13: parameterName =
"FGP_FOCUS";
break;
766 case 14: parameterName =
"FGP_TEMPERATURE";
break;
767 case 15: parameterName =
"FGP_TRIGGER";
break;
768 case 16: parameterName =
"FGP_TRIGGERDLY";
break;
769 case 17: parameterName =
"FGP_WHITESHD";
break;
770 case 18: parameterName =
"FGP_FRAMERATE";
break;
771 case 19: parameterName =
"FGP_ZOOM";
break;
772 case 20: parameterName =
"FGP_PAN";
break;
773 case 21: parameterName =
"FGP_TILT";
break;
774 case 22: parameterName =
"FGP_OPTICALFILTER";
break;
775 case 23: parameterName =
"FGP_CAPTURESIZE";
break;
776 case 24: parameterName =
"FGP_CAPTUREQUALITY";
break;
777 case 25: parameterName =
"FGP_PHYSPEED";
break;
778 case 26: parameterName =
"FGP_XSIZE";
break;
779 case 27: parameterName =
"FGP_YSIZE";
break;
780 case 28: parameterName =
"FGP_XPOSITION";
break;
781 case 29: parameterName =
"FGP_YPOSITION";
break;
782 case 30: parameterName =
"FGP_PACKETSIZE";
break;
783 case 31: parameterName =
"FGP_DMAMODE";
break;
784 case 32: parameterName =
"FGP_BURSTCOUNT";
break;
785 case 33: parameterName =
"FGP_FRAMEBUFFERCOUNT";
break;
786 case 34: parameterName =
"FGP_USEIRMFORBW";
break;
787 case 35: parameterName =
"FGP_ADJUSTPARAMETERS";
break;
788 case 36: parameterName =
"FGP_STARTIMMEDIATELY";
break;
789 case 37: parameterName =
"FGP_FRAMEMEMORYSIZE";
break;
790 case 38: parameterName =
"FGP_COLORFORMAT";
break;
791 case 39: parameterName =
"FGP_IRMFREEBW";
break;
792 case 40: parameterName =
"FGP_DO_FASTTRIGGER";
break;
793 case 41: parameterName =
"FGP_DO_BUSTRIGGER";
break;
794 case 42: parameterName =
"FGP_RESIZE";
break;
795 case 43: parameterName =
"FGP_USEIRMFORCHN";
break;
796 case 44: parameterName =
"FGP_CAMACCEPTDELAY";
break;
797 case 45: parameterName =
"FGP_ISOCHANNEL";
break;
798 case 46: parameterName =
"FGP_CYCLETIME";
break;
799 case 47: parameterName =
"FGP_DORESET";
break;
800 case 48: parameterName =
"FGP_DMAFLAGS";
break;
801 case 49: parameterName =
"FGP_R0C";
break;
802 case 50: parameterName =
"FGP_BUSADDRESS";
break;
803 case 51: parameterName =
"FGP_CMDTIMEOUT";
break;
804 case 52: parameterName =
"FGP_CARD";
break;
805 case 53: parameterName =
"FGP_LICENSEINFO";
break;
806 case 54: parameterName =
"FGP_PACKETCOUNT";
break;
807 case 55: parameterName =
"FGP_DO_MULTIBUSTRIGGER";
break;
808 case 56: parameterName =
"FGP_LAST";
break;
810 default: parameterName =
"Unknown parameter";
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;
827 unsigned long AVTPikeCam::TestCamera(
const char* filename)
829 if (AbstractColorCamera::TestCamera(filename) &
RET_FAILED)
872 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_SHUTTER, DC1394_FEATURE_MODE_AUTO);
873 if (err!=DC1394_SUCCESS)
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;
881 err = m_cam.SetParameter(FGP_SHUTTER, PVAL_AUTO);
884 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
885 std::cerr <<
"\t ... Could not set shutter time to AUTO mode ( error " << err <<
" )" << std::endl;
896 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
897 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
906 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_SHUTTER, &min, &max);
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;
916 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_SHUTTER, (uint32_t) cameraProperty->
u_longData);
917 if (err!=DC1394_SUCCESS)
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;
927 m_cam.GetParameterInfo(FGP_SHUTTER, &info);
928 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
937 err = m_cam.SetParameter(FGP_SHUTTER, cameraProperty->
u_longData);
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;
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;
964 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_BRIGHTNESS, DC1394_FEATURE_MODE_AUTO);
965 if (err!=DC1394_SUCCESS)
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;
973 err = m_cam.SetParameter(FGP_BRIGHTNESS, PVAL_AUTO);
976 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
977 std::cerr <<
"\t ... Could not set brightness time to AUTO mode ( error " << err <<
" )" << std::endl;
988 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
989 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
998 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_BRIGHTNESS, &min, &max);
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;
1008 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_BRIGHTNESS, (uint32_t) cameraProperty->
u_longData);
1009 if (err!=DC1394_SUCCESS)
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;
1019 m_cam.GetParameterInfo(FGP_BRIGHTNESS, &info);
1020 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1028 err = m_cam.SetParameter(FGP_BRIGHTNESS, cameraProperty->
u_longData);
1029 if(err!=FCE_NOERROR)
1031 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1032 std::cerr <<
"\t ... Could not set brightness ( error " << err <<
" )" << std::endl;
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;
1054 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_EXPOSURE, DC1394_FEATURE_MODE_AUTO);
1055 if (err!=DC1394_SUCCESS)
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;
1063 err = m_cam.SetParameter(FGP_AUTOEXPOSURE, PVAL_AUTO);
1064 if(err!=FCE_NOERROR)
1066 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1067 std::cerr <<
"\t ... Could not set exposure time to AUTO mode ( error " << err <<
" )" << std::endl;
1078 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1079 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1088 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_EXPOSURE, &min, &max);
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;
1098 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_EXPOSURE, (uint32_t) cameraProperty->
u_longData);
1099 if (err!=DC1394_SUCCESS)
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;
1109 m_cam.GetParameterInfo(FGP_AUTOEXPOSURE, &info);
1110 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1119 err = m_cam.SetParameter(FGP_AUTOEXPOSURE, cameraProperty->
u_longData);
1120 if(err!=FCE_NOERROR)
1122 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1123 std::cerr <<
"\t ... Could not set exposure time ( error " << err <<
" )" << std::endl;
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;
1145 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_WHITE_BALANCE, DC1394_FEATURE_MODE_AUTO);
1146 if (err!=DC1394_SUCCESS)
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;
1154 err = m_cam.SetParameter(FGP_WHITEBALCB, PVAL_AUTO);
1155 if(err!=FCE_NOERROR)
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;
1169 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1170 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1179 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_WHITE_BALANCE, &min, &max);
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;
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)
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;
1203 m_cam.GetParameterInfo(FGP_WHITEBALCB, &info);
1204 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1213 err = m_cam.SetParameter(FGP_WHITEBALCB, cameraProperty->
u_longData);
1214 if(err!=FCE_NOERROR)
1216 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1217 std::cerr <<
"\t ... Could not set white balance U value ( error " << err <<
" )" << std::endl;
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;
1239 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_WHITE_BALANCE, DC1394_FEATURE_MODE_AUTO);
1240 if (err!=DC1394_SUCCESS)
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;
1248 err = m_cam.SetParameter(FGP_WHITEBALCR, PVAL_AUTO);
1249 if(err!=FCE_NOERROR)
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;
1263 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1264 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1273 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_WHITE_BALANCE, &min, &max);
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;
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)
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;
1297 m_cam.GetParameterInfo(FGP_WHITEBALCR, &info);
1298 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1307 err = m_cam.SetParameter(FGP_WHITEBALCR, cameraProperty->
u_longData);
1308 if(err!=FCE_NOERROR)
1310 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1311 std::cerr <<
"\t ... Could not set white balance V value ( error " << err <<
" )" << std::endl;
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;
1333 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_HUE, DC1394_FEATURE_MODE_AUTO);
1334 if (err!=DC1394_SUCCESS)
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;
1342 err = m_cam.SetParameter(FGP_HUE, PVAL_AUTO);
1343 if(err!=FCE_NOERROR)
1345 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1346 std::cerr <<
"\t ... Could not set image hue to AUTO ( error " << err <<
" )" << std::endl;
1357 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1358 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1367 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_HUE, &min, &max);
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;
1377 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_HUE, (uint32_t) cameraProperty->
u_longData);
1378 if (err!=DC1394_SUCCESS)
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;
1388 m_cam.GetParameterInfo(FGP_HUE, &info);
1389 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1397 err = m_cam.SetParameter(FGP_HUE, cameraProperty->
u_longData);
1398 if(err!=FCE_NOERROR)
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;
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;
1424 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_SATURATION, DC1394_FEATURE_MODE_AUTO);
1425 if (err!=DC1394_SUCCESS)
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;
1433 err = m_cam.SetParameter(FGP_SATURATION, PVAL_AUTO);
1434 if(err!=FCE_NOERROR)
1436 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1437 std::cerr <<
"\t ... << Could not set saturation to AUTO ( error " << err <<
" )" << std::endl;
1448 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1449 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1458 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_SATURATION, &min, &max);
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;
1468 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_SATURATION, (uint32_t) cameraProperty->
u_longData);
1469 if (err!=DC1394_SUCCESS)
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;
1479 m_cam.GetParameterInfo(FGP_SATURATION, &info);
1480 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1487 err = m_cam.SetParameter(FGP_SATURATION, cameraProperty->
u_longData);
1488 if(err!=FCE_NOERROR)
1490 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1491 std::cerr <<
"\t ... Could not set saturation ( error " << err <<
" )" << std::endl;
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;
1513 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_GAMMA, DC1394_FEATURE_MODE_AUTO);
1514 if (err!=DC1394_SUCCESS)
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;
1522 err = m_cam.SetParameter(FGP_GAMMA, PVAL_AUTO);
1523 if(err!=FCE_NOERROR)
1525 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1526 std::cerr <<
"\t ... << Could not set gamma to AUTO ( error " << err <<
" )" << std::endl;
1537 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1538 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1547 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_GAMMA, &min, &max);
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;
1557 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_GAMMA, (uint32_t) cameraProperty->
u_longData);
1558 if (err!=DC1394_SUCCESS)
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;
1568 m_cam.GetParameterInfo(FGP_GAMMA, &info);
1569 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1577 err = m_cam.SetParameter(FGP_GAMMA, cameraProperty->
u_longData);
1578 if(err!=FCE_NOERROR)
1580 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1581 std::cerr <<
"\t ... << Could not set gamma to " << cameraProperty->
u_longData <<
" ( error " << err <<
" )" << std::endl;
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;
1603 err=dc1394_feature_set_mode(m_cam, DC1394_FEATURE_GAIN, DC1394_FEATURE_MODE_AUTO);
1604 if (err!=DC1394_SUCCESS)
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;
1612 err = m_cam.SetParameter(FGP_GAIN, PVAL_AUTO);
1613 if(err!=FCE_NOERROR)
1615 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1616 std::cerr <<
"\t ... Could not set gain (on auto mode) ( error " << err <<
" )" << std::endl;
1627 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1628 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
1637 dc1394_feature_get_boundaries(m_cam, DC1394_FEATURE_GAIN, &min, &max);
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;
1647 err=dc1394_feature_set_value(m_cam, DC1394_FEATURE_GAIN, (uint32_t) cameraProperty->
u_longData);
1648 if (err!=DC1394_SUCCESS)
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;
1658 m_cam.GetParameterInfo(FGP_GAIN, &info);
1659 if ((cameraProperty->
u_longData < info.MinValue) | (cameraProperty->
u_longData > info.MaxValue))
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;
1667 err = m_cam.SetParameter(FGP_GAIN, cameraProperty->
u_longData);
1668 if(err!=FCE_NOERROR)
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;
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;
1694 dc1394color_coding_t colorMode;
1695 dc1394video_mode_t videoMode;
1702 videoMode = DC1394_VIDEO_MODE_320x240_YUV422;
1705 videoMode = DC1394_VIDEO_MODE_640x480_YUV411;
1708 videoMode = DC1394_VIDEO_MODE_640x480_YUV422;
1712 videoMode = DC1394_VIDEO_MODE_640x480_RGB8;
1715 videoMode = DC1394_VIDEO_MODE_640x480_MONO8;
1718 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1719 std::cerr <<
"\t ... Specified video mode unknown." << std::endl;
1723 err=dc1394_video_set_mode(m_cam, videoMode);
1724 if (err!=DC1394_SUCCESS)
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;
1737 videoMode = DC1394_VIDEO_MODE_800x600_YUV422;
1740 videoMode = DC1394_VIDEO_MODE_800x600_RGB8;
1743 videoMode = DC1394_VIDEO_MODE_800x600_MONO8;
1746 videoMode = DC1394_VIDEO_MODE_1024x768_YUV422;
1750 videoMode = DC1394_VIDEO_MODE_1024x768_RGB8;
1753 videoMode = DC1394_VIDEO_MODE_1024x768_MONO8;
1756 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1757 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
1761 err=dc1394_video_set_mode(m_cam, videoMode);
1762 if (err!=DC1394_SUCCESS)
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;
1775 videoMode = DC1394_VIDEO_MODE_1280x960_YUV422;
1779 videoMode = DC1394_VIDEO_MODE_1280x960_RGB8;
1782 videoMode = DC1394_VIDEO_MODE_1280x960_MONO8;
1785 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1786 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
1790 err=dc1394_video_set_mode(m_cam, videoMode);
1791 if (err!=DC1394_SUCCESS)
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;
1805 colorMode = DC1394_COLOR_CODING_YUV411;
1808 colorMode = DC1394_COLOR_CODING_YUV422;
1811 colorMode = DC1394_COLOR_CODING_YUV444;
1815 colorMode = DC1394_COLOR_CODING_RGB8;
1818 colorMode = DC1394_COLOR_CODING_RGB16S;
1821 colorMode = DC1394_COLOR_CODING_RGB16;
1824 colorMode = DC1394_COLOR_CODING_MONO8;
1827 colorMode = DC1394_COLOR_CODING_MONO16S;
1830 colorMode = DC1394_COLOR_CODING_MONO16;
1833 colorMode = DC1394_COLOR_CODING_RAW8;
1836 colorMode = DC1394_COLOR_CODING_RAW16;
1839 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1840 std::cerr <<
"\t ... Specified color mode not supported." << std::endl;
1849 videoMode = DC1394_VIDEO_MODE_FORMAT7_0;
1852 videoMode = DC1394_VIDEO_MODE_FORMAT7_4;
1855 videoMode = DC1394_VIDEO_MODE_FORMAT7_5;
1858 videoMode = DC1394_VIDEO_MODE_FORMAT7_6;
1861 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1862 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
1867 err = dc1394_video_set_mode(m_cam, videoMode);
1868 if (err!=DC1394_SUCCESS)
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;
1875 err = dc1394_format7_set_color_coding(m_cam, videoMode, colorMode);
1876 if (err!=DC1394_SUCCESS)
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;
1886 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1887 std::cerr <<
"\t ... Specified video format unknown." << std::endl;
1892 FG_RESOLUTION resolution;
1893 FG_COLORMODE colorMode;
1901 resolution = RES_320_240;
1902 colorMode = CM_YUV422;
1905 resolution = RES_640_480;
1906 colorMode = CM_YUV411;
1909 resolution = RES_640_480;
1910 colorMode = CM_YUV422;
1914 resolution = RES_640_480;
1915 colorMode = CM_RGB8;
1918 resolution = RES_640_480;
1922 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1923 std::cerr <<
"\t ... Specified video mode unknown." << std::endl;
1927 err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_30));
1928 if(err!=FCE_NOERROR)
1930 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1931 std::cerr <<
"\t ... Could not set video format and mode ( error " << err <<
" )" << std::endl;
1940 resolution = RES_800_600;
1941 colorMode = CM_YUV422;
1944 resolution = RES_800_600;
1945 colorMode = CM_RGB8;
1948 resolution = RES_800_600;
1952 resolution = RES_1024_768;
1953 colorMode = CM_YUV422;
1957 resolution = RES_1024_768;
1958 colorMode = CM_RGB8;
1961 resolution = RES_1024_768;
1965 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1966 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
1970 err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_15));
1971 if(err!=FCE_NOERROR)
1973 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1974 std::cerr <<
"\t ... Could not set video format and mode ( error " << err <<
" )" << std::endl;
1983 resolution = RES_1280_960;
1984 colorMode = CM_YUV422;
1988 resolution = RES_1280_960;
1989 colorMode = CM_RGB8;
1992 resolution = RES_1280_960;
1996 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
1997 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
2001 err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEIMAGEFORMAT(resolution, colorMode, FR_15));
2002 if(err!=FCE_NOERROR)
2004 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2005 std::cerr <<
"\t ... Could not set video format and mode ( error " << err <<
" )" << std::endl;
2015 colorMode = CM_YUV444;
2018 colorMode = CM_YUV422;
2021 colorMode = CM_YUV411;
2025 colorMode = CM_RGB8;
2028 colorMode = CM_SRGB16;
2031 colorMode = CM_RGB16;
2037 colorMode = CM_SY16;
2043 colorMode = CM_RAW8;
2046 colorMode = CM_RAW16;
2049 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2050 std::cerr <<
"\t ... Specified color mode not supported." << std::endl;
2070 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2071 std::cerr <<
"\t ... Specified video mode not supported." << std::endl;
2075 err = m_cam.SetParameter(FGP_IMAGEFORMAT, MAKEDCAMFORMAT(RES_SCALABLE, videoMode, colorMode));
2076 if(err!=FCE_NOERROR)
2078 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2079 std::cerr <<
"\t ... Could not set video format and mode ( error " << err <<
" )" << std::endl;
2085 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2086 std::cerr <<
"\t ... Specified video format not supported." << std::endl;
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;
2104 dc1394video_mode_t videoMode;
2105 err=dc1394_video_get_mode(m_cam, &videoMode);
2106 if(err!=DC1394_SUCCESS)
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;
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)
2127 FGPINFO packetSizeInfo;
2128 err = m_cam.GetParameter(FGP_IMAGEFORMAT, &imageFormat);
2129 if(err!=FCE_NOERROR)
2131 std::cout <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2132 std::cerr <<
"\t ... Could not read image format ( error " << err <<
" )" << std::endl;
2138 if (IMGRES(imageFormat)==RES_SCALABLE)
2152 uint64_t bytesPerFrame;
2154 err = dc1394_format7_get_total_bytes(m_cam, videoMode, &bytesPerFrame);
2155 if (err!=DC1394_SUCCESS)
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;
2168 uint64_t bytesPerFrame = 0;
2169 uint32_t bytesPerPacket = 0;
2170 unsigned long packetsPerFrame = 0;
2171 double busPeriodInSeconds = 0;
2172 dc1394speed_t isoSpeed;
2174 err = dc1394_format7_get_packet_parameters(m_cam, videoMode, &min, &max);
2175 if (err!=DC1394_SUCCESS)
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;
2182 err = dc1394_format7_get_total_bytes(m_cam, videoMode, &bytesPerFrame);
2183 if (err!=DC1394_SUCCESS)
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;
2191 err = dc1394_video_get_iso_speed(m_cam, &isoSpeed);
2192 if (err!=DC1394_SUCCESS)
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;
2200 if (isoSpeed == DC1394_ISO_SPEED_100)
2202 busPeriodInSeconds = 500.0/1000000.0;
2204 else if(isoSpeed == DC1394_ISO_SPEED_200)
2206 busPeriodInSeconds = 250.0/1000000.0;
2208 else if(isoSpeed == DC1394_ISO_SPEED_400)
2210 busPeriodInSeconds = 125.0/1000000.0;
2214 busPeriodInSeconds = 62.5/1000000.0;
2217 packetsPerFrame = (int) (1.0/(busPeriodInSeconds*fps) + 0.5);
2218 bytesPerPacket = (uint32_t) ((bytesPerFrame + packetsPerFrame - 1)/(packetsPerFrame));
2220 if (bytesPerPacket < min || bytesPerPacket > max)
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;
2228 bytesPerPacket = ((int)(bytesPerPacket/min))*min;
2230 err = dc1394_format7_set_packet_size(m_cam, videoMode, bytesPerPacket);
2231 if (err!=DC1394_SUCCESS)
2233 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2234 std::cerr <<
"\t ... Could not set packet size " << bytesPerPacket <<
" ( error " << err <<
" )" << std::endl;
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)
2245 std::cout <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2246 std::cerr <<
"\t ... Could not read image size ( error " << err <<
" )" << std::endl;
2250 err = m_cam.GetParameter(FGP_PHYSPEED, &isoSpeed);
2251 if (err!=FCE_NOERROR)
2253 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2254 std::cerr <<
"\t ... Could not read iso speed info ( error " << err <<
" )" << std::endl;
2258 if (isoSpeed == PS_100MBIT)
2260 busPeriodInSeconds = 500.0/1000000.0;
2262 else if(isoSpeed == PS_200MBIT)
2264 busPeriodInSeconds = 250.0/1000000.0;
2266 else if(isoSpeed == PS_400MBIT)
2268 busPeriodInSeconds = 125.0/1000000.0;
2272 busPeriodInSeconds = 62.5/1000000.0;
2278 UINT32 bytesPerPacket = (UINT32) (fps * busPeriodInSeconds * (
double)bytesPerImage);
2280 err = m_cam.GetParameterInfo(FGP_PACKETSIZE, &packetSizeInfo);
2281 if(err!=FCE_NOERROR)
2283 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2284 std::cerr <<
"\t ... Could not read packet size info ( error " << err <<
" )" << std::endl;
2288 if (bytesPerPacket < packetSizeInfo.MinValue || bytesPerPacket > packetSizeInfo.MaxValue)
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;
2296 bytesPerPacket = ((int)(bytesPerPacket/packetSizeInfo.MinValue))*packetSizeInfo.MinValue;
2298 err = m_cam.SetParameter(FGP_PACKETSIZE, bytesPerPacket);
2299 if(err!=FCE_NOERROR)
2301 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2302 std::cerr <<
"\t ... Could not set packet size " << bytesPerPacket <<
" ( error " << err <<
" )" << std::endl;
2310 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2311 std::cerr <<
"\t ... Specified framerate out of range ( error " << err <<
" )" << std::endl;
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;
2330 err=dc1394_video_set_framerate(m_cam, DC1394_FRAMERATE_7_5);
2331 if (err!=DC1394_SUCCESS)
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;
2339 err = m_cam.SetParameter(FGP_FRAMERATE, PVAL_AUTO);
2340 if(err!=FCE_NOERROR)
2342 std::cout <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2343 std::cerr <<
"\t ... Could not set framerate to AUTO ( error " << err <<
" )" << std::endl;
2354 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2355 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2362 dc1394framerate_t framerate;
2365 framerate = DC1394_FRAMERATE_1_875;
2367 else if (cameraProperty->
floatData <= 3.75)
2369 framerate = DC1394_FRAMERATE_3_75;
2371 else if (cameraProperty->
floatData <= 7.5)
2373 framerate = DC1394_FRAMERATE_7_5;
2375 else if (cameraProperty->
floatData <= 15)
2377 framerate = DC1394_FRAMERATE_15;
2379 else if (cameraProperty->
floatData <= 30)
2381 framerate = DC1394_FRAMERATE_30;
2383 else if (cameraProperty->
floatData <= 60)
2385 framerate = DC1394_FRAMERATE_60;
2389 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2390 std::cerr <<
"\t ... Specified framerate " << cameraProperty->
floatData <<
" out of range ( error " << err <<
" )" << std::endl;
2393 err=dc1394_video_set_framerate(m_cam, framerate);
2394 if (err!=DC1394_SUCCESS)
2396 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2397 std::cerr <<
"\t ... Could not set specified framerate " << cameraProperty->
floatData <<
" ( error " << err <<
" )" << std::endl;
2404 framerate = FR_1_875;
2406 else if (cameraProperty->
floatData <= 3.75)
2408 framerate = FR_3_75;
2410 else if (cameraProperty->
floatData <= 7.5)
2414 else if (cameraProperty->
floatData <= 15)
2418 else if (cameraProperty->
floatData <= 30)
2422 else if (cameraProperty->
floatData <= 60)
2428 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2429 std::cerr <<
"\t ... Specified framerate " << cameraProperty->
floatData <<
" out of range ( error " << err <<
" )" << std::endl;
2432 err = m_cam.SetParameter(FGP_FRAMERATE, framerate);
2433 if(err!=FCE_NOERROR)
2435 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2436 std::cerr <<
"\t ... Could not set specified framerate " << cameraProperty->
floatData <<
" ( error " << err <<
" )" << std::endl;
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;
2458 m_operationMode_B =
false;
2463 m_operationMode_B =
false;
2468 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2469 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2478 m_operationMode_B =
false;
2483 m_operationMode_B =
true;
2488 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2489 std::cerr <<
"\t ... FireWire operation mode " << cameraProperty->
stringData <<
" unknown." << std::endl;
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;
2509 err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_400);
2510 if (err!=DC1394_SUCCESS)
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;
2518 err = m_cam.SetParameter(FGP_PHYSPEED, PS_AUTO);
2519 if(err!=FCE_NOERROR)
2521 std::cerr<<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2522 std::cerr <<
"\t ... Could not set iso speed to AUTO mode ( error " << err <<
" )" << std::endl;
2531 err = m_cam.SetParameter(FGP_PHYSPEED, PS_LAST);
2532 if(err!=FCE_NOERROR)
2534 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2535 std::cerr <<
"\t ... Could not set iso speed to DEFAULT mode ( error " << err <<
" )" << std::endl;
2542 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2543 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2550 err = DC1394_FAILURE;
2553 err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_100);
2557 err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_200);
2561 err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_400);
2565 err=dc1394_video_set_iso_speed(m_cam, DC1394_ISO_SPEED_800);
2567 if (err!=DC1394_SUCCESS)
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;
2578 err = m_cam.SetParameter(FGP_PHYSPEED, PS_100MBIT);
2582 err = m_cam.SetParameter(FGP_PHYSPEED, PS_200MBIT);
2586 err = m_cam.SetParameter(FGP_PHYSPEED, PS_400MBIT);
2590 err = m_cam.SetParameter(FGP_PHYSPEED, PS_800MBIT);
2592 if(err!=FCE_NOERROR)
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;
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;
2618 err = m_cam.SetParameter(FGP_XSIZE, PVAL_AUTO);
2619 if(err!=FCE_NOERROR)
2621 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2622 std::cerr <<
"\t ... Could not set x resolution to AUTO mode ( error " << err <<
" )" << std::endl;
2625 err = m_cam.SetParameter(FGP_YSIZE, PVAL_AUTO);
2626 if(err!=FCE_NOERROR)
2628 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2629 std::cerr <<
"\t ... Could not set y resolution to AUTO mode ( error " << err <<
" )" << std::endl;
2640 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2641 std::cerr <<
"\t ... Special value 'VALUE_AUTO' or 'VALUE_DEFAULT' expected." << std::endl;
2649 m_cam.GetParameterInfo(FGP_XSIZE, &info);
2653 std::cout <<
"WARNING - AVTPikeCam::SetProperty:" << std::endl;
2655 <<
" has to be a value between " << info.MinValue <<
" and " << info.MaxValue <<
"." << std::endl;
2656 std::cout <<
"\t ... Setting maximal x resolution" << std::endl;
2658 m_cam.GetParameterInfo(FGP_YSIZE, &info);
2662 std::cout <<
"WARNING - AVTPikeCam::SetProperty:" << std::endl;
2664 <<
" has to be a value between " << info.MinValue <<
" and " << info.MaxValue <<
"." << std::endl;
2665 std::cout <<
"\t ... Setting maximal y resolution" << std::endl;
2671 if(err!=FCE_NOERROR)
2673 std::cout <<
"WARNING - AVTPikeCam::SetProperty:" << std::endl;
2674 std::cout <<
"\t ... Could not set image width ( error " << err <<
" )" << std::endl;
2678 if(err!=FCE_NOERROR)
2680 std::cout <<
"WARNING - AVTPikeCam::SetProperty:" << std::endl;
2681 std::cout <<
"\t ... Could not set image height ( error " << err <<
" )" << std::endl;
2688 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2689 std::cerr <<
"\t ... Wrong property type. 'TYPE_CAMERA_RESOLUTION' or 'TYPE_SPECIAL' expected." << std::endl;
2697 std::cerr <<
"ERROR - VTPikeCam::SetProperty:" << std::endl;
2698 std::cerr <<
"\t ... Property " << cameraProperty->
propertyID <<
" unspecified." << std::endl;
2706 unsigned long AVTPikeCam::SetParameters()
2713 if (m_ColorCameraParameters.m_CameraRole ==
MASTER)
2715 std::cout <<
"Info - AVTPikeCam::SetProperty:" << std::endl;
2716 std::cout <<
"\t ... Setting camera in MASTER mode." << std::endl;
2721 err = dc1394_external_trigger_set_power(m_cam, DC1394_OFF);
2722 if (err!=DC1394_SUCCESS)
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;
2729 err = dc1394_external_trigger_set_mode(m_cam, DC1394_TRIGGER_MODE_3);
2730 if (err!=DC1394_SUCCESS)
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;
2740 UINT32 triggerValue;
2741 triggerValue=MAKETRIGGER(0, 0, 0, 0, 0);
2742 err = m_cam.SetParameter(FGP_TRIGGER,triggerValue);
2743 if(err!=FCE_NOERROR)
2745 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2746 std::cerr <<
"\t ... Could not set Slave trigger mode ( error " << err <<
" )" << std::endl;
2751 else if (m_ColorCameraParameters.m_CameraRole ==
SLAVE)
2753 std::cout <<
"Info - AVTPikeCam::SetProperty:" << std::endl;
2754 std::cout <<
"\t ... Setting camera in SLAVE mode." << std::endl;
2758 err = dc1394_external_trigger_set_power(m_cam, DC1394_ON);
2759 if (err!=DC1394_SUCCESS)
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;
2767 err = dc1394_external_trigger_set_polarity(m_cam, DC1394_TRIGGER_ACTIVE_HIGH);
2768 if (err!=DC1394_SUCCESS)
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;
2776 err = dc1394_external_trigger_set_mode(m_cam, DC1394_TRIGGER_MODE_0);
2777 if (err!=DC1394_SUCCESS)
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;
2791 UINT32 triggerValue;
2792 triggerValue=MAKETRIGGER(nOn, nPolarity, nSrc, nMode, nParm);
2793 err = m_cam.SetParameter(FGP_TRIGGER,triggerValue);
2794 if(err!=FCE_NOERROR)
2796 std::cerr <<
"ERROR - AVTPikeCam::SetProperty:" << std::endl;
2797 std::cerr <<
"\t ... Could not set Slave trigger mode ( error " << err <<
" )" << std::endl;
2807 std::string sIsoSpeed =
"";
2808 m_ColorCameraParameters.m_IsoSpeed.clear();
2809 m_ColorCameraParameters.m_IsoSpeed.seekg(0);
2810 m_ColorCameraParameters.m_IsoSpeed >> sIsoSpeed;
2811 if (sIsoSpeed ==
"AUTO")
2816 else if (sIsoSpeed ==
"DEFAULT")
2824 m_ColorCameraParameters.m_IsoSpeed.clear();
2825 m_ColorCameraParameters.m_IsoSpeed.seekg(0);
2826 m_ColorCameraParameters.m_IsoSpeed >> cameraProperty.
u_longData;
2831 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
2832 std::cout <<
"\t ... Could not set ISO speed." << std::endl;
2842 std::string sVideoFormat =
"";
2843 std::string sVideoMode =
"";
2844 std::string sColorMode =
"";
2846 m_ColorCameraParameters.m_VideoFormat.clear();
2847 m_ColorCameraParameters.m_VideoFormat.seekg(0);
2848 m_ColorCameraParameters.m_VideoFormat >> sVideoFormat;
2849 if (sVideoFormat ==
"FORMAT_DEFAULT")
2853 else if (sVideoFormat ==
"FORMAT_0")
2857 else if (sVideoFormat ==
"FORMAT_1")
2861 else if (sVideoFormat ==
"FORMAT_2")
2865 else if (sVideoFormat ==
"FORMAT_7")
2870 m_ColorCameraParameters.m_VideoMode.clear();
2871 m_ColorCameraParameters.m_VideoMode.seekg(0);
2872 m_ColorCameraParameters.m_VideoMode >> sVideoMode;
2873 if (sVideoMode ==
"MODE_DEFAULT")
2877 else if (sVideoMode ==
"MODE_0")
2881 else if (sVideoMode ==
"MODE_1")
2885 else if (sVideoMode ==
"MODE_2")
2889 else if (sVideoMode ==
"MODE_3")
2893 else if (sVideoMode ==
"MODE_4")
2897 else if (sVideoMode ==
"MODE_5")
2901 else if (sVideoMode ==
"MODE_6")
2905 else if (sVideoMode ==
"MODE_7")
2910 m_ColorCameraParameters.m_ColorMode.clear();
2911 m_ColorCameraParameters.m_ColorMode.seekg(0);
2912 m_ColorCameraParameters.m_ColorMode >> sColorMode;
2913 if (sColorMode ==
"COLOR_DEFAULT")
2917 else if (sColorMode ==
"COLOR_YUV422")
2921 else if (sColorMode ==
"COLOR_YUV411")
2925 else if (sColorMode ==
"COLOR_RGB8")
2929 else if (sColorMode ==
"COLOR_RGB16S")
2933 else if (sColorMode ==
"COLOR_RGB16")
2937 else if (sColorMode ==
"COLOR_MONO8")
2941 else if (sColorMode ==
"COLOR_MONO16")
2945 else if (sColorMode ==
"COLOR_MONO16S")
2949 else if (sColorMode ==
"COLOR_RAW8")
2953 else if (sColorMode ==
"COLOR_RAW16")
2958 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
2960 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
2961 std::cout <<
"\t ... Could not set video format, video mode and color mode" << std::endl;
2969 std::string sImageWidth =
"";
2970 std::string sImageHeight =
"";
2971 int iImageWidth = -1;
2972 int iImageHeight = -1;
2974 m_ColorCameraParameters.m_ImageWidth.clear();
2975 m_ColorCameraParameters.m_ImageWidth.seekg(0);
2976 m_ColorCameraParameters.m_ImageWidth >> sImageWidth;
2977 m_ColorCameraParameters.m_ImageHeight.clear();
2978 m_ColorCameraParameters.m_ImageHeight.seekg(0);
2979 m_ColorCameraParameters.m_ImageHeight >> sImageHeight;
2981 if (sImageWidth ==
"AUTO" || sImageHeight ==
"Auto")
2986 else if (sImageWidth ==
"DEFAULT" || sImageHeight ==
"DEFAULT")
2994 m_ColorCameraParameters.m_ImageWidth.clear();
2995 m_ColorCameraParameters.m_ImageWidth.seekg(0);
2996 m_ColorCameraParameters.m_ImageWidth >> iImageWidth;
2997 m_ColorCameraParameters.m_ImageHeight.clear();
2998 m_ColorCameraParameters.m_ImageHeight.seekg(0);
2999 m_ColorCameraParameters.m_ImageHeight >> iImageHeight;
3002 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3004 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3005 std::cout <<
"\t ... Could not set resolution." << std::endl;
3013 std::string sExposureTime =
"";
3015 m_ColorCameraParameters.m_ExposureTime.clear();
3016 m_ColorCameraParameters.m_ExposureTime.seekg(0);
3017 m_ColorCameraParameters.m_ExposureTime >> sExposureTime;
3019 if (sExposureTime ==
"AUTO")
3024 else if (sExposureTime ==
"DEFAULT")
3032 m_ColorCameraParameters.m_ExposureTime.clear();
3033 m_ColorCameraParameters.m_ExposureTime.seekg(0);
3034 m_ColorCameraParameters.m_ExposureTime >> cameraProperty.
u_longData;
3037 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3039 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3040 std::cout <<
"\t ... Could not set auto exposure." << std::endl;
3047 std::string sFrameRate =
"";
3049 m_ColorCameraParameters.m_FrameRate.clear();
3050 m_ColorCameraParameters.m_FrameRate.seekg(0);
3051 m_ColorCameraParameters.m_FrameRate >> sFrameRate;
3053 if (sFrameRate ==
"AUTO")
3058 else if (sFrameRate ==
"DEFAULT")
3066 m_ColorCameraParameters.m_FrameRate.clear();
3067 m_ColorCameraParameters.m_FrameRate.seekg(0);
3068 m_ColorCameraParameters.m_FrameRate >> cameraProperty.
floatData;
3071 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3073 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3074 std::cout <<
"\t ... Could not set frame rate." << std::endl;
3082 std::string sShutter =
"";
3084 m_ColorCameraParameters.m_Shutter.clear();
3085 m_ColorCameraParameters.m_Shutter.seekg(0);
3086 m_ColorCameraParameters.m_Shutter >> sShutter;
3088 if (sShutter ==
"AUTO")
3093 else if (sShutter ==
"DEFAULT")
3101 m_ColorCameraParameters.m_Shutter.clear();
3102 m_ColorCameraParameters.m_Shutter.seekg(0);
3103 m_ColorCameraParameters.m_Shutter >> cameraProperty.
u_longData;
3106 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3108 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3109 std::cout <<
"\t ... Could not set shutter." << std::endl;
3116 std::string sBrightness =
"";
3118 m_ColorCameraParameters.m_Brightness.clear();
3119 m_ColorCameraParameters.m_Brightness.seekg(0);
3120 m_ColorCameraParameters.m_Brightness >> sBrightness;
3122 if (sBrightness ==
"AUTO")
3127 else if (sBrightness ==
"DEFAULT")
3135 m_ColorCameraParameters.m_Brightness.clear();
3136 m_ColorCameraParameters.m_Brightness.seekg(0);
3137 m_ColorCameraParameters.m_Brightness >> cameraProperty.
u_longData;
3140 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3142 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3143 std::cout <<
"\t ... Could not set brightness." << std::endl;
3150 std::string sGain =
"";
3152 m_ColorCameraParameters.m_Gain.clear();
3153 m_ColorCameraParameters.m_Gain.seekg(0);
3154 m_ColorCameraParameters.m_Gain >> sGain;
3156 if (sGain ==
"AUTO")
3161 else if (sGain ==
"DEFAULT")
3169 m_ColorCameraParameters.m_Gain.clear();
3170 m_ColorCameraParameters.m_Gain.seekg(0);
3171 m_ColorCameraParameters.m_Gain >> cameraProperty.
u_longData;
3174 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3176 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3177 std::cout <<
"\t ... Could not set gain." << std::endl;
3184 std::string sGamma =
"";
3186 m_ColorCameraParameters.m_Gamma.clear();
3187 m_ColorCameraParameters.m_Gamma.seekg(0);
3188 m_ColorCameraParameters.m_Gamma >> sGamma;
3190 if (sGamma ==
"AUTO")
3195 else if (sGamma ==
"DEFAULT")
3203 m_ColorCameraParameters.m_Gamma.clear();
3204 m_ColorCameraParameters.m_Gamma.seekg(0);
3205 m_ColorCameraParameters.m_Gamma >> cameraProperty.
u_longData;
3208 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3210 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3211 std::cout <<
"\t ... Could not set gamma." << std::endl;
3218 std::string sHue =
"";
3220 m_ColorCameraParameters.m_Hue.clear();
3221 m_ColorCameraParameters.m_Hue.seekg(0);
3222 m_ColorCameraParameters.m_Hue >> sHue;
3229 else if (sHue ==
"DEFAULT")
3237 m_ColorCameraParameters.m_Hue.clear();
3238 m_ColorCameraParameters.m_Hue.seekg(0);
3239 m_ColorCameraParameters.m_Hue >> cameraProperty.
u_longData;
3242 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3244 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3245 std::cout <<
"\t ... Could not set hue." << std::endl;
3252 std::string sSaturation =
"";
3254 m_ColorCameraParameters.m_Saturation.clear();
3255 m_ColorCameraParameters.m_Saturation.seekg(0);
3256 m_ColorCameraParameters.m_Saturation >> sSaturation;
3258 if (sSaturation ==
"AUTO")
3263 else if (sSaturation ==
"DEFAULT")
3271 m_ColorCameraParameters.m_Saturation.clear();
3272 m_ColorCameraParameters.m_Saturation.seekg(0);
3273 m_ColorCameraParameters.m_Saturation >> cameraProperty.
u_longData;
3276 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3278 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3279 std::cout <<
"\t ... Could not set saturation." << std::endl;
3286 std::string sWhiteBalanceU =
"";
3288 m_ColorCameraParameters.m_WhiteBalanceU.clear();
3289 m_ColorCameraParameters.m_WhiteBalanceU.seekg(0);
3290 m_ColorCameraParameters.m_WhiteBalanceU >> sWhiteBalanceU;
3292 if (sWhiteBalanceU ==
"AUTO")
3297 else if (sWhiteBalanceU ==
"DEFAULT")
3305 m_ColorCameraParameters.m_WhiteBalanceU.clear();
3306 m_ColorCameraParameters.m_WhiteBalanceU.seekg(0);
3307 m_ColorCameraParameters.m_WhiteBalanceU >> cameraProperty.
u_longData;
3310 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3312 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3313 std::cout <<
"\t ... Could not set white balance U." << std::endl;
3320 std::string sWhiteBalanceV =
"";
3322 m_ColorCameraParameters.m_WhiteBalanceV.clear();
3323 m_ColorCameraParameters.m_WhiteBalanceV.seekg(0);
3324 m_ColorCameraParameters.m_WhiteBalanceV >> sWhiteBalanceV;
3326 if (sWhiteBalanceV ==
"AUTO")
3331 else if (sWhiteBalanceV ==
"DEFAULT")
3339 m_ColorCameraParameters.m_WhiteBalanceV.clear();
3340 m_ColorCameraParameters.m_WhiteBalanceV.seekg(0);
3341 m_ColorCameraParameters.m_WhiteBalanceV >> cameraProperty.
u_longData;
3344 if (SetProperty(&cameraProperty) & ipa_CameraSensors::RET_FAILED)
3346 std::cout <<
"WARNING - AVTPikeCam::SetParameters:" << std::endl;
3347 std::cout <<
"\t ... Could not set white balance V." << std::endl;
3352 unsigned long AVTPikeCam::LoadParameters(
const char* filename,
int cameraIndex)
3356 if (!p_configXmlDocument->LoadFile())
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;
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;
3367 if ( p_configXmlDocument )
3374 TiXmlElement *p_xmlElement_Root = NULL;
3375 p_xmlElement_Root = p_configXmlDocument->FirstChildElement(
"LibCameraSensors" );
3376 if ( p_xmlElement_Root )
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 )
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 )
3400 if ( p_xmlElement_Child->QueryValueAttribute(
"high", &tempString ) != TIXML_SUCCESS)
3402 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3403 std::cerr <<
"\t ... Can't find attribute 'high' of tag 'GUID'." << std::endl;
3406 m_GUID.High = strtoul(tempString.c_str(),NULL,16);
3409 if ( p_xmlElement_Child->QueryValueAttribute(
"low", &tempString ) != TIXML_SUCCESS)
3411 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3412 std::cerr <<
"\t ... Can't find attribute 'low' of tag 'GUID'." << std::endl;
3415 m_GUID.Low = strtoul(tempString.c_str(),NULL,16);
3419 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3420 std::cerr <<
"\t ... Can't find tag 'GUID'." << std::endl;
3427 p_xmlElement_Child = NULL;
3428 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"Role" );
3429 if ( p_xmlElement_Child )
3432 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString ) != TIXML_SUCCESS)
3434 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3435 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'Role'." << std::endl;
3439 if (tempString ==
"MASTER") m_ColorCameraParameters.m_CameraRole =
MASTER;
3440 else if (tempString ==
"SLAVE") m_ColorCameraParameters.m_CameraRole =
SLAVE;
3443 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3444 std::cerr <<
"\t ... Role " << tempString <<
" unspecified." << std::endl;
3451 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3452 std::cerr <<
"\t ... Can't find tag 'Role'." << std::endl;
3460 p_xmlElement_Child = NULL;
3461 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"VideoFormat" );
3462 if ( p_xmlElement_Child )
3465 if ( p_xmlElement_Child->QueryValueAttribute(
"type", &tempString) != TIXML_SUCCESS)
3467 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3468 std::cerr <<
"\t ... Can't find attribute 'type' of tag 'VideoFormat'." << std::endl;
3473 m_ColorCameraParameters.m_VideoFormat.str(
" " );
3474 m_ColorCameraParameters.m_VideoFormat.clear();
3475 m_ColorCameraParameters.m_VideoFormat << tempString;
3480 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3481 std::cerr <<
"\t ... Can't find tag 'VideoFormat'." << std::endl;
3489 p_xmlElement_Child = NULL;
3490 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"VideoMode" );
3491 if ( p_xmlElement_Child )
3494 if ( p_xmlElement_Child->QueryValueAttribute(
"type", &tempString ) != TIXML_SUCCESS)
3496 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3497 std::cerr <<
"\t ... Can't find attribute 'type' of tag 'VideoMode'." << std::endl;
3502 m_ColorCameraParameters.m_VideoMode.str(
" " );
3503 m_ColorCameraParameters.m_VideoMode.clear();
3504 m_ColorCameraParameters.m_VideoMode << tempString;
3510 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3511 std::cerr <<
"\t ... Can't find tag 'VideoMode'." << std::endl;
3519 p_xmlElement_Child = NULL;
3520 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"Resolution" );
3521 if ( p_xmlElement_Child )
3524 if ( p_xmlElement_Child->QueryValueAttribute(
"width", &tempString) != TIXML_SUCCESS)
3526 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3527 std::cerr <<
"\t ... Can't find attribute 'width' of tag 'Resolution'." << std::endl;
3532 m_ColorCameraParameters.m_ImageWidth.str(
" " );
3533 m_ColorCameraParameters.m_ImageWidth.clear();
3534 m_ColorCameraParameters.m_ImageWidth << tempString;
3537 if ( p_xmlElement_Child->QueryValueAttribute(
"height", &tempString) != TIXML_SUCCESS)
3539 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3540 std::cerr <<
"\t ... Can't find attribute 'height' of tag 'Resolution'." << std::endl;
3545 m_ColorCameraParameters.m_ImageHeight.str(
" " );
3546 m_ColorCameraParameters.m_ImageHeight.clear();
3547 m_ColorCameraParameters.m_ImageHeight << tempString;
3552 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3553 std::cerr <<
"\t ... Can't find tag 'Resolution'." << std::endl;
3561 p_xmlElement_Child = NULL;
3562 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"FrameRate" );
3563 if ( p_xmlElement_Child )
3566 if ( p_xmlElement_Child->QueryValueAttribute(
"fps", &tempString) != TIXML_SUCCESS)
3568 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3569 std::cerr <<
"\t ... Can't find attribute 'fps' of tag 'FrameRate'." << std::endl;
3574 m_ColorCameraParameters.m_FrameRate.str(
" " );
3575 m_ColorCameraParameters.m_FrameRate.clear();
3576 m_ColorCameraParameters.m_FrameRate << tempString;
3582 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3583 std::cerr <<
"\t ... Can't find tag 'FrameRate'." << std::endl;
3592 p_xmlElement_Child = NULL;
3593 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"ColorMode" );
3594 if ( p_xmlElement_Child )
3597 if ( p_xmlElement_Child->QueryValueAttribute(
"type", &tempString ) != TIXML_SUCCESS)
3599 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3600 std::cerr <<
"\t ... Can't find attribute 'type' of tag 'ColorMode'." << std::endl;
3605 m_ColorCameraParameters.m_ColorMode.str(
" " );
3606 m_ColorCameraParameters.m_ColorMode.clear();
3607 m_ColorCameraParameters.m_ColorMode << tempString;
3613 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3614 std::cerr <<
"\t ... Can't find tag 'ColorMode'." << std::endl;
3622 p_xmlElement_Child = NULL;
3623 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"IsoSpeed" );
3624 if ( p_xmlElement_Child )
3627 if ( p_xmlElement_Child->QueryValueAttribute(
"speed", &tempString ) != TIXML_SUCCESS)
3629 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3630 std::cerr <<
"\t ... Can't find attribute 'speed' of tag 'IsoSpeed'." << std::endl;
3635 m_ColorCameraParameters.m_IsoSpeed.str(
" " );
3636 m_ColorCameraParameters.m_IsoSpeed.clear();
3637 m_ColorCameraParameters.m_IsoSpeed << tempString;
3643 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3644 std::cerr <<
"\t ... Can't find tag 'IsoSpeed'." << std::endl;
3652 p_xmlElement_Child = NULL;
3653 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"OperationMode" );
3654 if ( p_xmlElement_Child )
3657 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString ) != TIXML_SUCCESS)
3659 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3660 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'OperationMode'." << std::endl;
3663 if (tempString ==
"A") m_operationMode_B =
false;
3664 else if (tempString ==
"B") m_operationMode_B =
true;
3667 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3668 std::cerr <<
"\t ... FireWire operation mode " << tempString <<
" unspecified." << std::endl;
3674 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3675 std::cerr <<
"\t ... Can't find tag 'OperationMode'." << std::endl;
3683 p_xmlElement_Child = NULL;
3684 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_SHUTTER" );
3685 if ( p_xmlElement_Child )
3688 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3690 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3691 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_SHUTTER'." << std::endl;
3696 m_ColorCameraParameters.m_Shutter.str(
" " );
3697 m_ColorCameraParameters.m_Shutter.clear();
3698 m_ColorCameraParameters.m_Shutter << tempString;
3703 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3704 std::cerr <<
"\t ... Can't find tag 'PROP_SHUTTER'." << std::endl;
3712 p_xmlElement_Child = NULL;
3713 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_BRIGHTNESS" );
3714 if ( p_xmlElement_Child )
3717 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3719 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3720 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_BRIGHTNESS'." << std::endl;
3725 m_ColorCameraParameters.m_Brightness.str(
" " );
3726 m_ColorCameraParameters.m_Brightness.clear();
3727 m_ColorCameraParameters.m_Brightness << tempString;
3733 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3734 std::cerr <<
"\t ... Can't find tag 'PROP_BRIGHTNES'." << std::endl;
3742 p_xmlElement_Child = NULL;
3743 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_EXPOSURE_TIME" );
3744 if ( p_xmlElement_Child )
3747 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3749 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3750 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_EXPOSURE_TIME'." << std::endl;
3755 m_ColorCameraParameters.m_ExposureTime.str(
" " );
3756 m_ColorCameraParameters.m_ExposureTime.clear();
3757 m_ColorCameraParameters.m_ExposureTime << tempString;
3763 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3764 std::cerr <<
"\t ... Can't find tag 'PROP_EXPOSURE_TIME'." << std::endl;
3772 p_xmlElement_Child = NULL;
3773 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_WHITE_BALANCE_U");
3774 if ( p_xmlElement_Child )
3777 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
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;
3785 m_ColorCameraParameters.m_WhiteBalanceU.str(
" " );
3786 m_ColorCameraParameters.m_WhiteBalanceU.clear();
3787 m_ColorCameraParameters.m_WhiteBalanceU << tempString;
3792 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3793 std::cerr <<
"\t ... Can't find tag 'PROP_WHITE_BALANCE_U'." << std::endl;
3801 p_xmlElement_Child = NULL;
3802 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_WHITE_BALANCE_V" );
3803 if ( p_xmlElement_Child )
3806 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
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;
3814 m_ColorCameraParameters.m_WhiteBalanceV.str(
" " );
3815 m_ColorCameraParameters.m_WhiteBalanceV.clear();
3816 m_ColorCameraParameters.m_WhiteBalanceV << tempString;
3821 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3822 std::cerr <<
"\t ... Can't find tag 'PROP_WHITE_BALANCE_V'." << std::endl;
3830 p_xmlElement_Child = NULL;
3831 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_HUE" );
3832 if ( p_xmlElement_Child )
3835 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3837 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3838 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_HUE'." << std::endl;
3843 m_ColorCameraParameters.m_Hue.str(
" " );
3844 m_ColorCameraParameters.m_Hue.clear();
3845 m_ColorCameraParameters.m_Hue << tempString;
3850 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3851 std::cerr <<
"\t ... Can't find tag 'PROP_HUE'." << std::endl;
3859 p_xmlElement_Child = NULL;
3860 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_SATURATION" );
3861 if ( p_xmlElement_Child )
3864 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3866 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3867 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_SATURATION'." << std::endl;
3872 m_ColorCameraParameters.m_Saturation.str(
" " );
3873 m_ColorCameraParameters.m_Saturation.clear();
3874 m_ColorCameraParameters.m_Saturation << tempString;
3879 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3880 std::cerr <<
"\t ... Can't find tag 'PROP_SATURATION'." << std::endl;
3888 p_xmlElement_Child = NULL;
3889 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_GAMMA" );
3890 if ( p_xmlElement_Child )
3893 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3895 std::cerr <<
"AVTPikeCam::LoadParameters:" << std::endl;
3896 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_GAMMA'." << std::endl;
3901 m_ColorCameraParameters.m_Gamma.str(
" " );
3902 m_ColorCameraParameters.m_Gamma.clear();
3903 m_ColorCameraParameters.m_Gamma << tempString;
3908 std::cerr <<
"AVTPikeCam::LoadParameters:" << std::endl;
3909 std::cerr <<
"\t ... Can't find tag 'PROP_GAMMA'." << std::endl;
3917 p_xmlElement_Child = NULL;
3918 p_xmlElement_Child = p_xmlElement_Root_AVTPikeCam->FirstChildElement(
"PROP_GAIN" );
3919 if ( p_xmlElement_Child )
3922 if ( p_xmlElement_Child->QueryValueAttribute(
"value", &tempString) != TIXML_SUCCESS)
3924 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3925 std::cerr <<
"\t ... Can't find attribute 'value' of tag 'PROP_GAIN '." << std::endl;
3930 m_ColorCameraParameters.m_Gain.str(
" " );
3931 m_ColorCameraParameters.m_Gain.clear();
3932 m_ColorCameraParameters.m_Gain << tempString;
3937 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3938 std::cerr <<
"\t ... Can't find tag 'PROP_EXPOSURE_TIME'." << std::endl;
3948 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3949 std::cerr <<
"\t ... Can't find tag '" << ss.str() <<
"'" << std::endl;
3959 std::cerr <<
"ERROR - AVTPikeCam::LoadParameters:" << std::endl;
3960 std::cerr <<
"\t ... Can't find tag 'LibCameraSensors'." << std::endl;
PROP_MODULATION_FREQUENCY
t_cameraResolution cameraResolution
boost::shared_ptr< AbstractColorCamera > AbstractColorCameraPtr
RET_FUNCTION_NOT_IMPLEMENTED
t_specialValues specialValue
RET_CAMERA_ALREADY_INITIALIZED
unsigned int u_integerData
t_cameraPropertyID propertyID
t_videoFormat videoFormat
unsigned long propertyType
__DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam()
#define __DLL_LIBCAMERASENSORS__