mirror of
https://github.com/opencv/opencv.git
synced 2026-11-09 18:04:29 -06:00
dnn, features2d, imgproc: fix build warnings with GCC 15 / C++20
- dnn: suppress false-positive std::vector::insert warning in ONNX GRU parser - features2d: simplify indexChange initialization in BRISK kernel generation - imgproc: fix implicit conversion warnings with INTER_TAB_SIZE in SIMD remap and warp tests
This commit is contained in:
@@ -1757,6 +1757,8 @@ void ONNXImporter::parseGRU(LayerParams& layerParams, const opencv_onnx::NodePro
|
|||||||
|
|
||||||
MatShape gruShape = outShapes[node_proto.output(0)];
|
MatShape gruShape = outShapes[node_proto.output(0)];
|
||||||
|
|
||||||
|
CV_CheckFalse(gruShape.empty(), "ERROR outShapes[node_proto.output(0)] is empty");
|
||||||
|
|
||||||
// Add fake 1 as it is done in ONNX
|
// Add fake 1 as it is done in ONNX
|
||||||
gruShape.insert(gruShape.begin() + 1, 1);
|
gruShape.insert(gruShape.begin() + 1, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -501,15 +501,15 @@ BRISK_Impl::generateKernel(const std::vector<float> &radiusList,
|
|||||||
noLongPairs_ = 0;
|
noLongPairs_ = 0;
|
||||||
|
|
||||||
// fill indexChange with 0..n if empty
|
// fill indexChange with 0..n if empty
|
||||||
unsigned int indSize = (unsigned int)indexChange.size();
|
if (indexChange.empty())
|
||||||
if (indSize == 0)
|
|
||||||
{
|
{
|
||||||
indexChange.resize(points_ * (points_ - 1) / 2);
|
indexChange.resize(points_ * (points_ - 1) / 2);
|
||||||
indSize = (unsigned int)indexChange.size();
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < indSize; i++)
|
for (unsigned int i = 0; i < (unsigned int)indexChange.size(); i++)
|
||||||
indexChange[i] = i;
|
indexChange[i] = i;
|
||||||
}
|
}
|
||||||
|
unsigned int indSize = (unsigned int)indexChange.size();
|
||||||
|
|
||||||
const float dMin_sq = dMin_ * dMin_;
|
const float dMin_sq = dMin_ * dMin_;
|
||||||
const float dMax_sq = dMax_ * dMax_;
|
const float dMax_sq = dMax_ * dMax_;
|
||||||
for (unsigned int i = 1; i < points_; i++)
|
for (unsigned int i = 1; i < points_; i++)
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ static int remapBilinearC1_run(const T* S0, size_t sstep, T* D,
|
|||||||
const int vlanes = VTraits<v_float32>::vlanes();
|
const int vlanes = VTraits<v_float32>::vlanes();
|
||||||
const int dx0 = dx;
|
const int dx0 = dx;
|
||||||
const v_float32 vone = vx_setall_f32(1.f);
|
const v_float32 vone = vx_setall_f32(1.f);
|
||||||
const v_float32 vscale = vx_setall_f32(1.f / INTER_TAB_SIZE);
|
const v_float32 vscale = vx_setall_f32(1.f / static_cast<float>(INTER_TAB_SIZE));
|
||||||
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
||||||
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
||||||
for( ; dx <= X1 - vlanes; dx += vlanes )
|
for( ; dx <= X1 - vlanes; dx += vlanes )
|
||||||
@@ -168,7 +168,7 @@ static int remapBilinearF32_run(const float* S0, size_t sstep, float* D,
|
|||||||
const int dx0 = dx;
|
const int dx0 = dx;
|
||||||
const float* S1 = S0 + sstep;
|
const float* S1 = S0 + sstep;
|
||||||
const v_float32 vone = vx_setall_f32(1.f);
|
const v_float32 vone = vx_setall_f32(1.f);
|
||||||
const v_float32 vscale = vx_setall_f32(1.f / INTER_TAB_SIZE);
|
const v_float32 vscale = vx_setall_f32(1.f / static_cast<float>(INTER_TAB_SIZE));
|
||||||
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
||||||
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
||||||
for( ; dx <= X1 - vlanes; dx += vlanes )
|
for( ; dx <= X1 - vlanes; dx += vlanes )
|
||||||
@@ -239,7 +239,7 @@ static int remapBicubicC1_run(const T* S0, size_t sstep, T* D, const short* XY,
|
|||||||
{
|
{
|
||||||
const int vlanes = VTraits<v_float32>::vlanes();
|
const int vlanes = VTraits<v_float32>::vlanes();
|
||||||
const int dx0 = dx;
|
const int dx0 = dx;
|
||||||
const v_float32 vscale = vx_setall_f32(1.f / INTER_TAB_SIZE);
|
const v_float32 vscale = vx_setall_f32(1.f / static_cast<float>(INTER_TAB_SIZE));
|
||||||
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
const v_int32 vmask = vx_setall_s32(INTER_TAB_SIZE - 1);
|
||||||
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ofs[VTraits<v_float32>::max_nlanes];
|
||||||
float CV_DECL_ALIGNED(CV_SIMD_WIDTH) buf[VTraits<v_float32>::max_nlanes];
|
float CV_DECL_ALIGNED(CV_SIMD_WIDTH) buf[VTraits<v_float32>::max_nlanes];
|
||||||
|
|||||||
@@ -588,8 +588,8 @@ private:
|
|||||||
{
|
{
|
||||||
const float fx = mapx.at<float>(y, x);
|
const float fx = mapx.at<float>(y, x);
|
||||||
const float fy = mapy.at<float>(y, x);
|
const float fy = mapy.at<float>(y, x);
|
||||||
const int scaledX = static_cast<int>(std::floor(fx * INTER_TAB_SIZE + 0.5f));
|
const int scaledX = static_cast<int>(std::floor(fx * static_cast<float>(INTER_TAB_SIZE) + 0.5f));
|
||||||
const int scaledY = static_cast<int>(std::floor(fy * INTER_TAB_SIZE + 0.5f));
|
const int scaledY = static_cast<int>(std::floor(fy * static_cast<float>(INTER_TAB_SIZE) + 0.5f));
|
||||||
const int sx = scaledX >> INTER_BITS;
|
const int sx = scaledX >> INTER_BITS;
|
||||||
const int sy = scaledY >> INTER_BITS;
|
const int sy = scaledY >> INTER_BITS;
|
||||||
const T wx = static_cast<T>(scaledX & (INTER_TAB_SIZE - 1)) /
|
const T wx = static_cast<T>(scaledX & (INTER_TAB_SIZE - 1)) /
|
||||||
|
|||||||
Reference in New Issue
Block a user