رسم الخطوط المختلفة و خوارزمياتها

Slides:



Advertisements
Similar presentations
Binary Image Algorithm. What is an Object? What is an object? – Binary image Connected cluster of black pixels on a white background Connected cluster.
Advertisements

Line Drawing Algorithms
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE.
Special effects Jen-Chang Liu, Spring 2005.
CSE554Cell ComplexesSlide 1 CSE 554 Lecture 3: Shape Analysis (Part II) Fall 2014.
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
9.7 Special Factors. a. 0 y y y-4y Ans:________________ (y+4)(y-4)
Hough Transform Reading Watt, An edge is not a line... How can we detect lines ?
2D Output Primitives Graphics packages provide basic operations (called primitive operations) to describe a scene in terms of geometric structures. The.
Raster conversion algorithms for line and circle
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics May 3, 2007.
1 Lecture 4 Graphical primitives Rasterization: algorithmic approach Rasterization: geometric approach 2D discrete lines, triangles Discrete planes 3D.
Cracking algoritm By Christopher Stenström All credits to Andrew Lowndes for algorithm,code and images.
University of Missouri at Columbia 2D Scan-line Conversion University of Missouri at Columbia.
Simplifying a Variable Expression
CGMB214: Introduction to Computer Graphics
Dr. Scott Schaefer Scan Conversion of Lines. 2/78 Displays – Cathode Ray Tube.
WHERE TO DRAW A LINE?? Line drawing is accomplished by calculating intermediate positions along the line path between specified end points. Precise definition.
A = Cos o x H Cosine Rule To find an adjacent side we need 1 side (hypotenuse) and the included angle. 9 cm 12 cm 60° 75° a a A = Cos ° x H A = Cos 75°
$100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300 $400 $500 $100 $200 $300.
Discrete Mathematics CS 2610 February 19, Logic Gates: the basic elements of circuits Electronic circuits consist of so-called gates connected.
Introduction Computer Graphics & Its application Types of computer graphics Graphic display : random Scan & Raster Scan display Frame buffer and video.
1 Line Drawing Version B: Semi-Formal Methods Derivation ©Anthony Steed
Line Drawing and Generalization. Outline  overview  line drawing  circle drawing  curve drawing.
Инвестиционный паспорт Муниципального образования «Целинский район»
5x 4 – 405 = 5(x 4 – 81) = 5(x 2 + 9)(x 2 – 9) = 5(x 2 + 9)(x + 3)(x – 3) by D. Fisher.
(x – 8) (x + 8) = 0 x – 8 = 0 x + 8 = x = 8 x = (x + 5) (x + 2) = 0 x + 5 = 0 x + 2 = x = - 5 x = - 2.
Image Synthesis Rabie A. Ramadan, PhD 7. 2 Image Rasterization.
MIDPOINT CIRCLE & ELLIPSE GENERARTING ALGORITHMS
Intersections of Lines in 2 Space Three Cases: 1) 2) 3)
Midpoint Circle Algorithm
Finding the distance between two points. (-4,4) (4,-6)
1 Bresenham’s Circle Algorithm Define:D(s i ) = distance of p 3 from circle D(t i ) = distance of p 2 from circle i.e.D(s i ) = (x i + 1) 2 + y i 2 – r.
Lecture 13: Raster Graphics and Scan Conversion
Circles Formula. x 2 + y 2 = r 2 Formula for Circle centered at the origin Center point (0,0) Radius = r.
Lecture 2: 19/4/1435 Graphical algorithms Lecturer/ Kawther Abas CS- 375 Graphics and Human Computer Interaction.
TRIGONOMETRY – Functions 1 We will now place the angle in the x–y plane. The initial side of the angle will always be placed on the (+) side of the x –
Adjacent = Cos o x H Cosine Ratio To find an adjacent side we need 1 side (hypotenuse) and the included angle. a = Cos ° x H a = Cos 60° x 9 a = 0.5 x.
照片档案整理 一、照片档案的含义 二、照片档案的归档范围 三、 卷内照片的分类、组卷、排序与编号 四、填写照片档案说明 五、照片档案编目及封面、备考填写 六、数码照片整理方法 七、照片档案的保管与保护.
공무원연금관리공단 광주지부 공무원대부등 공적연금 연계제도 공무원연금관리공단 광주지부. 공적연금 연계제도 국민연금과 직역연금 ( 공무원 / 사학 / 군인 / 별정우체국 ) 간의 연계가 이루어지지 않고 있 어 공적연금의 사각지대가 발생해 노후생활안정 달성 미흡 연계제도 시행전.
Жюль Верн ( ). Я мальчиком мечтал, читая Жюля Верна, Что тени вымысла плоть обретут для нас; Что поплывет судно громадней «Грейт Истерна»; Что.
: Chapter 13: Finding Basic Shapes 1 Montri Karnjanadecha ac.th/~montri Image Processing.
ΜΕΤΑΣΥΛΛΕΚΤΙΚΗ ΦΥΣΙΟΛΟΓΙΑ ΕΡΓΑΣΤΗΡΙΟ 3. Μετασυλλεκτική Εργ3-Λιοσάτου Γ.2 ΒΙΟΛΟΓΙΚΟΙ ΠΑΡΑΓΟΝΤΕΣ ΠΟΥ ΕΠΗΡΕΑΖΟΥΝ ΤΗ ΦΘΟΡΑ ΤΩΝ ΟΠΩΡΟΚΗΠΕΥΤΙΚΩΝ Αναπνοή Η λειτουργία.
Line Drawing Algorithms 1. A line in Computer graphics is a portion of straight line that extends indefinitely in opposite direction. 2. It is defined.
Image Sampling and Quantization
Computer Graphics Drawing Line.
CS G140 Graduate Computer Graphics
(c) 2002 University of Wisconsin, CS559
Prof. Harriet Fell Spring 2007 Lecture 5 – January 17, 2006
Fitting Curve Models to Edges
© University of Wisconsin, CS559 Fall 2004
Image Processing, Leture #12
(x2,y2) (3,2) (x1,y1) (-4,-2).
Line Drawing ©Anthony Steed 1999.
اثرات گرمايش جهاني تغييرات آب و هوا، تأثيرات عميق و شديدي بر بسياري از عوامل اساسي موثر بر سلامت از جمله : آب، غذا، هوا و محيط زيست دارد كه اين مورد خود.
Pixel Relations.
Scan Conversion Line(DDA Line and Bresenham Line)
B11 Exponents and Scientific Notation
Edited from The Rasterization Problem: Idealized Primitives Map to Discrete Display Space Edited from.
CSE 554 Lecture 3: Shape Analysis (Part II)
4 minutes Warm-Up Simplify 1) 2) 3) 4).
Finding Basic Shapes Hough Transforms
Trig. Ratios in a Coordinate System
Type to enter a caption. Computer Graphics Week 2 Lecture 1.
Space groups Start w/ 2s and 21s 222.
Where We Stand At this point we know how to: Next thing:
S.JOSEPHINE THERESA, DEPT OF CS, SJC, TRICHY-2
Line Drawing Algorithms
Fourier Analysis.
Presentation transcript:

رسم الخطوط المختلفة و خوارزمياتها الرسم بالحاسوب الوحدة الثانية رسم الخطوط المختلفة و خوارزمياتها أ. أشرف طـه

محتويات المقرر

اهدف الوحدة بعد دراسة هذه الوحدة يجب ان تكون قادر على ان أ. أشرف طـه

الخطوط المستقية و القطع المستقيمة رسم النقاط على الشاشة تحويل احدايثات النقطة في البرنامج الى احداثيات الشاشة وو ضع 1 في البت المناسبة النقطة على الشاشة تسمى pixel يتم تحديد x,y للنقطة

رسم الخط على الشاشة تحديد البداية تحديد النهاية اضاءة ما بينهما

معادلات الخط المستقيم حساب تغير المسافة في نظام الاحداثيات Increments and Distance حصول تغيير على قيم x دون تغير y ∆y=0 ∆x = x2 – x1

يتبع شكل 1: تغير المسافة على محور X في نظام الاحداثيات شكل 1

يتبع شكل2: التغير على المحورين x,y شكل 2

التغير على محور y ∆y = y2 – y1 = 5-1 = 4

اجمالي التغير على المحورين يتم بحساب المسافة d بين النقطتين (x2,y2) , (x1,y1) d = sqrt ((∆x)2+(∆y)2)

قانون فيثاغورس لحساب طول قطعة مستقية بدلالة نقطة البداية و النهاية d= [(x2-x1)^2 +(y2-y1)^2](1/2) حساب نقطة المنتصف =[(x1+x2)/2 , (y1+y2)/2 ] حساب ميل الخط المستقيم m=∆y/∆x

معادلة الخط المستقيم معادلة رقم 6 y = m . x + b m = (y2 – y1) / (x2 – x1) b = y1 – m x1 كثير من خوارزميات الرسم تعتمد على المعادلة رقم 6

خوارزميات الخط المستقيم رسم خط مستقيم رسم نقطة في x y زيادة x بوحدة كثافة نقطية حساب قيم y بزيادة متكررة ممثلة ب B yi= mxi + B yi+1= yi + m

مثال صفحة 50-51

تطوير رسم الخطوط وتحسينها رسم خط افقي تثبيت y و زيادة x رسم خط عمودي تثبيت x و زيادة y مثال صفحة 51-52

الناتج X Y 1 2 3 4 5

رسم خط بزاوية 45 درجة مثال صفحة 52

خوارزميات المحلل الرقمي المتغير حساب التغير في ∆x or ∆y و تغير الاحداثي الاخر بوحدة واحدة حيث ان ميل الخط m <=1 الرسم من اليسار الى اليمين

مثال صفحة رقم 54

خوارزمية برزنهام Bresenham Algorithm تعتمد على حساب معدل التغيير في احد الاحداثيات بمقدار ±1، اعتمادا على ميل الخط، الاحداثي الاخر قد يثبت او يتغير بزيادة راتبة (1،0) اعتمادا على معدل الخطأ نلاحظ من الشكل 8 ص 55 ان النقطة 2,1 من 1,0 عند الزيادة ½

مثال ص 58 تصحيح : يجب البدء من اعلى ، يسار زيادة ½ الى y وتثبيت xو التقريب ل 1 0,1 تثبيت y و زيادة ½ على x و التقريب ل 1 1,1 حتى النهاية

pseudo code

عيوب برزنهام استخدام اراقام كسرية استخدام القسمة لحساب معامل الخطأ

الحل خوارزمية برزنهام ذات الرقم الصحيح e = e + 2 ∆ y Or e = e - 2 ∆ x

خوارزمية برزنهام العامة تعتمد على زيادة ±1 اعتمادا على منطقة الرسم حسب شكل 12 صفحة 60 تدريب 2 صفحة 63 اكتب برنامج يرسم خطا عموديا من النقطة 2,2 الى 2,5

الحل x = 2; y1=2;y2=5; For (y=y1;y2;y++) {drowpiont (x,y);}

الحل m = (7-2)/(6-2)=5/4 > 1 y= y + 1 x n+1=xk + 1/m

(2,2) , (3,3) , (4,4),(5,4), (6,5), (7,6) y x X rounded 2 3 2 +.8 = 2.8 4 2.8 + .8 = 3.6 5 3.6 + .8 = 4.4 6 4.4 + .8 = 5.2 7 5.2 + .8 = 6 (2,2) , (3,3) , (4,4),(5,4), (6,5), (7,6)

الربط و الجوار في ثنائي و ثلاثي الأبعاد نظام الاحداثيات – الثنائي تعريف النقطة x,y استخدام centered pixel or edge pixel شكل 14 صفحة 67 نظام الاحداثيات – الثلاثي x,y,z Centered voxel or edge voxel

تصنيف التجاور 4 adjacent 8 adjacent تصنيف voxel 6 adjacent 18 adjacent 26 adjacent

خصائص الخطوط الثنائية خصائص الخط ليس وحيد في مساره و النقاط المكونة له مقارنة مع خط مستقيم شكل او نوع الخط يعتمد على قيمة a, b حيث انها ميل الخط شكل 19 صفحة 70

خزوارزمية نيف تعتمد على arithmetic thickness في تحديد نقاطها اهميتها عدم الاعتماد على الكسور او الضرب او القسمة شكل 20-22 صفحة 72-73 تتجاور مع بكسل اخر اذا اشترك في الزاوية او الضلع

خوارزمية ستاندارد تستخدم قيمة |a| + |b| =w تمتاز بميزات خوارزمية نيف

الخطوط ثلاثية الأبعاد ثلاث انواع 6 connected 18 connected 26 connected

ملء المنطقة المحجوزة ملئ خط مستقيم Addr (x + 1, y) = addr (x,y) + 1

معالجة التشويه حسب الشكل 31 صفحة 86 الرسم مثل الدرج المعالجة زيادة دقة الشاشة او التحكم في شدة الاضاءة

اوامر الرسم تجميع اكثر من امر لتكوين package Polyline (2, x, y) رسم خط بسمك نقطتين Fillpoly (n,x,y) ملئ منقطة بطول n-1

رسم الحروف ترسم الخطوط داخل شبكة 8 X 8 كما في الشكل 41 صفحة 94

الخطوط العريضة او الداكنه يتم اضاءة نقاط اضافية على احد جانبى الحرف

r3 الدوائر و القطع الناقص الدوران حول المركز بمقدار 360◦ رسم الدائرة بدلالة المركز و نصف القطر r3 x=xc + r.cos ᶲ

الرسم المتزايد التراكمي تجنب حساب sin and cos حيث يتم حساب النقطة التالية بناءا على النقطة السابقة.

خوارزمية دائرة النقطة الوسطى يتم رسم ثمن دائرة ثم ربع دائرة ثم التناظر لباقي الارباع

خوارزمية نيف لرسم الدائرة يتم رسم نقطة ثم اختيار النقطة التالية من بين ثلاث نقاط مرشحة كما في الشكل 58 صفحة 109

خوارزمية شبه الرقمي مركز الدائرة ½, ½ وليس 0,0 مركز الدائرة ½, ½ وليس 0,0 يتم اختيار النقطة التالية من بين ثلاث نقاط

القطع الناقص نفس طريقة رسم الدائرة (نقطة و نصف قطر) اما القطع الناقص يعتمد على (نقطة و نصف قطر اول و نصف قطر ثناني

Q & A