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

Pattern file image does not exist from webcam sample #12

Open
SimonDarksideJ opened this issue Dec 21, 2022 · 3 comments
Open

Pattern file image does not exist from webcam sample #12

SimonDarksideJ opened this issue Dec 21, 2022 · 3 comments

Comments

@SimonDarksideJ
Copy link

In the following line for the Markerless webcam sample

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

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
Copy link
Author

*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
Copy link
Author

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;

@EnoxSoftware
Copy link
Owner

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.

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