Search

WO-2026091429-A1 - CAMERA SHARING METHOD AND APPARATUS, DEVICE, AND MEDIUM

WO2026091429A1WO 2026091429 A1WO2026091429 A1WO 2026091429A1WO-2026091429-A1

Abstract

The present invention relates to the technical field of image processing. Disclosed are a camera sharing method and apparatus, a device, and a medium. The method comprises: for any camera, acquiring at least two target camera processes corresponding to the camera, the at least two target camera processes being camera processes having the possibility of simultaneously invoking the camera; for any target camera process, applying for a first memory for the target camera process according to image configuration requirements corresponding to the target camera process; when any target camera process is started, controlling the camera to collect image data according to the corresponding image configuration requirements, and applying for a second memory for the target camera process; storing the image data in the first memory corresponding to the target camera process; and copying the image data in the first memory corresponding to the target camera process to the second memory. The method enables at least two target camera processes to successfully invoke one camera, thereby achieving camera sharing among at least two camera processes.

Inventors

  • Yang, Mingming
  • LI, BAOCHENG
  • WANG, YUYING
  • QIU, XUDONG
  • YANG, QINGHE
  • WU, JIN
  • LI, YUFENG

Assignees

  • 歌尔股份有限公司

Dates

Publication Date
20260507
Application Date
20250424
Priority Date
20241028

Claims (10)

  1. A camera sharing method, characterized in that the method includes: For any camera, obtain at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; For any of the target camera processes, allocate first memory for the target camera process according to the image configuration requirements corresponding to the target camera process; When any of the target camera processes is started, the camera is controlled to acquire image data according to the corresponding image configuration requirements, and a second memory is allocated for the target camera process; The image data is stored in the first memory corresponding to the target camera process; In addition, the image data in the first memory corresponding to the target camera process is copied to the second memory.
  2. The method according to claim 1, wherein the step of acquiring at least two target camera processes corresponding to any camera includes: For any camera, if one of the at least two target camera processes is started, obtain the at least two target camera processes corresponding to that camera.
  3. The method according to claim 1, characterized in that, before allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process, the method further includes: For any of the target camera processes, the image configuration requirements corresponding to the target camera process are found from the preset mapping relationship; The preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements.
  4. According to the method of claim 1, the step of copying the image data from the first memory corresponding to the target camera process to the second memory includes: Once the data in the first memory is filled, the image data in the first memory corresponding to the target camera process is copied to the second memory.
  5. The method according to claim 1, wherein the image configuration requirements include at least one of image size and image format.
  6. A camera sharing device, characterized in that it comprises: The acquisition module is used to acquire, for any camera, at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; The application module is used to apply for first memory for any target camera process according to the image configuration requirements corresponding to the target camera process. The control module is used to control the camera to acquire image data according to the corresponding image configuration requirements when any of the target camera processes is started, and to allocate a second memory for the target camera process. A storage module is used to store the image data in the first memory corresponding to the target camera process; The copying module is used to copy the image data in the first memory corresponding to the target camera process to the second memory.
  7. The apparatus according to claim 6, wherein the acquisition module is specifically configured to: for any camera, if one of the at least two target camera processes is started, acquire at least two target camera processes corresponding to the camera.
  8. The apparatus according to claim 6, wherein the copying module is specifically configured to: copy the image data in the first memory corresponding to the target camera process to the second memory after the first memory has been filled with data.
  9. An electronic device, characterized in that the electronic device comprises the means as described in any one of claims 6 to 8; or, The electronic device includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-5.
  10. A computer-readable storage medium, characterized in that it stores a computer program thereon, which, when executed by a processor, implements the method according to any one of claims 1-5.

Description

Camera sharing methods, devices, equipment and media This application claims priority to Chinese Patent Application No. 202411516870.4, filed on October 28, 2024, entitled "Camera Sharing Method, Apparatus, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field This invention relates to the field of image processing technology, and more specifically, to a camera sharing method, apparatus, device, and medium. Background Technology With the rapid development of economy and technology, wearable devices, especially head-mounted devices (such as AR, VR, MR and XR smart glasses or helmets), are widely used in various fields. Multiple applications running simultaneously is a typical application scenario in head-mounted displays (HMDs), where multiple applications run in the foreground on the HMD simultaneously. In this scenario, the HMD may simultaneously run at least two processes that need to access the same camera. For example, it might run both a 6DoF algorithm and a gesture algorithm simultaneously, or it might run both a camera app and a QR code scanning app simultaneously. However, when a head-mounted device simultaneously launches at least two processes that need to access the same camera, once that same camera is accessed by one process, it cannot be accessed by other processes. This results in at least two processes that need to access the same camera being unable to simultaneously obtain camera data, or the camera function of the later-launched process becoming invalid. Summary of the Invention One object of the present invention is to provide a new technical solution for camera sharing. According to a first aspect of the present invention, a camera sharing method is provided, the method comprising: For any camera, obtain at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; For any of the target camera processes, allocate first memory for the target camera process according to the image configuration requirements corresponding to the target camera process; When any of the target camera processes is started, the camera is controlled to acquire image data according to the corresponding image configuration requirements, and a second memory is allocated for the target camera process; The image data is stored in the first memory corresponding to the target camera process; In addition, the image data in the first memory corresponding to the target camera process is copied to the second memory. Optionally, the process of acquiring at least two target camera processes corresponding to any given camera includes: For any camera, if one of the at least two target camera processes is started, obtain the at least two target camera processes corresponding to that camera. Optionally, before allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process, the method further includes: For any of the target camera processes, the image configuration requirements corresponding to the target camera process are found from the preset mapping relationship; The preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements. Optionally, copying the image data from the first memory corresponding to the target camera process to the second memory includes: Once the data in the first memory is filled, the image data in the first memory corresponding to the target camera process is copied to the second memory. Optionally, the image configuration requirements include at least one of image size and image format. According to a second aspect of the present invention, a camera sharing device is provided, comprising: The acquisition module is used to acquire, for any camera, at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; The application module is used to apply for first memory for any target camera process according to the image configuration requirements corresponding to the target camera process. The control module is used to control the camera to acquire image data according to the corresponding image configuration requirements when any of the target camera processes are started, and to allocate second memory for the target camera process. A storage module is used to store the image data in the first memory corresponding to the target camera process; The copying module is used to copy the image data in the first memory corresponding to the target camera process to the second memory. Optionally, the acquisition module is specifically used to: for any camera, if one of the at least two target camera processes is started, acquire at least two target camera processes corresponding t