# manojpremsm/edge_detection architecture

> Architecture diagram of the GitHub repository manojpremsm/edge_detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manojpremsm/edge_detection
- Repository: https://github.com/manojpremsm/edge_detection

## Overview

Edge Detection provides a standalone OpenCV image workflow and ROS-based edge detection, 2D-edge-to-3D-point-cloud conversion, and marker visualization. In the basic path, a user supplies an image and output paths to the Canny detector. In ROS, a client requests edge detection from a service; separately, camera image, depth, and calibration topics feed point-cloud generation, which a marker node can visualize. The README documents these capabilities, but the service server’s image-topic subscription and service request are not visibly connected in the sampled code.

Main entry points: [`edge_detection_ros/edge_service/src/edge_detection_client.py`](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_client.py) (Service Client), [`edge_detection_ros/Basic/edge_detection.py`](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/Basic/edge_detection.py) (Canny Image Detector), [`edge_detection_ros/edge_service/src/edge_detection_server.py`](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_server.py) (Service Server), [`edge_detection_ros/edge_service/src/edge2pc.py`](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge2pc.py) (Edge Point Converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basic["Basic Detection"]
  node_basic_detector["Canny Image Detector<br/>[edge_detection.py]"]
  node_image_outputs["Edge Image Outputs"]
end

subgraph group_ros_service["ROS Service"]
  node_ros_client["Service Client"]
  node_service_contract["Detection Service<br/>[EdgeDetection.srv]"]
  node_ros_server["Service Server"]
end

subgraph group_pointcloud["3D Conversion"]
  node_edge_to_cloud["Edge Point Converter<br/>[edge2pc.py]"]
  node_point_cloud[("Edge Point Cloud")]
end

subgraph group_visualization["Visualization"]
  node_marker_node["Marker Publisher<br/>[marker.py]"]
end

node_user(("Image User"))
node_camera_streams(("Camera Topics"))
node_rviz(("RViz"))

node_user -->|"supplies image"| node_basic_detector
node_basic_detector -->|"writes results"| node_image_outputs
node_user -->|"starts client"| node_ros_client
node_ros_client -->|"sends request"| node_service_contract
node_ros_client -->|"calls service"| node_ros_server
node_ros_server -->|"serves request"| node_service_contract
node_camera_streams -->|"provides image, depth, calibration"| node_edge_to_cloud
node_edge_to_cloud -->|"publishes points"| node_point_cloud
node_point_cloud -->|"supplies points"| node_marker_node
node_marker_node -->|"publishes markers"| node_rviz

click node_basic_detector "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/Basic/edge_detection.py"
click node_image_outputs "https://github.com/manojpremsm/edge_detection/tree/main/edge_detection_ros/Basic/output_results"
click node_ros_client "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_client.py"
click node_service_contract "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/srv/EdgeDetection.srv"
click node_ros_server "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_server.py"
click node_edge_to_cloud "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge2pc.py"
click node_marker_node "https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/marker.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_basic_detector,node_image_outputs,node_user toneBlue
class node_ros_client,node_service_contract,node_ros_server toneAmber
class node_edge_to_cloud,node_point_cloud toneMint
class node_marker_node toneRose
class node_camera_streams,node_rviz toneIndigo
```

## Components

### Basic Detection

- [Canny Image Detector](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/Basic/edge_detection.py): `edge_detection_ros/Basic/edge_detection.py`
- [Edge Image Outputs](https://github.com/manojpremsm/edge_detection/tree/main/edge_detection_ros/Basic/output_results): `edge_detection_ros/Basic/output_results`

### ROS Service

- [Service Client](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_client.py): `edge_detection_ros/edge_service/src/edge_detection_client.py`
- [Detection Service](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/srv/EdgeDetection.srv): `edge_detection_ros/edge_service/srv/EdgeDetection.srv`
- [Service Server](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge_detection_server.py): `edge_detection_ros/edge_service/src/edge_detection_server.py`

### 3D Conversion

- [Edge Point Converter](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/edge2pc.py): `edge_detection_ros/edge_service/src/edge2pc.py`
- **Edge Point Cloud**

### Visualization

- [Marker Publisher](https://github.com/manojpremsm/edge_detection/blob/main/edge_detection_ros/edge_service/src/marker.py): `edge_detection_ros/edge_service/src/marker.py`

### Other components

- **Image User**
- **Camera Topics**
- **RViz**

## Connections

- Image User → Canny Image Detector: supplies image (evidence: `README.md`)
- Canny Image Detector → Edge Image Outputs: writes results (evidence: `edge_detection_ros/Basic/edge_detection.py`)
- Image User → Service Client: starts client (evidence: `README.md`)
- Service Client → Detection Service: sends request (evidence: `edge_detection_ros/edge_service/src/edge_detection_client.py`)
- Service Client → Service Server: calls service (evidence: `edge_detection_ros/edge_service/src/edge_detection_client.py`)
- Service Server → Detection Service: serves request (evidence: `edge_detection_ros/edge_service/src/edge_detection_server.py`)
- Camera Topics → Edge Point Converter: provides image, depth, calibration (evidence: `edge_detection_ros/edge_service/src/edge2pc.py`)
- Edge Point Converter → Edge Point Cloud: publishes points (evidence: `edge_detection_ros/edge_service/src/edge2pc.py`)
- Edge Point Cloud → Marker Publisher: supplies points (evidence: `edge_detection_ros/edge_service/src/marker.py`)
- Marker Publisher → RViz: publishes markers (evidence: `README.md`)
