MarkerLessARExample icon indicating copy to clipboard operation
MarkerLessARExample copied to clipboard

Set marker as texture no camera

Open pablopalma opened this issue 6 years ago • 5 comments

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.

pablopalma avatar Sep 19 '19 19:09 pablopalma

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 ();


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

         }

EnoxSoftware avatar Sep 20 '19 09:09 EnoxSoftware

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

pablopalma avatar Sep 20 '19 13:09 pablopalma

this works for WebGL?

pablopalma avatar Sep 21 '19 17:09 pablopalma

This issue can be resolved (i don't see the option) i did another issue referred to this: https://github.com/EnoxSoftware/MarkerLessARExample/issues/8

pablopalma avatar Sep 23 '19 03:09 pablopalma

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.

pablopalma avatar Sep 25 '19 19:09 pablopalma