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

Incorrect Camera #38

Open
QuirkyCort opened this issue Apr 11, 2022 · 1 comment
Open

Incorrect Camera #38

QuirkyCort opened this issue Apr 11, 2022 · 1 comment

Comments

@QuirkyCort
Copy link

When using Chrome on a computer with multiple camera, tm2scratch appears to be always using the first camera for classification, even if the on-screen video image is using a different camera.

Steps to reproduce

  1. Use a computer with multiple cameras (eg. a laptop with a built-in camera and an external camera).
  2. Switch the default camera in Chrome to the second camera, open up stretch3 and load the tm2scratch extension. Ensure that the video on the stage is using the second camera (...this may take some fiddling).
  3. Load an image classification URL.
  4. Test the image classification using the second (...on stage) camera; it won't work.
  5. Test the image classification using the first camera; it'll work correctly.

This problem does not affect Firefox, and it does not affect ml2scratch either.

@QuirkyCort
Copy link
Author

Did a bit more digging and can verify that the device ID for the camera used by tm2scratch is different from the device ID used for the video display on the Scratch scene. This only appears to affect Chrome.

I notice that tm2scratch is using...

video: {
    width: 360,
    height: 360
}

...while Scratch is using...

video: {
    width: {min: 480, ideal: 640},
    height: {min: 360, ideal: 480}
}

Changing tm2scratch to use the same constraints as Scratch appears to solve the problem and ensures that both video devices are the same.

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

1 participant