# maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement architecture

> Architecture diagram of the GitHub repository maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement
- Repository: https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement

## Overview

This repository provides a bipolar-fuzzy low-light image enhancement library and a Streamlit demo. In the demo, a user uploads or selects an image and chooses membership functions, fusion, an objective, and optional post-processing. The app invokes the enhancement pipeline, then presents the selected result and the negamma search history. The library also exposes command-line variants and independent entropy-based helpers. The README documents the internal stages and capabilities; the sampled excerpts show the app-to-library call, but not all internal implementation calls.

Main entry points: [`bfi.py`](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py) (Enhancement entry points), [`app.py`](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_demo["Interactive demo"]
  node_app["Streamlit interface<br/>[app.py]"]
  node_input["Image loading<br/>[app.py]"]
  node_visuals["Pipeline visualizations<br/>[app.py]"]
end

subgraph group_pipeline["Enhancement pipeline"]
  node_entry["Enhancement entry points<br/>[bfi.py]"]
  node_color["RGB–HSI conversion<br/>[bfi.py]"]
  node_membership["Membership generators<br/>[bfi.py]"]
  node_search["Negamma search<br/>[bfi.py]"]
  node_fusion["Image fusion<br/>[bfi.py]"]
  node_post["Intensity post-processing<br/>[bfi.py]"]
end

subgraph group_quality["Quality and helpers"]
  node_objective["Scoring objectives<br/>[bfi.py]"]
  node_piqe["PIQE metric<br/>[bfi.py]"]
  node_niqe["NIQE metric<br/>[bfi.py]"]
  node_entropy["Entropy-based IFI<br/>[bfi.py]"]
end

subgraph group_delivery["Image results"]
  node_result["Enhanced RGB image<br/>[bfi.py]"]
  node_history["Search history<br/>[bfi.py]"]
  node_download["Display and download<br/>[app.py]"]
end

node_user(("Image user"))

node_user -->|"uploads image"| node_input
node_input -->|"provides image"| node_app
node_app -->|"invokes bfi_general"| node_entry
node_entry -.->|"converts channels"| node_color
node_entry -.->|"selects generators"| node_membership
node_entry -.->|"searches parameters"| node_search
node_search -.->|"evaluates candidates"| node_fusion
node_search -.->|"scores candidates"| node_objective
node_objective -.->|"uses no-reference metric"| node_piqe
node_objective -.->|"uses no-reference metric"| node_niqe
node_entry -.->|"optionally processes intensity"| node_post
node_entry -.->|"returns enhanced image"| node_result
node_entry -->|"records search history"| node_history
node_entry -.->|"also exposes IFI helpers"| node_entropy
node_app -->|"renders channels and search"| node_visuals
node_app -->|"displays and downloads result"| node_download
node_result -->|"returns enhancement"| node_app
node_history -->|"returns candidate scores"| node_app

click node_app "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py"
click node_input "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py"
click node_visuals "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py"
click node_entry "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_color "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_membership "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_search "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_fusion "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_post "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_objective "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_piqe "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_niqe "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_entropy "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_result "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_history "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py"
click node_download "https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_input,node_visuals,node_user toneBlue
class node_entry,node_color,node_membership,node_search,node_fusion,node_post toneAmber
class node_objective,node_piqe,node_niqe,node_entropy toneMint
class node_result,node_history,node_download toneRose
```

## Components

### Interactive demo

- [Streamlit interface](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py): `app.py`
- [Image loading](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py): `app.py`
- [Pipeline visualizations](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py): `app.py`

### Enhancement pipeline

- [Enhancement entry points](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [RGB–HSI conversion](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Membership generators](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Negamma search](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Image fusion](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Intensity post-processing](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`

### Quality and helpers

- [Scoring objectives](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [PIQE metric](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [NIQE metric](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Entropy-based IFI](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`

### Image results

- [Enhanced RGB image](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Search history](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/bfi.py): `bfi.py`
- [Display and download](https://github.com/maheshkumar-cv/bipolar-fuzzy-based-low-light-image-enhancement/blob/main/app.py): `app.py`

### Other components

- **Image user**

## Connections

- Image user → Image loading: uploads image (evidence: `app.py`)
- Image loading → Streamlit interface: provides image (evidence: `app.py`)
- Streamlit interface → Enhancement entry points: invokes bfi_general (evidence: `app.py`)
- Enhancement entry points → RGB–HSI conversion: converts channels (evidence: `README.md`)
- Enhancement entry points → Membership generators: selects generators (evidence: `README.md`)
- Enhancement entry points → Negamma search: searches parameters (evidence: `README.md`)
- Negamma search → Image fusion: evaluates candidates (evidence: `README.md`)
- Negamma search → Scoring objectives: scores candidates (evidence: `README.md`)
- Scoring objectives → PIQE metric: uses no-reference metric (evidence: `README.md`)
- Scoring objectives → NIQE metric: uses no-reference metric (evidence: `README.md`)
- Enhancement entry points → Intensity post-processing: optionally processes intensity (evidence: `README.md`)
- Enhancement entry points → Enhanced RGB image: returns enhanced image (evidence: `README.md`)
- Enhancement entry points → Search history: records search history (evidence: `app.py`)
- Enhancement entry points → Entropy-based IFI: also exposes IFI helpers (evidence: `README.md`)
- Streamlit interface → Pipeline visualizations: renders channels and search (evidence: `app.py`)
- Streamlit interface → Display and download: displays and downloads result (evidence: `app.py`)
- Enhanced RGB image → Streamlit interface: returns enhancement (evidence: `app.py`)
- Search history → Streamlit interface: returns candidate scores (evidence: `app.py`)
