Skip to content

Commit 742d9c9

Browse files
committed
Merge pull request #475 from mshabunin:hal_interface
2 parents fc5be80 + 9c80c40 commit 742d9c9

File tree

8 files changed

+30
-27
lines changed

8 files changed

+30
-27
lines changed

modules/aruco/src/dictionary.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ the use of this software, even if advised of the possibility of such damage.
4141
#include <opencv2/core.hpp>
4242
#include <opencv2/imgproc.hpp>
4343
#include "predefined_dictionaries.hpp"
44-
44+
#include "opencv2/core/hal/hal.hpp"
4545

4646
namespace cv {
4747
namespace aruco {
@@ -77,7 +77,7 @@ bool Dictionary::identify(const Mat &onlyBits, int &idx, int &rotation,
7777
int currentMinDistance = markerSize * markerSize + 1;
7878
int currentRotation = -1;
7979
for(unsigned int r = 0; r < 4; r++) {
80-
int currentHamming = hal::normHamming(
80+
int currentHamming = cv::hal::normHamming(
8181
bytesList.ptr(m)+r*candidateBytes.cols,
8282
candidateBytes.ptr(),
8383
candidateBytes.cols);
@@ -112,7 +112,7 @@ int Dictionary::getDistanceToId(InputArray bits, int id, bool allRotations) cons
112112
Mat candidateBytes = getByteListFromBits(bits.getMat());
113113
int currentMinDistance = int(bits.total() * bits.total());
114114
for(unsigned int r = 0; r < nRotations; r++) {
115-
int currentHamming = hal::normHamming(
115+
int currentHamming = cv::hal::normHamming(
116116
bytesList.ptr(id) + r*candidateBytes.cols,
117117
candidateBytes.ptr(),
118118
candidateBytes.cols);
@@ -331,7 +331,7 @@ static int _getSelfDistance(const Mat &marker) {
331331
Mat bytes = Dictionary::getByteListFromBits(marker);
332332
int minHamming = (int)marker.total() + 1;
333333
for(int r = 1; r < 4; r++) {
334-
int currentHamming = hal::normHamming(bytes.ptr(), bytes.ptr() + bytes.cols*r, bytes.cols);
334+
int currentHamming = cv::hal::normHamming(bytes.ptr(), bytes.ptr() + bytes.cols*r, bytes.cols);
335335
if(currentHamming < minHamming) minHamming = currentHamming;
336336
}
337337
return minHamming;

modules/optflow/src/motempl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
#include "precomp.hpp"
4343
#include "opencv2/core/utility.hpp"
44+
#include "opencv2/core/hal/hal.hpp"
4445
#include "opencl_kernels_optflow.hpp"
4546

4647
namespace cv {
@@ -212,7 +213,7 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
212213
float* orient_row = orient.ptr<float>(y);
213214
uchar* mask_row = mask.ptr<uchar>(y);
214215

215-
hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
216+
cv::hal::fastAtan2(dY_max_row, dX_min_row, orient_row, size.width, true);
216217

217218
// make orientation zero where the gradient is very small
218219
for( x = 0; x < size.width; x++ )
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#Install macro for libmv libraries
22
MACRO (LIBMV_INSTALL_LIB name)
33

4-
set_target_properties( ${name}
5-
PROPERTIES
6-
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
7-
)
4+
if(NOT BUILD_SHARED_LIBS)
5+
ocv_install_target(${name} EXPORT OpenCVModules
6+
ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
7+
endif()
88

9-
ENDMACRO (LIBMV_INSTALL_LIB)
9+
ENDMACRO (LIBMV_INSTALL_LIB)

modules/xfeatures2d/src/sift.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#include "precomp.hpp"
106106
#include <iostream>
107107
#include <stdarg.h>
108+
#include <opencv2/core/hal/hal.hpp>
108109

109110
namespace cv
110111
{
@@ -337,9 +338,9 @@ static float calcOrientationHist( const Mat& img, Point pt, int radius,
337338
len = k;
338339

339340
// compute gradient values, orientations and the weights over the pixel neighborhood
340-
hal::exp(W, W, len);
341-
hal::fastAtan2(Y, X, Ori, len, true);
342-
hal::magnitude(X, Y, Mag, len);
341+
cv::hal::exp32f(W, W, len);
342+
cv::hal::fastAtan2(Y, X, Ori, len, true);
343+
cv::hal::magnitude32f(X, Y, Mag, len);
343344

344345
for( k = 0; k < len; k++ )
345346
{
@@ -620,9 +621,9 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
620621
}
621622

622623
len = k;
623-
hal::fastAtan2(Y, X, Ori, len, true);
624-
hal::magnitude(X, Y, Mag, len);
625-
hal::exp(W, W, len);
624+
cv::hal::fastAtan2(Y, X, Ori, len, true);
625+
cv::hal::magnitude32f(X, Y, Mag, len);
626+
cv::hal::exp32f(W, W, len);
626627

627628
for( k = 0; k < len; k++ )
628629
{

modules/ximgproc/src/fgs_filter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636

3737
#include "precomp.hpp"
38-
#include "opencv2/hal/intrin.hpp"
38+
#include "opencv2/core/hal/intrin.hpp"
3939
#include <vector>
4040

4141
namespace cv {

modules/ximgproc/src/precomp.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
* By downloading, copying, installing or using the software you agree to this license.
33
* If you do not agree to this license, do not download, install,
44
* copy or use the software.
5-
*
6-
*
5+
*
6+
*
77
* License Agreement
88
* For Open Source Computer Vision Library
99
* (3 - clause BSD License)
10-
*
10+
*
1111
* Redistribution and use in source and binary forms, with or without modification,
1212
* are permitted provided that the following conditions are met :
13-
*
13+
*
1414
* *Redistributions of source code must retain the above copyright notice,
1515
* this list of conditions and the following disclaimer.
16-
*
16+
*
1717
* * Redistributions in binary form must reproduce the above copyright notice,
1818
* this list of conditions and the following disclaimer in the documentation
1919
* and / or other materials provided with the distribution.
20-
*
20+
*
2121
* * Neither the names of the copyright holders nor the names of the contributors
2222
* may be used to endorse or promote products derived from this software
2323
* without specific prior written permission.
24-
*
24+
*
2525
* This software is provided by the copyright holders and contributors "as is" and
2626
* any express or implied warranties, including, but not limited to, the implied
2727
* warranties of merchantability and fitness for a particular purpose are disclaimed.

modules/ximgproc/src/sparse_match_interpolators.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "opencv2/ximgproc/sparse_match_interpolator.hpp"
3939
#include <algorithm>
4040
#include <vector>
41+
#include "opencv2/core/hal/hal.hpp"
4142

4243
using namespace std;
4344

@@ -768,7 +769,7 @@ void EdgeAwareInterpolatorImpl::RansacInterpolation_ParBody::operator() (const R
768769
KNNdistances = inst->NNdistances.ptr<float>(i);
769770
if(inc>0) //forward pass
770771
{
771-
hal::exp(KNNdistances,KNNdistances,inst->k);
772+
cv::hal::exp32f(KNNdistances,KNNdistances,inst->k);
772773

773774
Point2f average = Point2f(0.0f,0.0f);
774775
for(int j=0;j<inst->k;j++)
@@ -878,4 +879,4 @@ bool operator<(const SparseMatch& lhs,const SparseMatch& rhs)
878879
}
879880

880881
}
881-
}
882+
}

modules/xphoto/src/grayworld_white_balance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "opencv2/xphoto.hpp"
4141

4242
#include "opencv2/core.hpp"
43-
#include "opencv2/hal/intrin.hpp"
43+
#include "opencv2/core/hal/intrin.hpp"
4444

4545
namespace cv { namespace xphoto {
4646

0 commit comments

Comments
 (0)