Thread: C++ image processing

  1. #1
    Registered User
    Join Date
    Jun 2006

    C++ image processing


    I'm implementing a laplacian mask image enhancement in Visual studio. I'm using a simple 3x3 mask of -1 -1 -1; -1 9 -1; -1 -1 -1 on some jpg; Applying the mask is easy. But I'm not sure what's the proper way to scale the output.

    The input image has a very uniform histogram(high contrast). After applying the mask for edge enhancement, I ended up with most graylevel clustered slightly to the left of the center. Thus, linearly mapping the pixels back to the [0, 255] range result in an image with poor constrast.

    Am I missing something here? What's the better way to remap the pixels?

    Or am I suppose to use power-law transformation to spread out the histogram?

    PS: power-law transformation is out = c * in^gamma. Is there a built-in function somewhere that can handle the in^gamma exponential(in is int[0-255], gamma is float [0-100])?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Like the pow() function in cmath ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2006
    yeah, thanks

    Still can't make the image to look right. Histogram equalization is the closest I got but it stretches the contrast a bit too much. ie. previously black background becomes grayish.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Simple Image Processing
    By ejohns85 in forum C++ Programming
    Replies: 4
    Last Post: 03-19-2009, 12:10 PM
  3. Replies: 4
    Last Post: 03-02-2003, 09:12 AM
  4. Memory Allocation in Intell Image processing liberary
    By nisar in forum Windows Programming
    Replies: 0
    Last Post: 01-12-2003, 07:29 AM
  5. Image rotation using intel image processing
    By sunis in forum Windows Programming
    Replies: 1
    Last Post: 11-18-2002, 02:40 AM