WO2019085109A1 - Image writing control method and apparatus, and electronic device - Google Patents

Image writing control method and apparatus, and electronic device Download PDF

Info

Publication number
WO2019085109A1
WO2019085109A1 PCT/CN2017/113567 CN2017113567W WO2019085109A1 WO 2019085109 A1 WO2019085109 A1 WO 2019085109A1 CN 2017113567 W CN2017113567 W CN 2017113567W WO 2019085109 A1 WO2019085109 A1 WO 2019085109A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
read
state
nth frame
read state
Prior art date
Application number
PCT/CN2017/113567
Other languages
French (fr)
Chinese (zh)
Inventor
王明
Original Assignee
歌尔科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 歌尔科技有限公司 filed Critical 歌尔科技有限公司
Publication of WO2019085109A1 publication Critical patent/WO2019085109A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/30Image reproducers
    • H04N13/332Displays for viewing with the aid of special glasses or head-mounted displays [HMD]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/30Image reproducers
    • H04N13/366Image reproducers using viewer tracking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/30Image reproducers
    • H04N13/398Synchronisation thereof; Control thereof

Definitions

  • the present invention relates to the field of data processing technologies, and in particular, to an image writing control method, apparatus, and electronic device.
  • virtual reality technology has been widely used in many fields, such as architecture, medical, media, film and television. Users can view images with virtual reality devices to achieve an immersive feel.
  • a cache queue is usually set in the virtual reality device, and the application installed on the virtual reality device writes the image to be displayed into the cache queue. Then, the display component in the virtual reality device reads the image to be displayed from the cache queue, and finally renders the image to be displayed onto the screen of the virtual reality device.
  • the writing and reading of the image to be displayed are controlled by mutually independent control signals, for example, the writing of the image to be displayed is controlled by the image writing signal, and the reading of the image to be displayed is controlled by the image reading signal, wherein This image read signal may be a vertical sync signal (V-SYNC signal). Therefore, the writing and reading of the image to be displayed are prone to conflicts, which causes tearing of the image displayed on the screen, which seriously degrades the quality of the image display.
  • an embodiment of the present invention provides an image writing control method, apparatus, and electronic device, which prevent image writing and reading from colliding by controlling image writing time, thereby avoiding image tearing and improving image display. the quality of.
  • An embodiment of the present invention provides an image writing control method, including:
  • the image of the (N+1)th frame is written into the buffer queue.
  • the second read state is a read end state; and if the first read state is a read end state, the first The second read state is the read start state.
  • the determining, according to the time-order relationship between the time variable value corresponding to the first read state and the time variable value corresponding to the current second read state, determining whether the image of the Nth frame is read includes:
  • the cache queue includes a first space for storing a left eye image and a second space for storing a right eye image, and the Nth frame image is an Nth frame left eye image or an Nth frame right eye image;
  • Writing the image of the (N+1)th frame to the cache queue includes:
  • the N+1th frame left eye image is written into the first space of the buffer queue
  • the N+1th frame right eye image is written into the second space of the buffer queue.
  • the method before the writing the (N+1)th frame image into the cache queue, the method further includes:
  • An embodiment of the present invention provides an image writing control apparatus, including:
  • an update module configured to update a first read state corresponding to the read operation triggered by the Nth frame image in the cache queue by the display component, and update a time variable value corresponding to the first read state to the first read The trigger time corresponding to the state;
  • a state determining module configured to determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read;
  • the writing module is configured to write the N+1th frame image into the buffer queue if the image of the Nth frame is read.
  • An embodiment of the present invention provides an electronic device, including: a memory, and a processor connected to the memory;
  • the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor;
  • the processor is configured to execute the one or more computer instructions in any one of the above image writing control methods.
  • the display component of the head mounted virtual reality device triggers a read operation on the Nth frame image in the buffer queue and simultaneously generates a first read state. Then, the head-mounted display device responds to the first read state generated by the read operation, thereby obtaining the trigger time of the read operation, that is, the trigger time corresponding to the first read state, and correspondingly using the first read state.
  • the trigger time updates the value of the time variable corresponding to the first read state. Determining whether the head-mounted virtual reality device has read the image of the Nth frame according to the sequential relationship between the time variable corresponding to the updated first read state and the time variable corresponding to the current second read state.
  • Head-mounted The writing operation of the image by the virtual reality device is controlled by the completion of the image reading. If the image reading operation has been completed, the head mounted virtual reality device will start to write the N+1th frame image into the buffer queue; if the image reading operation is not completed, the head mounted virtual reality device will be in Waiting state, no image is written. In this way, it can ensure that the reading and writing of the image are completed separately, and there is no case of reading and writing conflicts, which avoids tearing of the screen and improves the quality of the image display.
  • FIG. 1 is a flowchart of Embodiment 1 of an image writing control method according to an embodiment of the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of an image writing control method according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of Embodiment 1 of an image writing control apparatus according to an embodiment of the present disclosure
  • Embodiment 2 is a schematic structural diagram of Embodiment 2 of an image writing control apparatus according to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of Embodiment 1 of an electronic device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram of an internal configuration structure of a head mounted virtual reality device according to an embodiment of the present invention.
  • first, second, third, etc. may be used to describe XXX in embodiments of the invention, these XXX should not be limited to these terms. These terms are only used to distinguish XXX from each other.
  • first XXX may also be referred to as a second XXX without departing from the scope of the embodiments of the present invention.
  • second XXX may also be referred to as a first XXX.
  • the words “if” and “if” as used herein may be interpreted to mean “when” or “when” or “in response to determining” or “in response to detecting.”
  • the phrase “if determined” or “if detected (conditions or events stated)” may be interpreted as “when determined” or “in response to determination” or “when detected (stated condition or event) “Time” or “in response to a test (condition or event stated)”.
  • FIG. 1 is a flowchart of Embodiment 1 of the image writing control method according to the embodiment of the present invention, and the execution body of the image writing control method provided by the embodiment may be As a head mounted virtual reality device, as shown in FIG. 1, the method includes the following steps:
  • the time variable corresponding to the first read state is updated to be a trigger time corresponding to the first read state.
  • the display component in the head mounted virtual reality device After the head mounted virtual reality device is turned on, the display component in the head mounted virtual reality device periodically issues an image read signal.
  • the display component can control the start and end of reading of the image according to the image read signal.
  • the commonly used image read signal can be a vertical sync signal.
  • the display component triggers a read operation on the Nth frame image in the buffer queue in response to the image read control signal, and the display component also generates a first read state while triggering the read operation.
  • the triggered read operation may be an operation indicating that the image reading is started or an operation indicating that the image reading is ended.
  • the first read state may be a read start state, indicating the Nth frame image. Start reading; also can be the reading end state, indicating that the Nth frame image has been read.
  • the head mounted virtual reality device can obtain a trigger for reading the image of the Nth frame in response to the first read state
  • the trigger time of the operation that is, the trigger time corresponding to the first read state generated by the read operation.
  • the head-mounted virtual reality device may update the time variable value corresponding to the first read state according to the trigger time corresponding to the acquired first read state.
  • the time variable value corresponding to the updated first read state may represent the Nth frame.
  • the reading start time of the image may also indicate the reading end time of the image of the Nth frame.
  • S102 Determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read.
  • the head mounted virtual reality device may determine whether the image of the Nth frame is read according to the time variable value corresponding to the updated first read state and the time variable value corresponding to the current second read state, where the current The time variable value corresponding to the second read state is a time variable value that exists before updating the time variable value corresponding to the first read state.
  • the first read state and the second read state are two different read states.
  • the first read state is a read start state
  • the second read state is a read end state
  • the second read state is a read start state. status.
  • the first read state When the time variable value corresponding to the first read state indicates the time when the image reading of the Nth frame starts, and the time variable value corresponding to the second read state indicates the time when the image reading of the N-1th frame ends, the first read The value of the time variable corresponding to the state is greater than the value of the time variable corresponding to the second read state. At this time, it indicates that the image of the Nth frame is being read. At this time, the head mounted virtual reality device maintains the current waiting state and does not read the N+1th frame image from the buffer queue.
  • the first read state corresponds to The time variable value is smaller than the time variable value corresponding to the second read state. At this time, it indicates that the Nth frame image has been read. At this time, the head mounted virtual reality device can continue to write the N+1 frame image into the buffer queue. in.
  • the display component of the head mounted virtual reality device triggers a read operation on the Nth frame image in the buffer queue and simultaneously generates a first read state. Then, the head-mounted display device responds to the first read state generated by the read operation, thereby obtaining the trigger time of the read operation, that is, the trigger time corresponding to the first read state, and correspondingly using the first read state.
  • the trigger time updates the value of the time variable corresponding to the first read state. Determining whether the head-mounted virtual reality device has read the image of the Nth frame according to the sequential relationship between the time variable corresponding to the updated first read state and the time variable corresponding to the current second read state.
  • the write operation of the image by the head-mounted virtual reality device is controlled by the completion of the image reading. If the image reading operation has been completed, the head mounted virtual reality device will start to write the N+1th frame image into the buffer queue; if the image reading operation is not completed, the head mounted virtual reality device will be in Waiting state, no image is written. This will ensure that the image is read and written separately and will not appear. The situation of reading and writing conflicts avoids tearing of the picture and improves the quality of image display.
  • FIG. 2 is a flowchart of Embodiment 2 of an image writing control method according to an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
  • updating the time variable corresponding to the first read state is a trigger time corresponding to the first read state.
  • step S201 is similar to the corresponding steps of the foregoing embodiment.
  • steps S201 refer to the related description in the embodiment shown in FIG. 1 , and details are not described herein again.
  • S202 Determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read.
  • the first read state and the second read state are two different read states. It is easy to think that the following two situations will occur: the first read state is the read start state, the second read state is the read end state; the first read state is the read end state, the second read state The status is taken as the read start status.
  • the time variable value corresponding to the first read state is the time variable value corresponding to the read start state
  • the time variable value corresponding to the second read state is the time variable value corresponding to the read end state.
  • the time variable value corresponding to the first read state is the time variable value corresponding to the read end state
  • the second read The time variable value corresponding to the state is the time variable value corresponding to the read start state.
  • the scenes that users view in pre-built, 360° virtual scenes are closely related to the user's posture. Therefore, after the image of the Nth frame is read, the N+1th frame image to be written needs to be generated in real time according to the current posture of the user.
  • the head mounted virtual reality device may generate the image of the (N+1)th frame by:
  • the user's posture data is acquired.
  • an object located within the visual field of the user is determined based on the posture data and the position of each object in the virtual reality scene.
  • the nine-axis sensor disposed in the head-mounted virtual reality device may collect the posture data of the user at a preset collection interval.
  • the gesture data can be stored in a fixed storage space.
  • the head-mounted virtual reality device can obtain the current posture data of the user from the storage space.
  • the collected posture data can be the posture data of the user's head, such as the pitch angle, the deflection angle, and the heading of the user's head. angle.
  • the head-mounted virtual reality device can know the position coordinates of each object in the virtual reality scene.
  • the position coordinates of each object in the virtual scene can be written into a file. Therefore, the head-mounted virtual reality device can determine the coordinate range corresponding to the user's field of view according to the current posture data of the user, and filter out objects belonging to the user's field of view from the file. Finally, the head-mounted virtual reality device can generate an N+1th frame image based on the filtered object.
  • the head-mounted virtual reality device can write the generated image of the (N+1)th frame into the buffer queue.
  • the images displayed in the head-mounted virtual reality device all have a stereoscopic effect, which is produced by synthesizing two left-eye images and right-eye images having parallax.
  • a stereoscopic effect which is produced by synthesizing two left-eye images and right-eye images having parallax.
  • the buffer queue may be optionally divided into two spaces, that is, a first space for storing a left eye image and a second for storing a right eye image. Two spaces.
  • the Nth frame image and the N+1th frame image referred to above and below may be both a left eye image and a right eye image.
  • the N+1th left eye image is written into the first space of the buffer queue. If the read Nth frame image is the Nth frame right eye image, the N+1th frame right eye image is written into the second space of the buffer queue.
  • the present invention does not limit the order of image reading.
  • the left eye image may be read first.
  • the image for performing the write control needs to be generated in real time according to the posture data of the user, so that the content viewed by the user through the head-mounted virtual reality device and the posture data of the user are matched. Then, the left-eye image and the right-eye image generated in real time are respectively written into the cache queue.
  • the cache queue is spatially divided, that is, the cache queue is divided into a first space and a second space, and the first space and the second space are used to store a left eye image and a right eye image, respectively. This avoids the occurrence of an image reading error that is likely to occur when the left-eye image and the right-eye image are co-cached in a cache queue that is not divided into spaces. For example, the left-eye image should be read incorrectly.
  • the right eye image enables the head mounted virtual reality device to control the writing timing of the image more independently and accurately.
  • FIG. 3 is a schematic structural diagram of Embodiment 1 of an image writing control apparatus according to an embodiment of the present invention. As shown in FIG. 3, the image writing control apparatus includes: an updating module 11, a state determining module 12, and a writing module 13.
  • the update module 11 is configured to: in response to the first read state generated by the read operation triggered by the display component triggering the Nth frame image in the cache queue, update the time variable value corresponding to the first read state to correspond to the first read state Trigger time.
  • the state determining module 12 is configured to determine whether the image of the Nth frame is read according to a time-order relationship between the time variable value corresponding to the first read state and the time variable value corresponding to the current second read state.
  • the writing module 13 is configured to write the N+1th frame image into the buffer queue if the image of the Nth frame is read.
  • the apparatus shown in FIG. 3 can perform the method of the embodiment shown in FIG. 1.
  • Embodiment 4 is a schematic structural diagram of Embodiment 2 of an image writing control apparatus according to an embodiment of the present invention. As shown in FIG. 4, based on the embodiment shown in FIG. 3, an adjustment module 12 in the image writing control apparatus is used. : If the time variable value corresponding to the read start state is smaller than the time variable value corresponding to the read end state, it is determined that the Nth frame image is read.
  • the buffer queue includes a first space for storing a left eye image and a second space for storing a right eye image, and the Nth frame image is an Nth frame left eye image or an Nth frame right eye image;
  • the writing module 13 in the image writing control device is specifically configured to:
  • the image of the Nth frame is the left eye image of the Nth frame
  • the image of the left eye of the (N+1)th frame is written into the first space of the buffer queue
  • the image of the Nth frame is the image of the right eye of the Nth frame
  • the N+1 frame right eye image is written into the second space of the buffer queue.
  • the image writing control device further includes: an obtaining module 21, an object determining module 22, and a generating module 23.
  • the obtaining module 21 is configured to acquire posture data of the user.
  • the object determining module 22 is configured to determine an object located within a visual field of the user according to the posture data and the position of each object in the virtual reality scene.
  • the generating module 23 is configured to generate an N+1th left eye image and an N+1th right eye image corresponding to the object located in the visual field of the user.
  • the apparatus shown in FIG. 4 can perform the method of the embodiment shown in FIG. 2.
  • the structure of the image writing control device can be implemented as an electronic device such as a head mounted virtual reality device.
  • 5 is a schematic structural diagram of Embodiment 1 of an electronic device according to an embodiment of the present invention. As shown in FIG. 5, the electronic device includes: a memory 31, and a processor 32 connected to the memory, where the memory 31 is used to store the electronic device to perform the above.
  • the program of the image write control method provided in any of the embodiments, the processor 32 is configured to execute a program stored in the memory 31.
  • the program includes one or more computer instructions, wherein one or more computer instructions are executed by the processor 32 to:
  • updating the time variable corresponding to the first read state is a trigger time corresponding to the first read state
  • the image of the (N+1)th frame is written into the buffer queue.
  • the processor 32 is further configured to perform all or part of the foregoing method steps.
  • the structure of the electronic device may further include a communication interface 33 for the electronic device to communicate with other devices or a communication network.
  • FIG. 6 is a schematic diagram of an internal configuration structure of a head mounted virtual reality device according to an embodiment of the present invention.
  • the display unit 401 may include a display panel disposed on a side surface of the head mounted virtual display device 400 facing the user's face, and may be a whole panel or a left panel and a right panel corresponding to the left and right eyes of the user respectively.
  • the display panel may be an electroluminescent (EL) component, a liquid crystal display or a microdisplay having a similar structure, or a laser-scanned display in which the retina can be directly displayed or similar.
  • EL electroluminescent
  • the virtual image optical unit 402 photographs the image displayed by the display unit 401 in an enlarged manner and allows the user to observe the displayed image in the enlarged virtual image.
  • the display image outputted to the display unit 401 it may be an image of a virtual scene supplied from a content reproduction device (a Blu-ray disc or a DVD player) or a streaming server, or an image of a real scene photographed using an external camera 410.
  • virtual image optical unit 402 can include a lens unit, such as a spherical lens, an aspheric lens, a Fresnel lens, and the like.
  • the input operation unit 403 includes at least one operation member for performing an input operation, such as a button, a button, a switch, or other similarly functioned component, receives a user instruction through the operation member, and outputs an instruction to the control unit 407.
  • an input operation such as a button, a button, a switch, or other similarly functioned component
  • the status information acquiring unit 404 is configured to acquire status information of the user wearing the head mounted virtual display device 400.
  • the status information acquisition unit 404 may include various types of sensors for detecting status information by itself, and may acquire status information from the external device such as a smartphone, a wristwatch, and other multi-function terminals worn by the user through the communication unit 405. Status information obtained
  • the fetching unit 404 can acquire location information and/or posture information of the user's head.
  • the status information acquisition unit 404 may include one or more of a gyro sensor, an acceleration sensor, a Global Positioning System (GPS) sensor, a geomagnetic sensor, a Doppler effect sensor, an infrared sensor, and a radio frequency field intensity sensor.
  • GPS Global Positioning System
  • the state information acquisition unit 404 acquires state information of the user wearing the head-mounted virtual display device 400, for example, acquiring an operation state of the user (eg, whether the user wears the head-mounted virtual display device 400), an action state of the user (such as still, Walking, running, and the like, the posture of the hand or fingertip, the open or closed state of the eye, the direction of the line of sight, the size of the pupil, the mental state (whether the user is immersed in the image displayed by the observation, and the like), and even the physiological status.
  • an operation state of the user eg, whether the user wears the head-mounted virtual display device 400
  • an action state of the user such as still, Walking, running, and the like, the posture of the hand or fingertip, the open or closed state of the eye, the direction of the line of sight, the size of the pupil, the mental state (whether the user is immersed in the image displayed by the observation, and the like), and even the physiological status.
  • the communication unit 405 performs communication processing, modulation and demodulation processing with an external device, and encoding and decoding processing of the communication signal.
  • the control unit 407 can transmit transmission data from the communication unit 405 to an external device.
  • the communication method may be wired or wireless, for example, Mobile High-Definition Link (MHL) or Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), Wireless Fidelity (Wi-Fi), Bluetooth communication or Bluetooth low energy communication, and the mesh network of the IEEE802.11s standard.
  • the communication unit 405 may be a cellular radio transceiver that operates according to Wideband Code Division Multiple Access (W-CDMA), Long Term Evolution (LTE), and the like.
  • W-CDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • the head mounted virtual display device 400 may further include a storage unit, and the storage unit 406 is a mass storage device configured to have Solid State Drives (SSD) or the like.
  • storage unit 406 can store applications or various types of data. For example, content viewed by a user using the head mounted virtual display device 400 may be stored in the storage unit 406.
  • the head mounted virtual display device 400 may further include a control unit, and the control unit 407 may include a Central Processing Unit (CPU) or other device having similar functions.
  • control unit 407 can be used to execute an application stored by storage unit 406, or control unit 407 can also be used to perform the methods, functions, and operations disclosed in some embodiments of the present application.
  • the image processing unit 408 is for performing signal processing such as image quality correction related to the image signal output from the control unit 407, and converting its resolution into a resolution according to the screen of the display unit 401. Then, the display driving unit 404 sequentially selects each line of pixels of the display unit 401, and sequentially scans each line of pixels of the display unit 401 line by line, thereby providing a pixel signal based on the signal-processed image signal.
  • the head mounted virtual display device 400 can also include an external camera.
  • the external camera 410 may be disposed on the front surface of the main body of the head-mounted virtual display device 400, and the external camera 410 may be one or more.
  • the external camera 410 can acquire three-dimensional information and can also be used as a distance sensor.
  • a Position Sensitive Detector (PSD) or other type of distance sensor that detects a reflected signal from an object may be combined with the external camera 410. use.
  • PSD Position Sensitive Detector
  • the external camera 410 and the distance sensor can be used to detect the body position, posture, and shape of the user wearing the head mounted virtual display device 400. In addition, under certain conditions, the user can directly view or preview the real scene through the external camera 410.
  • the head mounted virtual display device 400 may further include a sound processing unit 411 that may perform sound quality correction or sound amplification of the sound signal output from the control unit 407, signal processing of the input sound signal, and the like. Then, the sound input/output unit 412 outputs the sound to the outside and the sound from the microphone after the sound processing.
  • a sound processing unit 411 may perform sound quality correction or sound amplification of the sound signal output from the control unit 407, signal processing of the input sound signal, and the like. Then, the sound input/output unit 412 outputs the sound to the outside and the sound from the microphone after the sound processing.
  • the structure or components shown by the thick line frame in FIG. 6 may be independent of the head mounted virtual display device 400, for example, may be disposed in an external processing system, such as a computer system, and a head mounted virtual display device.
  • the 400 is used in conjunction; or the structure or component shown by the dashed box may be disposed inside or on the surface of the head mounted virtual display device 400.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)
  • Processing Or Creating Images (AREA)

Abstract

An image writing control method and apparatus, and an electronic device. The method comprises: a display assembly triggers a read operation on an Nth frame of image in a cache queue, and simultaneously generates a first read state; then, a head-mounted display device responds to the first read state, so as to obtains the triggering time corresponding to the first read state, and updates a time variable value corresponding to the first read state to the triggering time (S101); according to a precedence relationship between the updated time variable corresponding to the first read state and a time variable corresponding to a current second read state, determining whether a head-mounted virtual-reality device completes the reading of the Nth frame of image (S102); and, only when the read operation of the image is completed, the head-mounted virtual-reality device starts to write an (N+1)th frame of image into the cache queue (S103). In this way, it is ensured that the image is separately read and written, the reading and writing do not conflict, and the image is prevented from being torn, thereby improving the image display quality.

Description

图像写入控制方法、装置及电子设备Image writing control method, device and electronic device 技术领域Technical field
本发明涉及数据处理技术领域,尤其涉及一种图像写入控制方法、装置及电子设备。The present invention relates to the field of data processing technologies, and in particular, to an image writing control method, apparatus, and electronic device.
背景技术Background technique
近几年,虚拟现实技术已经在众多领域得到了广泛的应用,例如,建筑、医疗、媒体、影视等。用户使用虚拟现实设备观看影像,可以达到身临其境的感觉。In recent years, virtual reality technology has been widely used in many fields, such as architecture, medical, media, film and television. Users can view images with virtual reality devices to achieve an immersive feel.
在现有技术中,虚拟现实设备中通常会设置一个缓存队列,安装于虚拟现实设备的应用程序会将待显示图像写入到此缓存队列中。然后,虚拟现实设备中显示组件会从此缓存队列中读取待显示图像,并最终将此待显示图像渲染到虚拟现实设备的屏幕上。但由于待显示图像的写入和读取是由相互独立的控制信号控制的,例如由图像写入信号控制待显示图像的写入,由图像读取信号控制待显示图像的读取,其中,此图像读取信号可以是垂直同步信号(V-SYNC信号)。因此,待显示图像的写入和读取很容易出现发生冲突,这就会使屏幕上显示的画面产生撕裂,严重降低了图像显示的质量。In the prior art, a cache queue is usually set in the virtual reality device, and the application installed on the virtual reality device writes the image to be displayed into the cache queue. Then, the display component in the virtual reality device reads the image to be displayed from the cache queue, and finally renders the image to be displayed onto the screen of the virtual reality device. However, since the writing and reading of the image to be displayed are controlled by mutually independent control signals, for example, the writing of the image to be displayed is controlled by the image writing signal, and the reading of the image to be displayed is controlled by the image reading signal, wherein This image read signal may be a vertical sync signal (V-SYNC signal). Therefore, the writing and reading of the image to be displayed are prone to conflicts, which causes tearing of the image displayed on the screen, which seriously degrades the quality of the image display.
发明内容Summary of the invention
有鉴于此,本发明实施例提供一种图像写入控制方法、装置及电子设备,通过控制图像写入的时间避免图像的写入和读取发生冲突,从而避免出现画面撕裂,提高图像显示的质量。In view of this, an embodiment of the present invention provides an image writing control method, apparatus, and electronic device, which prevent image writing and reading from colliding by controlling image writing time, thereby avoiding image tearing and improving image display. the quality of.
本发明实施例提供一种图像写入控制方法,包括:An embodiment of the present invention provides an image writing control method, including:
响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新所述第一读取状态对应的时间变量值为所述第一读取状态对应的触发时间;And updating a time variable corresponding to the first read state to a trigger time corresponding to the first read state, in response to the first read state generated by the read operation triggered by the display component triggering the image of the Nth frame in the cache queue ;
根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕;Determining whether the image of the Nth frame is read according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state;
若所述第N帧图像读取完毕,则将第N+1帧图像写入所述缓存队列中。If the image of the Nth frame is read, the image of the (N+1)th frame is written into the buffer queue.
可选地,若所述第一读取状态为读取开始状态,则所述第二读取状态为读取结束状态;若所述第一读取状态为读取结束状态,则所述第二读取状态为读取开始状态。Optionally, if the first read state is a read start state, the second read state is a read end state; and if the first read state is a read end state, the first The second read state is the read start state.
可选地,所述根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕,包括:Optionally, the determining, according to the time-order relationship between the time variable value corresponding to the first read state and the time variable value corresponding to the current second read state, determining whether the image of the Nth frame is read, includes:
若所述读取开始状态对应的时间变量值小于所述读取结束状态对应的时间变量值,则确 定所述第N帧图像读取完毕。If the time variable value corresponding to the read start state is smaller than the time variable value corresponding to the read end state, The image of the Nth frame is read.
可选地,所述缓存队列包括用于存储左眼图像的第一空间和用于存储右眼图像的第二空间,所述第N帧图像为第N帧左眼图像或第N帧右眼图像;Optionally, the cache queue includes a first space for storing a left eye image and a second space for storing a right eye image, and the Nth frame image is an Nth frame left eye image or an Nth frame right eye image;
所述将第N+1帧图像写入所述缓存队列中,包括:Writing the image of the (N+1)th frame to the cache queue includes:
若所述第N帧图像为第N帧左眼图像,则将第N+1帧左眼图像写入所述缓存队列的第一空间中;If the Nth frame image is the Nth frame left eye image, the N+1th frame left eye image is written into the first space of the buffer queue;
若所述第N帧图像为第N帧右眼图像,则将第N+1帧右眼图像写入所述缓存队列的第二空间中。If the Nth frame image is the Nth frame right eye image, the N+1th frame right eye image is written into the second space of the buffer queue.
可选地,在所述将第N+1帧图像写入所述缓存队列中之前,还包括:Optionally, before the writing the (N+1)th frame image into the cache queue, the method further includes:
获取用户的姿态数据;Obtaining the posture data of the user;
根据所述姿态数据以及虚拟现实场景中各个物体的位置确定位于用户视野范围内的物体;Determining an object located within a field of view of the user according to the posture data and a position of each object in the virtual reality scene;
生成与所述位于用户视野范围内物体对应的所述第N+1帧左眼图像和所述第N+1帧右眼图像。Generating the (N+1)th left eye image and the (N+1)th right eye image corresponding to the object located within the user's field of view.
本发明实施例提供一种图像写入控制装置,包括:An embodiment of the present invention provides an image writing control apparatus, including:
更新模块,用于响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新所述第一读取状态对应的时间变量值为所述第一读取状态对应的触发时间;And an update module, configured to update a first read state corresponding to the read operation triggered by the Nth frame image in the cache queue by the display component, and update a time variable value corresponding to the first read state to the first read The trigger time corresponding to the state;
状态确定模块,用于根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕;a state determining module, configured to determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read;
写入模块,用于若所述第N帧图像读取完毕,则将第N+1帧图像写入所述缓存队列中。The writing module is configured to write the N+1th frame image into the buffer queue if the image of the Nth frame is read.
本发明实施例提供一种电子设备,包括:存储器,以及与所述存储器连接的处理器;An embodiment of the present invention provides an electronic device, including: a memory, and a processor connected to the memory;
所述存储器,用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令供所述处理器调用执行;The memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor;
所述处理器,用于执行所述一条或多条计算机指令以上述图像写入控制方法中的任意一种方法。The processor is configured to execute the one or more computer instructions in any one of the above image writing control methods.
本发明实施例提供的图像写入控制方法、装置及电子设备,头戴式虚拟现实设备的显示组件会对缓存队列中第N帧图像触发读取操作并同时产生一个第一读取状态。然后,头戴式显示设备响应于此读取操作产生的第一读取状态,从而得到读取操作的触发时间也即是第一读取状态对应的触发时间,再利用第一读取状态对应的触发时间更新第一读取状态对应的时间变量值。根据更新的第一读取状态对应的时间变量以及当前的第二读取状态对应的时间变量之间的先后关系确定头戴式虚拟现实设备是否已经将第N帧图像读取完毕。也即是头戴式 虚拟现实设备对图像的写入操作是受图像读取的完成情况控制的。若图像的读取操作已经完成,则头戴式虚拟现实设备才会开始将第N+1帧图像写入缓存队列中;若图像的读取操作没有完成,则头戴式虚拟现实设备会处于等待状态,不对图像进行写入操作。这样便可以保证图像的读取和写入都是分别完成的,不会出现读写冲突的情况,避免出现画面撕裂,提高了图像显示的质量。The image writing control method and device and the electronic device provided by the embodiments of the present invention, the display component of the head mounted virtual reality device triggers a read operation on the Nth frame image in the buffer queue and simultaneously generates a first read state. Then, the head-mounted display device responds to the first read state generated by the read operation, thereby obtaining the trigger time of the read operation, that is, the trigger time corresponding to the first read state, and correspondingly using the first read state. The trigger time updates the value of the time variable corresponding to the first read state. Determining whether the head-mounted virtual reality device has read the image of the Nth frame according to the sequential relationship between the time variable corresponding to the updated first read state and the time variable corresponding to the current second read state. Head-mounted The writing operation of the image by the virtual reality device is controlled by the completion of the image reading. If the image reading operation has been completed, the head mounted virtual reality device will start to write the N+1th frame image into the buffer queue; if the image reading operation is not completed, the head mounted virtual reality device will be in Waiting state, no image is written. In this way, it can ensure that the reading and writing of the image are completed separately, and there is no case of reading and writing conflicts, which avoids tearing of the screen and improves the quality of the image display.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本发明实施例提供的图像写入控制方法实施例一的流程图;FIG. 1 is a flowchart of Embodiment 1 of an image writing control method according to an embodiment of the present invention;
图2为本发明实施例提供的图像写入控制方法实施例二的流程图;2 is a flowchart of Embodiment 2 of an image writing control method according to an embodiment of the present invention;
图3为本发明实施例提供的图像写入控制装置实施例一的结构示意图;FIG. 3 is a schematic structural diagram of Embodiment 1 of an image writing control apparatus according to an embodiment of the present disclosure;
图4为本发明实施例提供的图像写入控制装置实施例二的结构示意图;4 is a schematic structural diagram of Embodiment 2 of an image writing control apparatus according to an embodiment of the present invention;
图5为本发明实施例提供的电子设备实施例一的结构示意图;FIG. 5 is a schematic structural diagram of Embodiment 1 of an electronic device according to an embodiment of the present disclosure;
图6为本发明实施例提供的头戴式虚拟现实设备的内部配置结构示意图。FIG. 6 is a schematic diagram of an internal configuration structure of a head mounted virtual reality device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
在本发明实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本发明。在本发明实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义,“多种”一般包含至少两种,但是不排除包含至少一种的情况。The terms used in the embodiments of the present invention are for the purpose of describing particular embodiments only and are not intended to limit the invention. The singular forms "a", "the", "the" and "the" Generally, at least two types are included, but the case of including at least one is not excluded.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三 种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" as used herein is merely an association describing the associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, while A and B, there are three separate B Kind of situation. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
应当理解,尽管在本发明实施例中可能采用术语第一、第二、第三等来描述XXX,但这些XXX不应限于这些术语。这些术语仅用来将XXX彼此区分开。例如,在不脱离本发明实施例范围的情况下,第一XXX也可以被称为第二XXX,类似地,第二XXX也可以被称为第一XXX。It should be understood that although the terms first, second, third, etc. may be used to describe XXX in embodiments of the invention, these XXX should not be limited to these terms. These terms are only used to distinguish XXX from each other. For example, the first XXX may also be referred to as a second XXX without departing from the scope of the embodiments of the present invention. Similarly, the second XXX may also be referred to as a first XXX.
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the words "if" and "if" as used herein may be interpreted to mean "when" or "when" or "in response to determining" or "in response to detecting." Similarly, depending on the context, the phrase "if determined" or "if detected (conditions or events stated)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event) "Time" or "in response to a test (condition or event stated)".
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。It should also be noted that the terms "including", "comprising" or "comprising" or any other variations thereof are intended to encompass a non-exclusive inclusion, such that the item or system comprising a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such goods or systems. An element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the item or system including the element, without further limitation.
通常情况下,头戴式虚拟现实设备会先将待显示图像写入缓存队列中,然后头戴式显示设备中的显示组件再从缓存队列中读取并渲染此待显示图像,此时用户便可以通过头戴式虚拟现实设备的显示屏幕观看到虚拟场景中的图像。为了可以使用户正常的看到虚拟场景中的图像,图1为本发明实施例提供的图像写入控制方法实施例一的流程图,本实施例提供的该图像写入控制方法的执行主体可以为头戴式虚拟现实设备,如图1所示,该方法包括如下步骤:Generally, the head-mounted virtual reality device first writes the image to be displayed into the cache queue, and then the display component in the head-mounted display device reads and renders the image to be displayed from the cache queue, and the user then The image in the virtual scene can be viewed through the display screen of the head mounted virtual reality device. In order to enable the user to see the image in the virtual scene normally, FIG. 1 is a flowchart of Embodiment 1 of the image writing control method according to the embodiment of the present invention, and the execution body of the image writing control method provided by the embodiment may be As a head mounted virtual reality device, as shown in FIG. 1, the method includes the following steps:
S101,响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新第一读取状态对应的时间变量值为第一读取状态对应的触发时间。S101. In response to the first read state generated by the read operation triggered by the display component triggering the image of the Nth frame in the cache queue, the time variable corresponding to the first read state is updated to be a trigger time corresponding to the first read state.
在开启头戴式虚拟现实设备之后,头戴式虚拟现实设备中的显示组件会定时发出图像读取信号。显示组件可以根据此图像读取信号控制图像的读取开始与结束,可选地,在实际应用中,常用的图像读取信号可以为垂直同步信号。After the head mounted virtual reality device is turned on, the display component in the head mounted virtual reality device periodically issues an image read signal. The display component can control the start and end of reading of the image according to the image read signal. Alternatively, in practical applications, the commonly used image read signal can be a vertical sync signal.
显示组件通过响应于图像读取控制信号来触发对缓存队列中的第N帧图像的读取操作,在触发此读取操作的同时显示组件还会产生第一读取状态。可选地,触发的读取操作可以是表示图像读取开始的操作也可以是表示图像读取结束的操作,对应地,此第一读取状态可以为读取开始状态,表示第N帧图像开始读取;也可以为读取结束状态,表示第N帧图像已经读取完成。The display component triggers a read operation on the Nth frame image in the buffer queue in response to the image read control signal, and the display component also generates a first read state while triggering the read operation. Optionally, the triggered read operation may be an operation indicating that the image reading is started or an operation indicating that the image reading is ended. Correspondingly, the first read state may be a read start state, indicating the Nth frame image. Start reading; also can be the reading end state, indicating that the Nth frame image has been read.
头戴式虚拟现实设备可以响应于此第一读取状态,获取到触发针对于第N帧图像的读取 操作的触发时间,此读取操作的触发时间也即是读取操作产生的第一读取状态对应的触发时间。之后,头戴式虚拟现实设备可以根据获取到的第一读取状态对应的触发时间更新第一读取状态对应的时间变量值。正如上述描述所涉及的,由于第一读取状态可以为读取开始状态也可以为读取结束状态,因此,更新后的第一读取状态对应的时间变量值有可能表示的是第N帧图像的读取开始时间,也有可能表示的是第N帧图像的读取结束时间。The head mounted virtual reality device can obtain a trigger for reading the image of the Nth frame in response to the first read state The trigger time of the operation, that is, the trigger time corresponding to the first read state generated by the read operation. Afterwards, the head-mounted virtual reality device may update the time variable value corresponding to the first read state according to the trigger time corresponding to the acquired first read state. As described in the above description, since the first read state may be the read start state or the read end state, the time variable value corresponding to the updated first read state may represent the Nth frame. The reading start time of the image may also indicate the reading end time of the image of the Nth frame.
S102,根据第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定第N帧图像是否读取完毕。S102: Determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read.
S103,若第N帧图像读取完毕,则将第N+1帧图像写入缓存队列中。S103. If the image of the Nth frame is read, the image of the (N+1)th frame is written into the buffer queue.
头戴式虚拟现实设备可以根据经过更新的第一读取状态对应的时间变量值以及当前的第二读取状态对应的时间变量值确定第N帧图像是否读取完毕,此处涉及的当前第二读取状态对应的时间变量值是在更新第一读取状态对应的时间变量值之前已经存在的一个时间变量值。需要说明的是,在实际应用,第一读取状态和第二读取状态是两个不同的读取状态。可选地,若第一读取状态为读取开始状态,则第二读取状态为读取结束状态;若第一读取状态为读取结束状态,则第二读取状态为读取开始状态。The head mounted virtual reality device may determine whether the image of the Nth frame is read according to the time variable value corresponding to the updated first read state and the time variable value corresponding to the current second read state, where the current The time variable value corresponding to the second read state is a time variable value that exists before updating the time variable value corresponding to the first read state. It should be noted that, in practical applications, the first read state and the second read state are two different read states. Optionally, if the first read state is a read start state, the second read state is a read end state; if the first read state is a read end state, the second read state is a read start state. status.
当第一读取状态对应的时间变量值表示第N帧图像读取开始的时间,第二读取状态对应的时间变量值表示第N-1帧图像读取结束的时间,则第一读取状态对应的时间变量值大于第二读取状态对应的时间变量值,此时,表明第N帧图像正在进行读取。此时,头戴式虚拟现实设备保持当前的等待状态,不会从缓存队列中读取第N+1帧图像。When the time variable value corresponding to the first read state indicates the time when the image reading of the Nth frame starts, and the time variable value corresponding to the second read state indicates the time when the image reading of the N-1th frame ends, the first read The value of the time variable corresponding to the state is greater than the value of the time variable corresponding to the second read state. At this time, it indicates that the image of the Nth frame is being read. At this time, the head mounted virtual reality device maintains the current waiting state and does not read the N+1th frame image from the buffer queue.
当第一读取状态对应的时间变量值表示第N帧图像读取开始的时间,第二读取状态对应的时间变量值表示第N帧图像读取结束的时间,则第一读取状态对应的时间变量值小于第二读取状态对应的时间变量值,此时,表明第N帧图像已经读取完毕,此时,头戴式虚拟现实设备可以继续将N+1帧图像写入缓存队列中。When the time variable value corresponding to the first read state indicates the time when the image reading of the Nth frame starts, and the time variable value corresponding to the second read state indicates the time when the image reading of the Nth frame ends, the first read state corresponds to The time variable value is smaller than the time variable value corresponding to the second read state. At this time, it indicates that the Nth frame image has been read. At this time, the head mounted virtual reality device can continue to write the N+1 frame image into the buffer queue. in.
本实施例中,头戴式虚拟现实设备的显示组件会对缓存队列中第N帧图像触发读取操作并同时产生一个第一读取状态。然后,头戴式显示设备响应于此读取操作产生的第一读取状态,从而得到读取操作的触发时间也即是第一读取状态对应的触发时间,再利用第一读取状态对应的触发时间更新第一读取状态对应的时间变量值。根据更新的第一读取状态对应的时间变量以及当前的第二读取状态对应的时间变量之间的先后关系确定头戴式虚拟现实设备是否已经将第N帧图像读取完毕。也即是头戴式虚拟现实设备对图像的写入操作是受图像读取的完成情况控制的。若图像的读取操作已经完成,则头戴式虚拟现实设备才会开始将第N+1帧图像写入缓存队列中;若图像的读取操作没有完成,则头戴式虚拟现实设备会处于等待状态,不对图像进行写入操作。这样便可以保证图像的读取和写入都是分别完成的,不会出现 读写冲突的情况,避免出现画面撕裂,提高了图像显示的质量。In this embodiment, the display component of the head mounted virtual reality device triggers a read operation on the Nth frame image in the buffer queue and simultaneously generates a first read state. Then, the head-mounted display device responds to the first read state generated by the read operation, thereby obtaining the trigger time of the read operation, that is, the trigger time corresponding to the first read state, and correspondingly using the first read state. The trigger time updates the value of the time variable corresponding to the first read state. Determining whether the head-mounted virtual reality device has read the image of the Nth frame according to the sequential relationship between the time variable corresponding to the updated first read state and the time variable corresponding to the current second read state. That is, the write operation of the image by the head-mounted virtual reality device is controlled by the completion of the image reading. If the image reading operation has been completed, the head mounted virtual reality device will start to write the N+1th frame image into the buffer queue; if the image reading operation is not completed, the head mounted virtual reality device will be in Waiting state, no image is written. This will ensure that the image is read and written separately and will not appear. The situation of reading and writing conflicts avoids tearing of the picture and improves the quality of image display.
图2为本发明实施例提供的图像写入控制方法实施例二的流程图,如图2所示,该方法包括如下步骤:FIG. 2 is a flowchart of Embodiment 2 of an image writing control method according to an embodiment of the present invention. As shown in FIG. 2, the method includes the following steps:
S201,响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新第一读取状态对应的时间变量值为第一读取状态对应的触发时间。S201. In response to the first read state generated by the read operation triggered by the display component triggering the image of the Nth frame in the cache queue, updating the time variable corresponding to the first read state is a trigger time corresponding to the first read state.
上述步骤S201执行过程与前述实施例的相应步骤相似,可以参见如图1所示实施例中的相关描述,在此再不赘述。The process of the foregoing step S201 is similar to the corresponding steps of the foregoing embodiment. For details, refer to the related description in the embodiment shown in FIG. 1 , and details are not described herein again.
S202,根据第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定第N帧图像是否读取完毕。S202. Determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read.
根据实施例一中的相关描述,第一读取状态和第二读取状态是两个不同的读取状态。很容易想到的,会出现以下两种情况:第一读取状态为读取开始状态时,第二读取状态为读取结束状态;第一读取状态为读取结束状态时,第二读取状态为读取开始状态。According to the related description in the first embodiment, the first read state and the second read state are two different read states. It is easy to think that the following two situations will occur: the first read state is the read start state, the second read state is the read end state; the first read state is the read end state, the second read state The status is taken as the read start status.
此时,当第一读取状态为读取开始状态且第二读取状态为读取结束状态时,第一读取状态对应的时间变量值即为读取开始状态对应的时间变量值,第二读取状态对应的时间变量值即为读取结束状态对应的时间变量值。根据实施例一中的相关描述可以得到:若读取开始状态对应的时间变量值小于读取结束状态对应的时间变量值,则确定第N帧图像读取完毕。At this time, when the first read state is the read start state and the second read state is the read end state, the time variable value corresponding to the first read state is the time variable value corresponding to the read start state, The time variable value corresponding to the second read state is the time variable value corresponding to the read end state. According to the related description in the first embodiment, if the time variable value corresponding to the read start state is smaller than the time variable value corresponding to the read end state, it is determined that the Nth frame image is read.
当第一读取状态为读取结束状态且第二读取状态为读取开始状态时,第一读取状态对应的时间变量值即为读取结束状态对应的时间变量值,第二读取状态对应的时间变量值即为读取开始状态对应的时间变量值。同样地,根据实施例一中的相关描述可以得到:若读取开始状态对应的时间变量值大于读取结束状态对应的时间变量值,则确定第N帧图像正在读取。When the first read state is the read end state and the second read state is the read start state, the time variable value corresponding to the first read state is the time variable value corresponding to the read end state, and the second read The time variable value corresponding to the state is the time variable value corresponding to the read start state. Similarly, according to the related description in the first embodiment, it can be obtained that if the time variable value corresponding to the read start state is greater than the time variable value corresponding to the read end state, it is determined that the Nth frame image is being read.
S203,若第N帧图像读取完毕,生成第N+1帧图像。S203: If the image of the Nth frame is read, the image of the (N+1)th frame is generated.
与观看普通的影像不同,用户在预先搭建的、360°的虚拟场景中观看到的场景与用户的姿态是密切相关的。因此,在第N帧图像读取完毕后,需要根据用户当前的姿态实时生成待写入的第N+1帧图像。Unlike viewing ordinary images, the scenes that users view in pre-built, 360° virtual scenes are closely related to the user's posture. Therefore, after the image of the Nth frame is read, the N+1th frame image to be written needs to be generated in real time according to the current posture of the user.
可选地,在第N帧图像读取完毕后,头戴式虚拟现实设备可以通过以下方式生成第N+1帧图像:Optionally, after the image of the Nth frame is read, the head mounted virtual reality device may generate the image of the (N+1)th frame by:
首先,获取用户的姿态数据。First, the user's posture data is acquired.
进而,根据姿态数据以及虚拟现实场景中各个物体的位置确定位于用户视野范围内的物体。Further, an object located within the visual field of the user is determined based on the posture data and the position of each object in the virtual reality scene.
最后,生成与位于用户视野范围内物体对应的第N+1帧图像。 Finally, an N+1th frame image corresponding to the object located within the user's field of view is generated.
具体地,配置于头戴式虚拟现实设备中的九轴传感器可以以预设的采集间隔采集用户的姿态数据。可选地,此姿态数据可以存储于固定的一个存储空间中。头戴式虚拟现实设备便可以从此存储空间中获取到用户当前的姿态数据,可选地,采集到的姿态数据可以为用户头部的姿态数据,例如用户头部的俯仰角、偏转角和航向角。Specifically, the nine-axis sensor disposed in the head-mounted virtual reality device may collect the posture data of the user at a preset collection interval. Optionally, the gesture data can be stored in a fixed storage space. The head-mounted virtual reality device can obtain the current posture data of the user from the storage space. Optionally, the collected posture data can be the posture data of the user's head, such as the pitch angle, the deflection angle, and the heading of the user's head. angle.
在360°的虚拟现实场景中,用户的视野范围是有限的,视野范围可以通过视角的大小来度量,成人的双眼视角一般为110°左右。同时,在虚拟现实场景搭建完成后,头戴式虚拟现实设备便可以获知虚拟现实场景中各个物体的位置坐标,可选地,可以将虚拟场景中各个物体的位置坐标写入一个文件中。因此,头戴式虚拟现实设备可以根据用户当前的姿态数据确定用户视野范围所对应的坐标范围,并从文件中筛选出属于用户视野范围内的物体。最后,头戴式虚拟现实设备便可以根据筛选出的物体生成第N+1帧图像。In a 360° virtual reality scene, the user's field of view is limited, and the field of view can be measured by the size of the angle of view. The adult's binocular angle is generally about 110°. At the same time, after the virtual reality scene is set up, the head-mounted virtual reality device can know the position coordinates of each object in the virtual reality scene. Optionally, the position coordinates of each object in the virtual scene can be written into a file. Therefore, the head-mounted virtual reality device can determine the coordinate range corresponding to the user's field of view according to the current posture data of the user, and filter out objects belonging to the user's field of view from the file. Finally, the head-mounted virtual reality device can generate an N+1th frame image based on the filtered object.
S204,将第N+1帧图像写入缓存队列中。S204. Write an image of the (N+1)th frame into the buffer queue.
在第N帧图像读取完毕后,头戴式虚拟现实设备便可以将生成的第N+1帧图像写入缓存队列中。After the image of the Nth frame is read, the head-mounted virtual reality device can write the generated image of the (N+1)th frame into the buffer queue.
另外,在头戴式虚拟现实设备中显示的图像都是具有立体效果的,这种立体效果是通过将两张具有视差的左眼图像和右眼图像进行合成而产生的。要想正常显示一帧具有立体效果的图像就需要分别读取并渲染左眼图像和右眼图像,也即是需要分别对左眼图像和右眼图像写入的时机进行准确地控制。In addition, the images displayed in the head-mounted virtual reality device all have a stereoscopic effect, which is produced by synthesizing two left-eye images and right-eye images having parallax. In order to normally display one frame of a stereoscopic image, it is necessary to separately read and render the left eye image and the right eye image, that is, it is necessary to accurately control the timing of writing the left eye image and the right eye image, respectively.
为了准确地控制左眼图像以及右眼图像写入的时机,可选地,可以将缓存队列划分为两个空间,即用于存储左眼图像的第一空间和用于存储右眼图像的第二空间。其中,上文以及下文中涉及的第N帧图像以及第N+1帧图像既可以同时为左眼图像也可以同时为右眼图像。In order to accurately control the timing of the left eye image and the right eye image writing, the buffer queue may be optionally divided into two spaces, that is, a first space for storing a left eye image and a second for storing a right eye image. Two spaces. The Nth frame image and the N+1th frame image referred to above and below may be both a left eye image and a right eye image.
若读取完毕的第N帧图像为第N帧左眼图像,则将第N+1帧左眼图像写入缓存队列的第一空间中。若读取完毕的第N帧图像为第N帧右眼图像,则将第N+1帧右眼图像写入缓存队列的第二空间中。If the read Nth frame image is the Nth frame left eye image, the N+1th left eye image is written into the first space of the buffer queue. If the read Nth frame image is the Nth frame right eye image, the N+1th frame right eye image is written into the second space of the buffer queue.
在此需要说明的是,本发明并不对图像读取的顺序进行限定,在对一帧图像对应的左眼图像和右眼图像进行读取的过程中,既可以先读取左眼图像也可以先读取右眼图像。It should be noted that the present invention does not limit the order of image reading. In the process of reading the left eye image and the right eye image corresponding to one frame image, the left eye image may be read first. Read the right eye image first.
本实施例中,进行写入控制的图像是需要根据用户的姿态数据进行实时生成的,这样可以保证用户通过头戴式虚拟现实设备观看到的内容和用户的姿态数据是匹配的。然后再将实时生成的左眼图像和右眼图像分别写入缓存队列中。同时此缓存队列是已经进行过空间划分的,也即是将缓存队列划分为第一空间和第二空间,并且第一空间和第二空间分别用于存储左眼图像和右眼图像。这样可以避免发生将左眼图像和右眼图像共同缓存于一个不划分空间的缓存队列中而容易出现的图像读取错误的情况,例如,应该读取左眼图像时却错误地读取 了右眼图像,使头戴式虚拟现实设备可以更加独立、准确地控制图像的写入时机。In this embodiment, the image for performing the write control needs to be generated in real time according to the posture data of the user, so that the content viewed by the user through the head-mounted virtual reality device and the posture data of the user are matched. Then, the left-eye image and the right-eye image generated in real time are respectively written into the cache queue. At the same time, the cache queue is spatially divided, that is, the cache queue is divided into a first space and a second space, and the first space and the second space are used to store a left eye image and a right eye image, respectively. This avoids the occurrence of an image reading error that is likely to occur when the left-eye image and the right-eye image are co-cached in a cache queue that is not divided into spaces. For example, the left-eye image should be read incorrectly. The right eye image enables the head mounted virtual reality device to control the writing timing of the image more independently and accurately.
图3为本发明实施例提供的图像写入控制装置实施例一的结构示意图,如图3所示,该图像写入控制装置包括:更新模块11、状态确定模块12、写入模块13。FIG. 3 is a schematic structural diagram of Embodiment 1 of an image writing control apparatus according to an embodiment of the present invention. As shown in FIG. 3, the image writing control apparatus includes: an updating module 11, a state determining module 12, and a writing module 13.
更新模块11,用于响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新第一读取状态对应的时间变量值为第一读取状态对应的触发时间。The update module 11 is configured to: in response to the first read state generated by the read operation triggered by the display component triggering the Nth frame image in the cache queue, update the time variable value corresponding to the first read state to correspond to the first read state Trigger time.
状态确定模块12,用于根据第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定第N帧图像是否读取完毕。The state determining module 12 is configured to determine whether the image of the Nth frame is read according to a time-order relationship between the time variable value corresponding to the first read state and the time variable value corresponding to the current second read state.
写入模块13,用于若第N帧图像读取完毕,则将第N+1帧图像写入缓存队列中。The writing module 13 is configured to write the N+1th frame image into the buffer queue if the image of the Nth frame is read.
图3所示装置可以执行图1所示实施例的方法,本实施例未详细描述的部分,可参考对图1所示实施例的相关说明。该技术方案的执行过程和技术效果参见图1所示实施例中的描述,在此不再赘述。The apparatus shown in FIG. 3 can perform the method of the embodiment shown in FIG. 1. For the parts not described in detail in this embodiment, reference may be made to the related description of the embodiment shown in FIG. 1. For the implementation process and technical effects of the technical solution, refer to the description in the embodiment shown in FIG. 1, and details are not described herein again.
图4为本发明实施例提供的图像写入控制装置实施例二的结构示意图,如图4所示,在图3所示实施例基础上,该图像写入控制装置中的调整模块12用于:若读取开始状态对应的时间变量值小于读取结束状态对应的时间变量值,则确定第N帧图像读取完毕。4 is a schematic structural diagram of Embodiment 2 of an image writing control apparatus according to an embodiment of the present invention. As shown in FIG. 4, based on the embodiment shown in FIG. 3, an adjustment module 12 in the image writing control apparatus is used. : If the time variable value corresponding to the read start state is smaller than the time variable value corresponding to the read end state, it is determined that the Nth frame image is read.
可选地,缓存队列包括用于存储左眼图像的第一空间和用于存储右眼图像的第二空间,第N帧图像为第N帧左眼图像或第N帧右眼图像;Optionally, the buffer queue includes a first space for storing a left eye image and a second space for storing a right eye image, and the Nth frame image is an Nth frame left eye image or an Nth frame right eye image;
该图像写入控制装置中的写入模块13具体用于:The writing module 13 in the image writing control device is specifically configured to:
若第N帧图像为第N帧左眼图像,则将第N+1帧左眼图像写入缓存队列的第一空间中,以及若第N帧图像为第N帧右眼图像,则将第N+1帧右眼图像写入缓存队列的第二空间中。If the image of the Nth frame is the left eye image of the Nth frame, the image of the left eye of the (N+1)th frame is written into the first space of the buffer queue, and if the image of the Nth frame is the image of the right eye of the Nth frame, The N+1 frame right eye image is written into the second space of the buffer queue.
可选地,该图像写入控制装置还包括:获取模块21、物体确定模块22和生成模块23。Optionally, the image writing control device further includes: an obtaining module 21, an object determining module 22, and a generating module 23.
获取模块21,用于获取用户的姿态数据。The obtaining module 21 is configured to acquire posture data of the user.
物体确定模块22,用于根据姿态数据以及虚拟现实场景中各个物体的位置确定位于用户视野范围内的物体。The object determining module 22 is configured to determine an object located within a visual field of the user according to the posture data and the position of each object in the virtual reality scene.
生成模块23,用于生成与位于用户视野范围内物体对应的第N+1帧左眼图像和第N+1帧右眼图像。The generating module 23 is configured to generate an N+1th left eye image and an N+1th right eye image corresponding to the object located in the visual field of the user.
图4所示装置可以执行图2所示实施例的方法,本实施例未详细描述的部分,可参考对图2所示实施例的相关说明。该技术方案的执行过程和技术效果参见图2所示实施例中的描述,在此不再赘述。 The apparatus shown in FIG. 4 can perform the method of the embodiment shown in FIG. 2. For the parts not described in detail in this embodiment, reference may be made to the related description of the embodiment shown in FIG. 2. For the implementation process and technical effects of the technical solution, refer to the description in the embodiment shown in FIG. 2, and details are not described herein again.
以上描述了图像写入控制装置的内部功能和结构,在一个可能的设计中,图像写入控制装置的结构可实现为一电子设备,该电子设备比如为头戴式虚拟现实设备。图5为本发明实施例提供的电子设备实施例一的结构示意图,如图5所示,该电子设备包括:存储器31,以及与存储器连接的处理器32,存储器31用于存储电子设备执行上述任一实施例中提供的图像写入控制方法的程序,处理器32被配置为用于执行存储器31中存储的程序。The internal functions and structures of the image writing control device have been described above. In one possible design, the structure of the image writing control device can be implemented as an electronic device such as a head mounted virtual reality device. 5 is a schematic structural diagram of Embodiment 1 of an electronic device according to an embodiment of the present invention. As shown in FIG. 5, the electronic device includes: a memory 31, and a processor 32 connected to the memory, where the memory 31 is used to store the electronic device to perform the above. The program of the image write control method provided in any of the embodiments, the processor 32 is configured to execute a program stored in the memory 31.
程序包括一条或多条计算机指令,其中,一条或多条计算机指令被处理器32执行时能够实现如下步骤:The program includes one or more computer instructions, wherein one or more computer instructions are executed by the processor 32 to:
响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新第一读取状态对应的时间变量值为第一读取状态对应的触发时间;And in response to the first read state generated by the read operation triggered by the display component triggering the image of the Nth frame in the cache queue, updating the time variable corresponding to the first read state is a trigger time corresponding to the first read state;
根据第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定第N帧图像是否读取完毕;Determining whether the image of the Nth frame is read according to a time-order relationship between the value of the time variable corresponding to the first read state and the value of the time variable corresponding to the current second read state;
若第N帧图像读取完毕,则将第N+1帧图像写入缓存队列中。If the image of the Nth frame is read, the image of the (N+1)th frame is written into the buffer queue.
可选地,处理器32还用于执行前述各方法步骤中的全部或部分步骤。Optionally, the processor 32 is further configured to perform all or part of the foregoing method steps.
其中,电子设备的结构中还可以包括通信接口33,用于电子设备与其他设备或通信网络通信。The structure of the electronic device may further include a communication interface 33 for the electronic device to communicate with other devices or a communication network.
图6为本发明实施例提供的一种头戴式虚拟现实设备的内部配置结构示意图。FIG. 6 is a schematic diagram of an internal configuration structure of a head mounted virtual reality device according to an embodiment of the present invention.
显示单元401可以包括显示面板,显示面板设置在头戴式虚拟显示设备400上面向用户面部的侧表面,可以为一整块面板、或者为分别对应用户左眼和右眼的左面板和右面板。显示面板可以为电致发光(Electroluminescent,简称EL)元件、液晶显示器或具有类似结构的微型显示器、或者视网膜可直接显示或类似的激光扫描式显示器。The display unit 401 may include a display panel disposed on a side surface of the head mounted virtual display device 400 facing the user's face, and may be a whole panel or a left panel and a right panel corresponding to the left and right eyes of the user respectively. . The display panel may be an electroluminescent (EL) component, a liquid crystal display or a microdisplay having a similar structure, or a laser-scanned display in which the retina can be directly displayed or similar.
虚拟图像光学单元402以放大方式拍摄显示单元401所显示的图像,并允许用户按放大的虚拟图像观察所显示的图像。作为输出到显示单元401上的显示图像,可以是从内容再现设备(蓝光光碟或DVD播放器)或流媒体服务器提供的虚拟场景的图像、或者使用外部相机410拍摄的现实场景的图像。一些实施例中,虚拟图像光学单元402可以包括透镜单元,例如球面透镜、非球面透镜、菲涅尔透镜等。The virtual image optical unit 402 photographs the image displayed by the display unit 401 in an enlarged manner and allows the user to observe the displayed image in the enlarged virtual image. As the display image outputted to the display unit 401, it may be an image of a virtual scene supplied from a content reproduction device (a Blu-ray disc or a DVD player) or a streaming server, or an image of a real scene photographed using an external camera 410. In some embodiments, virtual image optical unit 402 can include a lens unit, such as a spherical lens, an aspheric lens, a Fresnel lens, and the like.
输入操作单元403包括至少一个用来执行输入操作的操作部件,例如按键、按钮、开关或者其他具有类似功能的部件,通过操作部件接收用户指令,并且向控制单元407输出指令。The input operation unit 403 includes at least one operation member for performing an input operation, such as a button, a button, a switch, or other similarly functioned component, receives a user instruction through the operation member, and outputs an instruction to the control unit 407.
状态信息获取单元404用于获取穿戴头戴式虚拟显示设备400的用户的状态信息。状态信息获取单元404可以包括各种类型的传感器,用于自身检测状态信息,并可以通过通信单元405从外部设备,例如智能手机、腕表和用户穿戴的其它多功能终端,获取状态信息。状态信息获 取单元404可以获取用户的头部的位置信息和/或姿态信息。状态信息获取单元404可以包括陀螺仪传感器、加速度传感器、全球定位系统(Global Positioning System,简称GPS)传感器、地磁传感器、多普勒效应传感器、红外传感器、射频场强度传感器中的一个或者多个。此外,状态信息获取单元404获取穿戴头戴式虚拟显示设备400的用户的状态信息,例如获取用户的操作状态(如用户是否穿戴头戴式虚拟显示设备400)、用户的动作状态(诸如静止、行走、跑动和诸如此类的移动状态,手或指尖的姿势、眼睛的开或闭状态、视线方向、瞳孔尺寸)、精神状态(用户是否沉浸在观察所显示的图像以及诸如此类的),甚至生理状态。The status information acquiring unit 404 is configured to acquire status information of the user wearing the head mounted virtual display device 400. The status information acquisition unit 404 may include various types of sensors for detecting status information by itself, and may acquire status information from the external device such as a smartphone, a wristwatch, and other multi-function terminals worn by the user through the communication unit 405. Status information obtained The fetching unit 404 can acquire location information and/or posture information of the user's head. The status information acquisition unit 404 may include one or more of a gyro sensor, an acceleration sensor, a Global Positioning System (GPS) sensor, a geomagnetic sensor, a Doppler effect sensor, an infrared sensor, and a radio frequency field intensity sensor. Further, the state information acquisition unit 404 acquires state information of the user wearing the head-mounted virtual display device 400, for example, acquiring an operation state of the user (eg, whether the user wears the head-mounted virtual display device 400), an action state of the user (such as still, Walking, running, and the like, the posture of the hand or fingertip, the open or closed state of the eye, the direction of the line of sight, the size of the pupil, the mental state (whether the user is immersed in the image displayed by the observation, and the like), and even the physiological status.
通信单元405执行与外部装置的通信处理、调制和解调处理、以及通信信号的编码和解码处理。另外,控制单元407可以从通信单元405向外部装置发送传输数据。通信方式可以是有线或者无线形式,例如移动高清链接(Mobile High-Definition Link,简称MHL)或通用串行总线(Universal Serial Bus,简称USB)、高清多媒体接口(High Definition Multimedia Interface,简称HDMI)、无线保真(Wireless Fidelity,简称Wi-Fi)、蓝牙通信或低功耗蓝牙通信,以及IEEE802.11s标准的网状网络等。另外,通信单元405可以是根据宽带码分多址(Wideband Code Division Multiple Access,简称W-CDMA)、长期演进(Long Term Evolution,简称LTE)和类似标准操作的蜂窝无线收发器。The communication unit 405 performs communication processing, modulation and demodulation processing with an external device, and encoding and decoding processing of the communication signal. In addition, the control unit 407 can transmit transmission data from the communication unit 405 to an external device. The communication method may be wired or wireless, for example, Mobile High-Definition Link (MHL) or Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), Wireless Fidelity (Wi-Fi), Bluetooth communication or Bluetooth low energy communication, and the mesh network of the IEEE802.11s standard. In addition, the communication unit 405 may be a cellular radio transceiver that operates according to Wideband Code Division Multiple Access (W-CDMA), Long Term Evolution (LTE), and the like.
一些实施例中,头戴式虚拟显示设备400还可以包括存储单元,存储单元406是配置为具有固态驱动器(Solid State Drives,简称SSD)等的大容量存储设备。一些实施例中,存储单元406可以存储应用程序或各种类型的数据。例如,用户使用头戴式虚拟显示设备400观看的内容可以存储在存储单元406中。In some embodiments, the head mounted virtual display device 400 may further include a storage unit, and the storage unit 406 is a mass storage device configured to have Solid State Drives (SSD) or the like. In some embodiments, storage unit 406 can store applications or various types of data. For example, content viewed by a user using the head mounted virtual display device 400 may be stored in the storage unit 406.
一些实施例中,头戴式虚拟显示设备400还可以包括控制单元,控制单元407可以包括计算机处理单元(Central Processing Unit,简称CPU)或者其他具有类似功能的设备。一些实施例中,控制单元407可以用于执行存储单元406存储的应用程序,或者控制单元407还可以用于执行本申请一些实施例公开的方法、功能和操作的电路。In some embodiments, the head mounted virtual display device 400 may further include a control unit, and the control unit 407 may include a Central Processing Unit (CPU) or other device having similar functions. In some embodiments, control unit 407 can be used to execute an application stored by storage unit 406, or control unit 407 can also be used to perform the methods, functions, and operations disclosed in some embodiments of the present application.
图像处理单元408用于执行信号处理,比如与从控制单元407输出的图像信号相关的图像质量校正,以及将其分辨率转换为根据显示单元401的屏幕的分辨率。然后,显示驱动单元404依次选择显示单元401的每行像素,并逐行依次扫描显示单元401的每行像素,因而提供基于经信号处理的图像信号的像素信号。The image processing unit 408 is for performing signal processing such as image quality correction related to the image signal output from the control unit 407, and converting its resolution into a resolution according to the screen of the display unit 401. Then, the display driving unit 404 sequentially selects each line of pixels of the display unit 401, and sequentially scans each line of pixels of the display unit 401 line by line, thereby providing a pixel signal based on the signal-processed image signal.
一些实施例中,头戴式虚拟显示设备400还可以包括外部相机。外部相机410可以设置在头戴式虚拟显示设备400主体前表面,外部相机410可以为一个或者多个。外部相机410可以获取三维信息,并且也可以用作距离传感器。另外,探测来自物体的反射信号的位置灵敏探测器(Position Sensitive Detector,简称PSD)或者其他类型的距离传感器可以与外部相机410一起 使用。外部相机410和距离传感器可以用于检测穿戴头戴式虚拟显示设备400的用户的身体位置、姿态和形状。另外,一定条件下用户可以通过外部相机410直接观看或者预览现实场景。In some embodiments, the head mounted virtual display device 400 can also include an external camera. The external camera 410 may be disposed on the front surface of the main body of the head-mounted virtual display device 400, and the external camera 410 may be one or more. The external camera 410 can acquire three-dimensional information and can also be used as a distance sensor. In addition, a Position Sensitive Detector (PSD) or other type of distance sensor that detects a reflected signal from an object may be combined with the external camera 410. use. The external camera 410 and the distance sensor can be used to detect the body position, posture, and shape of the user wearing the head mounted virtual display device 400. In addition, under certain conditions, the user can directly view or preview the real scene through the external camera 410.
一些实施例中,头戴式虚拟显示设备400还可以包括声音处理单元,声音处理单元411可以执行从控制单元407输出的声音信号的声音质量校正或声音放大,以及输入声音信号的信号处理等。然后,声音输入/输出单元412在声音处理后向外部输出声音以及输入来自麦克风的声音。In some embodiments, the head mounted virtual display device 400 may further include a sound processing unit 411 that may perform sound quality correction or sound amplification of the sound signal output from the control unit 407, signal processing of the input sound signal, and the like. Then, the sound input/output unit 412 outputs the sound to the outside and the sound from the microphone after the sound processing.
需要说明的是,图6中粗线框示出的结构或部件可以独立于头戴式虚拟显示设备400之外,例如可以设置在外部处理系统,例如计算机系统,中与头戴式虚拟显示设备400配合使用;或者,虚线框示出的结构或部件可以设置在头戴式虚拟显示设备400内部或者表面上。It should be noted that the structure or components shown by the thick line frame in FIG. 6 may be independent of the head mounted virtual display device 400, for example, may be disposed in an external processing system, such as a computer system, and a head mounted virtual display device. The 400 is used in conjunction; or the structure or component shown by the dashed box may be disposed inside or on the surface of the head mounted virtual display device 400.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without deliberate labor.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助加必需的通用硬件平台的方式来实现,当然也可以通过硬件和软件结合的方式来实现。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以产品的形式体现出来,该计算机产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by adding a necessary general hardware platform, and can also be implemented by a combination of hardware and software. Based on such understanding, the above-described technical solutions may be embodied in the form of products in essence or in the form of products, which may be stored in a computer readable storage medium such as a ROM/RAM, a disk, An optical disk or the like includes a number of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments or portions of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

  1. 一种图像写入控制方法,其特征在于,包括:An image writing control method, comprising:
    响应于显示组件对缓存队列中第N帧图像触发的读取操作产生的第一读取状态,更新所述第一读取状态对应的时间变量值为所述第一读取状态对应的触发时间;And updating a time variable corresponding to the first read state to a trigger time corresponding to the first read state, in response to the first read state generated by the read operation triggered by the display component triggering the image of the Nth frame in the cache queue ;
    根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕;Determining whether the image of the Nth frame is read according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state;
    若所述第N帧图像读取完毕,则将第N+1帧图像写入所述缓存队列中。If the image of the Nth frame is read, the image of the (N+1)th frame is written into the buffer queue.
  2. 根据权利要求1所述的方法,其特征在于,若所述第一读取状态为读取开始状态,则所述第二读取状态为读取结束状态;若所述第一读取状态为读取结束状态,则所述第二读取状态为读取开始状态。The method according to claim 1, wherein if the first read state is a read start state, the second read state is a read end state; if the first read state is When the end state is read, the second read state is a read start state.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕,包括:The method according to claim 2, wherein the determining the Nth according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to a current second read state Whether the frame image has been read, including:
    若所述读取开始状态对应的时间变量值小于所述读取结束状态对应的时间变量值,则确定所述第N帧图像读取完毕。If the time variable value corresponding to the read start state is smaller than the time variable value corresponding to the read end state, it is determined that the Nth frame image is read.
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述缓存队列包括用于存储左眼图像的第一空间和用于存储右眼图像的第二空间,所述第N帧图像为第N帧左眼图像或第N帧右眼图像;The method according to any one of claims 1 to 3, wherein the buffer queue includes a first space for storing a left eye image and a second space for storing a right eye image, the Nth The frame image is an Nth frame left eye image or an Nth frame right eye image;
    所述将第N+1帧图像写入所述缓存队列中,包括:Writing the image of the (N+1)th frame to the cache queue includes:
    若所述第N帧图像为第N帧左眼图像,则将第N+1帧左眼图像写入所述缓存队列的第一空间中;If the Nth frame image is the Nth frame left eye image, the N+1th frame left eye image is written into the first space of the buffer queue;
    若所述第N帧图像为第N帧右眼图像,则将第N+1帧右眼图像写入所述缓存队列的第二空间中。If the Nth frame image is the Nth frame right eye image, the N+1th frame right eye image is written into the second space of the buffer queue.
  5. 根据权利要求4所述的方法,其特征在于,在所述将第N+1帧图像写入所述缓存队列中之前,还包括:The method according to claim 4, further comprising: before the writing the (N+1)th frame image into the buffer queue,
    获取用户的姿态数据;Obtaining the posture data of the user;
    根据所述姿态数据以及虚拟现实场景中各个物体的位置确定位于用户视野范围内的物体;Determining an object located within a field of view of the user according to the posture data and a position of each object in the virtual reality scene;
    生成与所述位于用户视野范围内物体对应的所述第N+1帧左眼图像和所述第N+1帧右眼图像。Generating the (N+1)th left eye image and the (N+1)th right eye image corresponding to the object located within the user's field of view.
  6. 一种图像写入控制装置,其特征在于,包括: An image writing control device, comprising:
    更新模块,用于响应于显示组件对缓存队列中第N帧图像触发的第一读取状态,更新所述第一读取状态对应的时间变量值为所述第一读取状态对应的触发时间;And an update module, configured to: in response to the first read state triggered by the display component to the image of the Nth frame in the cache queue, update a time variable corresponding to the first read state to a trigger time corresponding to the first read state ;
    状态确定模块,用于根据所述第一读取状态对应的时间变量值和当前第二读取状态对应的时间变量值的时间先后关系,确定所述第N帧图像是否读取完毕;a state determining module, configured to determine, according to a time-order relationship between a time variable value corresponding to the first read state and a time variable value corresponding to the current second read state, whether the image of the Nth frame is read;
    写入模块,用于若所述第N帧图像读取完毕,则将第N+1帧图像写入所述缓存队列中。The writing module is configured to write the N+1th frame image into the buffer queue if the image of the Nth frame is read.
  7. 一种电子设备,其特征在于,包括:存储器,以及与所述存储器连接的处理器;An electronic device, comprising: a memory, and a processor coupled to the memory;
    所述存储器,用于存储一条或多条计算机指令,其中,所述一条或多条计算机指令供所述处理器调用执行;The memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor;
    所述处理器,用于执行所述一条或多条计算机指令以实现权利要求1至5中任一项所述的图像写入控制方法。The processor is configured to execute the one or more computer instructions to implement the image writing control method according to any one of claims 1 to 5.
  8. 一种存储有计算机程序的计算机可读存储介质,其特征在于,所述计算机程序使计算机执行时实现如权利要求1至5中任一项所述的图像写入控制方法。 A computer readable storage medium storing a computer program, wherein the computer program causes the computer to execute the image writing control method according to any one of claims 1 to 5.
PCT/CN2017/113567 2017-10-31 2017-11-29 Image writing control method and apparatus, and electronic device WO2019085109A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711047759.5A CN107743223A (en) 2017-10-31 2017-10-31 Image write-in control method, device and electronic equipment
CN201711047759.5 2017-10-31

Publications (1)

Publication Number Publication Date
WO2019085109A1 true WO2019085109A1 (en) 2019-05-09

Family

ID=61233469

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/113567 WO2019085109A1 (en) 2017-10-31 2017-11-29 Image writing control method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN107743223A (en)
WO (1) WO2019085109A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153414A (en) * 2021-11-27 2022-03-08 深圳曦华科技有限公司 Image anti-tearing method and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150277121A1 (en) * 2014-03-29 2015-10-01 Ron Fridental Method and apparatus for displaying video data
CN106095366A (en) * 2016-06-07 2016-11-09 北京小鸟看看科技有限公司 A kind of shorten the method for picture delay, device and virtual reality device
CN106331823A (en) * 2016-08-31 2017-01-11 北京奇艺世纪科技有限公司 Video playing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9905199B2 (en) * 2014-09-17 2018-02-27 Mediatek Inc. Processor for use in dynamic refresh rate switching and related electronic device and method
CN106296566B (en) * 2016-08-12 2019-05-17 南京睿悦信息技术有限公司 A kind of virtual reality mobile terminal dynamic time frame compensation rendering system and method
CN106454312A (en) * 2016-09-29 2017-02-22 乐视控股(北京)有限公司 Image processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150277121A1 (en) * 2014-03-29 2015-10-01 Ron Fridental Method and apparatus for displaying video data
CN106095366A (en) * 2016-06-07 2016-11-09 北京小鸟看看科技有限公司 A kind of shorten the method for picture delay, device and virtual reality device
CN106331823A (en) * 2016-08-31 2017-01-11 北京奇艺世纪科技有限公司 Video playing method and device

Also Published As

Publication number Publication date
CN107743223A (en) 2018-02-27

Similar Documents

Publication Publication Date Title
US10484600B2 (en) Electronic apparatus and controlling method thereof
US10534428B2 (en) Image processing device and image processing method, display device and display method, and image display system
CA2913650C (en) Virtual object orientation and visualization
US9076033B1 (en) Hand-triggered head-mounted photography
KR20180074369A (en) Method and Apparatus for Managing Thumbnail of 3-dimensional Contents
US9411162B2 (en) Mixed reality presenting system, virtual reality presenting system, display apparatus, information processing apparatus, control method, and program
JP6720341B2 (en) Virtual reality device and method for adjusting its contents
WO2018223663A1 (en) Vr image processing method, device, and apparatus
US10521013B2 (en) High-speed staggered binocular eye tracking systems
WO2019128251A1 (en) Method for renaming bluetooth module, and electronic device
US10997741B2 (en) Scene camera retargeting
WO2019015249A1 (en) Virtual-reality-based image display method and apparatus, and virtual reality helmet device
WO2019019232A1 (en) Method for playing video based on vr head-mounted device, and vr head-mounted device
WO2019061800A1 (en) Virtual scene switching method and head-mounted display device
US11749141B2 (en) Information processing apparatus, information processing method, and recording medium
JP6515512B2 (en) Display device, display device calibration method, and calibration program
WO2019085109A1 (en) Image writing control method and apparatus, and electronic device
WO2019061799A1 (en) Unlocking method and virtual reality device
US11328456B2 (en) Method and device for presenting synthesized reality companion content
CN107958478B (en) Rendering method of object in virtual reality scene and virtual reality head-mounted equipment
US20220058847A1 (en) Moving an avatar based on real-world data
US10628113B2 (en) Information processing apparatus
US11838486B1 (en) Method and device for perspective correction using one or more keyframes
CN108108019B (en) Virtual reality equipment and display method thereof
US20220180473A1 (en) Frame Rate Extrapolation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17930708

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17930708

Country of ref document: EP

Kind code of ref document: A1