+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Full Member level 3
    Points: 2,037, Level: 10

    Join Date
    Nov 2010
    Posts
    175
    Helped
    0 / 0
    Points
    2,037
    Level
    10

    normalization of histogram

    hello

    I am newbie in world of image processing. I want to make a simple classifier using neural networks using scilab. I created 3 photos, one of circle , one of rectangle and one of triangle. I wanted to get a descriptive value for those images, so I converted them to binary and got their histograms. The problem is that histogram values are not good enough to be fed to neural network, for example , I got thee histograms for the three images:
    imhis1 =

    2930.
    315502.

    imhis2 =

    3504.
    314928.

    imhis3 =

    4160.
    314272.
    I tried to give these inputs as they are to the neural network toolbox, and I got error related to singularity problem. I concluded that this because the numbers are so huge. I know that I am missing something. should I divide the histogram by a factor? I read about something called histogram normalization, does it have something to do with this?


    Code:
    im1=imread('E:\Science\Courses\Artificial Intelligience\Learning - Neural Networks\Image Recognition\shape1.jpg');
    im2=imread('E:\Science\Courses\Artificial Intelligience\Learning - Neural Networks\Image Recognition\shape2.jpg');
    im3=imread('E:\Science\Courses\Artificial Intelligience\Learning - Neural Networks\Image Recognition\shape3.jpg');
    im1b=im2bw(im1,0.2)
    im2b=im2bw(im2,0.2)
    im3b=im2bw(im3,0.2)
    imhis1=imhist(im1b,2)
    imhis2=imhist(im2b,2)
    imhis3=imhist(im3b,2)

    •   Alt3rd January 2017, 16:31

      advertising

        
       

  2. #2
    Super Moderator
    Points: 24,316, Level: 37
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Portugal
    Posts
    7,298
    Helped
    911 / 911
    Points
    24,316
    Level
    37
    Blog Entries
    5

    Re: normalization of histogram

    The use of the color histogram pattern (supposedly in grayscale) as an evaluation factor for image matching, in my personal opinion, is not a suitable criterion for a classifier, unless either the size and "color" of those pictures are fairly different, or if you are interested in a fastest algorithm. In fact, I think histogram equalization is nothing more than an image enhancement tool to emphasize some features of the image, but no more than that; Obviously it is a personal opinion, and in the case of image processing there are no general rules, and in your particular case you can even check if it meets the needs, who knows ...By the way, why not use the raw image itself for the neural network ?
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )


    1 members found this post helpful.

    •   Alt3rd January 2017, 17:22

      advertising

        
       

  3. #3
    Full Member level 3
    Points: 2,037, Level: 10

    Join Date
    Nov 2010
    Posts
    175
    Helped
    0 / 0
    Points
    2,037
    Level
    10

    Re: normalization of histogram

    Quote Originally Posted by andre_teprom View Post
    The use of the color histogram pattern (supposedly in grayscale) as an evaluation factor for image matching, in my personal opinion, is not a suitable criterion for a classifier, unless either the size and "color" of those pictures are fairly different, or if you are interested in a fastest algorithm. In fact, I think histogram equalization is nothing more than an image enhancement tool to emphasize some features of the image, but no more than that; Obviously it is a personal opinion, and in the case of image processing there are no general rules, and in your particular case you can even check if it meets the needs, who knows ...By the way, why not use the raw image itself for the neural network ?
    the images are fairly simple, I just want to test my understanding to image classification so I wanted to check it with an example (attached the some photos that I used)
    how to use raw image to the neural network? you mean that pixels themselves become the input to the network?

    Click image for larger version. 

Name:	shape3.jpg 
Views:	0 
Size:	8.9 KB 
ID:	134965

    Click image for larger version. 

Name:	shape2.jpg 
Views:	1 
Size:	12.3 KB 
ID:	134966



    •   Alt3rd January 2017, 17:49

      advertising

        
       

  4. #4
    Super Moderator
    Points: 24,316, Level: 37
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Portugal
    Posts
    7,298
    Helped
    911 / 911
    Points
    24,316
    Level
    37
    Blog Entries
    5

    Re: normalization of histogram

    Quote Originally Posted by mamech View Post
    the images are fairly simple
    Okay, but when using only the color histogram as a classifier, if both pictures above have the same color and perimeter (ie the same linear length) if I'm not mistaken - this would produce exactly the same pattern on the histogram graph, because there would have the same amount of pixels with same "color" in the histogram.

    how to use raw image to the neural network? you mean that pixels themselves become the input to the network?
    Obviously this would require a lot of processing resources and time spent, sorry if I wasn't too clear. When I said the raw image, I was rather referring to the clustered image. You should split the whole picture into smaller "squares", then optionally apply some kind of math to either dilate the lines and to take the average colour of each square, and just after that, apply the neural learning process.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  5. #5
    Full Member level 3
    Points: 2,037, Level: 10

    Join Date
    Nov 2010
    Posts
    175
    Helped
    0 / 0
    Points
    2,037
    Level
    10

    Re: normalization of histogram

    ah thanks, I got it, even if I do not know how to do it using SIVP (scilab image and video processing toolbox)
    by the way, the histogram that I used is not color histogram. I converted the image to binary image first and too histogram (it is binary intensity histogram, and the value of it for images were not the same and I could use it as input to neural network, but after scaling it to reasonable value.)



--[[ ]]--