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. Bulb Switcher

    There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every ...

  2. Solr DIH导入出现 Data Config problem: 前言中不允许有内容 异常

    Solr配置DIH导入时出现 “Data Config problem: 前言中不允许有内容.” 异常. <response> <lst name="responseHea ...

  3. Java for LeetCode 036 Valid Sudoku

    Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be ...

  4. codeforces 478B Random Teams 解题报告

    题目链接:http://codeforces.com/problemset/problem/478/B 题目意思:有 n 个人,需要将这班人分成 m 个 组,每个组至少含有一个人,同一个组里的人两两可 ...

  5. 使用apktool工具遇到could not decode arsc file的解决办法

    问题详情: 当前环境为 win7 64位  jdk1.7  apktool.jar(版本1.5.2)   apktool(版本windows-r05-ibot) 使用的反编译工具和apk文件为 反编译 ...

  6. atom初体验

    今天捣鼓了一天的atom,也测试了那个传说中绚丽的敲代码方式,感觉就是装逼利器,这里总结一下今天捣鼓的过程吧 首页,下载atom,这个在地址是:搜索 之后是安装插件,在这之前如果下载的是.exe的,那 ...

  7. .pro配置选项

    在Qt Creator的项目中添加头文件和库   在Qt Creator中的工程中,工程通过.pro文件管理. 额外需要连接的连接库 unix:LIBS += -L your_lib_path -ly ...

  8. android 的四种枚举Context.MODE_PRIVATE

    标签: mode_private Context.MODE_PRIVATE:为默认操作模式,代表该文件是私有数据,只能被应用本身访问,在该模式下,写入的内容会覆盖原文件的内容,如果想把新写入的内容追加 ...

  9. 注意padding-top 百分比定义基于父元素宽度的百分比上内边距!!是基于宽度

    定义和用法 padding-top 属性设置元素的上内边距(空间). 说明 该属性设置元素上内边距的宽度.行内非替换元素上设置的上内边距不会影响行高计算,因此,如果一个元素既有内边距又有背景,从视觉上 ...

  10. vim 多窗口

    打开多个文件: 1.vim还没有启动的时候: 在终端里输入 vim file1 file2 ... filen便可以打开所有想要打开的文件 2.vim已经启动 输入 :open file 可以再打开一 ...