Hi Yuri,
thanks for your reply! You're right the shortname should be the filename of the image. Somehow I loose the filename in the output matrix of my img2m command (third line from below). As far as there I can't find any issues with my code.
Please find my script enclosed:
pe_mkdir Folder path:=aa$;
pe_cd aa$;
string pth1$ = "…\Analyzing pictures\";
string fns, path$ = pth1$;
findfiles fname:=fns$ ext:="*.jpg";
int n = fns.GetNumTokens(CRLF);
string bkName$;
string fname$;
int m=n+1;
newbook name:="Matrices" sheet:=1;
newbook name:="Calibration" mat:=1;
impImage fname:="…\Analyzing pictures\Calibration\Calibration.jpg”;
imgResize lock:=1 unit:=pixel w:=400 h:=402 interpolate:=normal;
imgBinary t1:=11 t2:=160;
img2m;
m2w method:=direct xy:=noxy ow:=[Matrices]<Calibration>;
for(int ii = 1; ii<=n; ii++)
{
fname$ = fns.GetToken(ii, CRLF)$;
newbook s:=0 mat:=1 result:=bkName$;
impimage orng:=[bkName$]msheet1;
matrix -pg DIM nCol1 nRow1;matrix -pg DIM nCol1 nRow1;
imgResize lock:=1 unit:=pixel w:=400 h:=402 interpolate:=normal;
imgC2gray;
img2m;
expMatASC type:=csv path:"…\Excel Export\%H_.csv"
}
Thanks and Regards,
Max