0% found this document useful (0 votes)
2 views4 pages

True Workflow for Video Processing

Uploaded by

asmaaaaaa433
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

True Workflow for Video Processing

Uploaded by

asmaaaaaa433
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Got it — you don’t want a *block diagram*.

You want a **true workflow**: a step-wise, conditional, decision-based description


that clearly shows:

* **What happens → why it happens → what happens if it fails → how next step uses
the previous result.**
* A reader should understand **the entire project logic** just by reading the
workflow.

So here is the **proper, corrected, full workflow** based entirely on your project,
your methods, and your video processing pipeline.

---

# ✅ **FINAL WORKFLOW (Decision-Driven, True Project Logic)**

**“If this → then that” style, fully technical, complete, and highly accurate**

---

## **1. Video Acquisition**

1.1 Load input video (`[Link]`).


1.2 Extract frame-by-frame at the video FPS.
**→ If video frame is black or unreadable:** skip and move to next frame.
**→ Else:** process normally.

---

## **2. Pre-Processing**

2.1 Convert RGB → Grayscale.


2.2 Convert RGB → HSV (needed for shadow removal and color-based stability).
**Reason:** Grayscale helps structural detection; HSV helps reduce false detections
from shadows & lighting.

---

## **3. Background Subtraction (GMM)**

3.1 Apply Gaussian Mixture Model (ForegroundDetector).


3.2 GMM outputs a foreground mask.

**→ If GMM detects the bullet + shadow as one object:**

* Shadow appears attached → overestimated blob size → wrong centroid.


* Must fix using dedicated shadow suppression.

**→ If GMM output is too noisy:**

* Apply stronger Gaussian blur / modify GMM parameters.

---

## **4. Shadow Removal + Mask Refinement**

4.1 Use HSV rules:

* Shadows: **low V but similar H** → remove those pixels.


4.2 Apply morphological operations:
* Opening → remove noise
* Closing → restore bullet shape
* Fill holes → ensure solid bullet blob

**→ If bullet still merged with shadow:**

* Additional thresholding on V-channel


* Remove low-saturation pixels

**Result:**
A **clean bullet-only silhouette**, separated from background + shadow.

---

## **5. Bullet Detection**

5.1 Apply connected component analysis on refined mask.


5.2 Select the largest/highest-motion blob as bullet.

**→ If no bullet found:**

* Use Kalman prediction (skip correction).


**→ If multiple blobs detected:**
* Choose blob nearest to last Kalman prediction.

**Output:** Detected centroid (x, y)

---

## **6. Kalman Filter Tracking**

**This is crucial.**

### **When Kalman CORRECTS**

* If bullet is detected in the frame (valid centroid found)


→ Kalman performs **Correct()**
→ Updates state with real measurement
→ Removes jitter
→ Fixes missing-shadow contamination
→ Gives smoothed accurate centroid.

### **When Kalman PREDICTS**

* If bullet **not visible** (blur, explosion flash, motion too fast, occlusion)
→ Skip correction
→ Kalman only **Predict()**
→ Keeps continuous tracking even with missing frames
→ Prevents losing the object

**Result:**
Continuous, smooth, robust bullet trajectory.

---

## **7. Explosion Detection**

7.1 Monitor sudden increase in blob area, intensity, or HSV brightness.


7.2 When spike exceeds threshold → Explosion detected.

**→ If explosion occurs:**

* Bullet may be invisible for several frames → Kalman will PREDICT during this
period.
* Explosion width measured for real-world scaling if needed.

---

## **8. Camera Calibration + Real-World Distance Estimation**

This step gives the real-world scale.

### **8.1 Vanishing Point Method**

* Extract lines in the video


* Compute intersection → vanishing point
→ Gives camera orientation & perspective geometry.

### **8.2 Chessboard / Reference Object Method**

* Use reference markers of known size in the scene


→ Compute pixel-to-meter ratio
→ Create mapping matrix for depth and distance.

### **Combined Purpose**

* Converts all pixel motions → real-world distances.


* Compensates for perspective distortion.
* Provides accurate triangulation.

---

## **9. Velocity Calculation**

Based on **Kalman-filtered centroids**, not raw centroids.

### **Distance Calculation**

```
distance = sqrt( (x2 – x1)^2 + (y2 – y1)^2 ) * real_world_scaling
```

### **Velocity**

```
velocity = distance / (1 / fps)
```

**→ If scaling is wrong:**

* Check chessboard reference


* Check vanishing point calibration.

**Final Result:**
Real-world velocity (m/s), not pixel velocity.

---
## **10. Trajectory Generation**

10.1 Store all corrected centroids.


10.2 Plot continuous bullet path.
10.3 Highlight explosion point, prediction-only frames, and correction frames.

---

## **11. Output & Storage**

11.1 Store:

* Centroid (x, y) for all frames


* Real-world distance per frame
* Real-world velocity
* Explosion frame index
* Confidence flags for “Correct” or “Predict” steps

11.2 Export everything to **Excel sheet (.xlsx)** with labeled columns.

---

# 🎯 **This is a true workflow**

* Every step is connected


* Every operation has a condition
* Every failure path is defined
* Every method’s purpose is stated
* It represents the real working logic of your full system

Exactly what a professional 40-page technical project requires.

---

If you want, I can now generate:

### ✔ Workflow diagram (flowchart style)

### ✔ Activity diagram

### ✔ Block diagram

### ✔ Sequence diagram

### ✔ PPT-ready figure

Just say **“generate diagram version”**.

You might also like