int ddepth = CV_MAT_DEPTH(dtype);
int sdepth = CV_MAT_DEPTH(stype);
+#if IPP_VERSION_X100 >= 201700 && IPP_VERSION_X100 < 201702 // IPP bug with 1x1 kernel
+ if(kernel_width == 1 && kernel_height == 1)
+ return false;
+#endif
+
bool runIpp = true
&& (borderTypeNI == BORDER_CONSTANT || borderTypeNI == BORDER_REPLICATE)
&& (sdepth == ddepth)
}
#ifdef HAVE_IPP
- if (kernel_type == CV_32FC1) {
- IppFilter<CV_32F>* impl = new IppFilter<CV_32F>();
- if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
- max_width, max_height, stype, dtype,
- borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
- {
- return Ptr<hal::Filter2D>(impl);
+ CV_IPP_CHECK()
+ {
+ if (kernel_type == CV_32FC1) {
+ IppFilter<CV_32F>* impl = new IppFilter<CV_32F>();
+ if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
+ max_width, max_height, stype, dtype,
+ borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
+ {
+ return Ptr<hal::Filter2D>(impl);
+ }
+ delete impl;
}
- delete impl;
- }
- if (kernel_type == CV_16SC1) {
- IppFilter<CV_16S>* impl = new IppFilter<CV_16S>();
- if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
- max_width, max_height, stype, dtype,
- borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
- {
- return Ptr<hal::Filter2D>(impl);
+ if (kernel_type == CV_16SC1) {
+ IppFilter<CV_16S>* impl = new IppFilter<CV_16S>();
+ if (impl->init(kernel_data, kernel_step, kernel_type, kernel_width, kernel_height,
+ max_width, max_height, stype, dtype,
+ borderType, delta, anchor_x, anchor_y, isSubmatrix, isInplace))
+ {
+ return Ptr<hal::Filter2D>(impl);
+ }
+ delete impl;
}
- delete impl;
}
#endif
return;
}
- const double eps = 0.0;
+ const double eps = FLT_EPSILON * 100;
double diff_norm = cvtest::norm(actual_weights, weights, NORM_L2);
if (diff_norm > eps)
{
failed = true;
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
ts->set_gtest_status();
- return;
}
}
actual_hog->compute(img, actual_descriptors, winStride, padding, locations);
double diff_norm = cvtest::norm(actual_descriptors, descriptors, NORM_L2);
- const double eps = 0.0;
+ const double eps = FLT_EPSILON * 100;
if (diff_norm > eps)
{
ts->printf(cvtest::TS::SUMMARY, "Norm of the difference: %lf\n", diff_norm);
ts->printf(cvtest::TS::LOG, "Channels: %d\n", img.channels());
ts->set_gtest_status();
failed = true;
- return;
}
}
const char* args[] = { "Gradient's", "Qangles's" };
actual_hog->computeGradient(img, actual_mats[0], actual_mats[1], paddingTL, paddingBR);
- const double eps = 0.0;
+ const double eps = FLT_EPSILON * 100;
for (i = 0; i < 2; ++i)
{
double diff_norm = cvtest::norm(reference_mats[i], actual_mats[i], NORM_L2);
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
ts->set_gtest_status();
failed = true;
- return;
}
}
}
void CvCaptureCAM_Aravis::close()
{
- if(camera)
+ if(camera) {
stopCapture();
- g_object_unref(camera);
- camera = NULL;
+ g_object_unref(camera);
+ camera = NULL;
+ }
}
bool CvCaptureCAM_Aravis::getDeviceNameById(int id, std::string &device)
{
arv_camera_stop_acquisition(camera);
- g_object_unref(stream);
- stream = NULL;
+ if(stream) {
+ g_object_unref(stream);
+ stream = NULL;
+ }
}
bool CvCaptureCAM_Aravis::startCapture()
String s = "";
if (pAct.filterByArea)
{
- String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minArea))->str();
- String sup = static_cast<ostringstream*>(&(ostringstream() << pAct.maxArea))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << pAct.minArea).str();
+ String sup = static_cast<const ostringstream&>(ostringstream() << pAct.maxArea).str();
s = " Area range [" + inf + " to " + sup + "]";
}
if (pAct.filterByCircularity)
{
- String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minCircularity))->str();
- String sup = static_cast<ostringstream*>(&(ostringstream() << pAct.maxCircularity))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << pAct.minCircularity).str();
+ String sup = static_cast<const ostringstream&>(ostringstream() << pAct.maxCircularity).str();
if (s.length() == 0)
s = " Circularity range [" + inf + " to " + sup + "]";
else
}
if (pAct.filterByColor)
{
- String inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.blobColor))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.blobColor).str();
if (s.length() == 0)
s = " Blob color " + inf;
else
}
if (pAct.filterByConvexity)
{
- String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minConvexity))->str();
- String sup = static_cast<ostringstream*>(&(ostringstream() << pAct.maxConvexity))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << pAct.minConvexity).str();
+ String sup = static_cast<const ostringstream&>(ostringstream() << pAct.maxConvexity).str();
if (s.length() == 0)
s = " Convexity range[" + inf + " to " + sup + "]";
else
}
if (pAct.filterByInertia)
{
- String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minInertiaRatio))->str();
- String sup = static_cast<ostringstream*>(&(ostringstream() << pAct.maxInertiaRatio))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << pAct.minInertiaRatio).str();
+ String sup = static_cast<const ostringstream&>(ostringstream() << pAct.maxInertiaRatio).str();
if (s.length() == 0)
s = " Inertia ratio range [" + inf + " to " + sup + "]";
else
static String Legende(MSERParams &pAct)
{
String s="";
- String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minArea))->str();
- String sup = static_cast<ostringstream*>(&(ostringstream() << pAct.maxArea))->str();
+ String inf = static_cast<const ostringstream&>(ostringstream() << pAct.minArea).str();
+ String sup = static_cast<const ostringstream&>(ostringstream() << pAct.maxArea).str();
s = " Area[" + inf + "," + sup + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << pAct.delta))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << pAct.delta).str();
s += " del. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << pAct.maxVariation))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << pAct.maxVariation).str();
s += " var. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.minDiversity))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.minDiversity).str();
s += " div. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.pass2Only))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.pass2Only).str();
s += " pas. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.maxEvolution))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.maxEvolution).str();
s += "RGb-> evo. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.areaThreshold))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.areaThreshold).str();
s += " are. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.minMargin))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.minMargin).str();
s += " mar. [" + inf + "]";
- inf = static_cast<ostringstream*>(&(ostringstream() << (int)pAct.edgeBlurSize))->str();
+ inf = static_cast<const ostringstream&>(ostringstream() << (int)pAct.edgeBlurSize).str();
s += " siz. [" + inf + "]";
return s;
}