Thread: Image rotation without cropping....

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    1

    Image rotation without cropping....

    Hello Team,

    I am new to image processing..... and I am learning the concepts.
    Recently I have done image rotation of grey scale image using the following formula:
    x' = xcos(theta)-ysin(theta)
    y' = xsin(theta)+ycos(theta)

    The problem i have faced is image is getting cropped.

    I want to rotate an image without cropping.
    I have searched a lot but I am not getting any algorithm based on C.
    Can anyone please help me in getting the algorithm for image rotation without cropping.

    Thanks in advance.....

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    We don't hand out solutions here. But if you make an attempt, and post your code, we can probably help you sort out your cropping problem. Remember, post your code in [code][/code] tags. make sure it's properly formatted and indented.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by chakriv View Post
    Hello Team,

    I am new to image processing..... and I am learning the concepts.
    Recently I have done image rotation of grey scale image using the following formula:
    x' = xcos(theta)-ysin(theta)
    y' = xsin(theta)+ycos(theta)

    The problem i have faced is image is getting cropped.

    I want to rotate an image without cropping.
    I have searched a lot but I am not getting any algorithm based on C.
    Can anyone please help me in getting the algorithm for image rotation without cropping.

    Thanks in advance.....
    You need to increase the width and height of the image to prevent cropping.
    Rotate around the center of the image.
    Add half of the increase width and height to the x result and y result.
    There should be some simple trig equation to figure out the new width and height based on theta and old width and old height.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Image rotation (Bitwise operations?)
    By 127.0.0.1 in forum Game Programming
    Replies: 1
    Last Post: 05-29-2009, 12:45 PM
  2. Image rotation - doesn't always work
    By ulillillia in forum C Programming
    Replies: 12
    Last Post: 05-03-2007, 12:46 PM
  3. Sprite/Image Rotation in SDL
    By Blizzarddog in forum Game Programming
    Replies: 4
    Last Post: 03-18-2005, 11:19 AM
  4. Image rotation in SDL
    By Kinasz in forum Game Programming
    Replies: 1
    Last Post: 12-25-2003, 11:48 AM
  5. Image rotation using intel image processing
    By sunis in forum Windows Programming
    Replies: 1
    Last Post: 11-18-2002, 02:40 AM

Tags for this Thread