C++ image processing

This is a discussion on C++ image processing within the C++ Programming forums, part of the General Programming Boards category; Hi, I'm implementing a laplacian mask image enhancement in Visual studio. I'm using a simple 3x3 mask of -1 -1 ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    16

    C++ image processing

    Hi,

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    16
    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, 08:12 AM
  4. Memory Allocation in Intell Image processing liberary
    By nisar in forum Windows Programming
    Replies: 0
    Last Post: 01-12-2003, 06:29 AM
  5. Image rotation using intel image processing
    By sunis in forum Windows Programming
    Replies: 1
    Last Post: 11-18-2002, 01:40 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21