opencv3.3出炉,与深度学习结合更密切

opencv3.3在八月3号发布,日志中说到:

The main news is that we promoted DNN module from opencv_contrib to the main repository, improved and accelerated it a lot.For GPU there is experimental DNN acceleration using Halide.

这可是个好消息,OpenCV 3.3 使用了加速的 dnn 模块,并将其移动到了主存储库,这也是首次在 OpenCV 中出现 Halide,带来了多项优化和其他的改进。

OpenCV can now be built as C++ 11 library using the flag ENABLE_CXX11. Some cool features for C++ 11 programmers have been added.

除此之外,新版本还对C++11有了更完善的支持,比如:

// 1. use parallel_for_ with lambda to compute Mandelbrot fractal
parallel_for_(Range(0, img.rows*img.cols), [&](const Range& r) {
    for (int r = r.start; r < r.end; r++) {
        int i = r/img.cols, j = r%img.cols, t, maxiter=500;
        complex<float> z0(j * 2.7f/img.cols – 2.1f,
                          i * 2.4f/img.rows – 1.2f);
        for (t = 0; t < maxiter; t++) {
            if (z.real()*z.real()+z.imag()*z.imag()> 4.f) break;
            z = z*z + z0;
        }
        img.at<uchar>(i, j)=uchar(sqrt((float)t/maxiter)*255);
}});

// 2. using C++ 11 initializers
auto A = Mat_<double>({0, -1, 0, -1, 5, -1, 0, -1, 0}).reshape(1, 3);
Vec_<int, 10> digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

// 3. apply LUT to 8-bit image in C++ 11 style
Mat_<Vec3b> img = imread("lena.jpg");
for( auto& pixel: img ) {
    pixel[0] = gamma_lut[pixel[0]];
    pixel[1] = gamma_lut[pixel[1]];
    pixel[2] = gamma_lut[pixel[2]];
}
对于DL在opencv中的使用,官方wiki发布:

The supported frameworks:

Caffe 1
TensorFlow
Torch/PyTorch
The supported layers:
AbsVal
AveragePooling
BatchNormalization
Concatenation
Convolution (including dilated convolution)
Crop
Deconvolution, a.k.a. transposed convolution or full convolution
DetectionOutput (SSD-specific layer)
Dropout
Eltwise (+, *, max)
Flatten
FullyConnected
LRN
LSTM
MaxPooling
MaxUnpooling
MVN
NormalizeBBox (SSD-specific layer)
Padding
Permute
Power
PReLU (including ChannelPReLU with channel-specific slopes)
PriorBox (SSD-specific layer)
ReLU
RNN
Scale
Shift
Sigmoid
Slice
Softmax
Split
TanH
The following networks have been tested and known to work:
AlexNet
GoogLeNet v1 (also referred to as Inception-5h)
ResNet-34/50/...
SqueezeNet v1.1
VGG-based FCN (semantical segmentation network)
ENet (lightweight semantical segmentation network)
VGG-based SSD (object detection network)
MobileNet-based SSD (light-weight object detection network)
现在可以直接使用opencv去调用深度学习框架训练好的模型参数,比如caffemodel、tensorflow等等。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值