BingObjectnessCVPR14源码编译环境由vs2012+64位转换为vs2012+32位机过程
2014-10-17 13:34
381 查看
一、版本转换
1.将源码中vs2012版本转换为vs2010版本。
二、在vs编译环境中,openmp环境配置。
1.ConfigurationProlperties->c/c++->Language->Open MP Support->Yes
三、用_popcnt函数实现_popcnt64函数功能,需要自己动手在INT64类型基础上写函数。要加头文件#include<intrin.h>在stdafx.h中。
inline INT64 __popcount64(INT64x)
{
return __popcnt((unsignedint)(x )) +__popcnt((unsignedint)(x>> 32));
}
四、在LibLinear工程中编译生成LibLinear.lib文件,具体如下:
1. objectness下的properties->general->linker->linklibrary dependency 后面改成yes
2.在linear.cpp中函数voidset_print_string_function(void(*print_func)(const char*))前加入extern “c”;
3.build Liblinear工程,然后在ConfigurationProperties->Linker->General->Additional Library Directories中添加LibLinear.lib所在的位置路径。
五、Debugging information *.exe cannot be found or does not match(C++不能调试解决方法)
用这个方法,摘自某英文论坛
To enable debugging:
1) Goto Project->HelloWorld Properties
2) On the left expand "Configuration Properties"
3) Expand "C/C++"
4) On the left, Select "General"
5) On the right, change "Debug Information Format" to "ProgramDatabase For Edit And Continue (/ZI)"
5) On the left, Select "Optimization"
6) On the right, change "Optimization" to "Disabled (/Od)"
7) On the left, expand "Linker"
8) On the left, select "Debugging"
9) On the right, change "Generate Debug Info" to "Yes"
10) Click ok
11) Set your breakpoints
12) Rebuild your application
六、代码中Mat无法解析问题
1.具体原因暂时无法知道,可能是opencv中Mat_对INT64(unsignedlong long)类型的支持问题,可以用以下matchTemplate()函数替换FilterTIP.cpp文件中的matchTemplate原函数。
引用:(http://www.cvchina.info/2014/02/25/14cvprbing/comment-page-5/#comment-7391)中第16楼上的Liuyu.
1.将源码中vs2012版本转换为vs2010版本。
二、在vs编译环境中,openmp环境配置。
1.ConfigurationProlperties->c/c++->Language->Open MP Support->Yes
三、用_popcnt函数实现_popcnt64函数功能,需要自己动手在INT64类型基础上写函数。要加头文件#include<intrin.h>在stdafx.h中。
inline INT64 __popcount64(INT64x)
{
return __popcnt((unsignedint)(x )) +__popcnt((unsignedint)(x>> 32));
}
四、在LibLinear工程中编译生成LibLinear.lib文件,具体如下:
1. objectness下的properties->general->linker->linklibrary dependency 后面改成yes
2.在linear.cpp中函数voidset_print_string_function(void(*print_func)(const char*))前加入extern “c”;
3.build Liblinear工程,然后在ConfigurationProperties->Linker->General->Additional Library Directories中添加LibLinear.lib所在的位置路径。
五、Debugging information *.exe cannot be found or does not match(C++不能调试解决方法)
用这个方法,摘自某英文论坛
To enable debugging:
1) Goto Project->HelloWorld Properties
2) On the left expand "Configuration Properties"
3) Expand "C/C++"
4) On the left, Select "General"
5) On the right, change "Debug Information Format" to "ProgramDatabase For Edit And Continue (/ZI)"
5) On the left, Select "Optimization"
6) On the right, change "Optimization" to "Disabled (/Od)"
7) On the left, expand "Linker"
8) On the left, select "Debugging"
9) On the right, change "Generate Debug Info" to "Yes"
10) Click ok
11) Set your breakpoints
12) Rebuild your application
六、代码中Mat无法解析问题
1.具体原因暂时无法知道,可能是opencv中Mat_对INT64(unsignedlong long)类型的支持问题,可以用以下matchTemplate()函数替换FilterTIP.cpp文件中的matchTemplate原函数。
引用:(http://www.cvchina.info/2014/02/25/14cvprbing/comment-page-5/#comment-7391)中第16楼上的Liuyu.
void FilterTIG::matchTemplate(const Mat &mag1u, Mat &matchCost1f) { const int H = mag1u.rows, W = mag1u.cols; const Size sz(W+1, H+1); // Expand original size to avoid dealing with boundary conditions Mat_<float> scores(sz); // @ 2013.3.22 by ly; const int sizeSZ = sz.width * sz.height; INT64 * Tig1 = (INT64 *)malloc(sizeSZ * sizeof(INT64)); INT64 * Tig2 = (INT64 *)malloc(sizeSZ * sizeof(INT64)); INT64 * Tig4 = (INT64 *)malloc(sizeSZ * sizeof(INT64)); INT64 * Tig8 = (INT64 *)malloc(sizeSZ * sizeof(INT64)); byte * Row1 = (byte *)malloc(sizeSZ * sizeof(byte)); byte * Row2 = (byte *)malloc(sizeSZ * sizeof(byte)); byte * Row4 = (byte *)malloc(sizeSZ * sizeof(byte)); byte * Row8 = (byte *)malloc(sizeSZ * sizeof(byte)); memset(Tig1, 0, sizeSZ * sizeof(INT64)); memset(Tig2, 0, sizeSZ * sizeof(INT64)); memset(Tig4, 0, sizeSZ * sizeof(INT64)); memset(Tig8, 0, sizeSZ * sizeof(INT64)); memset(Row1, 0, sizeSZ * sizeof(byte)); memset(Row2, 0, sizeSZ * sizeof(byte)); memset(Row4, 0, sizeSZ * sizeof(byte)); memset(Row8, 0, sizeSZ * sizeof(byte)); for (int y=1; y<= H; y++) { const byte * G = mag1u.ptr(y-1); INT64 * T1 = Tig1 + y*sz.width; INT64 * T2 = Tig2 + y*sz.width; INT64 * T4 = Tig4 + y*sz.width; INT64 * T8 = Tig8 + y*sz.width; INT64 * Tu1 = Tig1 + (y-1)*sz.width; INT64 * Tu2 = Tig2 + (y-1)*sz.width; INT64 * Tu4 = Tig4 + (y-1)*sz.width; INT64 * Tu8 = Tig8 + (y-1)*sz.width; byte * R1 = Row1 + y*sz.width; byte * R2 = Row2 + y*sz.width; byte * R4 = Row4 + y*sz.width; byte * R8 = Row8 + y*sz.width; float *s = scores.ptr<float>(y); for (int x=1; x<= W; x++) { byte g = G[x-1]; R1[x] = (R1[x-1] << 1) | ((g >> 4) & 1); R2[x] = (R2[x-1] << 1) | ((g >> 5) & 1); R4[x] = (R4[x-1] << 1) | ((g >> 6) & 1); R8[x] = (R8[x-1] << 1) | ((g >> 7) & 1); T1[x] = (Tu1[x] << 8) | R1[x]; T2[x] = (Tu2[x] << 8) | R2[x]; T4[x] = (Tu4[x] << 8) | R4[x]; T8[x] = (Tu8[x] << 8) | R8[x]; s[x] = dot(T1[x], T2[x], T4[x], T8[x]); } } free(Tig1); free(Tig2); free(Tig4); free(Tig8); free(Row1); free(Row2); free(Row4); free(Row8); scores(Rect(8, 8, W-7, H-7)).copyTo(matchCost1f); }
相关文章推荐
- BingObjectnessCVPR14源码编译环境由vs2012+64位转换为vs2012+32位机过程
- CVPR2014 Objectness 源码转换(完整版) VS2012 X64 –>win32
- win10 64位环境下使用VS2012 + cmake3.9.0 编译 dcmtk 3.6.2(MT/MTd版)
- ubuntu12.04(64位)下编译android4.1.1源码过程
- qt4.8.7 源码在win7+vs2010环境的x64编译(qt 64位)
- 【转】Linux(ubuntu14.04)上编译Android4.4源码的环境搭建及编译全过程
- qt4.8.7 源码在win7+vs2010环境的x64编译(qt 64位)
- Hadoop2.2.0伪分布式环境搭建(附:64位下编译Hadoop-2.2.0过程)
- 64位Ubuntu 16.01搭建嵌入式交叉编译环境arm-linux-gcc过程图解
- Linux(ubuntu14.04)上编译Android4.4源码的环境搭建及编译全过程
- Windows+VS2012环境下编译调试MySQL源码(四)
- hadoop2.4.1源码在64位系统编译过程中遇到的几个错误及解决方法
- SUSE Linux 64位环境下编译hadoop2.2.0源码
- Qt5.4.1 在Win7+MinGW-w64 v6.4.0环境下源码编译64位库文件
- 关于全志A20的Ubuntu12.04 64位系统下环境配置及编译过程笔记【转】
- [AOSP]下载并配置Android6.0源码编译环境(ubuntu1404,64位)
- Android 源码编译环境搭建(64位Ubuntu)各种依赖包安装
- SUSE Linux 64位环境下编译hadoop2.2.0源码
- 在CENT OS 7.0 64位系统上源码编译安装OPENCV3.0以及CUDA7.0,支持CUDA开发,并集成QT5.5.0的开发环境
- Windows+VS2012环境下编译调试MySQL源码 转