Thread: Image rotation using intel image processing

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    5

    Talking Image rotation using intel image processing

    Dear friends

    i am using intel image processing library to rotate my image. if the image width is divesible by 8 , my image rotates fine. Otherwise i see garbage after rotation.i am using following code for this purpose. How can i get rid of it.


    jcprops.JPGFile =ofn.lpstrFile;
    if (ijlRead(&jcprops, IJL_JFILE_READPARAMS) != IJL_OK)
    {

    ijlFree(&jcprops);
    return(FALSE);
    }


    img1 = CreateImageHeaderFromIJL(&jcprops,NULL);
    iplAllocateImage(img1,0,0);


    img = CreateImageHeaderFromIJL(&jcprops,NULL);
    iplAllocateImage(img,0,0);

    jcprops.DIBBytes = (BYTE*)img1->imageData;
    jcprops.DIBWidth = wt;//width;//jcprops.JPGWidth;
    jcprops.DIBHeight =-ht;// -height;//jcprops.JPGHeight;
    jcprops.DIBChannels = 3;



    //--------------------------------------------------//

    ipad = (int) fmod(wt,8);
    jcprops.DIBPadBytes =ipad;

    //----------------------------------------------------//


    switch(jcprops.JPGChannels)
    {
    case 1:
    {
    jcprops.JPGColor = IJL_G;
    break;
    }
    case 3:
    {
    jcprops.JPGColor = IJL_YCBCR;
    break;
    }
    default:
    {
    jcprops.DIBColor = (IJL_COLOR)IJL_OTHER;
    jcprops.JPGColor = (IJL_COLOR)IJL_OTHER;
    break;
    }

    }



    ijlRead(&jcprops,IJL_JFILE_READWHOLEIMAGE);

    iplGetRotateShift(0.0,5.0,0.0, &xshift, &yshift);
    iplRotate(img1, img, 5.0, 0,0,IPL_INTER_LINEAR );

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    My docs say:

    Code:
    jcprops.DIBWidth = (((width * num_bits) + 31) & ~31) >> 3;
    jcprops.DIBPadBytes = jcprops.DIBWidth - (jcprops.DIBChannels * width);
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Image Processing
    By ejohns85 in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2009, 12:10 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. Intel syntax on MinGW ?
    By TmX in forum Tech Board
    Replies: 2
    Last Post: 01-06-2007, 09:44 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. Replies: 4
    Last Post: 03-02-2003, 09:12 AM