MarkerLessARExample icon indicating copy to clipboard operation
MarkerLessARExample copied to clipboard

Pattern file image does not exist from webcam sample

Open SimonDarksideJ opened this issue 2 years ago • 3 comments

In the following line for the Markerless webcam sample

https://github.com/EnoxSoftware/MarkerLessARExample/blob/1124537476ef9e219fe8041092823e70636864ad/Assets/MarkerLessARExample/WebCamTextureMarkerLessARExample/WebCamTextureMarkerLessARExample.cs#L155

The "patternImg.jpg" file does not exist in the project and thus is unable to be loaded and renders the sample unworkable.

patternMat = Imgcodecs.imread(Application.persistentDataPath + "/patternImg.jpg");

Can the sample be updated to be functional using the assets in the project?

It would also be preferable if:

  • The Texture2D samples was updated to be more functional, currently shows a static scene with no explaination
  • Update the WebCam sample to also accept a Texture2D rather than loading from file?

SimonDarksideJ avatar Dec 21 '22 13:12 SimonDarksideJ

*Note, not even the Android build that is published functions as it is unable to detect any of the images in this repository.

The Readme on the front page should be updated with usage instructions and expectations for the sample.

SimonDarksideJ avatar Dec 21 '22 14:12 SimonDarksideJ

I eventually got the sample working by using the Texture2D Input used in the Texture2D sample

Replacing the old Img load line

            //patternMat = Imgcodecs.imread(Application.persistentDataPath + "/PatternImage.jpg");

with

            Mat patternMat = new Mat(patternTexture.height, patternTexture.width, CvType.CV_8UC4);

            Utils.texture2DToMat(patternTexture, patternMat);

And adding a parameter for the texture

        public Texture2D patternTexture;

SimonDarksideJ avatar Dec 22 '22 17:12 SimonDarksideJ

It appears that the problem occurs when none of keypoints can be detected from the input pattern image. We will be releasing a new version soon that addresses that issue. Thank you very much.

EnoxSoftware avatar Dec 23 '22 01:12 EnoxSoftware