Skip to main content

Scan Conversion(Circle) - Midpoint Algorithm

Assignment 05.
  1. Use the mid-point circle technique to derive the necessary equations to scan convert the following circular sector (i.e., points from 270o to 315o)
  2. Implement your method and use the circle's symmetric property to draw complete circles.
  3.  
  4. The file is available here (ScanConvertCirclemidpoint.cpp)
  5. Play with it. You will understand..

Comments


  1. this code also correct!!
    void MidpointCircle(GLint x1, GLint y1, GLint x2, GLint y2){
    /********************************************************************
    This function draws a Circle using the Midpoint Circle algorithm for 270 - 315
    *********************************************************************/
    float r1 = (x2-x1)(x2-x1) + (y2-y1)(y2-y1);
    float r = sqrt(r1);
    int x=0,y=-r,p=1-r;
    while(x<=-y)
    {
    plot(x1+x,y1+y);

    if(p<0)
    {
    p=p+2*x+3;
    }
    else
    {

    p=p+2*(x+y)+5;
    y++;
    }
    x++;
    }

    }

    ReplyDelete

Post a Comment

Popular posts from this blog

Download your favorite Serials whole season at once

So, we all have our favorite serials. Or someone recently suggested you a serial which is now on it's latest season and you want to look at all those previous seasons. Some may watch it in online There are plenty of sites to watch them online. mywatchseries.to watch-series.com What if you want to download? You can download using IDM while playing online. How to download a whole season? Playing every episode and download? That's possible. But, is there an easy way? Yes. There is! These are the steps to follow. Before going down, download and install the latest IDM. IDM Latest (This is cracked. But, if you like. Support the developers by buying it) Step one Choose the site where you can download all your episodes. for example : http://dl2.mihanpix.com/Serial/ Index of Serial There are plenty of sites like this. To find those, just google "Index of Serials". Googled it Step two Go to the page of which season you want to download...

Image Processing

Okay, Now let's start doing Image Processing exercises on MATLAB. Before diving in let's start knowing what are the terms "Histograms", "Cumulative Histograms" and "Histogram Equalization" of an image. Let's see what are those, Histogram An image histogram is a type of histogram that acts as a graphical representation of the tonal distribution in a digital image. It plots the number of pixels for each tonal value. By looking at the histogram for a specific image a viewer will be able to judge the entire tonal distribution at a glance. Cumulative Histogram A cumulative histogram is a mapping that counts the cumulative number of observations in all of the bins up to the specified bin. That is, the cumulative histogram M i of a histogram m j is defined as:  Histogram Equalization Histogram equalization is a method in image processing of contrast adjustment using the image's histogram. for more definitions visit wik...