# How to display coordinate system inside my image?

Anonymous

I'm currently doing positioning. But i don't how to display coordinate system inside my image.How to do it? Hope can have any answere. Thx..

edit retag close merge delete

can you be more specific? How do you want to do it? Are you just worried about texts?

( 2014-03-04 08:48:00 -0500 )edit

Sort by » oldest newest most voted

about what exactly you want to get the coordinates? blob?, face?, and put your code so we can help! if blobs you can use blobs.coordinates()

example:

#  -*- coding: utf-8 -*-   # permite açentuações

from SimpleCV import * #importa todo meu FrameWork

__author__ = 'Rodrigo Gomes'
__name__ = "Bom_de_Mira"

cam = Camera()    # instanciacao da camera.
temp = Image('/home/rodrigo/Imagens/2.png').resize(190, 140)  #caminho para a Imagem

while True:
img = cam.getImage().flipHorizontal()  #captura os frames
mascara = img.hueDistance(color=Color.GREEN,minsaturation=150,minvalue=200).invert().threshold(150) #cria mascara

blobs = img.findBlobsFromMask(mascara,minsize=10) #procura obj apartir da mascara
if blobs: # se existir objetos
blobs = blobs[-1] # passa o objeto maior
cod = blobs.coordinates()  # pega as coordenadas do objeto em uma tupla
print "coordenadas do objeto ---&gt; %d  %d" % (cod[0],cod[1])
points = [(145, 90),(cod[0],cod[1])] # pontos para desenhar a linha

for i in xrange(len(points)-1):
img.drawLine(points[i], points[i+1],color=Color.RED, thickness=4)  #desenha a linha
img = img.applyLayers() # aplica as camadas
result = img.sideBySide(img,side='right') # divide a tela
result = img.sideBySide(mascara,side='botton')  #parte 1 da tela é a mascara
result.show() #mostra na tela


result:

more