Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new feature: tracking with display #4

Open
alexlib opened this issue Feb 28, 2024 · 0 comments
Open

new feature: tracking with display #4

alexlib opened this issue Feb 28, 2024 · 0 comments

Comments

@alexlib
Copy link
Collaborator

alexlib commented Feb 28, 2024

In the old version Tcl/Tk we had

		/* ******** Draw links now ******** */
		if (display)
			for (h=0;h<m[1];h++)
		{
			if(mega[1][h].next != -2 ) {

				strcpy(buf,"");
				sprintf(buf ,"green");

				for (j=0;j<n_img;j++)
				{
					if(c4[1][h].p[j]>0 && c4[2][mega[1][h].next].p[j]>0) {
						xp[j]=t4[1][j][c4[1][h].p[j]].x;
						yp[j]=t4[1][j][c4[1][h].p[j]].y;
						xc[j]=t4[2][j][c4[2][mega[1][h].next].p[j]].x;
						yc[j]=t4[2][j][c4[2][mega[1][h].next].p[j]].y;
						predict (xp[j], yp[j], xc[j], yc[j], &xn[j], &yn[j]);

						if ( ( fabs(xp[j]-zoom_x[j]) < imx/(2*zoom_f[j]))
							&& (fabs(yp[j]-zoom_y[j]) < imy/(2*zoom_f[j])))
						{
							strcpy(val,"");
							sprintf(val ,"orange");

							intx0 = (int)(imx/2+zoom_f[j]*(xp[j]-zoom_x[j]));
							inty0 = (int)(imy/2+zoom_f[j]*(yp[j]-zoom_y[j]));
							intx1 = (int)(imx/2+zoom_f[j]*(xc[j]-zoom_x[j]));
							inty1 = (int)(imy/2+zoom_f[j]*(yc[j]-zoom_y[j]));
							intx2 = (int)(imx/2+zoom_f[j]*(xn[j]-zoom_x[j]));
							inty2 = (int)(imy/2+zoom_f[j]*(yn[j]-zoom_y[j]));

							drawcross(interp,intx0,inty0,cr_sz,j,"green");
							drawcross(interp,intx1,inty1,cr_sz+1,j,"yellow");
							drawcross(interp,intx2,inty2,cr_sz+1,j,"white");
							drawvector (interp, intx0, inty0, intx1, inty1, 2, j, buf);
							drawvector (interp, intx1, inty1, intx2, inty2, 1, j, "white");

							if (mega[1][h].finaldecis> 0.2) {
								draw_pnr ( interp, intx0, inty0, h, j, "white");
								draw_pnr ( interp, intx0, inty0+10, mega[1][h].next, j, val);
								draw_value (interp, intx0, inty0 + 20,mega[1][h].finaldecis, j, val);
							}
						}
					}
				}
			}
		}

write at the end of the track loop. Please add it. Think how to manage it with openptv-python and pyptv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant