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

How to use a custom camera #738

Closed
bbq82828 opened this issue Sep 7, 2022 · 8 comments
Closed

How to use a custom camera #738

bbq82828 opened this issue Sep 7, 2022 · 8 comments
Labels
type:question Ask a question

Comments

@bbq82828
Copy link

bbq82828 commented Sep 7, 2022

Description

Hi
I have a custom camera I want it to replace the webcam and be able to implement the mediapipe function through this camera

@homuler homuler added the type:question Ask a question label Sep 8, 2022
@homuler
Copy link
Owner

homuler commented Sep 8, 2022

You may need to build ImageFrame instances using the input.
See also #343.

@bbq82828
Copy link
Author

bbq82828 commented Sep 13, 2022

Sorry for replying so late and thanks for your reply
I am currently rendering the camera image to RawImage and I want to pass the texture2d of the image to the mediapipe for use, but the mediapipe image will only move when the camera is initialized
I would like to ask how to make him execute continuously
The picture below shows me rewriting WebcamSource and replacing it with rawimage input

image

@homuler
Copy link
Owner

homuler commented Sep 13, 2022

Sorry, I don't understand your situation precisely.
What is your input class (e.g. WebCamTexture)? What you need to do is to build an ImageFrame instance using that.

@bbq82828
Copy link
Author

Sorry, maybe I didn’t make it clear enough. I got a texture2D from my custom camera and I pass it into ReadFromImageSource but the result I get is that the mediapipe's image is only rendered when my camera is initialized, after that the mediapipe's image is still
image
As for ImageFrame I am trying using that.

@bbq82828
Copy link
Author

I just solved the problem
I sent Textur2d to the past, but I didn't keep updating texure2d, so in order to solve it, I kept inputting the transmitted picture in my camera
Thanks for taking the time to reply
image

@kchanyou
Copy link

@bbq82828 Hello,
I am currently working on a similar problem as you are and trying to find a solution. If it's not too much trouble, could you provide any hints or code snippets on how to use the data from a custom camera that renders on a RawImage for mediapipe? Thank you

@bbq82828
Copy link
Author

@zzanyoung Hello,
You must first find GetCurrentTexture() in WebCamSource and replace webCamTexture with the texture2D of your custom camera
截圖 2023-04-18 下午2 15 43

@kchanyou
Copy link

kchanyou commented Apr 19, 2023

@bbq82828
(Modified!)

*It has been resolved. Thank you for leaving a response :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Ask a question
Projects
None yet
Development

No branches or pull requests

3 participants