Install FlyCatprue2 to the folder "C:\PointGreyResearch\"

Add the following to the .pro file:

# Add FlyCapture2
INCLUDEPATH += C:\PointGreyResearch\FlyCapture2\include
INCLUDEPATH += C:\PointGreyResearch\FlyCapture2\include\C LIBS += "C:\PointGreyResearch\FlyCapture2\lib\C\FlyCapture2_C.lib"
LIBS += "C:\PointGreyResearch\FlyCapture2\lib\C\FlyCapture2GUI_C.lib"

Note:

The C++ library only works with visual studio on Windows, not MinGW. So if we want to use MinGW, only the C library would work!

Sample FlyCapture2 API C Code:

#include "C/FlyCapture2_C.h"
#include <stdio.h> typedef enum _AviType
{
UNCOMPRESSED,
MJPG,
H264
} AviType; void PrintCameraInfo( fc2Context context )
{
fc2Error error;
fc2CameraInfo camInfo;
error = fc2GetCameraInfo( context, &camInfo );
if ( error != FC2_ERROR_OK )
{
// Error
} printf(
"\n*** CAMERA INFORMATION ***\n"
"Serial number - %u\n"
"Camera model - %s\n"
"Camera vendor - %s\n"
"Sensor - %s\n"
"Resolution - %s\n"
"Firmware version - %s\n"
"Firmware build time - %s\n\n",
camInfo.serialNumber,
camInfo.modelName,
camInfo.vendorName,
camInfo.sensorInfo,
camInfo.sensorResolution,
camInfo.firmwareVersion,
camInfo.firmwareBuildTime );
} int SaveAVIHelper(fc2Context context, AviType aviType, float frameRate)
{
fc2Error error;
const int k_numImagesToGrab = ;
fc2Image rawImage;
fc2AVIContext aviContext;
fc2AVIOption aviOption;
fc2H264Option h264Option;
fc2MJPGOption mjpgOption;
int i; error = fc2CreateAVI(&aviContext);
if (error != FC2_ERROR_OK)
{
printf("Error in fc2CreateAVI: %d\n", error);
return -;
} error = fc2CreateImage( &rawImage );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2CreateImage: %d\n", error );
fc2DestroyAVI(aviContext);
return -;
} for (i=; i < k_numImagesToGrab; i++)
{
// Retrieve the image
error = fc2RetrieveBuffer(context, &rawImage);
if (error != FC2_ERROR_OK)
{
printf("Error in retrieveBuffer: %d\n", error);
continue;
} // Perform some initialization for the first time
if (i == )
{
switch (aviType)
{
case UNCOMPRESSED:
aviOption.frameRate = frameRate;
error = fc2AVIOpen(aviContext, "SaveImageToAviEx_C-Uncompressed", &aviOption);
if (error != FC2_ERROR_OK)
{
printf("Error opening AVI: %d\n", error);
}
break; case MJPG:
mjpgOption.frameRate = frameRate;
mjpgOption.quality = ;
error = fc2MJPGOpen(aviContext, "SaveImageToAviEx_C-MJPG", &mjpgOption);
if (error != FC2_ERROR_OK)
{
printf("Error opening AVI: %d\n", error);
}
break; case H264:
h264Option.frameRate = frameRate;
h264Option.bitrate = ;
h264Option.width = rawImage.cols;
h264Option.height = rawImage.rows;
error = fc2H264Open(aviContext, "SaveImageToAviEx_C-H264", &h264Option);
if (error != FC2_ERROR_OK)
{
printf("Error opening AVI: %d\n", error);
}
break;
}
} error = fc2AVIAppend(aviContext, &rawImage);
if (error != FC2_ERROR_OK)
{
printf("Error appending to AVI: %d\n", error);
} printf("Appended image %d\n", i);
} error = fc2DestroyImage(&rawImage);
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2CreateImaged: %d\n", error );
fc2DestroyAVI(aviContext);
return -;
} error = fc2DestroyAVI(aviContext);
if (error != FC2_ERROR_OK)
{
printf("Error in fc2DestroyAVI: %d\n", error);
return -;
} return ;
} float GetFrameRate(fc2Context context)
{
fc2Error error;
fc2PropertyInfo propInfo;
fc2Property prop; // Check if the camera supports the FRAME_RATE property
printf( "Detecting frame rate from camera... \n" );
propInfo.type = FC2_FRAME_RATE;
error = fc2GetPropertyInfo(context, &propInfo);
if (error != FC2_ERROR_OK)
{
return 0.0f;
} if (propInfo.present)
{
// Get the frame rate
prop.type = FC2_FRAME_RATE;
error = fc2GetProperty(context, &prop);
if (error != FC2_ERROR_OK)
{
return 0.0f;
} // Set the frame rate.
// Note that the actual recording frame rate may be slower,
// depending on the bus speed and disk writing speed.
return prop.absValue;
} return 0.0f;
} int RunCamera(fc2Context context, fc2PGRGuid guid)
{
fc2Error error;
float frameRate = 0.0f; error = fc2Connect( context, &guid );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2Connect: %d\n", error );
return -;
} PrintCameraInfo( context ); error = fc2StartCapture( context );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2StartCapture: %d\n", error );
return -;
} frameRate = GetFrameRate(context);
if (frameRate == 0.0f)
{
printf("Invalid frame rate returned\n");
return -;
} SaveAVIHelper(context, UNCOMPRESSED, frameRate);
SaveAVIHelper(context, H264, frameRate);
SaveAVIHelper(context, MJPG, frameRate); error = fc2StopCapture( context );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2StopCapture: %d\n", error );
return -;
} return ;
} int main(int argc, char** argv)
{
fc2Error error;
fc2Context context;
fc2PGRGuid guid;
unsigned int numCameras = ; //PrintBuildInfo(); error = fc2CreateContext( &context );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2CreateContext: %d\n", error );
return ;
} error = fc2GetNumOfCameras( context, &numCameras );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2GetNumOfCameras: %d\n", error );
return ;
} if ( numCameras == )
{
// No cameras detected
printf( "No cameras detected.\n");
return -;
} // Get the 0th camera
error = fc2GetCameraFromIndex( context, , &guid );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2GetCameraFromIndex: %d\n", error );
return -;
} if (RunCamera(context, guid) != )
{
printf("Error running camera\n");
return -;
} error = fc2DestroyContext( context );
if ( error != FC2_ERROR_OK )
{
printf( "Error in fc2DestroyContext: %d\n", error );
return -;
} printf( "Done! Press Enter to exit...\n" );
getchar(); return ;
}

FlyCapture2 Qt5 MinGW Configuration的更多相关文章

  1. Qt5+VS2010的安装及使用

    在我的博客<Win7下Qt5的安装及使用>中讲解了win7下Qt5+MinGW的安装及使用,本节再讲解win7下Qt5+VS2010的安装及使用.利用Qt5+MinGW开发应用程序比较麻烦 ...

  2. Qt5 installation and path configuration

    Replace Default Qt version paths in: /usr/lib/x86_64-linux-gnu/qtchooser/default.confor in newer rel ...

  3. FLTK 1.3.3 MinGW 4.9.1 Configuration 配置

    Download FLTK 1.3.3 Download CMake 3.2.0 Start CMake 3.2.0, fill the source and destination: source: ...

  4. ITK 4.8.1 Qt 5.4 MinGW 4.9.1 Configuration 配置

    Download ITK 4.8.1 Download Qt 5.4 with MinGW 4.9.1 Download CMake 3.2.0 I assume you've already ins ...

  5. VTK 6.3.0 Qt 5.4 MinGW 4.9.1 Configuration 配置

    Download VTK 6.3.0 Download Qt 5.4 with MinGW 4.9.1 Download CMake 3.2.0 I assume you've already ins ...

  6. Clion+Cmake+Qt5+Qwt+msys2+MinGW在Windows下的安装配置使用教程

    摘要: CLion, a cross-platform C/C++ IDE. 本文主要介绍基于Clion作为IDE, MinGW作为编译器,CMake作为项目构建工具,开发基于Qt5.qwt的C++图 ...

  7. Qt5.8 在windows下mingw静态编译

    官方对编译一些条件介绍:https://doc.qt.io/qt-5/windows-requirements.html 在默认情况下,用QtCreator编译程序时,使用的是动态编译.编译好的程序在 ...

  8. 使用mingw编译完整Qt5的过程(使用了niXman的msys套装)good

    使用mingw编译完整Qt5的过程 坛子里似乎已经有人编译出Qt5了,不过大多有问题,不是缺少opengl就是缺少openssl,还有缺少webkit的,本文提供的仍然不能说是绝对完整的,不过相对以前 ...

  9. 用mingw静态编译Qt4.8.2和Qt5.1.1(需要修改不少源码)

    因为一些乱七八糟的原因,我需要用mingw静态编译Qt4.8.2和Qt5.1.1.经历了一天的折腾之后,自觉编译一下Qt还是件颇为麻烦的事情,故将过程略作总结,以备不时之需. 首先,在编译之前,我需要 ...

随机推荐

  1. static总结

    [本文链接] http://www.cnblogs.com/hellogiser/p/static.html [分析] [内存分配方式] 在C++中,内存分成5个区,他们分别是堆.栈.自由存储区.全局 ...

  2. HDU 1087 Super Jumping! Jumping! Jumping! 最大递增子序列

    Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 ...

  3. 重温CSS之背景、文本样式

    CSS背景样式: 背景色:background-color属性,设置元素的背景色,如:div {background:blue;}--设置所有div元素的背景为蓝色: 背景图像:background- ...

  4. 【读书笔记】读《JavaScript设计模式》之工厂模式

    一个类或对象中往往会包含别的对象.在创建这种成员对象时,你可能习惯于使用常规方式,也即用new关键字和类构造函数.问题在于这回导致相关的两个类之间产生依赖性. 工厂模式用于消除这两个类之间的依赖性,它 ...

  5. C++ friend

    如果类A希望类B可以访问它的私有成员, 可以把类B设置为友元类. // 类A,希望把私有成员公开给类B class A {     friend class B;// 把B设置为友元类 public: ...

  6. grep' \b\b'

    \b单词锁定符,如: '\bgrep\b'只匹配grep [root@86 ttf-arphic-uming-0.0.20050501]# cat /proc/diskstats 1 0 ram0 0 ...

  7. Java Hour 19 List

    有句名言,叫做10000小时成为某一个领域的专家.姑且不辩论这句话是否正确,让我们到达10000小时的时候再回头来看吧. 本文作者Java 现经验约为19 Hour,请各位不吝赐教. List Arr ...

  8. Android Studio打包未签名包

    Android Studio打包未签名包 好久没有写技术博客了,真有点懈怠了,作为35岁的程序员,转行重新捡起这些知识,还是挺犹豫纠结的,不过没啥其它办法,一点一滴开始吧,今天这开篇就小结点前几天工作 ...

  9. 2016"百度之星" - 初赛(Astar Round2A)1002 / HDU 5691 状态压缩DP

    Sitting in Line Problem Description   度度熊是他同时代中最伟大的数学家,一切数字都要听命于他.现在,又到了度度熊和他的数字仆人们玩排排坐游戏的时候了.游戏的规则十 ...

  10. 电赛菜鸟营培训(五)——OLED屏幕的使用

    一.取模软件的使用 首先进行设置 然后可以生成显示这个字母的代码,列优先,先按列画8行,然后再继续画下一列.汉字为16*16,字母为8*8,对应生成相应个数的ox代码. 二.STM32烤写OLED # ...