1
# -*- coding: utf-8 -*-
2
import os, numpy, scipy, hashlib
3
from pycvf.core import genericnode
4
from pycvfext.image.datatypes import image
5
import Image, ImageDraw
9
def __init__(self,*args,**kwargs):
11
def set_model_node(self,model):
13
while (self.model_node.parent_node!=None):
14
self.model_node=self.model_node.parent_node
15
def on_model_destroy(self,model):
17
def process(self,cpl):
19
oimg=numpy.require(oimg,numpy.uint8,'C')
20
I=Image.fromarray(oimg)
21
draw = ImageDraw.Draw(I)
30
x=max(0,min(x,oimg.shape[1]))
31
y=max(0,min(y,oimg.shape[0]))
32
X=max(0,min(X,oimg.shape[1]))
33
Y=max(0,min(Y,oimg.shape[0]))
35
zc=(z[0]*255,z[1]*255,z[2]*255)
37
draw.ellipse( ((x,y),(X,Y)), outline=zc,fill=zc)
43
Node=genericnode.pycvf_node_class(None,image.Datatype())(KPDraw)