Scalp image display method and device and electronic equipment
By converting the scalp images collected by the actual camera into UVC protocol format and using a USB transmission device to simulate a virtual camera, the problem of poor access to scalp image data source is solved, and efficient image transmission and display across platforms is achieved.
Patent Information
- Application Number
- CN202510254780.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-13
AI Technical Summary
The existing scalp image data source access flexibility is poor, making it difficult to adapt to remote monitoring and image acquisition tasks in special environments.
Through the USB transmission device, the initial scalp image of the network video stream protocol format in the video buffer pool is converted into the third image signal of the USB video UVC protocol format, and is transmitted to the preset storage area of the PC host in an isochronous transmission manner, decoded and rendered to the display interface in response to the browser access request.
It realizes a flexible scalp image display method, supports direct access to existing PC hosts and browsers, adapts to different hardware configurations and software environments, and improves the flexibility of data source access.
Smart Images

Figure CN120151648A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software design, and in particular, to a scalp image display method, device, and electronic device. Background Art
[0002] With the rapid development of Internet technology and multimedia applications, the demand for video communication is increasing day by day. To achieve the effective transmission and real-time display of video data, it is usually necessary to use an image acquisition device to transmit the video signal to a computer or server side, and further distribute it through the network. Traditional image acquisition devices rely on the support of specific driver programs, which not only increases the complexity of user installation and configuration, but also has many limitations in cross-platform compatibility.
[0003] Therefore, in some application scenarios, directly using an image acquisition device may have limitations. For example, remote monitoring devices or image acquisition tasks in special environments may require a more flexible data source access method. Summary of the Invention
[0004] The purpose of the present invention is to provide an image display method, device, and electronic device to alleviate the technical problem of poor flexibility in accessing the data source of the existing scalp image and improve the flexibility of accessing the data source.
[0005] In a first aspect, an embodiment of the present invention provides a scalp image display method applied to a PC host configured with a USB transmission device, where the USB transmission device serves as a virtual camera of the PC host. The method includes: converting an initial scalp image in the network video stream protocol format in a video buffer pool into a third image signal in the USB Video Class (UVC) protocol format through the USB transmission device, where the initial scalp image is an image collected by an actual camera connected to the PC host; transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; and in response to an access request of a browser of the PC host for the virtual camera, decoding and rendering the third image signal in the preset storage area to a display interface through the browser.
[0006] In a preferred embodiment of the present invention, converting an initial scalp image in the network video stream protocol format in a video buffer pool into a third image signal in the USB Video Class (UVC) protocol format includes: performing a luminance-chrominance format conversion on the initial scalp image in the network video stream protocol format in the video buffer pool to obtain a first image signal; encapsulating the first image signal through the UVC protocol to obtain a second image signal; and configuring a descriptor in the USB Video Class (UVC) protocol format for the second image signal to obtain the third image signal.
[0007] In a preferred embodiment of the present invention, before the step of converting the initial scalp image in the network video stream protocol format in the above video buffer pool into a luminance-chrominance format to obtain a first image signal, the above method includes: collecting an original scalp image through the above actual camera; performing compression encoding on the above original scalp image to obtain the initial scalp image in the above network video stream protocol format; and transmitting the above initial scalp image to the above video buffer pool through a wireless network.
[0008] In a preferred embodiment of the present invention, the step of transmitting the above initial scalp image to the above video buffer pool through a wireless network includes: transmitting the above initial scalp image to a wifi radio frequency module through a wireless network; reordering the above initial scalp image according to the real-time transmission protocol timestamp and sequence number of the above initial scalp image through the wifi radio frequency module to obtain reorganized data; transmitting the above reorganized data to a network protocol stack; performing error correction processing on the above reorganized data through the above network protocol stack to obtain an error-corrected image; and transmitting the above error-corrected image to the above video buffer pool for storage.
[0009] In a preferred embodiment of the present invention, the step of performing error correction processing on the above reorganized data through the above network protocol stack to obtain an error-corrected image includes: processing the reorganized data through the network protocol stack by using a hybrid mechanism of forward error correction and selective repeat to obtain an error-corrected image.
[0010] In a preferred embodiment of the present invention, the above actual camera is connected to a keyboard; after the step of decoding and rendering the third image signal in the above preset storage area to a display interface through the above browser in response to an access request of the browser of the above PC host for the above virtual camera, the above method further includes: if a screen capture instruction of the above keyboard is received, triggering the virtual keyboard of the above USB transmission device according to the user datagram protocol corresponding to the above screen capture instruction; the above virtual keyboard conforms to the human interface device standard; releasing the human interface device key code corresponding to the above user datagram protocol through the above virtual keyboard to release a target event corresponding to the above human interface device key code to the above browser; and performing a screen capture operation of the above display interface by the above browser according to the above target event.
[0011] In a preferred embodiment of the present invention, a plurality of keys are provided on the above keyboard; before the step of triggering the virtual keyboard of the above USB transmission device according to the user datagram protocol corresponding to the above screen capture instruction if a screen capture instruction of the above keyboard is received, the above method includes: if a trigger instruction of the above plurality of keys is received, determining the above screen capture instruction according to the above trigger instruction.
[0012] In a preferred embodiment of the present invention, the step of the browser performing a screenshot operation on the display interface according to the target event includes: the browser listens for the target event through JavaScript; checks whether the attribute of the human-machine interface device key code corresponding to the target event is the screenshot attribute corresponding to the screenshot instruction; if so, obtains a screenshot from the video stream of the display interface by obtaining user media rights.
[0013] In a second aspect, an embodiment of the present invention further provides a scalp image display device, which is applied to a PC host configured with a USB transmission device, and the USB transmission device serves as a virtual camera of the PC host. The device includes: a conversion module, configured to convert an initial scalp image in a network video stream protocol format in a video buffer pool into a third image signal in a USB video class UVC protocol format through the USB transmission device; wherein, the initial scalp image is an image collected by an actual camera connected to the PC host; a storage module, configured to transmit the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; a display module, configured to, in response to an access request of a browser of the PC host for the virtual camera, decode and render the third image signal in the preset storage area to a display interface through the browser.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, and the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the scalp image display method.
[0015] The embodiments of the present invention have the following beneficial technical effects:
[0016] An embodiment of the present invention provides a scalp image display method, apparatus, and electronic device, which are applied to a PC host configured with a USB transmission device. The USB transmission device serves as a virtual camera of the PC host. The method includes: converting an initial scalp image in the network video stream protocol format in a video buffer pool into a third image signal in the USB Video Class (UVC) protocol format through the USB transmission device; wherein the initial scalp image is an image collected by an actual camera connected to the PC host; transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; and in response to an access request of a browser of the PC host for the virtual camera, decoding and rendering the third image signal in the preset storage area to a display interface through the browser. This method realizes a flexible scalp image display method by converting the image collected by the actual camera into the UVC protocol format and using the USB transmission device to simulate a virtual camera, which not only supports direct access by existing PC hosts and browsers, but also can adapt to different hardware configurations and software environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic flowchart of a scalp image display method provided by an embodiment of the present invention;
[0019] Figure 2 It is a schematic flowchart of another scalp image display method provided by an embodiment of the present invention;
[0020] Figure 3 It is a schematic structural diagram of a scalp image display apparatus provided by an embodiment of the present invention;
[0021] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
[0022] Icons: 31 - Conversion module; 32 - Storage module; 33 - Display module; 41 - Memory; 42 - Processor; 43 - Bus; 44 - Communication interface. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Components of the embodiments of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.
[0024] With the development of Internet and multimedia technologies, people's demand for video communication is increasing. To efficiently transmit and display videos in real time, it is usually necessary to transmit the video signals captured by a camera to a computer or server and share them through a network. However, traditional cameras require specific driver programs, which increases the difficulty of installation and configuration, and there are compatibility issues when used on different platforms. In some special scenarios, such as remote monitoring or image acquisition in specific environments, traditional cameras may not meet the requirements because these scenarios require more flexible data access methods.
[0025] Based on this, the embodiments of the present invention provide a scalp image display method, device, and electronic device. This method converts the images captured by an actual camera into the UVC protocol format and uses a USB transmission device to simulate a virtual camera, realizing a flexible scalp image display method that not only supports direct access by existing PC hosts and browsers but also can adapt to different hardware configurations and software environments. For ease of understanding, a scalp image display method is first introduced.
[0026] Embodiment 1
[0027] In this embodiment, Figure 1 is a schematic flowchart of a scalp image display method provided by an embodiment of the present invention.
[0028] Among them, this method is applied to a PC host configured with a USB transmission device, and the above USB transmission device serves as a virtual camera of the above PC host.
[0029] As Figure 1 can be seen, this method includes:
[0030] Step S101: Through the above USB transmission device, convert the initial scalp image in the network video stream protocol format in the video buffer pool into a third image signal in the USB Video Class (UVC) protocol format; wherein, the above initial scalp image is an image captured by an actual camera connected to the above PC host.
[0031] Step S102: Transmit the above third image signal to a preset storage area of the above PC host in an isochronous transmission manner through the above USB transmission device.
[0032] Step S103: In response to the access request of the browser of the PC host to the virtual camera, the third image signal in the preset storage area is decoded and rendered to a display interface through the browser.
[0033] In actual operation, the PC host is connected to an actual camera via a USB interface or other means. The camera is responsible for capturing scalp images and transmitting these images to the video buffer pool of the PC host in a network video streaming protocol format (such as RTSP, RTMP, etc.). The video buffer pool is a temporary storage area for caching video data collected from the camera. This ensures that the device can stably process and transmit data even if the data traffic fluctuates greatly in a short period of time.
[0034] Then, the initial scalp images captured by the actual camera are read from the video buffer pool, and these images are encoded in the network video stream protocol format. The initial scalp images are converted into brightness and chrominance formats to meet the requirements of subsequent processing. For example, the YUV format (a common video stream format) is converted into the RGB format (a common format for computer displays) to generate a first image signal.
[0035] Next, the converted first image signal is encapsulated according to the USB Video Class (UVC) protocol to generate a second image signal. The UVC protocol is a standardized USB video transmission protocol that is widely used in various USB camera devices.
[0036] Furthermore, a descriptor in a USB video class UVC protocol format is configured for the second image signal. The descriptor defines the function, interface and endpoint information of the device to ensure that the image signal can be correctly identified and processed, thereby generating a third image signal.
[0037] Finally, the third image signal is transmitted to the preset storage area of the PC host by isochronous transmission through the USB transmission device. Isochronous transmission is a data transmission mode with strong real-time performance and low latency, which is particularly suitable for the transmission of video stream data. When the browser of the PC host initiates an access request for the virtual camera, the device will respond to this request, read the third image signal from the preset storage area, and decode and render it through the browser, and finally display the image on the user's browser interface.
[0038] Furthermore, the WebUSB API + custom browser extension is used to enable direct access to the USB transmission device from the web page, bypassing the camera driver layer of the PC host, reducing transmission delay and improving security.
[0039] An embodiment of the present invention provides a scalp image display method, which is applied to a PC host configured with a USB transmission device. The USB transmission device serves as a virtual camera of the PC host. The method includes: converting an initial scalp image in the network video stream protocol format in a video buffer pool into a third image signal in the USB Video Class (UVC) protocol format through the USB transmission device, where the initial scalp image is an image captured by an actual camera connected to the PC host; transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; and in response to an access request of a browser of the PC host for the virtual camera, decoding and rendering the third image signal in the preset storage area to a display interface through the browser. This method realizes a flexible scalp image display method by converting the image captured by the actual camera into the UVC protocol format and using the USB transmission device to simulate a virtual camera, which not only supports direct access by existing PC hosts and browsers but also can adapt to different hardware configurations and software environments.
[0040] Embodiment 2
[0041] Based on the above embodiment, Figure 2 is a schematic flowchart of another scalp image display method provided by an embodiment of the present invention.
[0042] Among them, this method is applied to a PC host configured with a USB transmission device, and the USB transmission device serves as a virtual camera of the PC host.
[0043] As Figure 2 can be seen, this method includes:
[0044] Step S201: Convert the luminance and chrominance format of the initial scalp image in the network video stream protocol format in the video buffer pool through the USB transmission device to obtain a first image signal, where the initial scalp image is an image captured by an actual camera connected to the PC host.
[0045] In actual operation, before step S201, this method includes: capturing an original scalp image through the actual camera; performing compression encoding on the original scalp image to obtain the initial scalp image in the network video stream protocol format; and transmitting the initial scalp image to the video buffer pool through a wireless network.
[0046] In some of these embodiments, the step of transmitting the above initial scalp image to the above video buffer pool via a wireless network includes: transmitting the above initial scalp image to a wifi radio frequency module via a wireless network; reordering the above initial scalp image according to the real-time transmission protocol timestamp and sequence number of the above initial scalp image by the wifi radio frequency module to obtain reorganized data; transmitting the above reorganized data to a network protocol stack; performing error correction processing on the above reorganized data by the above network protocol stack to obtain an error-corrected image; and transmitting the above error-corrected image to the above video buffer pool for storage. Further, the above step S201 includes: converting the luminance and chrominance format of the error-corrected image in the above video buffer pool through the above USB transmission device to obtain the above first image signal.
[0047] Further, the step of performing error correction processing on the above reorganized data by the above network protocol stack to obtain an error-corrected image includes: processing the reorganized data by the network protocol stack using a hybrid mechanism of forward error correction and selective retransmission to obtain an error-corrected image.
[0048] Specifically, the initial scalp images captured by the actual camera are first sent to the PC host through a wireless network (such as Wi-Fi). The wireless network provides a flexible transmission method that is not restricted by physical cables and is suitable for a variety of application scenarios. These image data are transmitted to the built-in or external Wi-Fi radio frequency module of the PC host. The Wi-Fi radio frequency module is responsible for receiving and processing wireless signals. The image data packets received by the Wi-Fi radio frequency module usually carry the timestamp and sequence number of the Real-time Transport Protocol (RTP). These information are used to ensure that the order of the image frames is correct. The data packets are reordered according to the timestamp and sequence number to restore the order of the original video stream. This step is crucial because wireless network transmission may cause the data packets to arrive out of order. The reorganized data is obtained after reordering. The reorganized data packets are passed to the network protocol stack in the operating device. The network protocol stack is a software component responsible for processing various network communication protocols, which will ensure that the data can be correctly transmitted between different layers. In the network protocol stack, error correction processing is performed on the reorganized data. This process includes detecting errors (such as lost or damaged data packets) that may be introduced during transmission and correcting them through algorithms. Commonly used error correction techniques include Forward Error Correction (FEC) and Automatic Repeat reQuest (ARQ). After error correction processing, complete and lossless image data, that is, the corrected image, is finally generated. The corrected image data is transmitted to the video buffer pool of the PC host for temporary storage. The video buffer pool is a memory area dedicated to caching video data, which can smooth video playback and cope with instantaneous data traffic fluctuations. The image data stored in the video buffer pool can be read by subsequent processing modules (such as the UVC conversion module) to prepare for the next operation.
[0049] In some examples, the above network video stream protocol format includes: Real-Time Streaming Protocol, Real-Time Messaging Protocol, and Real-Time Streaming Media.
[0050] Step S202: Encapsulate the above first image signal through the UVC protocol to obtain a second image signal.
[0051] Among them, the first image signal is the H.264 / MJPEG video stream converted to the YUV format required by the UVC protocol. This YUV format is YUV2.
[0052] Step S203: Configure a descriptor in the above USB Video Class UVC protocol format for the above second image signal to obtain the above third image signal.
[0053] In this embodiment, the UVC descriptor contains information about device functions, interfaces, and endpoints. To encapsulate the first image signal, it is first necessary to create an appropriate UVC descriptor to ensure that the receiving end can correctly parse and use this data.
[0054] Step S204: Transmit the third image signal to the preset storage area of the PC host in an isochronous transmission manner through the above-mentioned USB transmission device.
[0055] Step S205: In response to an access request from the browser of the PC host for the virtual camera, decode and render the third image signal in the preset storage area to the display interface through the browser.
[0056] In some of these embodiments, the above-mentioned physical camera is connected to a keyboard; after the step of decoding and rendering the third image signal in the preset storage area to the display interface through the browser in response to an access request from the browser of the PC host for the virtual camera, the method further includes: if a screenshot instruction of the keyboard is received, trigger the virtual keyboard of the USB transmission device according to the user datagram protocol corresponding to the screenshot instruction; the virtual keyboard complies with the human interface device standard; release the human interface device key code corresponding to the user datagram protocol through the virtual keyboard to release a target event corresponding to the human interface device key code to the browser; execute a screenshot operation of the display interface by the browser according to the target event.
[0057] Among them, a plurality of keys are provided on the keyboard; before the step of triggering the virtual keyboard of the USB transmission device according to the user datagram protocol corresponding to the screenshot instruction if a screenshot instruction of the keyboard is received, the method includes: if a trigger instruction of the plurality of keys is received, determine the screenshot instruction according to the trigger instruction.
[0058] Further, the step of executing a screenshot operation of the display interface by the browser according to the target event includes: the browser listens for the target event through JavaScript; checks whether an attribute of the human interface device key code corresponding to the target event is a screenshot attribute corresponding to the screenshot instruction; if so, obtain a screenshot from the video stream of the display interface by obtaining user media rights.
[0059] An embodiment of the present invention provides a scalp image display method, which is applied to a PC host configured with a USB transmission device. The USB transmission device serves as a virtual camera of the PC host. The method includes: converting the initial scalp image in the network video stream protocol format in the video buffer pool into a first image signal through the USB transmission device, where the initial scalp image is an image collected by an actual camera connected to the PC host; encapsulating the first image signal through the UVC protocol to obtain a second image signal; configuring a descriptor in the USB video class UVC protocol format for the second image signal to obtain the third image signal; transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; and in response to an access request of a browser of the PC host for the virtual camera, decoding and rendering the third image signal in the preset storage area to a display interface through the browser. This method converts the initial scalp image collected by the actual camera through the USB transmission device, performs UVC protocol encapsulation and descriptor configuration, and transfers it to the preset storage area of the PC host in an isochronous transmission manner, and finally decodes and renders it by the browser, realizing efficient and reliable cross-platform image transmission and display, and significantly improving compatibility, flexibility and image processing ability.
[0060] Embodiment 3
[0061] Based on the above embodiment, Figure 3 is a schematic structural diagram of a scalp image display device provided by an embodiment of the present invention.
[0062] Among them, the device is applied to a PC host configured with a USB transmission device, and the USB transmission device serves as a virtual camera of the PC host
[0063] As Figure 3 can be seen, the device includes:
[0064] A conversion module 31, configured to convert an initial scalp image in the network video stream protocol format in a video buffer pool into a third image signal in the USB video class UVC protocol format through the USB transmission device, where the initial scalp image is an image collected by an actual camera connected to the PC host.
[0065] A storage module 32, configured to transmit the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device.
[0066] A display module 33, configured to, in response to an access request of a browser of the PC host for the virtual camera, decode and render the third image signal in the preset storage area to a display interface through the browser.
[0067] Among them, the above-mentioned conversion module 31, storage module 32, and display module 33 are connected in sequence.
[0068] In one implementation, the above-mentioned conversion module 31 is further configured to perform a luminance-chrominance format conversion on the initial scalp image in the network video stream protocol format in the above-mentioned video buffer pool to obtain a first image signal; encapsulate the above-mentioned first image signal through the UVC protocol to obtain a second image signal; configure a descriptor in the above-mentioned USB video class UVC protocol format for the above-mentioned second image signal to obtain the above-mentioned third image signal.
[0069] In one implementation, the above-mentioned conversion module 31 is further configured to collect an original scalp image through the above-mentioned actual camera; perform compression encoding on the above-mentioned original scalp image to obtain the initial scalp image in the above-mentioned network video stream protocol format; transmit the above-mentioned initial scalp image to the above-mentioned video buffer pool through a wireless network.
[0070] In one implementation, the above-mentioned conversion module 31 is further configured to transmit the above-mentioned initial scalp image to the wifi radio frequency module through a wireless network; reorder the above-mentioned initial scalp image according to the real-time transmission protocol timestamp and sequence number of the above-mentioned initial scalp image through the wifi radio frequency module to obtain reorganized data; transmit the above-mentioned reorganized data to the network protocol stack; perform error correction processing on the above-mentioned reorganized data through the above-mentioned network protocol stack to obtain an error-corrected image; transmit the above-mentioned error-corrected image to the above-mentioned video buffer pool for storage.
[0071] In one implementation, the above-mentioned conversion module 31 is further configured to perform processing on the reorganized data through the network protocol stack using a hybrid mechanism of forward error correction and selective repeat to obtain an error-corrected image.
[0072] In one implementation, the above-mentioned actual camera is connected to a keyboard; the above-mentioned display module 33 is further configured to, if receiving a screenshot instruction from the above-mentioned keyboard, trigger the virtual keyboard of the above-mentioned USB transmission device according to the user datagram protocol corresponding to the above-mentioned screenshot instruction; the above-mentioned virtual keyboard complies with the human interface device standard; release the human interface device key code corresponding to the above-mentioned user datagram protocol through the above-mentioned virtual keyboard to release a target event corresponding to the above-mentioned human interface device key code to the above-mentioned browser; perform a screenshot operation on the above-mentioned display interface by the above-mentioned browser according to the above-mentioned target event.
[0073] In one implementation, a plurality of keys are provided on the above-mentioned keyboard; the above-mentioned display module 33 is further configured to, if receiving a trigger instruction from the above-mentioned plurality of keys, determine the above-mentioned screenshot instruction according to the above-mentioned trigger instruction.
[0074] In one of the embodiments, the display module 33 is further configured to enable the browser to listen for the target event through JavaScript; check whether the attribute of the human-machine interface device key code corresponding to the target event is the screenshot attribute corresponding to the screenshot instruction; if so, obtain a screenshot from the video stream of the display interface by obtaining the user media right.
[0075] The scalp image display device provided by the embodiment of the present invention has the same technical features as the scalp image display method provided by the above embodiment, so it can also solve the same technical problems and achieve the same technical effects. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.
[0076] Embodiment 4
[0077] This embodiment provides an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the scalp image display method.
[0078] This embodiment provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the scalp image display method are implemented.
[0079] See Figure 4 As shown in the schematic structural diagram of an electronic device, the electronic device includes: a memory 41 and a processor 42. A computer program that can run on the processor 42 is stored in the memory 41, and when the processor executes the computer program, the steps provided by the above scalp image display method are implemented.
[0080] As Figure 4 shown, the device further includes: a bus 43 and a communication interface 44. The processor 42, the communication interface 44, and the memory 41 are connected through the bus 43; the processor 42 is used to execute the executable module stored in the memory 41, such as a computer program.
[0081] Among them, the memory 41 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 44 (which can be wired or wireless), a communication connection between the device network element and at least one other network element is realized, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0082] The bus 43 can be an ISA bus, a PCI bus, an EISA bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 4 only a bidirectional arrow is used in Figure 4 , but it does not mean that there is only one bus or one type of bus.
[0083] Among them, the memory 41 is used to store programs. After receiving an execution instruction, the processor 42 executes the program. The method executed by the scalp image display device disclosed in any embodiment of the present invention can be applied to the processor 42 or implemented by the processor 42. The processor 42 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 42 or the instructions in the form of software. The above-mentioned processor 42 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being completed by the hardware decoding processor, or completed by the combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 41, and the processor 42 reads the information in the memory 41 and combines its hardware to complete the steps of the above method.
[0084] Furthermore, the embodiments of the present invention also provide a machine-readable storage medium. The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor 42, the machine-executable instructions cause the processor 42 to implement the above-mentioned scalp image display method.
[0085] The electronic device and the computer-readable storage medium provided by the embodiments of the present invention have the same technical features, so they can also solve the same technical problems and achieve the same technical effects.
[0086] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "coupled" should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or an integral connection; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the communication inside two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0087] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus cannot be understood as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
Claims
1. A scalp image display method, characterized in that: Applied to a PC host equipped with a USB transmission device, the USB transmission device serving as a virtual camera of the PC host, the method comprises: The USB transmission device converts the initial scalp image in the network video stream protocol format in the video buffer pool into a third image signal in the USB video class UVC protocol format; wherein the initial scalp image is an image captured by an actual camera connected to the PC host; Transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; In response to the access request of the browser of the PC host to the virtual camera, the third image signal in the preset storage area is decoded and rendered to a display interface through the browser.
2. The scalp image display method according to claim 1, characterized in that: Converting the initial scalp image in the network video stream protocol format in the video buffer pool into a third image signal in the USB video class UVC protocol format includes: Converting the initial scalp image in the network video stream protocol format in the video buffer pool into a luminance and chrominance format to obtain a first image signal; Encapsulating the first image signal through the UVC protocol to obtain a second image signal; A descriptor in the USB video class UVC protocol format is configured for the second image signal to obtain the third image signal.
3. The scalp image display method according to claim 2, characterized in that: Before the step of converting the initial scalp image in the network video stream protocol format in the video buffer pool into a luminance and chrominance format to obtain a first image signal, the method comprises: Collecting the original scalp image by the actual camera; Compressing and encoding the original scalp image to obtain an initial scalp image in the network video stream protocol format; The initial scalp image is transmitted to the video buffer pool via a wireless network.
4. The scalp image display method according to claim 3, characterized in that: The step of transmitting the initial scalp image to the video buffer pool via a wireless network comprises: Transmitting the initial scalp image to a wifi radio frequency module via a wireless network; Reordering the initial scalp image according to the real-time transport protocol timestamp and sequence number of the initial scalp image through a wifi radio frequency module to obtain reorganized data; transmitting the reassembled data to a network protocol stack; Performing error correction processing on the reorganized data through the network protocol stack to obtain an error-corrected image; The error-corrected image is transmitted to the video buffer pool for storage.
5. The scalp image display method according to claim 4, characterized in that: The step of performing error correction processing on the reorganized data through the network protocol stack to obtain an error-corrected image includes: The reconstructed data is processed by the network protocol stack using a hybrid mechanism of forward error correction and selective retransmission to obtain an error-corrected image.
6. The scalp image display method according to claim 1, characterized in that: The actual camera is connected to a keyboard; after the step of decoding and rendering the third image signal in the preset storage area to a display interface through the browser in response to an access request of the PC host browser to the virtual camera, the method further includes: If a screenshot instruction of the keyboard is received, triggering a virtual keyboard of the USB transmission device according to a user datagram protocol corresponding to the screenshot instruction; the virtual keyboard complies with a human-machine interface device standard; Releasing the human-machine interface device key code corresponding to the user datagram protocol through the virtual keyboard, so as to release the target event corresponding to the human-machine interface device key code to the browser; The browser performs a screenshot operation of the display interface according to the target event.
7. The scalp image display method according to claim 6, characterized in that: The keyboard is provided with a plurality of keys; if a screenshot instruction of the keyboard is received, before the step of triggering the virtual keyboard of the USB transmission device according to the user datagram protocol corresponding to the screenshot instruction, the method comprises: If trigger instructions of the multiple buttons are received, the screenshot instruction is determined according to the trigger instructions.
8. The scalp image display method according to claim 6, characterized in that: The step of executing a screenshot operation of the display interface according to the target event through the browser includes: The browser monitors the target event via JavaScript; Checking whether the attribute of the human-machine interface device key code corresponding to the target event is the screenshot attribute corresponding to the screenshot instruction; If yes, a screenshot is obtained from the video stream of the display interface by obtaining the user media rights.
9. A scalp image display device, characterized in that: Applicable to a PC host equipped with a USB transmission device, the USB transmission device serving as a virtual camera of the PC host, the device comprising: A conversion module, used to convert the initial scalp image in the network video stream protocol format in the video buffer pool into a third image signal in the USB video class UVC protocol format through the USB transmission device; wherein the initial scalp image is an image captured by an actual camera connected to the PC host; A storage module, used for transmitting the third image signal to a preset storage area of the PC host in an isochronous transmission manner through the USB transmission device; The display module is used to respond to the access request of the browser of the PC host to the virtual camera, and decode the third image signal in the preset storage area and render it to a display interface through the browser.
10. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the scalp image display method according to any one of claims 1 to 8.