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

Extract frame from the camera as a np array into class self attribute #98

Open
Hook12aaa opened this issue Apr 29, 2021 · 2 comments
Open

Comments

@Hook12aaa
Copy link

I want to extract the frame from the camera as a np array to use in other areas of my class. I tried making on_value_changed a self.methood to update frame but it didn't work and i don't know how to return the frame.

Any idea how i can get it all to be in one class?

class get_footage():
    frame = np.array(None)
    out = Image()
    
    def on_value_changed(_):
        im = Soruce.open(io.BytesIO(image_recorder.image.value))
        frame = np.array(im)
        return frame
    
    def get_frame(self):
        camera = CameraStream.facing_user(audio=False)
        image_recorder = ImageRecorder(stream=camera)
        print(image_recorder.image.observe(get_footage.on_value_changed,'value'))
        image_recorder.recording = True
@jiapei100
Copy link

@Hook12aaa
Same requirement here... Happened to notice it's been over 1 year.... my gosh...
So, did you find the solution ? ^_^

Cheers

@martinRenou
Copy link
Collaborator

Please don't spam all issues 😄

If you find issues and know how to fix them, PRs are very welcome.

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

3 participants