OpenCV里实现numpy的C++库扩展"/>
在OpenCV里实现numpy的C++库扩展
如果是常用的功能,已经非常稳定了,需要提供更快的运行速度,就可以使用C++来扩展numpy里的数据计算,这时就需要使用numpy的扩展库功能了。下面就来提供一个使用C++编写numpy扩展库的模板,这样大家就要减少很多弯路,减少跌入坑里的成本。这个扩展库的模板是从mahotas库里抽取出来的,经过最大化的简化,这样更加容易理解,更方便学习。
在这个扩展库里,首先要编写setup.py文件,内容如下:
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2019, caijunsheng <9073204@qq>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and
更多推荐
在OpenCV里实现numpy的C++库扩展
发布评论