/* This is AGAST and OAST, an optimal and accelerated corner detector
based on the accelerated segment tests
Below is the original copyright and the references */
/*
Copyright (C) 2010 Elmar Mair
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
*Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
*Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
*Neither the name of the University of Cambridge nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
The references are:
* Adaptive and Generic Corner Detection Based on the Accelerated Segment Test,
Elmar Mair and Gregory D. Hager and Darius Burschka
and Michael Suppa and Gerhard Hirzinger ECCV 2010
URL: http://www6.in.tum.de/Main/ResearchAgast
*/
#include "agast_score.hpp"
#ifdef _MSC_VER
#pragma warning( disable : 4127 )
#endif
namespace cv
{
void makeAgastOffsets(int pixel[16], int rowStride, int type)
{
static const int offsets16[][2] =
{
{-3, 0}, {-3, -1}, {-2, -2}, {-1, -3}, {0, -3}, { 1, -3}, { 2, -2}, { 3, -1},
{ 3, 0}, { 3, 1}, { 2, 2}, { 1, 3}, {0, 3}, {-1, 3}, {-2, 2}, {-3, 1}
};
static const int offsets12d[][2] =
{
{-3, 0}, {-2, -1}, {-1, -2}, {0, -3}, { 1, -2}, { 2, -1},
{ 3, 0}, { 2, 1}, { 1, 2}, {0, 3}, {-1, 2}, {-2, 1}
};
static const int offsets12s[][2] =
{
{-2, 0}, {-2, -1}, {-1, -2}, {0, -2}, { 1, -2}, { 2, -1},
{ 2, 0}, { 2, 1}, { 1, 2}, {0, 2}, {-1, 2}, {-2, 1}
};
static const int offsets8[][2] =
{
{-1, 0}, {-1, -1}, {0, -1}, { 1, -1},
{ 1, 0}, { 1, 1}, {0, 1}, {-1, 1}
};
const int (*offsets)[2] = type == AgastFeatureDetector::OAST_9_16 ? offsets16 :
type == AgastFeatureDetector::AGAST_7_12d ? offsets12d :
type == AgastFeatureDetector::AGAST_7_12s ? offsets12s :
type == AgastFeatureDetector::AGAST_5_8 ? offsets8 : 0;
CV_Assert(pixel && offsets);
int k = 0;
for( ; k < 16; k++ )
pixel[k] = offsets[k][0] + offsets[k][1] * rowStride;
}
// 16 pixel mask
template<>
int agast_cornerScore<AgastFeatureDetector::OAST_9_16>(const uchar* ptr, const int pixel[], int threshold)
{
int bmin = threshold;
int bmax = 255;
int b_test = (bmax + bmin) / 2;
short offset0 = (short) pixel[0];
short offset1 = (short) pixel[1];
short offset2 = (short) pixel[2];
short offset3 = (short) pixel[3];
short offset4 = (short) pixel[4];
short offset5 = (short) pixel[5];
short offset6 = (short) pixel[6];
short offset7 = (short) pixel[7];
short offset8 = (short) pixel[8];
short offset9 = (short) pixel[9];
short offset10 = (short) pixel[10];
short offset11 = (short) pixel[11];
short offset12 = (short) pixel[12];
short offset13 = (short) pixel[13];
short offset14 = (short) pixel[14];
short offset15 = (short) pixel[15];
while(true)
{
const int cb = *ptr + b_test;
const int c_b = *ptr - b_test;
if(ptr[offset0] > cb)
if(ptr[offset2] > cb)
if(ptr[offset4] > cb)
if(ptr[offset5] > cb)
if(ptr[offset7] > cb)
if(ptr[offset3] > cb)
if(ptr[offset1] > cb)
if(ptr[offset6] > cb)
if(ptr[offset8] > cb)
goto is_a_corner;
else
if(ptr[offset15] > cb)
goto is_a_corner;
else
goto is_not_a_corner;
else
if(ptr[offset13] > cb)
if(ptr[offset14] > cb)
if(ptr[offset15] > cb)
goto is_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
if(ptr[offset8] > cb)
if(ptr[offset9] > cb)
if(ptr[offset10] > cb)
if(ptr[offset6] > cb)
goto is_a_corner;
else
if(ptr[offset11] > cb)
if(ptr[offset12] > cb)
if(ptr[offset13] > cb)
if(ptr[offset14] > cb)
if(ptr[offset15] > cb)
goto is_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
if(ptr[offset10] > cb)
if(ptr[offset11] > cb)
if(ptr[offset12] > cb)
if(ptr[offset8] > cb)
if(ptr[offset9] > cb)
if(ptr[offset6] > cb)
goto is_a_corner;
else
if(ptr[offset13] > cb)
if(ptr[offset14] > cb)
if(ptr[offset15] > cb)
goto is_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
goto is_not_a_corner;
else
if(ptr[offset1] > cb)
if(ptr[offset13] > cb)
if(ptr
opencv4.5.0编译x86 32位
需积分: 0 93 浏览量
更新于2023-03-20
2
收藏 512.74MB RAR 举报
OpenCV(开源计算机视觉库)是一个强大的跨平台计算机视觉库,它包含了大量的图像处理和计算机视觉算法,广泛应用于机器学习、图像分析、机器人等领域。在本案例中,我们讨论的是OpenCV 4.5.0版本针对x86架构32位系统的编译。
编译OpenCV通常是一个复杂的过程,涉及多个步骤,包括安装依赖库、配置编译选项、执行编译和链接等。对于x86 32位系统,这个过程可能更具挑战性,因为一些现代库可能不再支持或优化这个平台。然而,提供预编译的OpenCV库可以极大地简化这个过程,使得开发者能够快速地在32位环境中使用OpenCV功能。
OpenCV 4.5.0版本引入了多项新特性与改进,例如:
1. 支持最新的深度学习框架:OpenCV 4.5.0增强了对TensorFlow、PyTorch等深度学习框架的接口,使得用户能更方便地将模型集成到OpenCV应用中。
2. 更新的图像处理模块:包括更快的图像滤波器、颜色空间转换、边缘检测算法等,提高了处理速度和准确性。
3. 更强的视频分析能力:新增了多种视频分析算法,如对象检测、跟踪、人脸识别等,有助于开发复杂的视频处理应用。
4. 改进的CUDA支持:对于配备NVIDIA GPU的系统,OpenCV 4.5.0提供了更好的CUDA加速,使得计算密集型任务的性能得到显著提升。
5. 强大的机器学习库:OpenCV集成了机器学习库如MLP(多层感知机)、SVM(支持向量机)、决策树等,便于构建分类和回归模型。
在使用这个预编译的OpenCV 4.5.0版本时,你需要确保你的开发环境是32位的,并且满足所有必要的依赖项。这些依赖通常包括但不限于:Boost、Qt、IPPICV、CUDA(如果需要GPU支持)等。一旦你解压了压缩包,你可以通过包含头文件和链接库文件来在你的项目中使用OpenCV。
在C++项目中,这可能看起来像这样:
```cpp
#include <opencv2/opencv.hpp>
int main() {
cv::Mat image = cv::imread("image.jpg");
// ... 进行图像处理操作
return 0;
}
```
编译时,确保链接到正确的OpenCV库路径。例如,如果你的库位于`/path/to/opencv4.5.0/lib`,编译命令可能如下:
```bash
g++ main.cpp -I/path/to/opencv4.5.0/include -L/path/to/opencv4.5.0/lib -lopencv_core -lopencv_imgcodecs -o my_app
```
总结来说,预编译的OpenCV 4.5.0 for x86 32位系统是一个宝贵的资源,它消除了手动编译的复杂性,让开发者能够专注于他们的核心任务——利用OpenCV的强大功能来解决实际的计算机视觉问题。无论你是新手还是经验丰富的开发者,这个预编译版本都能让你更轻松地在32位环境中进行计算机视觉开发。
![avatar](https://profile-avatar.csdnimg.cn/18d605506043439cb4aecc43725d0a92_hzzzz2.jpg!1)
遗忘的背篓elous
- 粉丝: 4
- 资源: 1
最新资源
- Matlab魔术轮胎公式:轮胎动力学仿真研究,涵盖制动、转弯及联合工况,解析纵向力与滑动率、侧向力与侧偏角关系,附参考文献及代码仿真复现 ,Matlab魔术轮胎公式:轮胎动力学仿真研究,涵盖制动、转弯
- 纯电动汽车Simulink整车仿真模型:构建高效动力系统,探索未来驾驶体验,纯电动汽车Simulink整车仿真模型构建与性能分析,纯电动汽车(含增程式)的 Simulink 整车仿真模型 ,纯电动;
- 贝叶斯优化算法在PID参数自动调参中的应用:一阶至高阶控制系统的自适应解决方案(附详细注释的M文件),贝叶斯优化算法在PID参数自动调整中的应用:一阶至高阶控制系统的自适应调参方法及详细注释说明,贝叶
- 基于Matlab的2PSK调制与解调系统仿真:原理、实现与源文件详解说明文档,基于MATLAB的2PSK调制与解调系统仿真及其详细说明文档与仿真源文件研究分析,基于matlab的2PSK调制与解调系统
- 基于BP神经网络的复杂故障诊断在三相逆变器仿真复现中的应用研究,基于BP神经网络的智能三相逆变器故障诊断技术研究与仿真复现:深度探索与验证,基于BP神经网络的三相逆变器故障诊断研究,仿真复现 ,基于B
- 四轮独立线控转向系统与Carsim-Simulink联合仿真的研究与应用,四轮转向线控转向系统的Carsim与Simulink联合仿真研究与实践,四轮转向线控转向系统的carsim与simulink联
- 基于Matlab与Simulink的六自由度水下机器人滑模控制运动模型:无差度轨迹跟踪效果与S-function及Matlab function互换性应用与说明文档,基于Matlab与Simulink
- C#与Halcon运动控制及视觉框架源码联合,可自定义连线式运动控制,开源可二次开发视觉处理利器 ,C#结合Halcon视觉框架的运动控制源代码分享与二次开发指南,C#联合Halcon运动控制源代码
- COMSOL MXene超材料吸收器的性能研究:探索高效能量转换与吸收机制,COMSOL MXene超材料吸收器的性能研究:探索高效能量转换与吸收机制,comsol MXene超材料吸收器 ,com
- 船用柴油机Simulink动态模型:四缸CI发动机设计与仿真(带PID控制)参考文档,船用柴油机Simulink动态模型构建:四缸CI发动机PID控制详解与文献参考,船用柴油机Simulink动态模
- 基于SOGI二阶广义积分器和高频注入的PMSM无速度传感器控制策略研究-MATLAB/Simulink仿真及传统滤波方法对比,基于pmsm永磁同步电机的高频注入技术与sogi二阶广义积分器传统滤波在
- 基于C++和C语言的农村污水处理系统设计源码
- 基于HTML和CSS技术的大学学业作业仓库设计源码
- 基于COMSOL的三相变压器仿真:振动噪声、温度及多场耦合计算的综合性研究,基于COMSOL的三相变压器仿真:振动噪声、温度场及多物理场耦合计算的研究,COMSOL三相变压器仿真振动噪声温度 变压器磁
- 基于JavaScript技术的自有家用源建设二分队设计源码
- 基于Vue与Electron的跨平台可视化页面与流程设计源码