import clr
clr.AddReference("OpenCV.Net")
from OpenCV.Net import CV, Mat
from System import Array, Single, Type
def getOutputType():
return Type.GetType("System.Single[,]")
def process(value):
output = Array.CreateInstance(Single, value.Height, value.Width)
header = Mat.CreateMatHeader(output)
CV.Convert(value, header)
header.Dispose()
return outputHi again, I try the Python Transform alone with the Load Image (the image I am loading is a 100x100 pixels .png image I created in Illustrator with a particular pixel size), a Timer and a Combine Latest and it seems to work (the output is a window with "System.Single[,]" inside. However, when I try to send the output of the Python Transform to the externalized Kernel of the Filter2D I cannot save the workflow and it gives the following error. Do you know what am I doing wrong? It seems to me that I cannot send the output of the Python Transform to the Kernel as easily as I would expect. Do I need to define something in the Kernel? Thank you again!
import clr
clr.AddReference("OpenCV.Net")
from OpenCV.Net import *
@returns(IplImage)
def process(value):
image = value.Item1
kernel = value.Item2
output = IplImage(image.Size, image.Depth, image.Channels)
CV.Filter2D(image, output, kernel, Point(-1, -1))
return output