Skip to content

Chetansonawane7/Change-Detection-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Objective Detect and highlight differences between before and after images of the same scene by drawing bounding boxes around changed regions.

πŸ“ Folder Structure arduino Copy Edit . β”œβ”€β”€ task_2_code.py ← Python script to run the detection β”œβ”€β”€ task_2_output/ ← Folder containing input and output images β”‚ β”œβ”€β”€ 1.jpg ← Input "before" image β”‚ β”œβ”€β”€ 13.jpg ← Output: "after" image with bounding boxes β”‚ β”œβ”€β”€ 2.jpg β”‚ β”œβ”€β”€ 23.jpg β”‚ └── ... ⚠️ X~2.jpg (original after image) is used internally but not stored in the final output.

πŸš€ How to Run

1. Install dependencies (once):

pip install -r requirements.txt

2. Place images in the task_2_output/ folder:

Before image: X.jpg After image: X~2.jpg

3. Run the script:

python task_2_code.py

The script will generate: X~3.jpg: Annotated image showing the changes It will also ensure X.jpg is retained in the folder

πŸ§ͺ How It Works Converts both images to grayscale and applies Gaussian blur.

Computes differences using: cv2.absdiff (raw pixel difference) SSIM (structural difference)

Combines both masks and applies morphological operations to reduce noise.

Detects contours and draws bounding boxes using smart filtering: Area threshold Aspect ratio Solidity Pixel change ratio inside each box

πŸ“¦ Dependencies See requirements.txt: opencv-python numpy scikit-image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages