Hi All,
To locate specific pattern in an image I am using the cv_MatchTemplate
plugin in a macro. The "Model" pattern is then rotated to get occurences
in every orientation (see below).
My problem is : Each time cvMatch_Template is called, the Results window
is Cleared so that I lose the results.
If I print the results in the Log before Results is Cleared, I am not
able to get data back from the Log.
Is there any macro solution for this problem ?
Thanks for your ideas.
open(); FileName=File.nameWithoutExtension;
title=getTitle();
for(i=0;i<90;i=i+10){
selectWindow("Model.tif");
run("Rotate... ", "angle=&i grid=1 interpolation=Bilinear");
run("cvMatch_Template...", "image=[&title] method=[Normalized
correlation coefficient] template=Model.tif multiple tolerence=0.80
threshold=0");
selectWindow("Results");
x=newArray(nResults); y=newArray(nResults);
for (j=0; j<nResults;j++){
x[j]=getResult("X", j);
y[j]=getResult("Y", j);
print (i+" \t "+x[j]+" \t "+y[j]);
}}
--
Eric Denarier
Grenoble Institut des Neurosciences
Inserm U836
Chemin Fortuné Ferrini
38700 La Tronche
France
Tél :33 (0)4 56 52 05 38
Fax :33 (0)4 56 52 06 57
http://neurosciences.ujf-grenoble.fr/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html