Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to pad bit in last row pixel of image

how to pad bit in last row pixel of image

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gentleguy
    wrote on last edited by
    #1

    dear all this is image processing issue in c++, i don'w know how to pad bits in last row of image? anyone know this point, please help me, thanks

    gentleguy

    C 1 Reply Last reply
    0
    • G gentleguy

      dear all this is image processing issue in c++, i don'w know how to pad bits in last row of image? anyone know this point, please help me, thanks

      gentleguy

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      1. allocate a buffer of the right size 2. copy the pixel rows into the new buffer, skipping [padding] bits between rows

      image processing toolkits | batch image processing

      G 1 Reply Last reply
      0
      • C Chris Losinger

        1. allocate a buffer of the right size 2. copy the pixel rows into the new buffer, skipping [padding] bits between rows

        image processing toolkits | batch image processing

        G Offline
        G Offline
        gentleguy
        wrote on last edited by
        #3

        thanks friend, i have done already what you said, but some of images were distorted, i blurred image using Gaussian function. the code is as follows: for (int i=0;i { for (int j=0;j { int iIndex=i+j*width; if (j==0) { ucGauImgVArray[iIndex]=ucGauHImg[i+j*iWidth1]*mask[1]+ucGauHImg[i+(j+1)*Width]*mask[2]; } else if (j==(Height-1)) { ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width]*mask[1]; } else { ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width1]*mask[1]+ucGauHImg[i+(j+1)*Width1]*mask[2]; } } } //Declare a memory for vertical convolution allocimage(&m_vicGauVImg,Width,Height,8); unsigned char *ucGauVImg=m_vicGauVImg.ibuff; int Widthbyte=m_vicGauVImg.buffwidth; for (int y3=0;y3 { for (int x3=0;x3 { int iIndex=x3+y3*iWidth1; ucGauVImg[x3]=ucGauImgVArray[iIndex]; } ucGauVImg+=iWidthbyte; } i am very sorry, why i couldn't put width,height behind the i,j.very sad..

        gentleguy

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups