Przeglądaj źródła

fix pyi warnings

pikastech 3 lat temu
rodzic
commit
083e6d1e53

+ 17 - 13
package/PikaCV/PikaCV.pyi

@@ -70,18 +70,19 @@ class Image:
     def size(self) -> int:
     def size(self) -> int:
         """Get the size of the image by bytes"""
         """Get the size of the image by bytes"""
 
 
-    def add(self,image:Imgae):
+    def add(self, image: Image):
         """Add two images"""
         """Add two images"""
 
 
-    def minus(self,image:Imgae):
+    def minus(self, image: Image):
         """Minus two images"""
         """Minus two images"""
 
 
-    def split(self) -> List:
+    def split(self) -> list:
         """Split one 3-channels image to three 1-channel"""
         """Split one 3-channels image to three 1-channel"""
 
 
-    def merge(self,R:Image,G:Image,B:Image):
+    def merge(self, R: Image, G: Image, B: Image):
         """Merge three 1-channel image to 3-channels"""
         """Merge three 1-channel image to 3-channels"""
 
 
+
 class Converter:
 class Converter:
     """The Converter class is used to 
     """The Converter class is used to 
     convert an image from one format to another."""
     convert an image from one format to another."""
@@ -105,7 +106,7 @@ class Converter:
     @staticmethod
     @staticmethod
     def toBGR888(image: Image):
     def toBGR888(image: Image):
         """Convert the image to BGR888"""
         """Convert the image to BGR888"""
-    def converter(image:Image,format:int):
+    def converter(image: Image, format: int):
         """ 
         """ 
         2:RGB888
         2:RGB888
         3:BGR888
         3:BGR888
@@ -114,13 +115,14 @@ class Converter:
         6:BMP
         6:BMP
         """
         """
 
 
+
 class Transforms:
 class Transforms:
     """The transforms class is used to 
     """The transforms class is used to 
     supply the rotate, flip, and crop operation for an image."""
     supply the rotate, flip, and crop operation for an image."""
     @staticmethod
     @staticmethod
     def rotateDown(image: Image):
     def rotateDown(image: Image):
         """Rotate the image """
         """Rotate the image """
-    def threshold(image:Image,thre:int,maxval:int,thresholdType:int):
+    def threshold(image: Image, thre: int, maxval: int, thresholdType: int):
         """
         """
         0:THRESH_BINARY 
         0:THRESH_BINARY 
         1:THRESH_BINARY_INV
         1:THRESH_BINARY_INV
@@ -129,20 +131,20 @@ class Transforms:
         4:THRESH_TOZERO_INV
         4:THRESH_TOZERO_INV
         5:OTSU
         5:OTSU
         """
         """
-    def setROI(image:Image,x:int,y:int,w:int,h:int) :
+    def setROI(image: Image, x: int, y: int, w: int, h: int):
         """xywh"""
         """xywh"""
-    def getOTSUthre(image:Image) -> int:
+    def getOTSUthre(image: Image) -> int:
         """return otsu threshold"""
         """return otsu threshold"""
-    def setOTSU(image:Image):
+    def setOTSU(image: Image):
         """otsu"""
         """otsu"""
-    def resize(image:Image,x:int,y:int,resizeType:int):
+    def resize(image: Image, x: int, y: int, resizeType: int):
         """
         """
         resize image
         resize image
         0:NEAREST
         0:NEAREST
         TODO:
         TODO:
         1:BILINEAR
         1:BILINEAR
         """
         """
-    def adaptiveThreshold(image:Image,maxval:int,subsize:int,c:int,method:int):
+    def adaptiveThreshold(image: Image, maxval: int, subsize: int, c: int, method: int):
         """
         """
         AdaptiveThreshold
         AdaptiveThreshold
         method
         method
@@ -150,10 +152,12 @@ class Transforms:
         1:medianFilter
         1:medianFilter
         #TODO 2:gaussianFilter
         #TODO 2:gaussianFilter
         """
         """
+
+
 class Filter:
 class Filter:
     """The Filter class is used to 
     """The Filter class is used to 
     supply some Image Filtering Algorithms ."""
     supply some Image Filtering Algorithms ."""
-    def meanFilter(image:Image,ksizex:int,ksizey:int):
+    def meanFilter(image: Image, ksizex: int, ksizey: int):
         """ mean filter,ksize is odd"""
         """ mean filter,ksize is odd"""
-    def medianFilter(image:Image):
+    def medianFilter(image: Image):
         """ median filter,kernel size is 3*3"""
         """ median filter,kernel size is 3*3"""

+ 1 - 1
package/PikaCV/PikaCV_Image.c

@@ -406,7 +406,7 @@ PikaObj* PikaCV_Image_split(PikaObj* self) {
         PikaObj* img = newNormalObj(New_PikaCV_Image);
         PikaObj* img = newNormalObj(New_PikaCV_Image);
         PikaCV_Image___init__(img);
         PikaCV_Image___init__(img);
         PikaCV_Image_loadGray(img, src->width, src->height, RGB[i]);
         PikaCV_Image_loadGray(img, src->width, src->height, RGB[i]);
-        Arg* token_arg = arg_newPtr(ARG_TYPE_OBJECT, img);
+        Arg* token_arg = arg_newObj(img);
         /* 添加到 list 对象 */
         /* 添加到 list 对象 */
         PikaStdData_List_append(list, token_arg);
         PikaStdData_List_append(list, token_arg);
         /* 销毁 arg */
         /* 销毁 arg */

+ 17 - 13
port/linux/package/pikascript/PikaCV.pyi

@@ -70,18 +70,19 @@ class Image:
     def size(self) -> int:
     def size(self) -> int:
         """Get the size of the image by bytes"""
         """Get the size of the image by bytes"""
 
 
-    def add(self,image:Imgae):
+    def add(self, image: Image):
         """Add two images"""
         """Add two images"""
 
 
-    def minus(self,image:Imgae):
+    def minus(self, image: Image):
         """Minus two images"""
         """Minus two images"""
 
 
-    def split(self) -> List:
+    def split(self) -> list:
         """Split one 3-channels image to three 1-channel"""
         """Split one 3-channels image to three 1-channel"""
 
 
-    def merge(self,R:Image,G:Image,B:Image):
+    def merge(self, R: Image, G: Image, B: Image):
         """Merge three 1-channel image to 3-channels"""
         """Merge three 1-channel image to 3-channels"""
 
 
+
 class Converter:
 class Converter:
     """The Converter class is used to 
     """The Converter class is used to 
     convert an image from one format to another."""
     convert an image from one format to another."""
@@ -105,7 +106,7 @@ class Converter:
     @staticmethod
     @staticmethod
     def toBGR888(image: Image):
     def toBGR888(image: Image):
         """Convert the image to BGR888"""
         """Convert the image to BGR888"""
-    def converter(image:Image,format:int):
+    def converter(image: Image, format: int):
         """ 
         """ 
         2:RGB888
         2:RGB888
         3:BGR888
         3:BGR888
@@ -114,13 +115,14 @@ class Converter:
         6:BMP
         6:BMP
         """
         """
 
 
+
 class Transforms:
 class Transforms:
     """The transforms class is used to 
     """The transforms class is used to 
     supply the rotate, flip, and crop operation for an image."""
     supply the rotate, flip, and crop operation for an image."""
     @staticmethod
     @staticmethod
     def rotateDown(image: Image):
     def rotateDown(image: Image):
         """Rotate the image """
         """Rotate the image """
-    def threshold(image:Image,thre:int,maxval:int,thresholdType:int):
+    def threshold(image: Image, thre: int, maxval: int, thresholdType: int):
         """
         """
         0:THRESH_BINARY 
         0:THRESH_BINARY 
         1:THRESH_BINARY_INV
         1:THRESH_BINARY_INV
@@ -129,20 +131,20 @@ class Transforms:
         4:THRESH_TOZERO_INV
         4:THRESH_TOZERO_INV
         5:OTSU
         5:OTSU
         """
         """
-    def setROI(image:Image,x:int,y:int,w:int,h:int) :
+    def setROI(image: Image, x: int, y: int, w: int, h: int):
         """xywh"""
         """xywh"""
-    def getOTSUthre(image:Image) -> int:
+    def getOTSUthre(image: Image) -> int:
         """return otsu threshold"""
         """return otsu threshold"""
-    def setOTSU(image:Image):
+    def setOTSU(image: Image):
         """otsu"""
         """otsu"""
-    def resize(image:Image,x:int,y:int,resizeType:int):
+    def resize(image: Image, x: int, y: int, resizeType: int):
         """
         """
         resize image
         resize image
         0:NEAREST
         0:NEAREST
         TODO:
         TODO:
         1:BILINEAR
         1:BILINEAR
         """
         """
-    def adaptiveThreshold(image:Image,maxval:int,subsize:int,c:int,method:int):
+    def adaptiveThreshold(image: Image, maxval: int, subsize: int, c: int, method: int):
         """
         """
         AdaptiveThreshold
         AdaptiveThreshold
         method
         method
@@ -150,10 +152,12 @@ class Transforms:
         1:medianFilter
         1:medianFilter
         #TODO 2:gaussianFilter
         #TODO 2:gaussianFilter
         """
         """
+
+
 class Filter:
 class Filter:
     """The Filter class is used to 
     """The Filter class is used to 
     supply some Image Filtering Algorithms ."""
     supply some Image Filtering Algorithms ."""
-    def meanFilter(image:Image,ksizex:int,ksizey:int):
+    def meanFilter(image: Image, ksizex: int, ksizey: int):
         """ mean filter,ksize is odd"""
         """ mean filter,ksize is odd"""
-    def medianFilter(image:Image):
+    def medianFilter(image: Image):
         """ median filter,kernel size is 3*3"""
         """ median filter,kernel size is 3*3"""