ms-types 0.10.7 → 0.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/package.json +2 -2
  2. package/types/action.d.ts +7 -2
  3. package/types/ai.d.ts +5 -4
  4. package/types/appleocr.d.ts +4 -4
  5. package/types/cloud.d.ts +1 -2
  6. package/types/config.d.ts +1 -1
  7. package/types/cryptoUtils.d.ts +5 -2
  8. package/types/device.d.ts +1 -1
  9. package/types/dotocr.d.ts +3 -1
  10. package/types/file.d.ts +2 -2
  11. package/types/hotUpdate.d.ts +1 -2
  12. package/types/http.d.ts +6 -6
  13. package/types/image.d.ts +1 -1
  14. package/types/ime.d.ts +1 -1
  15. package/types/logger.d.ts +2 -2
  16. package/types/lua/action.lua +119 -89
  17. package/types/lua/ai.lua +34 -16
  18. package/types/lua/appleocr.lua +35 -22
  19. package/types/lua/cloud.lua +25 -12
  20. package/types/lua/config.lua +18 -11
  21. package/types/lua/cryptoUtils.lua +35 -27
  22. package/types/lua/cv.lua +173 -25
  23. package/types/lua/device.lua +38 -20
  24. package/types/lua/dotocr.lua +8 -2
  25. package/types/lua/file.lua +61 -40
  26. package/types/lua/global.lua +56 -20
  27. package/types/lua/hid.lua +147 -101
  28. package/types/lua/hotupdate.lua +25 -3
  29. package/types/lua/http.lua +71 -41
  30. package/types/lua/image.lua +222 -98
  31. package/types/lua/ime.lua +37 -13
  32. package/types/lua/logger.lua +22 -12
  33. package/types/lua/media.lua +54 -14
  34. package/types/lua/mysql.lua +61 -12
  35. package/types/lua/netcard.lua +25 -11
  36. package/types/lua/node.lua +4 -2
  37. package/types/lua/paddleocr.lua +35 -21
  38. package/types/lua/pip.lua +30 -18
  39. package/types/lua/system.lua +112 -31
  40. package/types/lua/tomatoocr.lua +73 -26
  41. package/types/lua/tts.lua +26 -10
  42. package/types/lua/ui.lua +35 -14
  43. package/types/lua/utils.lua +27 -17
  44. package/types/lua/yolo.lua +25 -17
  45. package/types/lua/yolocls.lua +27 -18
  46. package/types/media.d.ts +1 -1
  47. package/types/mysql.d.ts +1 -1
  48. package/types/netCard.d.ts +3 -0
  49. package/types/node.d.ts +1 -1
  50. package/types/paddleocr.d.ts +2 -5
  51. package/types/pip.d.ts +3 -0
  52. package/types/system.d.ts +1 -1
  53. package/types/tomatoocr.d.ts +3 -4
  54. package/types/tts.d.ts +2 -2
  55. package/types/ui.d.ts +1 -1
  56. package/types/utils.d.ts +1 -1
  57. package/types/web.d.ts +1 -1
  58. package/types/yolo.d.ts +1 -1
  59. package/types/yoloCls.d.ts +1 -1
  60. package/types/zh/HID/346/250/241/345/235/227.d.ts +1 -1
  61. package/types/zh/HTTP/346/250/241/345/235/227.d.ts +7 -6
  62. package/types/zh/MySql/346/250/241/345/235/227.d.ts +2 -1
  63. package/types/zh/PaddleOCR/346/250/241/345/235/227.d.ts +3 -5
  64. package/types/zh/YOLO/345/210/206/347/261/273/346/250/241/345/235/227.d.ts +1 -1
  65. package/types/zh/YOLO/346/250/241/345/235/227.d.ts +1 -1
  66. package/types/zh//344/272/221/346/216/247/346/250/241/345/235/227.d.ts +4 -1
  67. package/types/zh//345/212/250/344/275/234/346/250/241/345/235/227.d.ts +7 -2
  68. package/types/zh//345/233/276/347/211/207/346/250/241/345/235/227.d.ts +2 -1
  69. package/types/zh//345/252/222/344/275/223/346/250/241/345/235/227.d.ts +1 -1
  70. package/types/zh//345/267/245/345/205/267/346/250/241/345/235/227.d.ts +1 -1
  71. package/types/zh//346/202/254/346/265/256/347/252/227/346/250/241/345/235/227.d.ts +2 -1
  72. package/types/zh//346/226/207/344/273/266/346/250/241/345/235/227.d.ts +3 -2
  73. package/types/zh//346/226/207/345/255/227/350/275/254/350/257/255/351/237/263/346/250/241/345/235/227.d.ts +3 -2
  74. package/types/zh//346/227/245/345/277/227/346/250/241/345/235/227.d.ts +2 -2
  75. package/types/zh//347/202/271/351/230/265OCR/346/250/241/345/235/227.d.ts +3 -1
  76. package/types/zh//347/263/273/347/273/237/346/250/241/345/235/227.d.ts +2 -1
  77. package/types/zh//347/272/277/347/250/213/346/250/241/345/235/227.d.ts +1 -0
  78. package/types/zh//350/212/202/347/202/271/346/250/241/345/235/227.d.ts +1 -1
  79. package/types/zh//350/213/271/346/236/234OCR.d.ts +4 -4
  80. package/types/zh//350/247/206/345/233/276/346/250/241/345/235/227.d.ts +2 -2
  81. package/types/zh//350/256/276/345/244/207/346/250/241/345/235/227.d.ts +2 -1
  82. package/types/zh//350/276/223/345/205/245/346/263/225/346/250/241/345/235/227.d.ts +2 -1
  83. package/types/zh//351/205/215/347/275/256/346/250/241/345/235/227.d.ts +1 -1
package/types/lua/cv.lua CHANGED
@@ -1,4 +1,5 @@
1
1
  ---@meta
2
+ --- OpenCV模块
2
3
  --- OpenCV 精简绑定;全局 `cv`。Mat 是字符串句柄。方法与常量对齐 JS `cv`。
3
4
  ---@alias OpenCV.Mat string
4
5
 
@@ -722,22 +723,28 @@
722
723
  ---@field MARKER_TRIANGLE_DOWN integer
723
724
  local _OpenCV = {}
724
725
 
725
- --- capture
726
+ --- 截屏为 Mat;参数与 `image.captureScreen` 一致,无参全屏
726
727
  ---@param x number|nil
727
728
  ---@param y number|nil
728
729
  ---@param ex number|nil
729
730
  ---@param ey number|nil
730
731
  ---@return OpenCV.Mat|nil
732
+ ---@example cv.capture(x, y, ex, ey)
731
733
  function _OpenCV.capture(x, y, ex, ey) return nil end
732
734
 
733
- --- imread
735
+ --- 读取图片为 Mat 句柄。`cv` 中**唯一**支持路径类输入的加载入口(与 `image.readImage` 同源):
736
+ --- msbundle/res 相对路径、手机绝对路径、`$MS_IMG$_…` imageId、`screen` / `shortcut` /
737
+ --- `actionScreenshot`、HTTP(S)、`media:n`、`data:image/...;base64,...` 等。
738
+ --- 其它算子只接受 Mat 句柄。
734
739
  ---@param path string
735
740
  ---@return OpenCV.Mat|nil
741
+ ---@example cv.imread(path)
736
742
  function _OpenCV.imread(path) return nil end
737
743
 
738
- --- imdecode
744
+ --- 仅解码 base64 / data URI;路径与 imageId 请用 `imread`
739
745
  ---@param data string
740
746
  ---@return OpenCV.Mat|nil
747
+ ---@example cv.imdecode(data)
741
748
  function _OpenCV.imdecode(data) return nil end
742
749
 
743
750
  --- imwrite
@@ -746,6 +753,7 @@ function _OpenCV.imdecode(data) return nil end
746
753
  ---@param path string
747
754
  ---@param mat OpenCV.Mat
748
755
  ---@return boolean
756
+ ---@example cv.imwrite(path, mat)
749
757
  function _OpenCV.imwrite(path, mat) return false end
750
758
 
751
759
  --- imencode
@@ -754,58 +762,70 @@ function _OpenCV.imwrite(path, mat) return false end
754
762
  ---@param mat OpenCV.Mat
755
763
  ---@param quality number|nil
756
764
  ---@return string|nil
765
+ ---@example cv.imencode(ext, mat, quality)
757
766
  function _OpenCV.imencode(ext, mat, quality) return nil end
758
767
 
759
768
  --- fromImageId
760
769
  ---@param imageId string
761
770
  ---@return OpenCV.Mat|nil
771
+ ---@example cv.fromImageId(imageId)
762
772
  function _OpenCV.fromImageId(imageId) return nil end
763
773
 
764
774
  --- toImageId
765
775
  ---@param mat OpenCV.Mat
766
776
  ---@return string|nil
777
+ ---@example cv.toImageId(mat)
767
778
  function _OpenCV.toImageId(mat) return nil end
768
779
 
769
780
  --- Mat
770
781
  ---@param options OpenCV.MatCreateOptions
771
782
  ---@return OpenCV.Mat|nil
783
+ ---@example cv.Mat(options)
772
784
  function _OpenCV.Mat(options) return nil end
773
785
 
774
786
  --- zeros
775
787
  ---@param options OpenCV.MatSizeOptions
776
788
  ---@return OpenCV.Mat|nil
789
+ ---@example cv.zeros(options)
777
790
  function _OpenCV.zeros(options) return nil end
778
791
 
779
792
  --- ones
780
793
  ---@param options OpenCV.MatSizeOptions
781
794
  ---@return OpenCV.Mat|nil
795
+ ---@example cv.ones(options)
782
796
  function _OpenCV.ones(options) return nil end
783
797
 
784
798
  --- clone
785
799
  ---@param mat OpenCV.Mat
786
800
  ---@return OpenCV.Mat|nil
801
+ ---@example cv.clone(mat)
787
802
  function _OpenCV.clone(mat) return nil end
788
803
 
789
804
  --- empty
790
805
  ---@param mat OpenCV.Mat
791
806
  ---@return boolean
807
+ ---@example cv.empty(mat)
792
808
  function _OpenCV.empty(mat) return false end
793
809
 
794
810
  --- isRelease
795
811
  ---@param mat OpenCV.Mat
796
812
  ---@return boolean
813
+ ---@example cv.isRelease(mat)
797
814
  function _OpenCV.isRelease(mat) return false end
798
815
 
799
816
  --- release
800
817
  ---@param mat OpenCV.Mat
818
+ ---@example cv.release(mat)
801
819
  function _OpenCV.release(mat) end
802
820
 
803
821
  --- releaseAll
822
+ ---@example cv.releaseAll()
804
823
  function _OpenCV.releaseAll() end
805
824
 
806
825
  --- getSize
807
826
  ---@param mat OpenCV.Mat
808
827
  ---@return OpenCV.MatInfo|nil
828
+ ---@example cv.getSize(mat)
809
829
  function _OpenCV.getSize(mat) return nil end
810
830
 
811
831
  --- at
@@ -813,241 +833,282 @@ function _OpenCV.getSize(mat) return nil end
813
833
  ---@param row number
814
834
  ---@param col number
815
835
  ---@return number[]|nil
836
+ ---@example cv.at(mat, row, col)
816
837
  function _OpenCV.at(mat, row, col) return nil end
817
838
 
818
839
  --- set
819
840
  ---@param mat OpenCV.Mat
820
841
  ---@param options OpenCV.SetOptions
821
842
  ---@return boolean
843
+ ---@example cv.set(mat, options)
822
844
  function _OpenCV.set(mat, options) return false end
823
845
 
824
846
  --- copyTo
825
847
  ---@param mat OpenCV.Mat
826
848
  ---@param mask OpenCV.Mat|nil
827
849
  ---@return OpenCV.Mat|nil
850
+ ---@example cv.copyTo(mat, mask)
828
851
  function _OpenCV.copyTo(mat, mask) return nil end
829
852
 
830
853
  --- cvtColor;源图通道必须和转换码一致,例如 COLOR_BGR2GRAY 要 3 通道。
831
854
  ---@param mat OpenCV.Mat
832
855
  ---@param code number
833
856
  ---@return OpenCV.Mat|nil
857
+ ---@example cv.cvtColor(mat, code)
834
858
  function _OpenCV.cvtColor(mat, code) return nil end
835
859
 
836
860
  --- threshold
837
861
  ---@param mat OpenCV.Mat
838
862
  ---@param options OpenCV.ThresholdOptions
839
863
  ---@return OpenCV.Mat|nil
864
+ ---@example cv.threshold(mat, options)
840
865
  function _OpenCV.threshold(mat, options) return nil end
841
866
 
842
867
  --- adaptiveThreshold,只接受 CV_8UC1。
843
868
  ---@param mat OpenCV.Mat
844
869
  ---@param options OpenCV.AdaptiveThresholdOptions
845
870
  ---@return OpenCV.Mat|nil
871
+ ---@example cv.adaptiveThreshold(mat, options)
846
872
  function _OpenCV.adaptiveThreshold(mat, options) return nil end
847
873
 
848
874
  --- inRange
849
875
  ---@param mat OpenCV.Mat
850
876
  ---@param options OpenCV.InRangeOptions
851
877
  ---@return OpenCV.Mat|nil
878
+ ---@example cv.inRange(mat, options)
852
879
  function _OpenCV.inRange(mat, options) return nil end
853
880
 
854
881
  --- bitwise_and
855
882
  ---@param src1 OpenCV.Mat
856
883
  ---@param options OpenCV.BitwiseOptions
857
884
  ---@return OpenCV.Mat|nil
885
+ ---@example cv.bitwise_and(src1, options)
858
886
  function _OpenCV.bitwise_and(src1, options) return nil end
859
887
 
860
888
  --- bitwise_or
861
889
  ---@param src1 OpenCV.Mat
862
890
  ---@param options OpenCV.BitwiseOptions
863
891
  ---@return OpenCV.Mat|nil
892
+ ---@example cv.bitwise_or(src1, options)
864
893
  function _OpenCV.bitwise_or(src1, options) return nil end
865
894
 
866
895
  --- bitwise_xor
867
896
  ---@param src1 OpenCV.Mat
868
897
  ---@param options OpenCV.BitwiseOptions
869
898
  ---@return OpenCV.Mat|nil
899
+ ---@example cv.bitwise_xor(src1, options)
870
900
  function _OpenCV.bitwise_xor(src1, options) return nil end
871
901
 
872
902
  --- bitwise_not
873
903
  ---@param mat OpenCV.Mat
874
904
  ---@param options OpenCV.MaskOptions|nil
875
905
  ---@return OpenCV.Mat|nil
906
+ ---@example cv.bitwise_not(mat, options)
876
907
  function _OpenCV.bitwise_not(mat, options) return nil end
877
908
 
878
909
  --- absdiff
879
910
  ---@param src1 OpenCV.Mat
880
911
  ---@param options OpenCV.Src2Options
881
912
  ---@return OpenCV.Mat|nil
913
+ ---@example cv.absdiff(src1, options)
882
914
  function _OpenCV.absdiff(src1, options) return nil end
883
915
 
884
916
  --- addWeighted
885
917
  ---@param src1 OpenCV.Mat
886
918
  ---@param options OpenCV.AddWeightedOptions
887
919
  ---@return OpenCV.Mat|nil
920
+ ---@example cv.addWeighted(src1, options)
888
921
  function _OpenCV.addWeighted(src1, options) return nil end
889
922
 
890
923
  --- convertScaleAbs
891
924
  ---@param mat OpenCV.Mat
892
925
  ---@param options OpenCV.ScaleOptions|nil
893
926
  ---@return OpenCV.Mat|nil
927
+ ---@example cv.convertScaleAbs(mat, options)
894
928
  function _OpenCV.convertScaleAbs(mat, options) return nil end
895
929
 
896
930
  --- countNonZero,只接受单通道 Mat;多通道返回 -1。
897
931
  ---@param mat OpenCV.Mat
898
932
  ---@return number
933
+ ---@example cv.countNonZero(mat)
899
934
  function _OpenCV.countNonZero(mat) return 0 end
900
935
 
901
936
  --- minMaxLoc,只接受单通道 Mat;多通道返回 nil。可选 mask 必须是 CV_8UC1。
902
937
  ---@param mat OpenCV.Mat
903
938
  ---@param options OpenCV.MaskOptions|nil
904
939
  ---@return OpenCV.MinMaxLocResult|nil
940
+ ---@example cv.minMaxLoc(mat, options)
905
941
  function _OpenCV.minMaxLoc(mat, options) return nil end
906
942
 
907
943
  --- mean
908
944
  ---@param mat OpenCV.Mat
909
945
  ---@param options OpenCV.MaskOptions|nil
910
946
  ---@return number[]|nil
947
+ ---@example cv.mean(mat, options)
911
948
  function _OpenCV.mean(mat, options) return nil end
912
949
 
913
950
  --- split
914
951
  ---@param mat OpenCV.Mat
915
952
  ---@return OpenCV.Mat[]|nil
953
+ ---@example cv.split(mat)
916
954
  function _OpenCV.split(mat) return nil end
917
955
 
918
956
  --- merge
919
957
  ---@param channels OpenCV.Mat[]
920
958
  ---@return OpenCV.Mat|nil
959
+ ---@example cv.merge(channels)
921
960
  function _OpenCV.merge(channels) return nil end
922
961
 
923
962
  --- GaussianBlur
924
963
  ---@param mat OpenCV.Mat
925
964
  ---@param options OpenCV.BlurOptions
926
965
  ---@return OpenCV.Mat|nil
966
+ ---@example cv.GaussianBlur(mat, options)
927
967
  function _OpenCV.GaussianBlur(mat, options) return nil end
928
968
 
929
969
  --- blur
930
970
  ---@param mat OpenCV.Mat
931
971
  ---@param options OpenCV.KSizeOptions
932
972
  ---@return OpenCV.Mat|nil
973
+ ---@example cv.blur(mat, options)
933
974
  function _OpenCV.blur(mat, options) return nil end
934
975
 
935
976
  --- medianBlur
936
977
  ---@param mat OpenCV.Mat
937
978
  ---@param options OpenCV.MedianBlurOptions
938
979
  ---@return OpenCV.Mat|nil
980
+ ---@example cv.medianBlur(mat, options)
939
981
  function _OpenCV.medianBlur(mat, options) return nil end
940
982
 
941
983
  --- bilateralFilter,只接受 1 或 3 通道,深度 CV_8U 或 CV_32F。
942
984
  ---@param mat OpenCV.Mat
943
985
  ---@param options OpenCV.BilateralFilterOptions
944
986
  ---@return OpenCV.Mat|nil
987
+ ---@example cv.bilateralFilter(mat, options)
945
988
  function _OpenCV.bilateralFilter(mat, options) return nil end
946
989
 
947
990
  --- Canny,只接受 8 位图(CV_8U,1/3/4 通道均可)。
948
991
  ---@param mat OpenCV.Mat
949
992
  ---@param options OpenCV.CannyOptions
950
993
  ---@return OpenCV.Mat|nil
994
+ ---@example cv.Canny(mat, options)
951
995
  function _OpenCV.Canny(mat, options) return nil end
952
996
 
953
997
  --- Sobel
954
998
  ---@param mat OpenCV.Mat
955
999
  ---@param options OpenCV.SobelOptions
956
1000
  ---@return OpenCV.Mat|nil
1001
+ ---@example cv.Sobel(mat, options)
957
1002
  function _OpenCV.Sobel(mat, options) return nil end
958
1003
 
959
1004
  --- Laplacian
960
1005
  ---@param mat OpenCV.Mat
961
1006
  ---@param options OpenCV.LaplacianOptions
962
1007
  ---@return OpenCV.Mat|nil
1008
+ ---@example cv.Laplacian(mat, options)
963
1009
  function _OpenCV.Laplacian(mat, options) return nil end
964
1010
 
965
1011
  --- equalizeHist,只接受 CV_8UC1。
966
1012
  ---@param mat OpenCV.Mat
967
1013
  ---@return OpenCV.Mat|nil
1014
+ ---@example cv.equalizeHist(mat)
968
1015
  function _OpenCV.equalizeHist(mat) return nil end
969
1016
 
970
1017
  --- resize
971
1018
  ---@param mat OpenCV.Mat
972
1019
  ---@param options OpenCV.ResizeOptions
973
1020
  ---@return OpenCV.Mat|nil
1021
+ ---@example cv.resize(mat, options)
974
1022
  function _OpenCV.resize(mat, options) return nil end
975
1023
 
976
1024
  --- crop
977
1025
  ---@param mat OpenCV.Mat
978
1026
  ---@param options OpenCV.CropOptions
979
1027
  ---@return OpenCV.Mat|nil
1028
+ ---@example cv.crop(mat, options)
980
1029
  function _OpenCV.crop(mat, options) return nil end
981
1030
 
982
1031
  --- rotate
983
1032
  ---@param mat OpenCV.Mat
984
1033
  ---@param rotateCode number
985
1034
  ---@return OpenCV.Mat|nil
1035
+ ---@example cv.rotate(mat, rotateCode)
986
1036
  function _OpenCV.rotate(mat, rotateCode) return nil end
987
1037
 
988
1038
  --- flip
989
1039
  ---@param mat OpenCV.Mat
990
1040
  ---@param flipCode number
991
1041
  ---@return OpenCV.Mat|nil
1042
+ ---@example cv.flip(mat, flipCode)
992
1043
  function _OpenCV.flip(mat, flipCode) return nil end
993
1044
 
994
1045
  --- copyMakeBorder
995
1046
  ---@param mat OpenCV.Mat
996
1047
  ---@param options OpenCV.CopyMakeBorderOptions
997
1048
  ---@return OpenCV.Mat|nil
1049
+ ---@example cv.copyMakeBorder(mat, options)
998
1050
  function _OpenCV.copyMakeBorder(mat, options) return nil end
999
1051
 
1000
1052
  --- getRotationMatrix2D
1001
1053
  ---@param options OpenCV.GetRotationMatrix2DOptions
1002
1054
  ---@return OpenCV.Mat|nil
1055
+ ---@example cv.getRotationMatrix2D(options)
1003
1056
  function _OpenCV.getRotationMatrix2D(options) return nil end
1004
1057
 
1005
1058
  --- warpAffine
1006
1059
  ---@param mat OpenCV.Mat
1007
1060
  ---@param options OpenCV.WarpAffineOptions
1008
1061
  ---@return OpenCV.Mat|nil
1062
+ ---@example cv.warpAffine(mat, options)
1009
1063
  function _OpenCV.warpAffine(mat, options) return nil end
1010
1064
 
1011
- --- rectangle
1065
+ --- 就地绘制,返回同一句柄
1012
1066
  ---@param mat OpenCV.Mat
1013
1067
  ---@param options OpenCV.RectangleOptions
1014
1068
  ---@return OpenCV.Mat|nil
1069
+ ---@example cv.rectangle(mat, options)
1015
1070
  function _OpenCV.rectangle(mat, options) return nil end
1016
1071
 
1017
1072
  --- circle
1018
1073
  ---@param mat OpenCV.Mat
1019
1074
  ---@param options OpenCV.CircleOptions
1020
1075
  ---@return OpenCV.Mat|nil
1076
+ ---@example cv.circle(mat, options)
1021
1077
  function _OpenCV.circle(mat, options) return nil end
1022
1078
 
1023
1079
  --- line
1024
1080
  ---@param mat OpenCV.Mat
1025
1081
  ---@param options OpenCV.LineOptions
1026
1082
  ---@return OpenCV.Mat|nil
1083
+ ---@example cv.line(mat, options)
1027
1084
  function _OpenCV.line(mat, options) return nil end
1028
1085
 
1029
1086
  --- putText
1030
1087
  ---@param mat OpenCV.Mat
1031
1088
  ---@param options OpenCV.PutTextOptions
1032
1089
  ---@return OpenCV.Mat|nil
1090
+ ---@example cv.putText(mat, options)
1033
1091
  function _OpenCV.putText(mat, options) return nil end
1034
1092
 
1035
1093
  --- fillPoly
1036
1094
  ---@param mat OpenCV.Mat
1037
1095
  ---@param options OpenCV.FillPolyOptions
1038
1096
  ---@return OpenCV.Mat|nil
1097
+ ---@example cv.fillPoly(mat, options)
1039
1098
  function _OpenCV.fillPoly(mat, options) return nil end
1040
1099
 
1041
1100
  --- polylines
1042
1101
  ---@param mat OpenCV.Mat
1043
1102
  ---@param options OpenCV.PolylinesOptions
1044
1103
  ---@return OpenCV.Mat|nil
1104
+ ---@example cv.polylines(mat, options)
1045
1105
  function _OpenCV.polylines(mat, options) return nil end
1046
1106
 
1047
1107
  --- drawContours
1048
1108
  ---@param mat OpenCV.Mat
1049
1109
  ---@param options OpenCV.DrawContoursOptions
1050
1110
  ---@return OpenCV.Mat|nil
1111
+ ---@example cv.drawContours(mat, options)
1051
1112
  function _OpenCV.drawContours(mat, options) return nil end
1052
1113
 
1053
1114
  --- matchTemplate
@@ -1055,6 +1116,7 @@ function _OpenCV.drawContours(mat, options) return nil end
1055
1116
  ---@param templ OpenCV.Mat
1056
1117
  ---@param options OpenCV.MatchTemplateOptions|nil
1057
1118
  ---@return OpenCV.Mat|nil
1119
+ ---@example cv.matchTemplate(image, templ, options)
1058
1120
  function _OpenCV.matchTemplate(image, templ, options) return nil end
1059
1121
 
1060
1122
  --- matchTemplateLoc
@@ -1062,188 +1124,220 @@ function _OpenCV.matchTemplate(image, templ, options) return nil end
1062
1124
  ---@param templ OpenCV.Mat
1063
1125
  ---@param options OpenCV.MatchTemplateOptions|nil
1064
1126
  ---@return OpenCV.MatchLocResult|nil
1127
+ ---@example cv.matchTemplateLoc(image, templ, options)
1065
1128
  function _OpenCV.matchTemplateLoc(image, templ, options) return nil end
1066
1129
 
1067
1130
  --- findContours
1068
1131
  ---@param mat OpenCV.Mat
1069
1132
  ---@param options OpenCV.FindContoursOptions|nil
1070
1133
  ---@return OpenCV.FindContoursResult|nil
1134
+ ---@example cv.findContours(mat, options)
1071
1135
  function _OpenCV.findContours(mat, options) return nil end
1072
1136
 
1073
1137
  --- boundingRect
1074
1138
  ---@param matOrPoints OpenCV.Mat|OpenCV.Point[]
1075
1139
  ---@return OpenCV.Rect|nil
1140
+ ---@example cv.boundingRect(matOrPoints)
1076
1141
  function _OpenCV.boundingRect(matOrPoints) return nil end
1077
1142
 
1078
1143
  --- minAreaRect
1079
1144
  ---@param points OpenCV.Point[]
1080
1145
  ---@return OpenCV.RotatedRect|nil
1146
+ ---@example cv.minAreaRect(points)
1081
1147
  function _OpenCV.minAreaRect(points) return nil end
1082
1148
 
1083
1149
  --- contourArea
1084
1150
  ---@param matOrPoints OpenCV.Mat|OpenCV.Point[]
1085
1151
  ---@param oriented boolean|nil
1086
1152
  ---@return number
1153
+ ---@example cv.contourArea(matOrPoints, oriented)
1087
1154
  function _OpenCV.contourArea(matOrPoints, oriented) return 0 end
1088
1155
 
1089
1156
  --- arcLength
1090
1157
  ---@param points OpenCV.Point[]
1091
1158
  ---@param closed boolean|nil
1092
1159
  ---@return number
1160
+ ---@example cv.arcLength(points, closed)
1093
1161
  function _OpenCV.arcLength(points, closed) return 0 end
1094
1162
 
1095
1163
  --- approxPolyDP
1096
1164
  ---@param points OpenCV.Point[]
1097
1165
  ---@param options OpenCV.ApproxPolyOptions
1098
1166
  ---@return OpenCV.Point[]|nil
1167
+ ---@example cv.approxPolyDP(points, options)
1099
1168
  function _OpenCV.approxPolyDP(points, options) return nil end
1100
1169
 
1101
1170
  --- erode
1102
1171
  ---@param mat OpenCV.Mat
1103
1172
  ---@param options OpenCV.MorphOptions
1104
1173
  ---@return OpenCV.Mat|nil
1174
+ ---@example cv.erode(mat, options)
1105
1175
  function _OpenCV.erode(mat, options) return nil end
1106
1176
 
1107
1177
  --- dilate
1108
1178
  ---@param mat OpenCV.Mat
1109
1179
  ---@param options OpenCV.MorphOptions
1110
1180
  ---@return OpenCV.Mat|nil
1181
+ ---@example cv.dilate(mat, options)
1111
1182
  function _OpenCV.dilate(mat, options) return nil end
1112
1183
 
1113
1184
  --- morphologyEx
1114
1185
  ---@param mat OpenCV.Mat
1115
1186
  ---@param options OpenCV.MorphologyExOptions
1116
1187
  ---@return OpenCV.Mat|nil
1188
+ ---@example cv.morphologyEx(mat, options)
1117
1189
  function _OpenCV.morphologyEx(mat, options) return nil end
1118
1190
 
1119
1191
  --- getStructuringElement
1120
1192
  ---@param options OpenCV.StructuringElementOptions
1121
1193
  ---@return OpenCV.Mat|nil
1194
+ ---@example cv.getStructuringElement(options)
1122
1195
  function _OpenCV.getStructuringElement(options) return nil end
1123
1196
 
1124
- --- SIFT
1197
+ --- SIFT 检测并计算描述子。
1125
1198
  ---@param mat OpenCV.Mat
1126
1199
  ---@param options OpenCV.SIFTOptions|nil
1127
1200
  ---@return OpenCV.FeatureResult|nil
1201
+ ---@example local feat = cv.SIFT(src, { nfeatures = 500 })
1128
1202
  function _OpenCV.SIFT(mat, options) return nil end
1129
1203
 
1130
- --- ORB
1204
+ --- ORB 检测并计算描述子(二进制描述子,匹配常用 NORM_HAMMING)
1131
1205
  ---@param mat OpenCV.Mat
1132
1206
  ---@param options OpenCV.ORBOptions|nil
1133
1207
  ---@return OpenCV.FeatureResult|nil
1208
+ ---@example cv.ORB(mat, options)
1134
1209
  function _OpenCV.ORB(mat, options) return nil end
1135
1210
 
1136
1211
  --- FAST,只接受 CV_8UC1。
1137
1212
  ---@param mat OpenCV.Mat
1138
1213
  ---@param options OpenCV.FASTOptions|nil
1139
1214
  ---@return OpenCV.FASTResult|nil
1215
+ ---@example cv.FAST(mat, options)
1140
1216
  function _OpenCV.FAST(mat, options) return nil end
1141
1217
 
1142
- --- BFMatcher
1218
+ --- 暴力匹配描述子,返回 DMatch 数组
1143
1219
  ---@param queryDescriptors OpenCV.Mat
1144
1220
  ---@param trainDescriptors OpenCV.Mat
1145
1221
  ---@param options OpenCV.MatcherOptions|nil
1146
1222
  ---@return OpenCV.DMatch[]|nil
1223
+ ---@example cv.BFMatcher(queryDescriptors, trainDescriptors, options)
1147
1224
  function _OpenCV.BFMatcher(queryDescriptors, trainDescriptors, options) return nil end
1148
1225
 
1149
- --- knnMatch
1226
+ --- K 近邻匹配;可设 ratio 做 Lowe 筛选
1150
1227
  ---@param queryDescriptors OpenCV.Mat
1151
1228
  ---@param trainDescriptors OpenCV.Mat
1152
1229
  ---@param options OpenCV.KnnMatchOptions|nil
1153
1230
  ---@return OpenCV.DMatch[][]|nil
1231
+ ---@example cv.knnMatch(queryDescriptors, trainDescriptors, options)
1154
1232
  function _OpenCV.knnMatch(queryDescriptors, trainDescriptors, options) return nil end
1155
1233
 
1156
- --- drawKeypoints
1234
+ --- 绘制关键点,返回新 Mat 句柄
1157
1235
  ---@param mat OpenCV.Mat
1158
1236
  ---@param options OpenCV.DrawKeypointsOptions
1159
1237
  ---@return OpenCV.Mat|nil
1238
+ ---@example cv.drawKeypoints(mat, options)
1160
1239
  function _OpenCV.drawKeypoints(mat, options) return nil end
1161
1240
 
1162
- --- drawMatches
1241
+ --- 绘制匹配连线
1163
1242
  ---@param mat OpenCV.Mat
1164
1243
  ---@param options OpenCV.DrawMatchesOptions
1165
1244
  ---@return OpenCV.Mat|nil
1245
+ ---@example cv.drawMatches(mat, options)
1166
1246
  function _OpenCV.drawMatches(mat, options) return nil end
1167
1247
 
1168
- --- findHomography
1248
+ --- 计算单应矩阵,返回 3x3 Mat 句柄
1169
1249
  ---@param options OpenCV.FindHomographyOptions
1170
1250
  ---@return OpenCV.Mat|nil
1251
+ ---@example cv.findHomography(options)
1171
1252
  function _OpenCV.findHomography(options) return nil end
1172
1253
 
1173
- --- warpPerspective
1254
+ --- 透视变换图像
1174
1255
  ---@param mat OpenCV.Mat
1175
1256
  ---@param options OpenCV.WarpPerspectiveOptions
1176
1257
  ---@return OpenCV.Mat|nil
1258
+ ---@example cv.warpPerspective(mat, options)
1177
1259
  function _OpenCV.warpPerspective(mat, options) return nil end
1178
1260
 
1179
- --- perspectiveTransform
1261
+ --- 用单应矩阵变换点集
1180
1262
  ---@param points OpenCV.Point[]
1181
1263
  ---@param options OpenCV.MatrixOptions
1182
1264
  ---@return OpenCV.Point[]|nil
1265
+ ---@example cv.perspectiveTransform(points, options)
1183
1266
  function _OpenCV.perspectiveTransform(points, options) return nil end
1184
1267
 
1185
- --- goodFeaturesToTrack
1268
+ --- Shi-Tomasi 角点
1186
1269
  ---@param mat OpenCV.Mat
1187
1270
  ---@param options OpenCV.GoodFeaturesOptions
1188
1271
  ---@return OpenCV.Point[]|nil
1272
+ ---@example cv.goodFeaturesToTrack(mat, options)
1189
1273
  function _OpenCV.goodFeaturesToTrack(mat, options) return nil end
1190
1274
 
1191
- --- HoughLinesP
1275
+ --- 概率霍夫直线,返回 {x1,y1,x2,y2}[]
1192
1276
  ---@param mat OpenCV.Mat
1193
1277
  ---@param options OpenCV.HoughLinesPOptions
1194
1278
  ---@return OpenCV.HoughLine[]|nil
1279
+ ---@example cv.HoughLinesP(mat, options)
1195
1280
  function _OpenCV.HoughLinesP(mat, options) return nil end
1196
1281
 
1197
- --- HoughCircles
1282
+ --- 霍夫圆,返回 {x,y,radius}[]
1198
1283
  ---@param mat OpenCV.Mat
1199
1284
  ---@param options OpenCV.HoughCirclesOptions
1200
1285
  ---@return OpenCV.HoughCircle[]|nil
1286
+ ---@example cv.HoughCircles(mat, options)
1201
1287
  function _OpenCV.HoughCircles(mat, options) return nil end
1202
1288
 
1203
- --- CLAHE
1289
+ --- CLAHE 对比度受限自适应直方图均衡
1204
1290
  ---@param mat OpenCV.Mat
1205
1291
  ---@param options OpenCV.CLAHEOptions|nil
1206
1292
  ---@return OpenCV.Mat|nil
1293
+ ---@example cv.CLAHE(mat, options)
1207
1294
  function _OpenCV.CLAHE(mat, options) return nil end
1208
1295
 
1209
1296
  --- pyrDown
1210
1297
  ---@param mat OpenCV.Mat
1211
1298
  ---@return OpenCV.Mat|nil
1299
+ ---@example cv.pyrDown(mat)
1212
1300
  function _OpenCV.pyrDown(mat) return nil end
1213
1301
 
1214
1302
  --- pyrUp
1215
1303
  ---@param mat OpenCV.Mat
1216
1304
  ---@return OpenCV.Mat|nil
1305
+ ---@example cv.pyrUp(mat)
1217
1306
  function _OpenCV.pyrUp(mat) return nil end
1218
1307
 
1219
1308
  --- Scharr
1220
1309
  ---@param mat OpenCV.Mat
1221
1310
  ---@param options OpenCV.ScharrOptions
1222
1311
  ---@return OpenCV.Mat|nil
1312
+ ---@example cv.Scharr(mat, options)
1223
1313
  function _OpenCV.Scharr(mat, options) return nil end
1224
1314
 
1225
1315
  --- boxFilter
1226
1316
  ---@param mat OpenCV.Mat
1227
1317
  ---@param options OpenCV.BoxFilterOptions
1228
1318
  ---@return OpenCV.Mat|nil
1319
+ ---@example cv.boxFilter(mat, options)
1229
1320
  function _OpenCV.boxFilter(mat, options) return nil end
1230
1321
 
1231
- --- floodFill
1322
+ --- 就地洪水填充,返回填充像素数与外接矩形
1232
1323
  ---@param mat OpenCV.Mat
1233
1324
  ---@param options OpenCV.FloodFillOptions
1234
1325
  ---@return OpenCV.FloodFillResult|nil
1326
+ ---@example cv.floodFill(mat, options)
1235
1327
  function _OpenCV.floodFill(mat, options) return nil end
1236
1328
 
1237
1329
  --- convexHull
1238
1330
  ---@param points OpenCV.Point[]
1239
1331
  ---@param options OpenCV.ConvexHullOptions|nil
1240
1332
  ---@return OpenCV.Point[]|nil
1333
+ ---@example cv.convexHull(points, options)
1241
1334
  function _OpenCV.convexHull(points, options) return nil end
1242
1335
 
1243
1336
  --- moments;Mat 输入必须是单通道栅格或 2 通道点集。
1244
1337
  ---@param matOrPoints OpenCV.Mat|OpenCV.Point[]
1245
1338
  ---@param options OpenCV.MomentsOptions|nil
1246
1339
  ---@return OpenCV.MomentsResult|nil
1340
+ ---@example cv.moments(matOrPoints, options)
1247
1341
  function _OpenCV.moments(matOrPoints, options) return nil end
1248
1342
 
1249
1343
  --- matchShapes
@@ -1251,90 +1345,106 @@ function _OpenCV.moments(matOrPoints, options) return nil end
1251
1345
  ---@param contour2 OpenCV.Mat|OpenCV.Point[]
1252
1346
  ---@param options OpenCV.MatchShapesOptions|nil
1253
1347
  ---@return number
1348
+ ---@example cv.matchShapes(contour1, contour2, options)
1254
1349
  function _OpenCV.matchShapes(contour1, contour2, options) return 0 end
1255
1350
 
1256
1351
  --- connectedComponentsWithStats
1257
1352
  ---@param mat OpenCV.Mat
1258
1353
  ---@return OpenCV.ConnectedComponentsResult|nil
1354
+ ---@example cv.connectedComponentsWithStats(mat)
1259
1355
  function _OpenCV.connectedComponentsWithStats(mat) return nil end
1260
1356
 
1261
1357
  --- distanceTransform
1262
1358
  ---@param mat OpenCV.Mat
1263
1359
  ---@param options OpenCV.DistanceTransformOptions|nil
1264
1360
  ---@return OpenCV.Mat|nil
1361
+ ---@example cv.distanceTransform(mat, options)
1265
1362
  function _OpenCV.distanceTransform(mat, options) return nil end
1266
1363
 
1267
1364
  --- add
1268
1365
  ---@param src1 OpenCV.Mat
1269
1366
  ---@param options OpenCV.ArithMaskOptions
1270
1367
  ---@return OpenCV.Mat|nil
1368
+ ---@example cv.add(src1, options)
1271
1369
  function _OpenCV.add(src1, options) return nil end
1272
1370
 
1273
1371
  --- subtract
1274
1372
  ---@param src1 OpenCV.Mat
1275
1373
  ---@param options OpenCV.ArithMaskOptions
1276
1374
  ---@return OpenCV.Mat|nil
1375
+ ---@example cv.subtract(src1, options)
1277
1376
  function _OpenCV.subtract(src1, options) return nil end
1278
1377
 
1279
1378
  --- multiply
1280
1379
  ---@param src1 OpenCV.Mat
1281
1380
  ---@param options OpenCV.ArithScaleOptions
1282
1381
  ---@return OpenCV.Mat|nil
1382
+ ---@example cv.multiply(src1, options)
1283
1383
  function _OpenCV.multiply(src1, options) return nil end
1284
1384
 
1285
1385
  --- divide
1286
1386
  ---@param src1 OpenCV.Mat
1287
1387
  ---@param options OpenCV.ArithScaleOptions
1288
1388
  ---@return OpenCV.Mat|nil
1389
+ ---@example cv.divide(src1, options)
1289
1390
  function _OpenCV.divide(src1, options) return nil end
1290
1391
 
1291
1392
  --- normalize
1292
1393
  ---@param mat OpenCV.Mat
1293
1394
  ---@param options OpenCV.NormalizeOptions|nil
1294
1395
  ---@return OpenCV.Mat|nil
1396
+ ---@example cv.normalize(mat, options)
1295
1397
  function _OpenCV.normalize(mat, options) return nil end
1296
1398
 
1297
1399
  --- norm
1298
1400
  ---@param mat OpenCV.Mat
1299
1401
  ---@param options OpenCV.NormOptions|nil
1300
1402
  ---@return number
1403
+ ---@example cv.norm(mat, options)
1301
1404
  function _OpenCV.norm(mat, options) return 0 end
1302
1405
 
1303
1406
  --- meanStdDev
1304
1407
  ---@param mat OpenCV.Mat
1305
1408
  ---@param options OpenCV.MaskOptions|nil
1306
1409
  ---@return OpenCV.MeanStdDevResult|nil
1410
+ ---@example cv.meanStdDev(mat, options)
1307
1411
  function _OpenCV.meanStdDev(mat, options) return nil end
1308
1412
 
1309
1413
  --- findNonZero
1310
1414
  ---@param mat OpenCV.Mat
1311
1415
  ---@return OpenCV.Point[]|nil
1416
+ ---@example cv.findNonZero(mat)
1312
1417
  function _OpenCV.findNonZero(mat) return nil end
1313
1418
 
1314
1419
  --- hconcat
1315
1420
  ---@param mats OpenCV.Mat[]
1316
1421
  ---@return OpenCV.Mat|nil
1422
+ ---@example cv.hconcat(mats)
1317
1423
  function _OpenCV.hconcat(mats) return nil end
1318
1424
 
1319
1425
  --- vconcat
1320
1426
  ---@param mats OpenCV.Mat[]
1321
1427
  ---@return OpenCV.Mat|nil
1428
+ ---@example cv.vconcat(mats)
1322
1429
  function _OpenCV.vconcat(mats) return nil end
1323
1430
 
1324
1431
  --- getPerspectiveTransform
1325
1432
  ---@param options OpenCV.PointPairOptions
1326
1433
  ---@return OpenCV.Mat|nil
1434
+ ---@example cv.getPerspectiveTransform(options)
1327
1435
  function _OpenCV.getPerspectiveTransform(options) return nil end
1328
1436
 
1329
1437
  --- getAffineTransform
1330
1438
  ---@param options OpenCV.PointPairOptions
1331
1439
  ---@return OpenCV.Mat|nil
1440
+ ---@example cv.getAffineTransform(options)
1332
1441
  function _OpenCV.getAffineTransform(options) return nil end
1333
1442
 
1334
1443
  --- FlannBasedMatcher
1335
1444
  ---@param queryDescriptors OpenCV.Mat
1336
1445
  ---@param trainDescriptors OpenCV.Mat
1337
1446
  ---@return OpenCV.DMatch[]|nil
1447
+ ---@example cv.FlannBasedMatcher(queryDescriptors, trainDescriptors)
1338
1448
  function _OpenCV.FlannBasedMatcher(queryDescriptors, trainDescriptors) return nil end
1339
1449
 
1340
1450
  --- flannKnnMatch
@@ -1342,12 +1452,14 @@ function _OpenCV.FlannBasedMatcher(queryDescriptors, trainDescriptors) return ni
1342
1452
  ---@param trainDescriptors OpenCV.Mat
1343
1453
  ---@param options OpenCV.FlannKnnOptions|nil
1344
1454
  ---@return OpenCV.DMatch[][]|nil
1455
+ ---@example cv.flannKnnMatch(queryDescriptors, trainDescriptors, options)
1345
1456
  function _OpenCV.flannKnnMatch(queryDescriptors, trainDescriptors, options) return nil end
1346
1457
 
1347
1458
  --- calcHist
1348
1459
  ---@param mat OpenCV.Mat
1349
1460
  ---@param options OpenCV.CalcHistOptions|nil
1350
1461
  ---@return OpenCV.Mat|nil
1462
+ ---@example cv.calcHist(mat, options)
1351
1463
  function _OpenCV.calcHist(mat, options) return nil end
1352
1464
 
1353
1465
  --- compareHist
@@ -1355,203 +1467,239 @@ function _OpenCV.calcHist(mat, options) return nil end
1355
1467
  ---@param H2 OpenCV.Mat
1356
1468
  ---@param options OpenCV.MethodOptions|nil
1357
1469
  ---@return number
1470
+ ---@example cv.compareHist(H1, H2, options)
1358
1471
  function _OpenCV.compareHist(H1, H2, options) return 0 end
1359
1472
 
1360
1473
  --- boxPoints
1361
1474
  ---@param options OpenCV.BoxPointsOptions
1362
1475
  ---@return OpenCV.Point[]|nil
1476
+ ---@example cv.boxPoints(options)
1363
1477
  function _OpenCV.boxPoints(options) return nil end
1364
1478
 
1365
1479
  --- pointPolygonTest
1366
1480
  ---@param contour OpenCV.Point[]
1367
1481
  ---@param ptOrOptions OpenCV.Point|OpenCV.PointPolygonTestOptions
1368
1482
  ---@return number
1483
+ ---@example cv.pointPolygonTest(contour, ptOrOptions)
1369
1484
  function _OpenCV.pointPolygonTest(contour, ptOrOptions) return 0 end
1370
1485
 
1371
1486
  --- minEnclosingCircle
1372
1487
  ---@param points OpenCV.Point[]
1373
1488
  ---@return OpenCV.MinEnclosingCircleResult|nil
1489
+ ---@example cv.minEnclosingCircle(points)
1374
1490
  function _OpenCV.minEnclosingCircle(points) return nil end
1375
1491
 
1376
- --- fitEllipse
1492
+ --- 椭圆拟合,至少 5 个点;可用于圆形/椭圆控件轮廓
1377
1493
  ---@param points OpenCV.Point[]
1378
1494
  ---@return OpenCV.RotatedRect|nil
1495
+ ---@example cv.fitEllipse(points)
1379
1496
  function _OpenCV.fitEllipse(points) return nil end
1380
1497
 
1381
1498
  --- filter2D
1382
1499
  ---@param mat OpenCV.Mat
1383
1500
  ---@param options OpenCV.Filter2DOptions
1384
1501
  ---@return OpenCV.Mat|nil
1502
+ ---@example cv.filter2D(mat, options)
1385
1503
  function _OpenCV.filter2D(mat, options) return nil end
1386
1504
 
1387
1505
  --- ellipse
1388
1506
  ---@param mat OpenCV.Mat
1389
1507
  ---@param options OpenCV.EllipseOptions
1390
1508
  ---@return OpenCV.Mat|nil
1509
+ ---@example cv.ellipse(mat, options)
1391
1510
  function _OpenCV.ellipse(mat, options) return nil end
1392
1511
 
1393
1512
  --- getTextSize
1394
1513
  ---@param options OpenCV.GetTextSizeOptions
1395
1514
  ---@return OpenCV.TextSizeResult|nil
1515
+ ---@example cv.getTextSize(options)
1396
1516
  function _OpenCV.getTextSize(options) return nil end
1397
1517
 
1398
- --- encodeQRCode
1518
+ --- 编码二维码为可显示/可识别的 BGR Mat(已放大并加静区,可直接 detectQRCode)
1399
1519
  ---@param text string
1400
1520
  ---@return OpenCV.Mat|nil
1521
+ ---@example cv.encodeQRCode(text)
1401
1522
  function _OpenCV.encodeQRCode(text) return nil end
1402
1523
 
1403
1524
  --- detectQRCode
1404
1525
  ---@param mat OpenCV.Mat
1405
1526
  ---@return OpenCV.QRCodeResult|nil
1527
+ ---@example cv.detectQRCode(mat)
1406
1528
  function _OpenCV.detectQRCode(mat) return nil end
1407
1529
 
1408
1530
  --- detectBarcode
1409
1531
  ---@param mat OpenCV.Mat
1410
1532
  ---@return OpenCV.BarcodeResult|nil
1533
+ ---@example cv.detectBarcode(mat)
1411
1534
  function _OpenCV.detectBarcode(mat) return nil end
1412
1535
 
1413
1536
  --- inpaint
1414
1537
  ---@param mat OpenCV.Mat
1415
1538
  ---@param options OpenCV.InpaintOptions
1416
1539
  ---@return OpenCV.Mat|nil
1540
+ ---@example cv.inpaint(mat, options)
1417
1541
  function _OpenCV.inpaint(mat, options) return nil end
1418
1542
 
1419
1543
  --- fastNlMeansDenoising
1420
1544
  ---@param mat OpenCV.Mat
1421
1545
  ---@param options OpenCV.DenoiseOptions|nil
1422
1546
  ---@return OpenCV.Mat|nil
1547
+ ---@example cv.fastNlMeansDenoising(mat, options)
1423
1548
  function _OpenCV.fastNlMeansDenoising(mat, options) return nil end
1424
1549
 
1425
1550
  --- fastNlMeansDenoisingColored
1426
1551
  ---@param mat OpenCV.Mat
1427
1552
  ---@param options OpenCV.DenoiseColoredOptions|nil
1428
1553
  ---@return OpenCV.Mat|nil
1554
+ ---@example cv.fastNlMeansDenoisingColored(mat, options)
1429
1555
  function _OpenCV.fastNlMeansDenoisingColored(mat, options) return nil end
1430
1556
 
1431
1557
  --- LUT
1432
1558
  ---@param mat OpenCV.Mat
1433
1559
  ---@param options OpenCV.LUTOptions
1434
1560
  ---@return OpenCV.Mat|nil
1561
+ ---@example cv.LUT(mat, options)
1435
1562
  function _OpenCV.LUT(mat, options) return nil end
1436
1563
 
1437
1564
  --- compare
1438
1565
  ---@param src1 OpenCV.Mat
1439
1566
  ---@param options OpenCV.CompareOptions
1440
1567
  ---@return OpenCV.Mat|nil
1568
+ ---@example cv.compare(src1, options)
1441
1569
  function _OpenCV.compare(src1, options) return nil end
1442
1570
 
1443
1571
  --- min
1444
1572
  ---@param src1 OpenCV.Mat
1445
1573
  ---@param options OpenCV.Src2Options
1446
1574
  ---@return OpenCV.Mat|nil
1575
+ ---@example cv.min(src1, options)
1447
1576
  function _OpenCV.min(src1, options) return nil end
1448
1577
 
1449
1578
  --- max
1450
1579
  ---@param src1 OpenCV.Mat
1451
1580
  ---@param options OpenCV.Src2Options
1452
1581
  ---@return OpenCV.Mat|nil
1582
+ ---@example cv.max(src1, options)
1453
1583
  function _OpenCV.max(src1, options) return nil end
1454
1584
 
1455
1585
  --- extractChannel
1456
1586
  ---@param mat OpenCV.Mat
1457
1587
  ---@param options OpenCV.ExtractChannelOptions
1458
1588
  ---@return OpenCV.Mat|nil
1589
+ ---@example cv.extractChannel(mat, options)
1459
1590
  function _OpenCV.extractChannel(mat, options) return nil end
1460
1591
 
1461
1592
  --- sum
1462
1593
  ---@param mat OpenCV.Mat
1463
1594
  ---@return number[]|nil
1595
+ ---@example cv.sum(mat)
1464
1596
  function _OpenCV.sum(mat) return nil end
1465
1597
 
1466
1598
  --- invertAffineTransform
1467
1599
  ---@param M OpenCV.Mat
1468
1600
  ---@return OpenCV.Mat|nil
1601
+ ---@example cv.invertAffineTransform(M)
1469
1602
  function _OpenCV.invertAffineTransform(M) return nil end
1470
1603
 
1471
1604
  --- getRectSubPix
1472
1605
  ---@param mat OpenCV.Mat
1473
1606
  ---@param options OpenCV.GetRectSubPixOptions
1474
1607
  ---@return OpenCV.Mat|nil
1608
+ ---@example cv.getRectSubPix(mat, options)
1475
1609
  function _OpenCV.getRectSubPix(mat, options) return nil end
1476
1610
 
1477
- --- phaseCorrelate
1611
+ --- 相位相关估计两图位移(如滚动/拖拽前后帧)
1478
1612
  ---@param src1 OpenCV.Mat
1479
1613
  ---@param options OpenCV.PhaseCorrelateOptions
1480
1614
  ---@return OpenCV.PhaseCorrelateResult|nil
1615
+ ---@example cv.phaseCorrelate(src1, options)
1481
1616
  function _OpenCV.phaseCorrelate(src1, options) return nil end
1482
1617
 
1483
1618
  --- cornerHarris
1484
1619
  ---@param mat OpenCV.Mat
1485
1620
  ---@param options OpenCV.CornerHarrisOptions|nil
1486
1621
  ---@return OpenCV.Mat|nil
1622
+ ---@example cv.cornerHarris(mat, options)
1487
1623
  function _OpenCV.cornerHarris(mat, options) return nil end
1488
1624
 
1489
1625
  --- cornerSubPix
1490
1626
  ---@param mat OpenCV.Mat
1491
1627
  ---@param options OpenCV.CornerSubPixOptions
1492
1628
  ---@return OpenCV.Point[]|nil
1629
+ ---@example cv.cornerSubPix(mat, options)
1493
1630
  function _OpenCV.cornerSubPix(mat, options) return nil end
1494
1631
 
1495
1632
  --- calcBackProject
1496
1633
  ---@param mat OpenCV.Mat
1497
1634
  ---@param options OpenCV.CalcBackProjectOptions
1498
1635
  ---@return OpenCV.Mat|nil
1636
+ ---@example cv.calcBackProject(mat, options)
1499
1637
  function _OpenCV.calcBackProject(mat, options) return nil end
1500
1638
 
1501
1639
  --- HuMoments
1502
1640
  ---@param contourOrMoments OpenCV.Point[]|OpenCV.MomentsResult
1503
1641
  ---@return number[]|nil
1642
+ ---@example cv.HuMoments(contourOrMoments)
1504
1643
  function _OpenCV.HuMoments(contourOrMoments) return nil end
1505
1644
 
1506
1645
  --- connectedComponents
1507
1646
  ---@param mat OpenCV.Mat
1508
1647
  ---@param options OpenCV.ConnectedComponentsOptions|nil
1509
1648
  ---@return OpenCV.ConnectedComponentsCountResult|nil
1649
+ ---@example cv.connectedComponents(mat, options)
1510
1650
  function _OpenCV.connectedComponents(mat, options) return nil end
1511
1651
 
1512
1652
  --- convexityDefects
1513
1653
  ---@param contour OpenCV.Point[]
1514
1654
  ---@param options OpenCV.ConvexityDefectsOptions
1515
1655
  ---@return OpenCV.ConvexityDefect[]|nil
1656
+ ---@example cv.convexityDefects(contour, options)
1516
1657
  function _OpenCV.convexityDefects(contour, options) return nil end
1517
1658
 
1518
1659
  --- isContourConvex
1519
1660
  ---@param contour OpenCV.Point[]
1520
1661
  ---@return boolean
1662
+ ---@example cv.isContourConvex(contour)
1521
1663
  function _OpenCV.isContourConvex(contour) return false end
1522
1664
 
1523
1665
  --- fitLine
1524
1666
  ---@param points OpenCV.Point[]
1525
1667
  ---@param options OpenCV.FitLineOptions|nil
1526
1668
  ---@return number[]|nil
1669
+ ---@example cv.fitLine(points, options)
1527
1670
  function _OpenCV.fitLine(points, options) return nil end
1528
1671
 
1529
- --- drawMarker
1672
+ --- 就地绘制标记点,返回原句柄
1530
1673
  ---@param mat OpenCV.Mat
1531
1674
  ---@param options OpenCV.DrawMarkerOptions
1532
1675
  ---@return OpenCV.Mat|nil
1676
+ ---@example cv.drawMarker(mat, options)
1533
1677
  function _OpenCV.drawMarker(mat, options) return nil end
1534
1678
 
1535
- --- arrowedLine
1679
+ --- 就地画箭头线,返回原句柄
1536
1680
  ---@param mat OpenCV.Mat
1537
1681
  ---@param options OpenCV.ArrowedLineOptions
1538
1682
  ---@return OpenCV.Mat|nil
1683
+ ---@example cv.arrowedLine(mat, options)
1539
1684
  function _OpenCV.arrowedLine(mat, options) return nil end
1540
1685
 
1541
- --- fillConvexPoly
1686
+ --- 就地填充凸多边形,返回原句柄
1542
1687
  ---@param mat OpenCV.Mat
1543
1688
  ---@param options OpenCV.FillConvexPolyOptions
1544
1689
  ---@return OpenCV.Mat|nil
1690
+ ---@example cv.fillConvexPoly(mat, options)
1545
1691
  function _OpenCV.fillConvexPoly(mat, options) return nil end
1546
1692
 
1547
1693
  --- estimateAffine2D
1548
1694
  ---@param options OpenCV.EstimateAffineOptions
1549
1695
  ---@return OpenCV.Mat|nil
1696
+ ---@example cv.estimateAffine2D(options)
1550
1697
  function _OpenCV.estimateAffine2D(options) return nil end
1551
1698
 
1552
- --- estimateAffinePartial2D
1699
+ --- 相似变换(平移+旋转+等比缩放,无剪切),点对齐/跨分辨率匹配常用
1553
1700
  ---@param options OpenCV.EstimateAffineOptions
1554
1701
  ---@return OpenCV.Mat|nil
1702
+ ---@example cv.estimateAffinePartial2D(options)
1555
1703
  function _OpenCV.estimateAffinePartial2D(options) return nil end
1556
1704
 
1557
1705
  ---@type OpenCV