OpenCV Image Sharpening(Can't find the MISTAKE in my code) -


void sharpen(iplimage *in,iplimage *out) {     int r=in->height;     int c=in->width;     int st=in->widthstep;     int i,j;     for(i=1;i<r-1;i++)     {         uchar *cur=(uchar *)(in->imagedata+i*st);         uchar *pre=(uchar *)(in->imagedata+(i-1)*st);         uchar *next=(uchar *)(in->imagedata+(i+1)*st);         uchar *output=(uchar *)(out->imagedata+i*st);         for(j=3;j<c*3-3;j++)         {             *output=uchar(5*cur[j]-cur[j-3]-cur[j+3]-pre[j]-next[j]);             *output++;         }     }  } 

opencv image sharpening using laplacian... mind finding out mistakes me?

one obvious mistake that:

        *output++; 

should be:

        output++; 

i.e. need increment pointer, not dereference it. don't think that's bug.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -