-
Create and activate virtual environment
python -m venv .env source .env/bin/activate -
Install required packages
pip install -r requirements.txt
Control Fan Speed based on temperature and humidity
-
Without visualization plots
python usage.py
-
With visualization plots
python usage_viz.py
-
Input: Crisp values (e.g., temperature=38, humidity=70)
-
Fuzzification:
- Convert crisp -> fuzzy membership degrees
- Use triangular/trapezoidal membership functions
-
Rule Evaluation:
- Apply IF-THEN rules with OR/AND operators
- Calculate rule activation strengths
-
Aggregation:
- Combine activated output membership functions
- Use max (union) operation
-
Defuzzification:
- Convert aggregated fuzzy set → crisp value
- Centroid method
-
Output: Crisp control value (e.g., fan speed=75.2)
python main.py <image_path> <threshold: [0-100] Default: 25>- Example Usage
python main.py pictures/pic1.jpg 18 - utils/line.py
- Point Dataclass
- Line Class:
Modeled using y = mx + c
Handled vertical line edge-case - Intersection calculation functions for both lines and line-segements
- utils/polygon.py
- Polygon Class
- combinePolygons function
Targeted just for trapezoids, triangles and their portions whose one side sits on X-axis
- utils/centroid.py
- Area calculation funtion of polygon
- Centroid calculation function of polygon





