Skip to content

About

Its a program can detect motion on 2 bmp files by comparing pixel intensties

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

📸 Motion Detection

🇬🇧 English

📌 About the Project

Motion Detection is a Python program that detects motion between two BMP image files by comparing pixel intensity values. The images are converted to grayscale and analyzed to determine if motion has occurred between them. The result is saved as a new output image.

This project is useful for basic image processing demonstrations, learning motion detection logic, and experimenting with pixel-based comparison algorithms in Python.


✨ Features

  • Read and write BMP image files
  • Convert images to grayscale
  • Detect motion between two images
  • Save output image with motion highlights

🧰 Tech Stack

  • Programming Language: Python 3.x

🚀 Installation

  1. Clone the repository:

    git clone https://github.com/ollqherTR/Motion-Detection.git
    cd Motion-Detection
  2. (Optional) Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate   # macOS/Linux
    venv\Scripts\activate    # Windows
  3. Install dependencies (if any):

    pip install -r requirements.txt

▶️ Usage

  1. Place two BMP images (e.g., sample1.bmp, sample2.bmp) in the project directory.

  2. Run the motion detection script:

    python Main.py
  3. The program will produce:

    • Grayscale versions of images
    • A result image (result.bmp) showing motion detection output
  4. The terminal will indicate whether motion was detected or not.


📈 How It Works

The program loads two BMP images, converts them to grayscale, and compares pixel values between the two frames. Changes above a certain threshold are considered motion. This method uses basic background subtraction and pixel difference, common in simple motion detection tasks.


🇹🇷 Türkçe

📌 Proje Hakkında

Motion Detection, iki BMP resim dosyası arasındaki hareketi, piksel yoğunluklarını karşılaştırarak tespit eden bir Python programıdır. Resimler gri tonlara dönüştürülür ve piksel farkları kullanılarak hareket analizi yapılır. Sonuç yeni bir BMP dosyası olarak kaydedilir.

Bu proje, temel görüntü işleme gösterimleri, basit hareket tespiti algoritmalarını öğrenmek ve Python ile piksel karşılaştırma mantığını denemek için uygundur.


✨ Özellikler

  • BMP görüntü dosyalarını okuma ve yazma
  • Görüntüleri gri tona dönüştürme
  • İki resim arasında hareket tespiti
  • Hareket sonucunu içeren yeni BMP dosyası oluşturma

🧰 Teknoloji

  • Programlama Dili: Python 3.x

🚀 Kurulum

  1. Depoyu klonlayın:

    git clone https://github.com/ollqherTR/Motion-Detection.git
    cd Motion-Detection
  2. (İsteğe bağlı) Sanal ortam oluşturun:

    python3 -m venv venv
    source venv/bin/activate   # macOS/Linux
    venv\Scripts\activate    # Windows
  3. Bağımlılıkları yükleyin (varsa):

    pip install -r requirements.txt

▶️ Kullanım

  1. İki BMP resmi (örneğin sample1.bmp, sample2.bmp) proje klasörüne yerleştirin.

  2. Hareket tespit scriptini çalıştırın:

    python Main.py
  3. Program şunları üretecektir:

    • Resimlerin gri tonlu halleri
    • result.bmp dosyasında hareket tespit sonucu
  4. Terminalde hareket algılandı / algılanmadı mesajı görüntülenecektir.


📈 Nasıl Çalışır

Program iki BMP resmini yükler, gri tonlara dönüştürür ve iki resim arasındaki piksel değerlerini karşılaştırır. Belirli eşik değerlerin üzerindeki değişimler hareket olarak kabul edilir. Bu yöntem basit arka plan çıkarma ve piksel farkı kullanımıyla yapılan temel hareket tespit tekniklerinden biridir.


👨‍💻 Geliştirici

Mert Eren Dilsiz

About

Its a program can detect motion on 2 bmp files by comparing pixel intensties

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages