Switching Model Settings

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Switching Model Settings

Postby jackreynolds » Sat Jun 24, 2017 5:22 pm

So while thinking of options to help improve our performance with our existing applications, I had a crazy idea.

We are in need of tracking a marker in a camera on top of an american football field for the purpose of augmenting graphics for live TV.

The current idea was to take a simple 2D marker (Hiro pattern) and move it around, this way the graphic can be positioned correctly as other variables move, however this poses the issue of inexactness, and a job that no one wants to do during a game.

I had the idea of potentially using a NFT configuration, but this would require one key ability for us.

Some explanation: We need a yellow line model to be placed wherever the ball starts a play at. As a result, this constantly changes. We currently have a ready system that can be used with a person with a Hiro pattern on a pole, placing the marker at the right position, but this has the issues that I listed earlier.
So, what we would need to do would be the ability to have a model, which would be just a simple one, but listed one hundred times inside of the objects.dat file, each with different positioning, for each yardage position that the ball can be in. We would have to be able to change this during runtime, using key inputs.

So what I am asking is:

Is there a way we could potentially build in our own way of turning on and off model visibility during the game, while running the application? For example, using the same input functions that run the '?' help dialogue, only using it to show or hide different model configurations from inside of the objects.dat file?

Thank you,

Jack Reynolds

MrDaniel
Posts: 381
Joined: Wed Nov 18, 2015 9:07 pm

Re: Switching Model Settings

Postby MrDaniel » Sun Jun 25, 2017 1:39 pm

Hello Jack,

If you're working with NFT. I would load all the NFT images.

Would you be able to upload some images to help illustrate your idea?

Regards,

Daniel

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Re: Switching Model Settings

Postby jackreynolds » Mon Jun 26, 2017 12:01 pm

Hello!

This video should help explain it a bit better.
https://youtu.be/isbi50Knel4

Thanks!
Jack

MrDaniel
Posts: 381
Joined: Wed Nov 18, 2015 9:07 pm

Re: Switching Model Settings

Postby MrDaniel » Mon Jun 26, 2017 2:01 pm

Hello Jack,

So you have a voice! :) Me too!

Ok. So in terms of the representation of lines i believe you approach is a good one.

1) You shouldn't need to edit the markers.dat file.

I think you should have all of the lines and markers defined as you have suggested in the .dat file.

The control over the display of the lines should be handled internally in your code.

So for instance....

SimpleLite example....

Here the pattern is defined, but rendering it is controlled by a flag gPatt_found. I would suggest you have a map or vector of flags (1 for each line) and then allow this to be a central control for the visibility of the lines that way you don't need to re-program the ARController. It might just be me, but the ARController should control the AR and you should perhaps have an abstracted class called LineController or something which handles the rendering. Apologies for the patronising tone of that last sentence.

For example......

if (gPatt_found) {

// Calculate the camera position relative to the marker.
// Replace VIEW_SCALEFACTOR with 1.0 to make one drawing unit equal to 1.0 ARToolKit units (usually millimeters).
arglCameraViewRH((const ARdouble (*)[4])gPatt_trans, m, VIEW_SCALEFACTOR);
#ifdef ARDOUBLE_IS_FLOAT
glLoadMatrixf(m);
#else
glLoadMatrixd(m);
#endif

// All lighting and geometry to be drawn relative to the marker goes here.
DrawCube();

} // gPatt_found

Have you researched any similar work? Is there anything else you were keen to try?

http://cvgl.stanford.edu/teaching/cs231 ... imothy.pdf

"To extract the yardlines, first, a Sobel edge detector is utilized on a greyscale version of the image. This exposes the edges on the field and increases the prominence of the yardlines. Then, a Hough transform is utilized to detect the locations of these yardlines. An example of identification of yardlines using the Hough transform is seen in Figure 2. The result of this operation is obtaining the pixel coordinates of these yardlines."

http://web.engr.oregonstate.edu/~afern/ ... wacv14.pdf

"Figure 1. (Left) Line extraction: Green lines are the output from the Hough transform, red lines are the results from RANSAC. (Right) Line tracking: Blue lines are the tracked lines from last frame, the red line is the new line detected in this frame."

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Re: Switching Model Settings

Postby jackreynolds » Tue Jun 27, 2017 11:13 am

Thank you for your reply, I will have a look into everything you've included here.

If we were to set up a separate class or some method, such as an abstracted LineController class, what is your opinion of the best way of interfacing it, that is adding some form of user input?

Thanks,
Jack

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Re: Switching Model Settings

Postby jackreynolds » Mon Jul 17, 2017 11:37 am

One of the largest problems I've noticed is actually how long it takes to place each configuration in its position in nftBook. Currently I launch the application, observe the position of the item, then change the position in the objects.dat file, and restart the application. This process is time consuming. I am currently looking for ways to shorten this process by wondering if there is a way I can reload the objects.dat file. I was wondering if there was a way that I could add a key, such as 'P', in the Keyboard function, then have that somehow call VirtualEnvironmentInit to have it reload the models. I tried placing VirtualEnvironmentInit in the keyboard switch function, but to no success.

Code: Select all

static void Keyboard(unsigned char key, int x, int y)
{
switch (key)  {
   case 0x1B:
   case 'Q':
   case 'q':
      cleanup ();
      exit(0);
      break;
   case '?':
   case '/':
      ARLOG("Keys:\n");
      ARLOG(" q or [esc]   Quit demo.\n");
      ARLOG(" ? or /          Show this help.\n");
      ARLOG("\nAdditionally, the ARVideo library supplied the following help text:\n");
      arVideoDispOption();
      break;
   case 'P':
   case 'p':
      VirtualEnvironmentInit(objectDataFilename);
      break;
   default:
      break;
      }
   }
   


Any help would be greatly appreciated. Thank you,
Jack

MrDaniel
Posts: 381
Joined: Wed Nov 18, 2015 9:07 pm

Re: Switching Model Settings

Postby MrDaniel » Mon Jul 17, 2017 3:52 pm

I'm lost now.... What are we trying to do here?

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Re: Switching Model Settings

Postby jackreynolds » Mon Jul 17, 2017 6:46 pm

Ignore my code please, I'm not really sure what I was attempting there :roll:

My problem is this: making the coordinates for each position of my yellow line is tedious and overly time consuming. I am required to restart the application each time I change the coordinates in order to reload the objects.day file, which takes too much time.

I am looking for a way to either automatically reload the objects.dat file, or reload it upon a command or keypress, however I am not sure of the way to go about doing this.

Being able to have the computer reload the coordinates and update the positioning of my model will greatly increase the speed of the positioning process. I am at a loss of how to go about this. I was wondering if there was a simple way to potentially call a reloading of the function that initializes the objects.dat, for example by pressing a key and having it load that into the main loop, or having the main loop automatically refresh the file.

Please let me know what you think, thanks.
Jack

MrDaniel
Posts: 381
Joined: Wed Nov 18, 2015 9:07 pm

Re: Switching Model Settings

Postby MrDaniel » Mon Jul 17, 2017 6:51 pm

Hmmmm. Is there a way to share your project files with me? Perhaps have a Skype chat and go over it. ;)

jackreynolds
Posts: 61
Joined: Sun Jul 24, 2016 4:21 pm

Re: Switching Model Settings

Postby jackreynolds » Wed Jul 19, 2017 10:04 am

I've sent you a PM and an email, please let me know if you got it, thanks.


Return to “ARToolKit for Desktop v5.x”

Who is online

Users browsing this forum: No registered users and 1 guest