Giter Site home page Giter Site logo

image-processing-using-ml's Introduction

Ship Survival Game

Welcome to the "Ship Survival Game"! In this innovative game, you take control of a pirate ship on a quest to find a hidden treasure. Your journey will take you through challenging seas filled with other pirates and dangerous creatures. Use your hand gestures to navigate the ship, avoid collisions, and reach the treasure.

App Screenshot

Game Innovation

The game introduces a unique control mechanism using hand gestures captured through a camera using OpenCV. The player can control the ship's movement left and right based on the hand gestures(open hand and fist) recognized by the system. The game also features an immersive story that unfolds as you progress through different levels.

Game Story

Level 1

App Screenshot

Gameplay

Controls:

  • Use hand gestures to control the ship.
  • Fist Gesture: Move the ship left.
  • Open Hand Gesture: Move the ship right.

Objective:

  • Reach the treasure without colliding with other pirates and creatures. Score points by avoiding collisions and progressing through levels.

Scoring:

  • Earn points by avoiding collisions with enemy ships. The game becomes more challenging as you progress.

How to play

  • Run the game script.
  • The main menu will appear.
  • Click the "Play" button to start the game.
  • Follow the on-screen instructions to navigate the ship using hand gestures.
  • Reach the treasure to advance to the next level.
  • Watch out for enemy ships and creatures โ€“ avoid collisions!
  • If your ship collides, the game will display a game over screen.
  • You can choose to play again (press 'Y') or exit (press 'N').

Technical Details

The game is implemented in Python using the Pygame library for graphics and input handling. OpenCV is employed for hand gesture recognition, allowing players to control the ship through webcam input.

Hand Gesture Recognition Method

The game leverages OpenCV for hand gesture recognition. The relevant function, imageFiltering, performs the following steps:

ROI Extraction:

  • Extracts the Region of Interest (ROI) from the webcam frame based on specified coordinates (x, y, w, h).

Image Preprocessing:

  • Applies Gaussian blur to reduce noise.
  • Converts the image from colored to HSV (Hue, Saturation, Value).
  • Applies a mask to isolate skin color.

Contour Detection:

  • Finds contours in the thresholded image.
  • Utilizes convex hull and convexity defects for hand gesture analysis.

Gesture Recognition:

  • Detects the number of defects in the hand gesture(more defects likely to be fist).
  • Determines if the gesture represents a fist or an open hand.

Dependencies

  • Python
  • Pygame
  • OpenCV

image-processing-using-ml's People

Contributors

rajvinayak1809 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.