Thread: Drawing a circle in a video captured frame

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    1

    Question Drawing a circle in a video captured frame

    Greetings to all, a newbie here to this forum.

    Recently I have been encountered a problem in drawing a circle on a video captured image. It was part of a video capture/face recognition project I was doing.

    I have a copy of a video capture source code but is really unsure on how to go about doing it.

    Basically, the video capture code captures an image from an analog camera and thru a video capture card, converted into an image file. I have no problem on fixing up the video capture code. It's just that I have no idea on how to code the part which draws the circle onto the image and output it together.

    The idea of the video capture code is to first capture the image and store it into a temp buffer. A pointer will be then assigned to point to this buffer. (Finding the correct pointer would be a problem too. ^^) The image would be then output onto the screen. However, the end result was to have a circle together with the image output onto the screen.

    My initial guess would be that it would require the trigo libraries in order to draw a circle.

    Can anyone enlighten me on my question ?

    Thank you.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    197
    You can draw a circle with the formula y-coordinate=squareroot(x-coordinate^2+r^2)

    r is the range between the circle and his middle-point.
    Sorry I donīt know that special words in english!


    klausi
    When I close my eyes nobody can see me...

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Unless your camera is taking very high res images circles are very hard to draw. This is due to the rectangular pixcel's.
    That is you will get an elipse not a circle. Draw a grid of rectangles, approx y=3x/4 and try to draw a circle, see what I mean.

    And if your res is not high enough you will not get the detail you need to pull any data from the image.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Drawing a circle with ASCII character
    By bnkslo in forum C Programming
    Replies: 15
    Last Post: 04-03-2008, 12:56 PM
  2. drawing circle to console
    By golom in forum C Programming
    Replies: 2
    Last Post: 12-20-2006, 10:57 AM
  3. Drawing circle into a bitmap file
    By brokensail in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2006, 01:26 AM
  4. Animation not working....
    By aquinn in forum C Programming
    Replies: 7
    Last Post: 02-19-2005, 05:37 AM
  5. Drawing a circle using glut...
    By bennyho03 in forum C Programming
    Replies: 6
    Last Post: 10-18-2004, 10:06 AM