数学英语 11 How to Use Median Averaging
by Jason Marshall
In the last two articles we’ve learned how to calculate two types of average values: the mean and the median. Today, we’re going to continue where we left off and talk about how median averaging can be useful in everyday, real life situations. Specifically, how you can use median averaging to get better photos by making pesky tourists disappear—leaving you with a clear view of your subject.
But first, the podcast edition of this tip was sponsored by Go To Meeting. Save time and money by hosting your meetings online. Visit GoToMeeting.com/podcast and sign up for a free 45 day trial of their web conferencing solution.
Recap: What is the Difference Between Mean and Median?
Before we get too deep into how median averaging can fix your photos, let’s take a minute to review the difference between mean and median averaging. In the last two articles, we’ve discussed in detail how to calculate these two values using bags of potato chips as an example—so take a look at those articles if you need a refresher on how to crunch 1 the numbers. (For more on mean values, see How to Calculate Mean Values; for more on median values, see How to Calculate Median Values.) For today, let’s concentrate on reviewing what these two quantities really mean (sorry, the pun is nearly impossible to avoid). Up first, the mean.
Recap: What is the Mean?
Imagine you have five identical glasses in front of you, each of which is filled to a different height with water. What’s the mean height of the water in these glasses? We could figure this out by measuring the heights, adding them all together, and finally dividing the result by five to get the answer. Alternatively, we could simply pour water from one glass to another until they all had the same height of water. Some glasses would lose water, others would gain. But when you measure the final height of water in the glasses, it will be the exact same value as you calculated by summing the individual quantities and dividing by five. That is exactly what the mean value means. This shifting of the water between glasses is an excellent intuitive picture for you to keep in your head to help you understand what it really means to find mean values.
Recap: What is the Median?
How about the median? Go back to imagining you’re looking at the original glasses filled with different heights of water. Now, move the glasses into a line ordered from the least amount of water to the most. The median height is the height of the water in the middle glass. In the last episode on how to calculate median values we talked about how the real power of the median lies in its ability to resist outlying values—that is, those values that are extremely aberrant 2 (frequently these outliers are the result of something like a measurement error). In the case of our water glasses, if one glass had a lot more water than the others, the mean height would increase significantly (since we’d have to pour water from the super-full glass into the others), but the median height wouldn’t change at all.
What are Pixels in Digital Images?
So that’s the meaning of the mean and the median. Now: What can we do with them? In particular, today we’re interested in how average statistics can help us make our photos look better. But in order to talk about that, we first need to understand a few things about digital pictures and how digital cameras work. Digital cameras, including cameras on cell phones, take pictures by breaking an image into many millions of tiny discreet 3 boxes in a grid 4 pattern (it’s like looking through the mesh 5 of a window screen). Each of these tiny boxes is called a pixel (short for picture element), and each of these pixels collect light. When you put them all together, these millions of pixels determine exactly how bright and precisely 6 what color each portion of your image will be. But what does all this stuff have to do with median averaging?
How to Use Median Averaging to Get Better Photos
Well, have you ever tried to take a picture of a fantastic landmark 7, only to have your efforts to get the perfect clean shot thwarted 8 by wandering tourists? If so, and if in the future you’d like to get rid of those aberrations 9, median averaging can help. Here’s how: First, you’ll need to take several pictures of your scene (five or more pictures capturing the same area is ideal). Each successive shot should be taken several seconds apart—at least long enough that the people wandering around have rearranged themselves. The idea is that in one (or at most a few) of the images a tourist might be blocking some portion of the background you’re interested in, but the background will be exposed in the majority of the pictures (this means the scene can’t be too crowded—the technique is awesome 10, but it’s not magical).
Here’s where the pixel-nature of digital images comes into play. Let’s imagine that in each of the images you take of your landmark, the same pixel (say the top-left one) is capturing light from the same bit of background (perhaps a dark portion of a statue). That pixel will have a low value in almost all the images since there isn’t much light coming from it—except, perhaps, in that one picture where a tourist with a bright white T-shirt is standing 11 in the way. In that image, the pixel will have a high value as a result of the brightness of the T-shirt. If that T-shirt laden 12 image were the only shot you had of the statue, your final picture would obviously feature the shirt. However, that’s not your only picture—you have many T-shirt-free images too. So why not use them to replace the T-shirt tainted 13 pixel? And if you use this idea to replace every aberrant pixel in the image, you will get an image with no T-shirts or tourists whatsoever 14.
But what’s the best way to do this? Well, if you create a new image in which the value of each pixel (low for dark regions, and high for bright) is obtained by finding the median value of that same pixel in all the images, you’ll get exactly the result you’re after. In other words, the median value will throw out the outlying pixel values (belonging to T-shirts and the people wearing them), and will leave you with a clear view of the landmark! Why the median and not the mean? Well, in our case, the pixel of interest had a low value (meaning dark) in each of the pictures except the one with the bright T-shirt. The mean value of this pixel across all the images would be thrown off by this single high value, and the resulting pixel would be way too bright. Just as with the bag of crushed potato chips, the median value gives us a way to get rid of the effects of aberrant data and obtain a true representation of the typical value.
But how exactly do you go about finding this median value for each pixel in your set of digital images? It’s an impressive trick to see, so be sure to check out this week’s Math Dude “Video Extra!” episode on YouTube for a demo. And you can try it out yourself with your own pictures using the free Tourist Remover tool at............ Have fun!
Wrap Up
Okay, that’s all the math we have time for today. Now when people ask, “What’s the point of median averages?” you can enlighten them. Thanks again to our sponsor this week, Go To Meeting. Visit GoToMeeting.com/podcast and sign up for a free 45 day trial of their online conferencing service.
Please email your math questions and comments to..............You can get updates about the Math Dude podcast, the “Video Extra!” episodes on YouTube, and all my other musings about math, science, and life in general by following me on Twitter. And don’t forget to join our great community of social networking math fans by becoming a fan of the Math Dude on Facebook.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!
- If it comes to the crunch they'll support us.关键时刻他们是会支持我们的。
- People who crunch nuts at the movies can be very annoying.看电影时嘎吱作声地嚼干果的人会使人十分讨厌。
- His aberrant behavior at the party shocked everyone.他在晚会上的异常举止令所有人感到震惊!
- I saw that the insects and spiders were displaying the same kind of aberrant behavior.我看到昆虫和蜘蛛正在表现出相同反常的行为。
- He is very discreet in giving his opinions.发表意见他十分慎重。
- It wasn't discreet of you to ring me up at the office.你打电话到我办公室真是太鲁莽了。
- In this application,the carrier is used to encapsulate the grid.在这种情况下,要用载体把格栅密封起来。
- Modern gauges consist of metal foil in the form of a grid.现代应变仪则由网格形式的金属片组成。
- Their characters just don't mesh.他们的性格就是合不来。
- This is the net having half inch mesh.这是有半英寸网眼的网。
- It's precisely that sort of slick sales-talk that I mistrust.我不相信的正是那种油腔滑调的推销宣传。
- The man adjusted very precisely.那个人调得很准。
- The Russian Revolution represents a landmark in world history.俄国革命是世界历史上的一个里程碑。
- The tower was once a landmark for ships.这座塔曾是船只的陆标。
- The guards thwarted his attempt to escape from prison. 警卫阻扰了他越狱的企图。
- Our plans for a picnic were thwarted by the rain. 我们的野餐计划因雨受挫。
- These events were aberrations from the norm. 这些事件不合常规。 来自辞典例句
- These chromosome aberrations are all stable, compatible with cell viability. 这些染色体畸变都是稳定的,不影响细胞生活力的。 来自辞典例句
- The church in Ireland has always exercised an awesome power.爱尔兰的教堂一直掌握着令人敬畏的权力。
- That new white convertible is totally awesome.那辆新的白色折篷汽车简直棒极了.
- After the earthquake only a few houses were left standing.地震过后只有几幢房屋还立着。
- They're standing out against any change in the law.他们坚决反对对法律做任何修改。
- He is laden with heavy responsibility.他肩负重任。
- Dragging the fully laden boat across the sand dunes was no mean feat.将满载货物的船拖过沙丘是一件了不起的事。
- The administration was tainted with scandal. 丑闻使得政府声名狼藉。
- He was considered tainted by association with the corrupt regime. 他因与腐败政府有牵连而名誉受损。 来自《简明英汉词典》
- There's no reason whatsoever to turn down this suggestion.没有任何理由拒绝这个建议。
- All things whatsoever ye would that men should do to you,do ye even so to them.你想别人对你怎样,你就怎样对人。