From the course: Code Clinic: Ruby

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Optimizations

Optimizations

From the course: Code Clinic: Ruby

Start my 1-month free trial

Optimizations

-In this movie we'll talk about some of the ways that we can alter our search strategy to speed up our matches. There are a number of things that we could try. For example, we could try using only the red, green, or blue color channels. After all, the amount of red used throughout the image ought to be the same in both if the pixels are similar. So let's just use 1/3 of the color channel, and maybe that would speed things up, or we could convert both images to grayscale. If the conversion process is sound, then they should both convert to the same colors of gray, and we could just work with that smaller set of gray images. We could also try scaling down the image. If we scale down each of the images in the same proportion, then those pixels ought to be scaled down accordingly and should still match, while giving us less territory to actually cover during our search. We could also try manipulating the image in other ways. We could increase the contrast of the image to remove details…

Contents