forked from Alaa-Fouad22/Computer-Vision-Edge_Detection
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivecontour.h
More file actions
24 lines (17 loc) · 923 Bytes
/
Copy pathactivecontour.h
File metadata and controls
24 lines (17 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef ACTIVECONTOUR_H
#define ACTIVECONTOUR_H
#include <opencv2/opencv.hpp>
#include <vector>
class ActiveContour {
public:
ActiveContour();
// إنشاء الدائرة المبدئية اللي هتبدأ تقفل على الشكل
std::vector<cv::Point> initializeCircle(int centerX, int centerY, int radius, int numPoints = 100);
// حساب طاقة الصورة (المغناطيس اللي بيسحب النقط للحواف)
cv::Mat calculateImageEnergy(const cv::Mat& image);
// تنفيذ لفة (Iteration) واحدة من خوارزمية الـ Snake
void iterate(std::vector<cv::Point>& points, const cv::Mat& imageEnergy, float alpha, float beta, float gamma);
// رسم الـ Snake على الصورة
cv::Mat drawContour(const cv::Mat& image, const std::vector<cv::Point>& points, const cv::Scalar& color = cv::Scalar(0, 0, 255));
};
#endif // ACTIVECONTOUR_H