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

Set marker as texture no camera #6

Open
pablopalma opened this issue Sep 19, 2019 · 5 comments
Open

Set marker as texture no camera #6

pablopalma opened this issue Sep 19, 2019 · 5 comments

Comments

@pablopalma
Copy link

Hello!

I need set a custom image marker texture but without a camera capture. (i.e: vuforia)
It's possible make this? there's some way o example?

Cheers.

@EnoxSoftware
Copy link
Owner

It is possible to load Texture2D preset in the Inspector as a pattern image by changing the code as follows.

https://github.com/EnoxSoftware/MarkerLessARExample/blob/master/Assets/MarkerLessARExample/WebCamTextureMarkerLessARExample/WebCamTextureMarkerLessARExample.cs#L165-L197

        /// <summary>
        /// The pattern texture.
        /// </summary>
        public Texture2D patternTexture;


        void Start ()
        {

----------------
 
         Mat patternMat = new Mat (patternTexture.height, patternTexture.width, CvType.CV_8UC4);
            
         Utils.texture2DToMat (patternTexture, patternMat);
         Debug.Log ("patternMat dst ToString " + patternMat.ToString ());

         pattern = new Pattern ();
         patternTrackingInfo = new PatternTrackingInfo ();
                
         patternDetector = new PatternDetector (null, null, null, true);
                
         patternDetector.buildPatternFromImage (patternMat, pattern);
         patternDetector.train (pattern);


          #if UNITY_ANDROID && !UNITY_EDITOR
          // Avoids the front camera low light issue that occurs in only some Android devices (e.g. Google Pixel, Pixel2).
          webCamTextureToMatHelper.avoidAndroidFrontCameraLowLightIssue = true;
          #endif
          webCamTextureToMatHelper.Initialize ();


--------------

         }

@pablopalma
Copy link
Author

Thanks a lot! I'm very happy with this library, i'll check this and then i'll mark as resolved the issue.

@pablopalma
Copy link
Author

this works for WebGL?

@pablopalma
Copy link
Author

This issue can be resolved (i don't see the option) i did another issue referred to this: #8

@pablopalma
Copy link
Author

There's some way to change the confidentiality of the matches? If i use a texture of a brand that it's a
wine bottle label. If i focus a printed paper the matches works fine, but if i focus the bottle label, this doesn't work.

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

2 participants