pikastech 3 лет назад
Родитель
Сommit
083e6d1e53
3 измененных файлов с 35 добавлено и 27 удалено
  1. 17 13
      package/PikaCV/PikaCV.pyi
  2. 1 1
      package/PikaCV/PikaCV_Image.c
  3. 17 13
      port/linux/package/pikascript/PikaCV.pyi

+ 17 - 13
package/PikaCV/PikaCV.pyi

@@ -70,18 +70,19 @@ class Image:
     def size(self) -> int:
         """Get the size of the image by bytes"""
 
-    def add(self,image:Imgae):
+    def add(self, image: Image):
         """Add two images"""
 
-    def minus(self,image:Imgae):
+    def minus(self, image: Image):
         """Minus two images"""
 
-    def split(self) -> List:
+    def split(self) -> list:
         """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"""
 
+
 class Converter:
     """The Converter class is used to 
     convert an image from one format to another."""
@@ -105,7 +106,7 @@ class Converter:
     @staticmethod
     def toBGR888(image: Image):
         """Convert the image to BGR888"""
-    def converter(image:Image,format:int):
+    def converter(image: Image, format: int):
         """ 
         2:RGB888
         3:BGR888
@@ -114,13 +115,14 @@ class Converter:
         6:BMP
         """
 
+
 class Transforms:
     """The transforms class is used to 
     supply the rotate, flip, and crop operation for an image."""
     @staticmethod
     def rotateDown(image: 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 
         1:THRESH_BINARY_INV
@@ -129,20 +131,20 @@ class Transforms:
         4:THRESH_TOZERO_INV
         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"""
-    def getOTSUthre(image:Image) -> int:
+    def getOTSUthre(image: Image) -> int:
         """return otsu threshold"""
-    def setOTSU(image:Image):
+    def setOTSU(image: Image):
         """otsu"""
-    def resize(image:Image,x:int,y:int,resizeType:int):
+    def resize(image: Image, x: int, y: int, resizeType: int):
         """
         resize image
         0:NEAREST
         TODO:
         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
         method
@@ -150,10 +152,12 @@ class Transforms:
         1:medianFilter
         #TODO 2:gaussianFilter
         """
+
+
 class Filter:
     """The Filter class is used to 
     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"""
-    def medianFilter(image:Image):
+    def medianFilter(image: Image):
         """ 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);
         PikaCV_Image___init__(img);
         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 对象 */
         PikaStdData_List_append(list, token_arg);
         /* 销毁 arg */

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

@@ -70,18 +70,19 @@ class Image:
     def size(self) -> int:
         """Get the size of the image by bytes"""
 
-    def add(self,image:Imgae):
+    def add(self, image: Image):
         """Add two images"""
 
-    def minus(self,image:Imgae):
+    def minus(self, image: Image):
         """Minus two images"""
 
-    def split(self) -> List:
+    def split(self) -> list:
         """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"""
 
+
 class Converter:
     """The Converter class is used to 
     convert an image from one format to another."""
@@ -105,7 +106,7 @@ class Converter:
     @staticmethod
     def toBGR888(image: Image):
         """Convert the image to BGR888"""
-    def converter(image:Image,format:int):
+    def converter(image: Image, format: int):
         """ 
         2:RGB888
         3:BGR888
@@ -114,13 +115,14 @@ class Converter:
         6:BMP
         """
 
+
 class Transforms:
     """The transforms class is used to 
     supply the rotate, flip, and crop operation for an image."""
     @staticmethod
     def rotateDown(image: 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 
         1:THRESH_BINARY_INV
@@ -129,20 +131,20 @@ class Transforms:
         4:THRESH_TOZERO_INV
         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"""
-    def getOTSUthre(image:Image) -> int:
+    def getOTSUthre(image: Image) -> int:
         """return otsu threshold"""
-    def setOTSU(image:Image):
+    def setOTSU(image: Image):
         """otsu"""
-    def resize(image:Image,x:int,y:int,resizeType:int):
+    def resize(image: Image, x: int, y: int, resizeType: int):
         """
         resize image
         0:NEAREST
         TODO:
         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
         method
@@ -150,10 +152,12 @@ class Transforms:
         1:medianFilter
         #TODO 2:gaussianFilter
         """
+
+
 class Filter:
     """The Filter class is used to 
     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"""
-    def medianFilter(image:Image):
+    def medianFilter(image: Image):
         """ median filter,kernel size is 3*3"""