Ask Your Question
0

How to display coordinate system inside my image?

asked 2014-03-04 08:23:00 -0500

anonymous user

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 flag offensive close merge delete

Comments

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

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

1 Answer

Sort by » oldest newest most voted
1

answered 2014-03-05 07:38:29 -0500

updated 2014-03-05 07:39:50 -0500

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 
    img+=img.blit(temp,(1,2),alphaMask=temp)  #junta Imagem ao Frame
    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 ---> %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:

Result

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-04 08:23:00 -0500

Seen: 212 times

Last updated: Mar 05 '14