08.06.2015 Views

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

Building Machine Learning Systems with Python - Richert, Coelho

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Computer Vision – Pattern Recognition<br />

Notice how we did not convert the gray screenshot to unsigned integers; we<br />

just made use of the floating point result as it is. The second argument to<br />

the gaussian_filter function is the size of the filter (the standard deviation of<br />

the filter). Larger values result in more blurring, as can be seen in the following<br />

screenshot (shown are filtering <strong>with</strong> sizes 8, 16, and 32):<br />

We can use the screenshot on the left and threshold it <strong>with</strong> Otsu (using the same<br />

code seen previously). Now the result is a perfect separation of the building region<br />

and the sky. While some of the details have been smoothed over, the bright regions<br />

in the parking lot have also been smoothed over. The result is an approximate<br />

outline of the sky <strong>with</strong>out any artifacts. By blurring, we got rid of the detail that<br />

didn't matter to the broad picture. Have a look at the following screenshot:<br />

[ 206 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!