rename more functions and types
MODIFY
gen_rust.py
gen_rust.py
@@ -111,6 +111,7 @@ decls_manual_post = {
# dict of functions to rename or skip, key is FuncInfo.identifier, value is new name ("+" will be replaces by old name) or "-" to skip
func_rename = { # todo check if any "new" is required
+ # fixme remove entries that don't actually change name
### calib3d ###
"cv_findEssentialMat_Mat_Mat_Mat_int_double_double_Mat": "+_matrix",
"cv_findHomography_Mat_Mat_int_double_Mat_int_double": "+_full",
@@ -131,7 +132,6 @@ func_rename = { # todo check if any "new" is required
### core ###
"cv_addImpl_int_const_char_X": "-",
"cv_MatExpr_type_const": "typ",
- "cv_Mat_Mat": "new",
"cv_Mat_Mat_int_int_int": "new_rows_cols",
"cv_Mat_Mat_Size_int": "new_size",
"cv_Mat_Mat_int_int_int_Scalar": "new_rows_cols_with_default",
@@ -157,9 +157,7 @@ func_rename = { # todo check if any "new" is required
"cv_Mat_create_int_const_int_X_int": "-", # duplicate of cv_Mat_create_VectorOfint_int, but with pointers
"cv_Mat_create_VectorOfint_int": "create_nd",
"cv_Mat_diag_Mat": "diag_new_mat",
- "cv_Mat_diag_const_int": "diag",
"cv_Mat_ptr_int": "ptr_mut",
- "cv_Mat_ptr_const_int": "ptr",
"cv_Mat_ptr_int_int": "ptr_2d_mut",
"cv_Mat_ptr_const_int_int": "ptr_2d",
"cv_Mat_ptr_int_int_int": "ptr_3d_mut",
@@ -171,9 +169,7 @@ func_rename = { # todo check if any "new" is required
"cv_Mat_at_const_int_int": "at_2d",
"cv_Mat_at_int_int_int": "at_3d_mut",
"cv_Mat_at_const_int_int_int": "at_3d",
- "cv_Mat_resize_size_t": "resize",
"cv_Mat_resize_size_t_Scalar": "resize_with_default",
- "cv_Mat_rowRange_const_Range": "row_range",
"cv_Mat_rowRange_const_int_int": "rowbounds",
"cv_Mat_type_const": "typ",
"cv_Mat_reshape_const_int_int_const_int_X": "-", # duplicate of cv_Mat_reshape_const_int_VectorOfint, but with pointers
@@ -191,18 +187,16 @@ func_rename = { # todo check if any "new" is required
"cv_PCA_PCA": "default",
"cv_PCA_PCA_Mat_Mat_int_double": "new_mat_variance",
"cv_PCA_PCA_Mat_Mat_int_int": "new_mat_max",
- "cv_PCA_backProject_const_Mat_Mat": "back_project_to",
- "cv_PCA_project_const_Mat_Mat": "project_to",
+ "cv_PCA_backProject_const_Mat_Mat": "+_to",
+ "cv_PCA_project_const_Mat_Mat": "+_to",
"cv_PCACompute_Mat_Mat_Mat_double": "pca_compute_variance",
"cv_PCACompute_Mat_Mat_Mat_Mat_double": "pca_compute_values_variance",
"cv_PCACompute_Mat_Mat_Mat_Mat_int": "pca_compute_values",
"cv_Range_Range": "default",
"cv_Range_Range_int_int": "new",
"cv_RotatedRect_RotatedRect": "default",
- "cv_RotatedRect_RotatedRect_Point2f_Size2f_float": "new",
"cv_RotatedRect_RotatedRect_Point2f_Point2f_Point2f": "for_points",
"cv_TermCriteria_TermCriteria": "default",
- "cv_TermCriteria_TermCriteria_int_int_double": "new",
"cv_UMat_type_const": "typ",
"cv_UMat_copyTo_const_Mat": "copy_to",
"cv_UMat_copyTo_const_Mat_Mat": "copy_to_masked",
@@ -212,17 +206,13 @@ func_rename = { # todo check if any "new" is required
"cv_clipLine_Rect_Point_Point": "clip_line",
"cv_cv_abs_short": "-",
"cv_cv_abs_uchar": "-",
- "cv_divide_double_Mat_Mat_int": "divide",
"cv_divide_Mat_Mat_Mat_double_int": "divide_mat",
"cv_ellipse_Mat_RotatedRect_Scalar_int_int": "ellipse_new_rotated_rect",
"cv_ellipse2Poly_Point2d_Size2d_int_int_int_int_VectorOfPoint2d": "ellipse_2_poly_f64",
"cv_ellipse2Poly_Point_Size_int_int_int_int_VectorOfPoint": "ellipse_2_poly",
"cv_norm_Mat_Mat_int_Mat": "norm_with_type",
- "cv_norm_Mat_int_Mat": "norm",
"cv_rectangle_Mat_Point_Point_Scalar_int_int_int": "rectangle_points",
- "cv_rectangle_Mat_Rect_Scalar_int_int_int": "rectangle",
"cv_repeat_Mat_int_int_Mat": "repeat_to",
- "cv_repeat_Mat_int_int": "repeat",
"cv_split_Mat_Mat": "-", # duplicate of cv_split_Mat_VectorOfMat, but with pointers
"cv_getNumberOfCPUs": "get_number_of_cpus",
"cv_setImpl_int": "-",
@@ -249,7 +239,6 @@ func_rename = { # todo check if any "new" is required
"cv_BOWKMeansTrainer_BOWKMeansTrainer_int_TermCriteria_int_int": "new_with_criteria",
"cv_BOWImgDescriptorExtractor_compute_Mat_VectorOfKeyPoint_Mat_VectorOfVectorOfint_Mat": "compute_desc",
"cv_DMatch_DMatch": "default",
- "cv_DMatch_DMatch_int_int_float": "new",
"cv_DMatch_DMatch_int_int_int_float": "new_index",
"cv_DescriptorMatcher_knnMatch_const_Mat_Mat_VectorOfVectorOfDMatch_int_Mat_bool": "knn_train_matches",
"cv_DescriptorMatcher_knnMatch_Mat_VectorOfVectorOfDMatch_int_VectorOfMat_bool": "knn_matches",
@@ -259,22 +248,21 @@ func_rename = { # todo check if any "new" is required
"cv_DescriptorMatcher_radiusMatch_Mat_VectorOfVectorOfDMatch_float_VectorOfMat_bool": "radius_matches",
"cv_FAST_Mat_VectorOfKeyPoint_int_bool": "FAST",
"cv_FAST_Mat_VectorOfKeyPoint_int_bool_int": "FAST_with_type",
- "cv_Feature2D_detect_VectorOfMat_VectorOfVectorOfKeyPoint_VectorOfMat": "detect_n",
+ "cv_Feature2D_detect_VectorOfMat_VectorOfVectorOfKeyPoint_VectorOfMat": "+_multiple",
"cv_KeyPoint_KeyPoint": "default",
"cv_KeyPoint_KeyPoint_Point2f_float_float_float_int_int": "new_point",
"cv_KeyPoint_KeyPoint_float_float_float_float_float_int_int": "new_coords",
"cv_KeyPoint_convert_VectorOfKeyPoint_VectorOfPoint2f_VectorOfint": "convert_from",
"cv_KeyPoint_convert_VectorOfPoint2f_VectorOfKeyPoint_float_float_int_int": "convert_to",
"cv_MatStep_MatStep": "default",
- "cv_MatStep_MatStep_size_t": "new",
"cv_drawMatches_Mat_VectorOfKeyPoint_Mat_VectorOfKeyPoint_VectorOfDMatch_Mat_Scalar_Scalar_VectorOfchar_int": "draw_matches",
"cv_drawMatches_Mat_VectorOfKeyPoint_Mat_VectorOfKeyPoint_VectorOfVectorOfDMatch_Mat_Scalar_Scalar_VectorOfVectorOfchar_int": "draw_vector_matches",
"cv_BRISK_create_VectorOffloat_VectorOfint_float_float_VectorOfint": "create_with_pattern",
"cv_BRISK_create_int_int_VectorOffloat_VectorOfint_float_float_VectorOfint": "create_with_pattern_threshold_octaves",
"cv_BOWTrainer_cluster_const_Mat": "cluster_with_descriptors",
- "cv_GFTTDetector_create_int_double_double_int_int_bool_double": "create_with_gradient",
- "cv_Feature2D_compute_VectorOfMat_VectorOfVectorOfKeyPoint_VectorOfMat": "compute_multiple",
- "cv_DescriptorMatcher_create_int": "create_with_matcher_type",
+ "cv_GFTTDetector_create_int_double_double_int_int_bool_double": "+_with_gradient",
+ "cv_Feature2D_compute_VectorOfMat_VectorOfVectorOfKeyPoint_VectorOfMat": "+_multiple",
+ "cv_DescriptorMatcher_create_int": "+_with_matcher_type",
"cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_PtrOfFeature2D_PtrOfDescriptorMatcher": "new_with_dextractor",
### highgui ###
@@ -286,23 +274,21 @@ func_rename = { # todo check if any "new" is required
"cv_imdecode_Mat_int_Mat": "+_to",
### imgproc ###
- "cv_Canny_Mat_Mat_Mat_double_double_bool": "canny_derivative",
+ "cv_Canny_Mat_Mat_Mat_double_double_bool": "+_derivative",
"cv_Moments_Moments": "default",
- "cv_Moments_Moments_double_double_double_double_double_double_double_double_double_double": "new",
"cv_Subdiv2D_Subdiv2D": "default",
- "cv_Subdiv2D_Subdiv2D_Rect": "new",
- "cv_Subdiv2D_insert_Point2f": "insert",
- "cv_Subdiv2D_insert_VectorOfPoint2f": "insert_n",
- "cv_findContours_Mat_VectorOfMat_Mat_int_int_Point": "find_contours_with_hierarchy",
- "cv_distanceTransform_Mat_Mat_Mat_int_int_int": "distance_transform_labels",
- "cv_distanceTransform_Mat_Mat_int_int_int": "distance_transform",
- "cv_integral_Mat_Mat_Mat_Mat_int_int": "integral_titled_sq",
- "cv_integral_Mat_Mat_Mat_int_int": "integral_sq_depth",
- "cv_GeneralizedHough_detect_Mat_Mat_Mat_Mat_Mat": "detect_with_edges",
+ "cv_Subdiv2D_insert_VectorOfPoint2f": "+_multiple",
+ "cv_findContours_Mat_VectorOfMat_Mat_int_int_Point": "+_with_hierarchy",
+ "cv_distanceTransform_Mat_Mat_Mat_int_int_int": "+_labels",
+ "cv_integral_Mat_Mat_Mat_Mat_int_int": "+_titled_sq",
+ "cv_integral_Mat_Mat_Mat_int_int": "+_sq_depth",
+ "cv_GeneralizedHough_detect_Mat_Mat_Mat_Mat_Mat": "+_with_edges",
+ "cv_goodFeaturesToTrack_Mat_Mat_int_double_double_Mat_int_int_bool_double": "+_with_gradient",
### ml ###
"cv_ml_ParamGrid_ParamGrid_double_double_double": "for_range",
- # objdetect": "",
+
+ ### objdetect ###
"cv_CascadeClassifier_CascadeClassifier": "default",
"cv_CascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_VectorOfdouble_double_int_int_Size_Size_bool": "detect_multi_scale_levels",
"cv_CascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_double_int_int_Size_Size": "detect_multi_scale_num",
@@ -311,14 +297,13 @@ func_rename = { # todo check if any "new" is required
"cv_HOGDescriptor_detectMultiScale_const_Mat_VectorOfRect_VectorOfdouble_double_Size_Size_double_double_bool": "detect_multi_scale",
"cv_HOGDescriptor_detectMultiScale_const_Mat_VectorOfRect_double_Size_Size_double_double_bool": "detect_multi_scale_weights",
"cv_HOGDescriptor_detect_const_Mat_VectorOfPoint_VectorOfdouble_double_Size_Size_VectorOfPoint": "detect_weights",
- "cv_HOGDescriptor_detect_const_Mat_VectorOfPoint_double_Size_Size_VectorOfPoint": "detect",
- "cv_groupRectangles_VectorOfRect_VectorOfint_VectorOfdouble_int_double": "group_rectangles_levels",
- "cv_groupRectangles_VectorOfRect_VectorOfint_int_double": "group_rectangle_weights",
- "cv_groupRectangles_VectorOfRect_int_double": "group_rectangle",
- "cv_groupRectangles_VectorOfRect_int_double_VectorOfint_VectorOfdouble": "group_rectangle_levelweights",
- "cv_ml_StatModel_train_PtrOfTrainData_int": "train_with_data",
- "cv_BaseCascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_double_int_int_Size_Size": "detect_multi_scale_num",
- "cv_BaseCascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_VectorOfdouble_double_int_int_Size_Size_bool": "detect_multi_scale_levels",
+ "cv_groupRectangles_VectorOfRect_VectorOfint_VectorOfdouble_int_double": "+_levels",
+ "cv_groupRectangles_VectorOfRect_VectorOfint_int_double": "+_weights",
+ "cv_groupRectangles_VectorOfRect_int_double_VectorOfint_VectorOfdouble": "+_levelweights",
+ "cv_ml_StatModel_train_PtrOfTrainData_int": "+_with_data",
+ "cv_BaseCascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_double_int_int_Size_Size": "+_num",
+ "cv_BaseCascadeClassifier_detectMultiScale_Mat_VectorOfRect_VectorOfint_VectorOfdouble_double_int_int_Size_Size_bool": "+_levels",
+ "cv_HOGDescriptor_setSVMDetector_Mat": "+_mat",
### photo ###
"cv_fastNlMeansDenoisingColored_Mat_Mat_float_float_int_int": "fast_nl_means_denoising_color",
@@ -331,7 +316,6 @@ func_rename = { # todo check if any "new" is required
### video ###
"cv_KalmanFilter_KalmanFilter": "default",
- "cv_KalmanFilter_KalmanFilter_int_int_int_int": "new",
### videoio ###
"cv_VideoCapture_VideoCapture": "default",
@@ -353,7 +337,6 @@ func_rename = { # todo check if any "new" is required
"cv_dnn_NMSBoxes_VectorOfRotatedRect_VectorOffloat_float_float_VectorOfint_float_int": "nms_boxes_rotated",
"cv_dnn_NMSBoxes_VectorOfRect2d_VectorOffloat_float_float_VectorOfint_float_int": "nms_boxes_f64",
"cv_dnn_Dict_ptr_String": "ptr_mut",
- "cv_dnn_Dict_ptr_const_String": "ptr",
"cv_dnn_Net_forward_VectorOfMat_String": "forward_layer",
"cv_dnn_Net_forward_VectorOfMat_VectorOfString": "forward_first_outputs",
"cv_dnn_Net_forward_VectorOfVectorOfMat_VectorOfString": "forward_all",
@@ -451,6 +434,7 @@ type_replace = {
"_OutputArray": "cv::Mat",
"_InputOutputArray": "cv::Mat",
"vector_Mat": "vector<cv::Mat>",
+ "vector_float": "vector<float>",
"_Range": "cv::Range",
"Point_<int>": "Point2i",
"Point_<int64>": "Point2l",

rename more functions and types