小编Raf*_*cki的帖子

哈尔创建样本解析错误

我在opencv 2.1中通过"opencv_createsamples.exe"创建示例,但我在第1行遇到了解析错误.

文件positives.txt包含:

c:\haar\Positives\PosImg_0.jpg 1 175,120,275,240
c:\haar\Positives\PosImg_1.jpg 1 175,120,275,240
c:\haar\Positives\PosImg_10.jpg 1 175,120,275,240
...(--and so on )
Run Code Online (Sandbox Code Playgroud)

我在cmd中所做的是:

c:\Haar>C:\OpenCV2.1\bin\opencv_createsamples.exe  -info positives.txt -vec Posi
tivesMany.vec -num 15 -w 24 -h 24 PAUSE
Info file name: positives.txt
Img file name: (NULL)
Vec file name: PositivesMany.vec
BG  file name: (NULL)
Num: 15
BG color: 0
BG threshold: 80
Invert: FALSE
Max intensity deviation: 40
Max x angle: 1.1
Max y angle: 1.1
Max z angle: 0.5
Show samples: FALSE
Width: 24
Height: …
Run Code Online (Sandbox Code Playgroud)

c++ xml opencv classification

4
推荐指数
2
解决办法
8895
查看次数

undefined symbols架构x86_64的未定义符号:"_ kCFAllocatorDefault"

我试图在eclipse中的mac os 10.7下编译一些东西,然后构建就死了:

  Undefined symbols for architecture x86_64:
  "_kCFAllocatorDefault", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_CFURLCreateWithFileSystemPath", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_CFStringCreateWithCString", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_CFBundleCreate", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_CFBundleGetFunctionPointerForName", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_CFRelease", referenced from:
      ___GLeeGetProcAddress in GLee.o
  "_glGetString", referenced from:
      ___GLeeGetExtensions in GLee.o
      _GLeeGetExtStrGL in GLee.o
      _GLeeInit in GLee.o
     (maybe you meant: _GLee_Lazy_glGetStringi, _GLeeFuncPtr_glGetStringi )
  "___CFConstantStringClassReference", referenced from:
      CFString in GLee.o
Run Code Online (Sandbox Code Playgroud)

所以我知道问题在于ld符号.现在我尝试在eclipse中预测项目属性并将-framework CoreFramework添加到g ++和gcc的参数中,但这并没有解决它.

这些符号位于何处,更重要的是 - 如何将它们添加到我的项目中

c++ macos gcc g++ undefined-symbol

3
推荐指数
2
解决办法
7752
查看次数

尝试加入组播组时,Boost.Asio会抛出"没有此类设备"的异常

以下代码"No such device"在尝试加入多播组(set_option调用)时抛出异常.

#include <boost/asio.hpp>

int main(){
    const std::string recv_addr = "232.4.130.147";
    const int recv_port = 31338;

    boost::asio::io_service io_service;
    boost::asio::ip::udp::endpoint recv_endpoint(
                boost::asio::ip::address::from_string(recv_addr),
                recv_port);
    boost::asio::ip::udp::socket recv_sock(io_service, recv_endpoint);

    recv_sock.set_option(
            boost::asio::ip::multicast::join_group(
                boost::asio::ip::address::from_string(recv_addr).to_v4()
                ));
}
Run Code Online (Sandbox Code Playgroud)

无论网络管理器是否正在运行,都会发生这种情况.并且不考虑IP地址集.

当我连接到手动设置IP地址的内部网络时出现问题.在从DHCP获得IP的另一个网络上,我发现没有问题.

我一直有eth0接口,这是唯一有效的非本地接口.

我已经尝试过如此处所示的 listen接口,但是我得到了一个例外"Invalid argument",而Boost.Asio文档并没有说任何关于设置接口的内容.

c++ network-programming boost-asio

3
推荐指数
1
解决办法
2318
查看次数

缺少Python.h头文件

我正在试图弄清楚如何在C中编译Python模块(http://docs.python.org/extending/extending.html),但似乎缺少Python.h头文件.

我已经安装了所有python开发头文件(我有Python-dev,python2.7-dev,python2.6-dev,python-all-dev)但是gcc仍在重新编译错误:

fatal error: Python.h: No such file or directory

compilation terminated.
Run Code Online (Sandbox Code Playgroud)

知道我哪里错了吗?还有一个参数我需要为Python.h添加到gcc(它是什么?).

c python gcc header-files

3
推荐指数
1
解决办法
3636
查看次数

git add之后没有进行更改

为什么Changes not staged for commit我跑完后会得到物品git add .

> git add .
> git st 

# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#       modified:   bin/ls-- (modified content, untracked content)
#
Run Code Online (Sandbox Code Playgroud)

这是Red Hat 4.1.2-50git 1.7.10.

git

3
推荐指数
2
解决办法
3671
查看次数

试图将Ubuntu 10.10上的Boost 1.46.1交叉编译为Arm Linux

我有一个交叉编译工具链,我在Ubuntu 10.10上成功编译了一个相当大的应用程序.

现在我试图介绍boost 1.46.1.我已经完成了boost cross编译方向所说的内容.即运行bootstrap.sh,修改user-config.jam以添加行:

using gcc : arm : /path/to/compiler/arm-none-linux-gnueabi-g++ ;
Run Code Online (Sandbox Code Playgroud)

当我发出:

 ./bjam --toolchain=gcc-arm
Run Code Online (Sandbox Code Playgroud)

bjam编译提升,但是当我做一个:

 file ..../something.o
Run Code Online (Sandbox Code Playgroud)

输出表示Intel 80386 ELF文件,而不是arm文件.我已经使用其他应用程序arm对象进行了检查,并且文件命令报告arm不是80386.

我已经尝试将我设置PATH为交叉编译二进制文件并设置LD_LIBRARY_PATH为arm编译器库,但我所做的一切似乎都无法保持bjam不会编译为Intel.

boost compilation

2
推荐指数
1
解决办法
2005
查看次数

如何识别新iPad

我需要知道目前的设备是iPad2还是新iPad.我用[[UIScreen mainScreen] Scale],但结果是1.0

ios

2
推荐指数
1
解决办法
528
查看次数

使用openCV识别HSV中的颜色范围

我正在使用python中的openCV识别黄色。我到了这一步,我必须在HSV中定义黄色的上下限。

定义蓝色范围的示例:

lower_blue = np.array([110,50,50])
upper_blue = np.array([130,255,255])
Run Code Online (Sandbox Code Playgroud)

HSV通常以百分比定义,我想知道像示例一样如何定义黄色范围。

这是我一直关注的色彩空间教程。

编辑:在上面提到的博客中有一些建议,但它没有给我想要的输出。

python opencv

2
推荐指数
3
解决办法
2万
查看次数

如何实施季度订阅贝宝按钮

我想做的是在我的网站上有一个PayPal订阅按钮,并带有按季度计费选项。

我知道有一种方法可以使用非托管按钮代码执行此操作,但是我想知道是否有任何方法可以使用PayPal托管订阅按钮(出于安全性)来实现此目的。我想避免必须使用带有加密的非托管按钮代码以及所有需要的脚本工作。

paypal button subscription

1
推荐指数
1
解决办法
3644
查看次数

如何在C++控制台应用程序中使用shell32.dll

我需要做的是获得ApplicationData路径,我在谷歌发现有一个叫做的功能

HRESULT SHGetFolderPath(
  __in   HWND hwndOwner,
  __in   int nFolder,
  __in   HANDLE hToken,
  __in   DWORD dwFlags,
  __out  LPTSTR pszPath
);
Run Code Online (Sandbox Code Playgroud)

但它存在于shell32.dll中.在C#中,我会做类似的事情

[DllImport]
static extern HRESULT SHGetFolderPath() and so on.
Run Code Online (Sandbox Code Playgroud)

在C++ Console应用程序中我需要做什么才能调用此API?也许,我可以使用LoadLibrary()?但是这样做的正确方法是什么?

我能以某种方式静态链接这个DLL作为我的exe的一部分吗?我正在使用Visual Studio 2010.

c++ linker static-linking

1
推荐指数
1
解决办法
4702
查看次数