Noesis Forum : Visilog Software Forum Index Noesis Forum : Visilog Software
Image processing forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Récupérer les données dela variable temporaire Hough_circle

 
Post new topic   Reply to topic    Noesis Forum : Visilog Software Forum Index -> VBA
View previous topic :: View next topic  
Author Message
Madeline



Joined: 16 May 2008
Posts: 17
Location: Grenoble

PostPosted: Fri Jun 27, 2008 1:02 pm    Post subject: Récupérer les données dela variable temporaire Hough_circle Reply with quote

Bonjour,

je souhaite récupérer les centres des cercles obtenus avec la fonction houghcircles2. Voici mon code :

Code:

Dim var_value(1 To 4) As Single
...
Call houghcircle2("imagec", VlgIArray1, 1, 1, 4, "im3D", M_NO_OUTPUT)
Err = Data.GetFieldArray("Hough_circle", eDATATYPE_TMP, "Center X", var_value)

Debug.Print Err
Debug.Print var_value(1)
Debug.Print var_value(2)
Debug.Print var_value(3)
Debug.Print var_value(4)


et voilà ce que ça m'affiche :

Code:

1
116  ' correspond bien à l'abscisse d'un des centres des cercles
0
0
0


alors que 4 cercles ont bien été détectés dans l'image.

Cela vient-il de la déclaration de var_value ? Quelle forme doit avoir ce tableau ?

Merci pour vos réponses

Madeline
Back to top
View user's profile Send private message Visit poster's website
Laurent Bernard



Joined: 31 Jan 2006
Posts: 156
Location: Crolles

PostPosted: Mon Jun 30, 2008 8:10 am    Post subject: Pb Objet temporaire Reply with quote

Contrairement à ce qu'il y a écrit dans la documentation, c'est l'objet Maxextract_circle qui contient les valeurs de retour de la commande houghcircle2

Voici le code qui va bien

Code:
Dim var_valueX(0 To 3) As Single
Dim var_valueY(0 To 3) As Single
ReDim VlgIArray1(0 To 1)
VlgIArray1(0) = 20
VlgIArray1(1) = 30

Call houghcircle2("balls", VlgIArray1, 1, 1, 4, "im3D", M_NO_OUTPUT)
Err = Data.GetFieldArray("Maxextract_circle", eDATATYPE_TMP, "Center X", var_valueX)
Err = Data.GetFieldArray("Maxextract_circle", eDATATYPE_TMP, "Center Y", var_valueY)
For i = 0 To 3
    Debug.Print ("Line N° " + CStr(i + 1))
    Debug.Print ("   X    = " + CStr(var_valueX(i)))
    Debug.Print ("   Y    = " + CStr(var_valueY(i)))
Next


Sur l'image balls, on obtient ces valeurs :

Code:
Line N° 1
   X    = 142
   Y    = 259
Line N° 2
   X    = 150
   Y    = 22
Line N° 3
   X    = 165
   Y    = 22
Line N° 4
   X    = 60
   Y    = 435


Last edited by Laurent Bernard on Mon Jun 30, 2008 8:54 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Madeline



Joined: 16 May 2008
Posts: 17
Location: Grenoble

PostPosted: Mon Jun 30, 2008 8:19 am    Post subject: Reply with quote

Merci bien !
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Noesis Forum : Visilog Software Forum Index -> VBA All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group