تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تحديد مركز الدائرة فى صورة
#1
السلام عليكم

أخباركم شباب

اذا كان عندى صورة من لون معين و ليكن أزرق و بها دوائر صغيرة بلون أسود 
المطلوب 
 تحديد الدوائر و مركز كلا منها

   

شكرا مقدما
الرد }}}
تم الشكر بواسطة:
#2
عليك البحث علي النت عن موضوعات تتحدث عن Pixel Scan

ممكن تبدأ من الرابط التالي

اللينك
Retired
الرد }}}
تم الشكر بواسطة:
#3
اخى الفاضل
ليست المشكلة فى عمل  pixel scan

المشكلة فى تحديد حواف الدائرة و من ثم تحديد مركزها
الرد }}}
تم الشكر بواسطة:
#4
ما وصلت اليه الى الان 
هو عمل قق لايجاد ثلاث نقاط على محيط الدائرة
من خلال تلك النقاط  يتم حساب مركز الدائرة و نصف قطرها باستخدام الكود التالى 


كود :
   'Find a circle through the three points.
   Private Sub FindCircle(ByVal a As PointF, ByVal b As PointF, ByVal c As PointF, ByRef center As PointF, ByRef radius As Single)
       ' Get the perpendicular bisector of (x1, y1) and (x2, y2).
       Dim x1 As Single = (b.X + a.X) / 2
       Dim y1 As Single = (b.Y + a.Y) / 2
       Dim dy1 As Single = b.X - a.X
       Dim dx1 As Single = -(b.Y - a.Y)

       ' Get the perpendicular bisector of (x2, y2) and (x3, y3).
       Dim x2 As Single = (c.X + b.X) / 2
       Dim y2 As Single = (c.Y + b.Y) / 2
       Dim dy2 As Single = c.X - b.X
       Dim dx2 As Single = -(c.Y - b.Y)

       ' See where the lines intersect.
       Dim lines_intersect, segments_intersect As Boolean
       Dim intersection, close1, close2 As PointF
       FindIntersection(New PointF(x1, y1), New PointF(x1 + dx1, y1 + dy1), New PointF(x2, y2), New PointF(x2 + dx2, y2 + dy2), lines_intersect, segments_intersect, intersection, close1, close2)
       If Not lines_intersect Then
           MessageBox.Show("The points are colinear")
           center = New PointF(0, 0)
           radius = 0
       Else
           center = intersection
           Dim dx As Single = center.X - a.X
           Dim dy As Single = center.Y - a.Y
           radius = CSng(Math.Sqrt(dx * dx + dy * dy))
       End If
   End Sub
   ' Find the point of intersection between the lines p1 --> p2 and p3 --> p4.
   Private Sub FindIntersection(ByVal p1 As PointF, ByVal p2 As PointF, ByVal p3 As PointF, ByVal p4 As PointF, ByRef lines_intersect As Boolean, ByRef segments_intersect As Boolean, ByRef intersection As PointF, ByRef close_p1 As PointF, ByRef close_p2 As PointF)
       ' Get the segments' parameters.
       Dim dx12 As Single = p2.X - p1.X
       Dim dy12 As Single = p2.Y - p1.Y
       Dim dx34 As Single = p4.X - p3.X
       Dim dy34 As Single = p4.Y - p3.Y

       ' Solve for t1 and t2
       Dim denominator As Single = (dy12 * dx34 - dx12 * dy34)

       Dim t1 As Single = ((p1.X - p3.X) * dy34 + (p3.Y - p1.Y) * dx34) / denominator
       If Single.IsInfinity(t1) Then
           ' The lines are parallel (or close enough to it).
           lines_intersect = False
           segments_intersect = False
           intersection = New PointF(Single.NaN, Single.NaN)
           close_p1 = New PointF(Single.NaN, Single.NaN)
           close_p2 = New PointF(Single.NaN, Single.NaN)
           Return
       End If
       lines_intersect = True

       Dim t2 As Single = ((p3.X - p1.X) * dy12 + (p1.Y - p3.Y) * dx12) / -denominator

       ' Find the point of intersection.
       intersection = New PointF(p1.X + dx12 * t1, p1.Y + dy12 * t1)

       ' The segments intersect if t1 and t2 are between 0 and 1.
       segments_intersect = ((t1 >= 0) AndAlso (t1 <= 1) AndAlso (t2 >= 0) AndAlso (t2 <= 1))

       ' Find the closest points on the segments.
       If t1 < 0 Then
           t1 = 0
       ElseIf t1 > 1 Then
           t1 = 1
       End If

       If t2 < 0 Then
           t2 = 0
       ElseIf t2 > 1 Then
           t2 = 1
       End If

       close_p1 = New PointF(p1.X + dx12 * t1, p1.Y + dy12 * t1)
       close_p2 = New PointF(p3.X + dx34 * t2, p3.Y + dy34 * t2)
   End Sub
الرد }}}
تم الشكر بواسطة:
#5
Emgu CV



emgu cv circle detection
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  إدراج صورة الموظف من خلال رابط في حقل من قاعدة البيانات saud1004 4 524 13-12-24, 04:48 AM
آخر رد: saud1004
Lightbulb [سؤال] تحويل صورة الى ملف Pdf ackore 8 757 27-09-24, 07:51 PM
آخر رد: محمد مسافر
  اضافة صورة مخزنة في قاعدة البيانات sql الى الكريستال ريبورت صالح عبدالله 3 460 24-09-24, 09:52 AM
آخر رد: صالح عبدالله
  [كود] كود عند اختيار صورة في فورم تسمع في فورم اخري Mostafa201255411 0 242 13-09-24, 09:20 PM
آخر رد: Mostafa201255411
  أريد تحديد صلاحيات المستخدمين عن طريق حقل في جدول قاعدة البيانات F.H.M 0 323 12-09-24, 06:29 PM
آخر رد: F.H.M
  التعامل مع موقع ويب لجلب صورة لالفيجوال بيزك صبري زينوبي 3 436 09-09-24, 11:22 PM
آخر رد: Taha Okla
  معرفة حجم ملف PDF تم تحديد مساره modymody300894 1 288 10-08-24, 03:35 PM
آخر رد: ميدو الفنان
  ماهي طريقة تحويل ملف pdf الى صورة جيولوجي مبتدئ 3 558 12-07-24, 09:22 PM
آخر رد: atefkhalf2004
  [VB.NET] تحويل pdf الى صورة بدون استخدام الاكروبات بأستخدام adobe reader العادى فقط AhmedNagib 1 1,172 11-07-24, 01:16 PM
آخر رد: تركي الحلواني
  [سؤال] رفع صورة لاستضافة أون لاين .أغلب الأكواد لا تعمل لنفس السبب dr.programming 1 312 08-05-24, 11:50 AM
آخر رد: dr.programming

التنقل السريع :


يقوم بقرائة الموضوع: