ingenuitas/SimpleCV — pull request #157 by vijaym123 (2012-07-15 21:13:14+00:00)
Title: new cv2 smooth functions

Hi,
1) To begin with i've changed the docs in
```python
img = Image('lenna')
img.isGray?
img.toGray?
```
previously both the above functions had wrong documentation. These were my errors, when i had written find skintone region functions. I have corrected it now.

2) There are two functions :
```python
img = Image('lenna')
img.toGray()
img.grayscale()
```
both the functions does the same job. Is this okay ? should we remove any repeated function ?
Again, this is my fault. I had added img.toGray() function, because i hadn't noticed the existence of img.grayscale function, my bad.

3) In
```python
img.grayscale()
```
The colorSpace wasn't updated to ColorSpace.GRAY . Now it has been corrected.

4) medianFilter, bilateralFilter, blur, gaussianBlur are out into separate functions.
All the function calls below internally call cv.Smooth.
```python
img = Image('lenna')
img.smooth()
img.smooth('bilateral', (3,3), 4, 1))
img.smooth('blur', (3, 3))
img.smooth('median', (3, 3))
img.smooth('gaussian', (5,5), 0)
img.smooth('bilateral', (3,3), 4, 1,grayscale=False)
img.smooth('blur', (3, 3),grayscale=True)
img.smooth('median', (3, 3),grayscale=True)
img.smooth('gaussian', (5,5), 0,grayscale=True)
```
The document of smooth function has been updated suggesting the users to use medianFilter, bilateralFilter, blur, gaussianBlur if they have cv2 in there machine.

5) medianFilter, bilateralFilter, blur, gaussianBlur are inter-operable. i.e they call cv2 functions is they have cv2 installed.
```python
img = Image('lenna')
img.medianFilter(window=(3,3),grayscale=False)
img.bilateralFilter(diameter=5,sigmaColor=10, sigmaSpace=10,grayscale=False)
img.blur(self, window = '', grayscale=False)
img.gaussianBlur(window =(7,7) , sigmaX=5 , sigmaY=7 ,grayscale=False)
```
If the machine has just cv. The extra parameters become obsolete. This has been notified to the user in the docs associated with the receptive functions.

6) In smooth function, the check on window size if its positive and odd also width and height are made equal if they are not are added.

All the docs updated. Test cases for these functions are added in test_display. Sorry for the previous mistakes. Hope i haven't done any mistakes this time. If any please inform me, if have done any. i will correct it. :)

Regards,
Vijay Mahantesh SM