@@ -795,6 +795,64 @@ PERF_TEST_P_(GoodFeaturesPerfTest, TestPerformance)
795
795
796
796
// ------------------------------------------------------------------------------
797
797
798
+ PERF_TEST_P_ (FindContoursPerfTest, TestPerformance)
799
+ {
800
+ CompareMats cmpF;
801
+ MatType type;
802
+ cv::Size sz;
803
+ cv::RetrievalModes mode;
804
+ cv::ContourApproximationModes method;
805
+ cv::GCompileArgs compile_args;
806
+ std::tie (cmpF, type, sz, mode, method, compile_args) = GetParam ();
807
+
808
+ cv::Mat in;
809
+ initMatForFindingContours (in, sz, type);
810
+ cv::Point offset = cv::Point ();
811
+ std::vector<cv::Vec4i> out_hier_gapi = std::vector<cv::Vec4i>();
812
+
813
+ std::vector<std::vector<cv::Point>> out_cnts_gapi;
814
+ cv::GComputation c (findContoursTestGAPI (in, mode, method, std::move (compile_args),
815
+ out_cnts_gapi, out_hier_gapi, offset));
816
+
817
+ TEST_CYCLE ()
818
+ {
819
+ c.apply (gin (in, offset), gout (out_cnts_gapi));
820
+ }
821
+
822
+ findContoursTestOpenCVCompare (in, mode, method, out_cnts_gapi, out_hier_gapi, cmpF);
823
+ SANITY_CHECK_NOTHING ();
824
+ }
825
+
826
+ PERF_TEST_P_ (FindContoursHPerfTest, TestPerformance)
827
+ {
828
+ CompareMats cmpF;
829
+ MatType type;
830
+ cv::Size sz;
831
+ cv::RetrievalModes mode;
832
+ cv::ContourApproximationModes method;
833
+ cv::GCompileArgs compile_args;
834
+ std::tie (cmpF, type, sz, mode, method, compile_args) = GetParam ();
835
+
836
+ cv::Mat in;
837
+ initMatForFindingContours (in, sz, type);
838
+ cv::Point offset = cv::Point ();
839
+
840
+ std::vector<std::vector<cv::Point>> out_cnts_gapi;
841
+ std::vector<cv::Vec4i> out_hier_gapi;
842
+ cv::GComputation c (findContoursTestGAPI<HIERARCHY>(in, mode, method, std::move (compile_args),
843
+ out_cnts_gapi, out_hier_gapi, offset));
844
+
845
+ TEST_CYCLE ()
846
+ {
847
+ c.apply (gin (in, offset), gout (out_cnts_gapi, out_hier_gapi));
848
+ }
849
+
850
+ findContoursTestOpenCVCompare<HIERARCHY>(in, mode, method, out_cnts_gapi, out_hier_gapi, cmpF);
851
+ SANITY_CHECK_NOTHING ();
852
+ }
853
+
854
+ // ------------------------------------------------------------------------------
855
+
798
856
PERF_TEST_P_ (BoundingRectMatPerfTest, TestPerformance)
799
857
{
800
858
CompareRects cmpF;
@@ -871,6 +929,198 @@ PERF_TEST_P_(BoundingRectVector32FPerfTest, TestPerformance)
871
929
872
930
// ------------------------------------------------------------------------------
873
931
932
+ PERF_TEST_P_ (FitLine2DMatVectorPerfTest, TestPerformance)
933
+ {
934
+ CompareVecs<float , 4 > cmpF;
935
+ cv::Size sz;
936
+ MatType type;
937
+ cv::DistanceTypes distType;
938
+ cv::GCompileArgs compile_args;
939
+ std::tie (cmpF, type, sz, distType, compile_args) = GetParam ();
940
+
941
+ initMatByPointsVectorRandU<cv::Point_>(type, sz, -1 );
942
+
943
+ cv::Vec4f out_vec_gapi;
944
+ cv::GComputation c (fitLineTestGAPI (in_mat1, distType, std::move (compile_args), out_vec_gapi));
945
+
946
+ TEST_CYCLE ()
947
+ {
948
+ c.apply (cv::gin (in_mat1), cv::gout (out_vec_gapi));
949
+ }
950
+
951
+ fitLineTestOpenCVCompare (in_mat1, distType, out_vec_gapi, cmpF);
952
+ SANITY_CHECK_NOTHING ();
953
+ }
954
+
955
+ PERF_TEST_P_ (FitLine2DVector32SPerfTest, TestPerformance)
956
+ {
957
+ CompareVecs<float , 4 > cmpF;
958
+ cv::Size sz;
959
+ cv::DistanceTypes distType;
960
+ cv::GCompileArgs compile_args;
961
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
962
+
963
+ std::vector<cv::Point2i> in_vector;
964
+ initPointsVectorRandU (sz.width , in_vector);
965
+
966
+ cv::Vec4f out_vec_gapi;
967
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
968
+ out_vec_gapi));
969
+
970
+ TEST_CYCLE ()
971
+ {
972
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
973
+ }
974
+
975
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
976
+ SANITY_CHECK_NOTHING ();
977
+ }
978
+
979
+ PERF_TEST_P_ (FitLine2DVector32FPerfTest, TestPerformance)
980
+ {
981
+ CompareVecs<float , 4 > cmpF;
982
+ cv::Size sz;
983
+ cv::DistanceTypes distType;
984
+ cv::GCompileArgs compile_args;
985
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
986
+
987
+ std::vector<cv::Point2f> in_vector;
988
+ initPointsVectorRandU (sz.width , in_vector);
989
+
990
+ cv::Vec4f out_vec_gapi;
991
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
992
+ out_vec_gapi));
993
+
994
+ TEST_CYCLE ()
995
+ {
996
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
997
+ }
998
+
999
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
1000
+ SANITY_CHECK_NOTHING ();
1001
+ }
1002
+
1003
+ PERF_TEST_P_ (FitLine2DVector64FPerfTest, TestPerformance)
1004
+ {
1005
+ CompareVecs<float , 4 > cmpF;
1006
+ cv::Size sz;
1007
+ cv::DistanceTypes distType;
1008
+ cv::GCompileArgs compile_args;
1009
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
1010
+
1011
+ std::vector<cv::Point2d> in_vector;
1012
+ initPointsVectorRandU (sz.width , in_vector);
1013
+
1014
+ cv::Vec4f out_vec_gapi;
1015
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
1016
+ out_vec_gapi));
1017
+
1018
+ TEST_CYCLE ()
1019
+ {
1020
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
1021
+ }
1022
+
1023
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
1024
+ SANITY_CHECK_NOTHING ();
1025
+ }
1026
+
1027
+ PERF_TEST_P_ (FitLine3DMatVectorPerfTest, TestPerformance)
1028
+ {
1029
+ CompareVecs<float , 6 > cmpF;
1030
+ cv::Size sz;
1031
+ MatType type;
1032
+ cv::DistanceTypes distType;
1033
+ cv::GCompileArgs compile_args;
1034
+ std::tie (cmpF, type, sz, distType, compile_args) = GetParam ();
1035
+
1036
+ initMatByPointsVectorRandU<cv::Point3_>(type, sz, -1 );
1037
+
1038
+ cv::Vec6f out_vec_gapi;
1039
+ cv::GComputation c (fitLineTestGAPI (in_mat1, distType, std::move (compile_args), out_vec_gapi));
1040
+
1041
+ TEST_CYCLE ()
1042
+ {
1043
+ c.apply (cv::gin (in_mat1), cv::gout (out_vec_gapi));
1044
+ }
1045
+
1046
+ fitLineTestOpenCVCompare (in_mat1, distType, out_vec_gapi, cmpF);
1047
+ SANITY_CHECK_NOTHING ();
1048
+ }
1049
+
1050
+ PERF_TEST_P_ (FitLine3DVector32SPerfTest, TestPerformance)
1051
+ {
1052
+ CompareVecs<float , 6 > cmpF;
1053
+ cv::Size sz;
1054
+ cv::DistanceTypes distType;
1055
+ cv::GCompileArgs compile_args;
1056
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
1057
+
1058
+ std::vector<cv::Point3i> in_vector;
1059
+ initPointsVectorRandU (sz.width , in_vector);
1060
+
1061
+ cv::Vec6f out_vec_gapi;
1062
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
1063
+ out_vec_gapi));
1064
+
1065
+ TEST_CYCLE ()
1066
+ {
1067
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
1068
+ }
1069
+
1070
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
1071
+ SANITY_CHECK_NOTHING ();
1072
+ }
1073
+
1074
+ PERF_TEST_P_ (FitLine3DVector32FPerfTest, TestPerformance)
1075
+ {
1076
+ CompareVecs<float , 6 > cmpF;
1077
+ cv::Size sz;
1078
+ cv::DistanceTypes distType;
1079
+ cv::GCompileArgs compile_args;
1080
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
1081
+
1082
+ std::vector<cv::Point3f> in_vector;
1083
+ initPointsVectorRandU (sz.width , in_vector);
1084
+
1085
+ cv::Vec6f out_vec_gapi;
1086
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
1087
+ out_vec_gapi));
1088
+
1089
+ TEST_CYCLE ()
1090
+ {
1091
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
1092
+ }
1093
+
1094
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
1095
+ SANITY_CHECK_NOTHING ();
1096
+ }
1097
+
1098
+ PERF_TEST_P_ (FitLine3DVector64FPerfTest, TestPerformance)
1099
+ {
1100
+ CompareVecs<float , 6 > cmpF;
1101
+ cv::Size sz;
1102
+ cv::DistanceTypes distType;
1103
+ cv::GCompileArgs compile_args;
1104
+ std::tie (cmpF, sz, distType, compile_args) = GetParam ();
1105
+
1106
+ std::vector<cv::Point3d> in_vector;
1107
+ initPointsVectorRandU (sz.width , in_vector);
1108
+
1109
+ cv::Vec6f out_vec_gapi;
1110
+ cv::GComputation c (fitLineTestGAPI (in_vector, distType, std::move (compile_args),
1111
+ out_vec_gapi));
1112
+
1113
+ TEST_CYCLE ()
1114
+ {
1115
+ c.apply (cv::gin (in_vector), cv::gout (out_vec_gapi));
1116
+ }
1117
+
1118
+ fitLineTestOpenCVCompare (in_vector, distType, out_vec_gapi, cmpF);
1119
+ SANITY_CHECK_NOTHING ();
1120
+ }
1121
+
1122
+ // ------------------------------------------------------------------------------
1123
+
874
1124
PERF_TEST_P_ (EqHistPerfTest, TestPerformance)
875
1125
{
876
1126
compare_f cmpF = get<0 >(GetParam ());
0 commit comments