0% found this document useful (0 votes)
56 views

Virtual Reality With Cv2 in Python

The document discusses using computer vision (cv2) and keyboard automation (pyautogui) in Python to create virtual reality games. It describes creating a VR version of the Google Dino game by opening the game in a browser, starting the webcam to capture motion, and using cv2 to detect color and pyautogui to press keys based on detected motion. The document then states it will also create a VR version of Minecraft using these same techniques and libraries.

Uploaded by

Stutya Patwal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Virtual Reality With Cv2 in Python

The document discusses using computer vision (cv2) and keyboard automation (pyautogui) in Python to create virtual reality games. It describes creating a VR version of the Google Dino game by opening the game in a browser, starting the webcam to capture motion, and using cv2 to detect color and pyautogui to press keys based on detected motion. The document then states it will also create a VR version of Minecraft using these same techniques and libraries.

Uploaded by

Stutya Patwal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

By Stutya Patwal 1

Virtual Reality with cv2 in python

Stutya Patwal

___

Author Note

Gmail: [email protected]
BY STUTYA PATWAL 2

Abstract

All we need here is a computer, camera and a pro programmer. We will simply use cv2 to detect

movement and pyautogui to press keys. First, we will make google dino game vr. After that we

will make Minecraft vr. After that we will understand how we have done this

Minecraft: A famous voxel game

Cv2: A module in python used to access the camera

Pyautogui: Used to press keys on keyboard on a computer or laptop


BY STUTYA PATWAL 3

Virtual Reality with cv2 in python

So First let’s do this with google dino

Vr Google Dino

First, we need to install the following modules –

 Cv2

 PyAutoGui

 PyWhatKit

First, we need to open the game -

pywhatkit.search(“chrome://dino/”)

After that we need to open the camera –

import cv2

vid = cv2.VideoCapture(0)

while(True):

frame = vid.read()

cv2.imshow('frame', frame)

if cv2.waitKey(1) & 0xFF == ord('q'):

break

vid.release()

cv2.destroyAllWindows()

After that we will detect a colour


BY STUTYA PATWAL 4

[Heading 2]1

[To add a table of contents (TOC), apply the appropriate heading style to just the heading text at

the start of a paragraph and it will show up in your TOC. To do this, select the text for your

heading. Then, on the Home tab, in the Styles gallery, click the style you need.]

[Heading 3].

[Include a period at the end of a run-in heading. Note that you can include consecutive

paragraphs with their own headings, where appropriate.]

[Heading 4].

[When using headings, don’t skip levels. If you need a heading 3, 4, or 5 with no text

following it before the next heading, just add a period at the end of the heading and then start a

new paragraph for the subheading and its text.] (Last Name, Year)

[Heading 5].

[Like all sections of your paper, references start on their own page. The references page

that follows is created using the Citations & Bibliography feature, available on the References

tab. This feature includes a style option that formats your references for APA 6th Edition. You

can also use this feature to add in-text citations that are linked to your source, such as those

shown at the end of this paragraph and the preceding paragraph. To customize a citation, right-

click it and then click Edit Citation.] (Last Name, Year)


BY STUTYA PATWAL 5

References

Last Name, F. M. (Year). Article Title. Journal Title, Pages From - To.

Last Name, F. M. (Year). Book Title. City Name: Publisher Name.


BY STUTYA PATWAL 6

Footnotes
1
[Add footnotes, if any, on their own page following references. For APA formatting

requirements, it’s easy to just type your own footnote references and notes. To format a footnote

reference, select the number and then, on the Home tab, in the Styles gallery, click Footnote

Reference. The body of a footnote, such as this example, uses the Normal text style. (Note: If

you delete this sample footnote, don’t forget to delete its in-text reference as well. That’s at the

end of the sample Heading 2 paragraph on the first page of body content in this template.)]
BY STUTYA PATWAL 7

Tables

Table 1

[Table Title]

Column Head Column Head Column Head Column Head Column Head
Row Head 123 123 123 123
Row Head 456 456 456 456
Row Head 789 789 789 789
Row Head 123 123 123 123
Row Head 456 456 456 456
Row Head 789 789 789 789

Note: [Place all tables for your paper in a tables section, following references (and, if applicable,

footnotes). Start a new page for each table, include a table number and table title for each, as

shown on this page. All explanatory text appears in a table note that follows the table, such as

this one. Use the Table/Figure style, available on the Home tab, in the Styles gallery, to get the

spacing between table and note. Tables in APA format can use single or 1.5 line spacing.

Include a heading for every row and column, even if the content seems obvious. A default table

style has been setup for this template that fits APA guidelines. To insert a table, on the Insert tab,

click Table.]
BY STUTYA PATWAL 8

Figures title:

0
Category 1 Category 2 Category 3 Category 4

Series 1 Series 2 Series 3

Figure 1. [Include all figures in their own section, following references (and footnotes and tables,

if applicable). Include a numbered caption for each figure. Use the Table/Figure style for easy

spacing between figure and caption.]

For more information about all elements of APA formatting, please consult the APA Style

Manual, 6th Edition.

You might also like