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

Live Camera Feed Enhancement #6220

Closed
JahnabDutta opened this issue Sep 4, 2023 Discussed in #6219 · 2 comments
Closed

Live Camera Feed Enhancement #6220

JahnabDutta opened this issue Sep 4, 2023 Discussed in #6219 · 2 comments
Labels

Comments

@JahnabDutta
Copy link
Contributor

Discussed in https://github.com/orgs/coronasafe/discussions/6219

Originally posted by JahnabDutta September 4, 2023

Boundary based visualization

Features

  • A boundary in terms of x and y coordinates around a patient bed.
  • User is able to add and delete a boundary along with modifying the existing boundary in terms of left, right, top and bottom boundaries.
  • When boundary is initially added, it is based on the point presets of the patient bed and the respective zoom level of the presets.
  • Movement of the camera is validated based on the
    boundary.

How to use

  • Go to assets page.
  • Select a working camera asset and move to configure page.
  • There, in the Live Feed section, boundary configuration can be achieved.
  • If no boundary is present, click on Add Boundary button to add a boundary.
  • Else, modify or delete the boundary.
  • To view the validation, move to a patient using the bed which has a boundary. Then, click on the Camera Feed button. Now move the camera to see the validation.

Implementation

  • Adding a new boundary and deleting an existing boundary

    • In care_fe repository, move to ONVIFCamera.tsx page.
    • Refer to addBoundaryPreset to add a new boundary.
    • Refer to deleteBoundaryPreset to delete an existing boundary.
    • ONVIFCamera component uses the LiveFeed component which in turn uses the CameraBoundaryConfigure component where the UI for addition, deletion and preview of boundary is present.
    • The previewBoundary function in LiveFeed is used to preview the boundary edges.
  • Modifying an existing boundary

    • In care_fe repository, move to ONVIFCamera.tsx page.
    • Refer to updateBoundaryPreset to modify an existing boundary.
    • ONVIFCamera component uses the LiveFeed component which in turn uses the UpdateCameraBoundaryConfigure component where the UI for modification of boundary is present.
    • In the LiveFeed page, the gotoDirectionalBoundary function is used to move the camera to the directional boundary being modified.
  • Validation based on boundary

    • In care_fe repository, move to Feed.tsx page.
    • refer to the function other inside cameraPTZActionCBs function to see the validation based on boundary.
    • To go to backend validation, move to care repo and refer to onvif.py page.
    • The validation rules are written in validate_action function.

Patient Privacy Feature

Features

  • A button to toggle patient privacy.
  • When privacy is toggled on, the camera feed is not shown to the user.
  • Role based priviledge to toggle privacy.

How to use

  • Go to the page of a patient.
  • Toggle the privacy button.
  • Click on Camera Feed button to see effect of privacy.

Implementation

  • Enabling privacy toggle in frontend

    • Go to PatientPrivacyTogggle.tsx file in care_fe repo.
    • The getPrivacyInfo function is used to get the current privacy status from the backend.
    • The togglePrivacy function is used to toggle the privacy of the patient.
  • Validating privacy toggle in backend.

    • Go to bed.py in care/facility/api/viewsets.
    • The toggle_patient_privacy API is used to deal with validating role priviledge and toggling privacy.

Lock asset feature

Features

  • Provides dedicated access to the camera to the user.
  • User is able to view the current occupier of the camera if he does not own the camera access.
  • User is also able to request for the camera access.
  • Works in real-time.

How to use

  • Open two different browsers with two differnt users.
  • Move to the page of a patient and click on Camera Feed button.
  • The user who enters first will have camera access to move the camera. The other user will be able to view the camera feed but will not be able to move the camera.
  • The other user will be able to see the details of first user and send him request to leave the camera.

Implementation

  • Setting up dedicated camera access

    • In care_fe repository, move to Feed.tsx page.
    • Refer to the functions lockAsset, unlockAsset for methods of locking,unlocking asset, and requestAccess for requesting access to the camera.
    • Refer to base.py and onvif.py in care/utils/assetintegration.
    • In onvif.py, the api request for lock_asset, unlock_asset is handled via the the respective functions.
    • The request_access api is used to send request to the user who has camera access.
  • Displaying current occupier of the camera

    • In care_fe repository, in Feed.tsx page, the currentCameraOccupierInfo function is used to display the current occupier of the camera.
    • There is another function subscriptionInfo used to display information about subscription to push notifications.
  • Making access realtime

    • In care repo, move to base.py in care/utils/assetintegration.
    • Here refer to the functions add_to_waiting_queue and remove_from waiting_queue to see how queue of users is maintained who await camera access.
    • Then, the generate_notification function is used to send push notifications to the user who has camera access.
    • The request_access function is used to send request to the user who has camera access.
@github-project-automation github-project-automation bot moved this to Triage in Care Sep 4, 2023
@JahnabDutta JahnabDutta changed the title Live Feed Camera Enhancement Live Camera Feed Enhancement Sep 4, 2023
@github-actions
Copy link

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

@github-actions github-actions bot added the stale label Sep 19, 2023
@rithviknishad
Copy link
Member

Closing as this is a documentation of the implemented feature, and not an issue.

@rithviknishad rithviknishad closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Care Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants