You are hereFeed aggregator

Feed aggregator


Excerpt from In Real Life, YA graphic novel about gold farmers

Cory Doctorow - 2014, September 15 - 07:17



In Real Life is the book-length graphic novel adapted by Jen Wang from my short story Anda's Game, about a girl who encounters a union organizer working to sign up Chinese gold-farmers in a multiplayer game.

Tor.com has published a long excerpt from the book, showcasing Jen's wonderful art, character development and writing!

In Real Life (Comic Excerpt)

Categories: Blogs

Okotoks Wishmaker Walk 2014

Coal Trail - 2014, September 12 - 07:45







For the fourth year, our family is participating in the Wishmaker Walk in support of the Children's Wish Foundation.  Bennett was granted a wish some years ago and he has decided what his wish is.  You can view the video to see what he has decided.



This year, we are once again asking for a donation to support the work of the Foundation for the many kids and families that are dealing with life threatening illness.  Our family and friends have been incredibly supportive in the past years and we are so grateful to have the support of many as we walk this journey!  Since we have started the Okotoks Wishmaker Walk 3 years ago - our community has raised $110,000 alone for children in our community!



Please click on the link below to be directed to Bennett's fundraising page.  This year Bennett is managing and tracking his own donations on the page!

https://secure.e2rm.com/registrant/TeamFundraisingPage.aspx?teamID=573174&langPref=en-CA&Referrer=%26Referrer%3dhttp%253a%252f%252fwishmaker.ca%252f


As far as joining our team, our family is joining the Ecole Beausoleil team this year.  You may join this team with us or even better start your own team and recruit members!!!



See you all on October 4th!!!

Categories: Blogs

Internet Slowdown Day! | TakePart Live

Belmont - 2014, September 10 - 16:21

That spinning wheel of death could soon become a reality. The Federal Communications Commission proposal would effectively end net neutrality, the free and open internet we all depend on.

Evan Greer, campaign director of website Fight for the Future, talks about Internet Slowdown Day. Sites that will be affected by the end of net neutrality such as Netflix and Vimeo will feature the loading wheel to encourage users to take action in the five days before the FCC stops receiving comments about their proposal.

Then TPL hosts have changed their Twitter avatars to the loading symbol to show protest the FCC’s regulations and they want you to do the same!

Learn more at Battle for the Net!

Categories: Blogs

Image file information using imfinfo

Matlab Image processing blog - 2014, September 10 - 07:55

How can you find out what's in an image file before you read in the data? The answer is the function imfinfo. Today I want to explore the basics of using this function.

The function imfinfo returns a struct. The fields of the struct contain information about the image file.

Here's an example.

imfinfo('peppers.png') ans = Filename: '/Applications/MATLAB_R2014a.app/toolbox/matla...' FileModDate: '02-Apr-2013 15:55:52' FileSize: 287677 Format: 'png' FormatVersion: [] Width: 512 Height: 384 BitDepth: 24 ColorType: 'truecolor' FormatSignature: [137 80 78 71 13 10 26 10] Colormap: [] Histogram: [] InterlaceType: 'none' Transparency: 'none' SimpleTransparencyData: [] BackgroundColor: [] RenderingIntent: [] Chromaticities: [] Gamma: [] XResolution: [] YResolution: [] ResolutionUnit: [] XOffset: [] YOffset: [] OffsetUnit: [] SignificantBits: [] ImageModTime: '16 Jul 2002 16:46:41 +0000' Title: [] Author: [] Description: 'Zesty peppers' Copyright: 'Copyright The MathWorks, Inc.' CreationTime: [] Software: [] Disclaimer: [] Warning: [] Source: [] Comment: [] OtherText: []

The fields returned by imfinfo aren't the same for all image files. Here's the output for a TIFF file.

imfinfo('forest.tif') ans = Filename: '/Applications/MATLAB_R2014a.app/toolbox/im...' FileModDate: '25-Sep-2013 20:12:00' FileSize: 124888 Format: 'tif' FormatVersion: [] Width: 447 Height: 301 BitDepth: 8 ColorType: 'indexed' FormatSignature: [73 73 42 0] ByteOrder: 'little-endian' NewSubFileType: 0 BitsPerSample: 8 Compression: 'PackBits' PhotometricInterpretation: 'RGB Palette' StripOffsets: [1x17 double] SamplesPerPixel: 1 RowsPerStrip: 18 StripByteCounts: [1x17 double] XResolution: 72 YResolution: 72 ResolutionUnit: 'Inch' Colormap: [256x3 double] PlanarConfiguration: 'Chunky' TileWidth: [] TileLength: [] TileOffsets: [] TileByteCounts: [] Orientation: 1 FillOrder: 1 GrayResponseUnit: 0.0100 MaxSampleValue: 255 MinSampleValue: 0 Thresholding: 1 Offset: 122964 ImageDescription: 'Carmanah Ancient Forest, British Columbia,...'

Only the first nine fields of the returned struct are always the same:

  • Filename
  • FileModDate
  • FileSize
  • Format
  • FormatVersion
  • Width
  • Height
  • BitDepth
  • ColorType

FileModDate is the file modification date (as reported by the operating system). FileSize is the size of the file in bytes. The peppers.png file takes up 287,677 bytes on disk.

Format is an abbreviation indicating the type of image file (PNG, TIFF, JPEG, etc.). Although frequently the filename extension indicates the image format type, this isn't always the case. The Format field shows you the format type whether or not the filename extension indicates it.

FormatVersion has turned out to be less useful than I thought would be back in the mid-1990s. You generally don't need to pay attention to it.

Width is the number of image columns, and Height is the number of rows.

If I were designing imfinfo from scratch today, I'd probably call the next field BitsPerPixel instead of BitDepth. I might also add a field called SamplesPerPixel. Anyway, images such as peppers.png used to be frequently called "24-bit images" because each pixel is represented by three samples (one number for red, one for green, and one for blue), and each sample is represented by 8 bits. 3*8 is 24, hence 24-bit image.

The file forest.tif, on the other hand, uses only one sample for each pixel, and each sample is represented by 8 bits, so forest.tif is sometimes called an "8-bit image," and its BitDepth is 8.

ColorType tells us how the pixel values are interpreted as colors on the screen. The most common values for ColorType are 'grayscale', 'indexed', and 'truecolor'. In a grayscale image, each pixel value represents a shade of gray. In an indexed image, each pixel value is really a lookup index used to get the pixel color from a colormap (also called a palette). Truecolor (in this context) originally referred to a 24-bit image with three samples per pixels, and with the samples representing red, green, and blue. In MATLAB, though, we use the term to refer to any RGB image represented by three samples per pixel, regardless of the bit depth.

Here's an example of using the information returned by imfinfo to compute the compression ratio for a JPEG file. Let's use ngc6543a.jpg, the first truecolor sample image shipped with MATLAB.

info = imfinfo('ngc6543a.jpg'); file_bytes = info.FileSize; image_bytes = info.Width * info.Height * info.BitDepth / 8;

I divided by 8 in the line above because BitDepth is in bits instead of bytes.

compression_ratio = image_bytes / file_bytes compression_ratio = 42.7210

So what about all those other fields after the first nine? Well, they vary depending on the file format and the specific information contained in the file. For example, TIFF files optionally contain horizontal and vertical resolution information.

info = imfinfo('forest.tif'); info.XResolution ans = 72 info.YResolution ans = 72 info.ResolutionUnit ans = Inch

Most image file formats allow you to store text descriptions in them.

info = imfinfo('peppers.png'); info.Description ans = Zesty peppers

These days, most cameras store a lot more information in image files than the older sample images that are in MATLAB and the Image Processing Toolbox. This information is also available using imfinfo.

imshow('IMG_1046.JPG','InitialMagnification',20) info = imfinfo('IMG_1046.JPG') info = Filename: '/Users/steve/Dropbox/MATLAB/Blogs/IMG_1046.JPG' FileModDate: '28-Jun-2014 22:07:32' FileSize: 1595137 Format: 'jpg' FormatVersion: '' Width: 2816 Height: 1880 BitDepth: 24 ColorType: 'truecolor' FormatSignature: '' NumberOfSamples: 3 CodingMethod: 'Huffman' CodingProcess: 'Sequential' Comment: {} ImageDescription: ' ' Make: 'Canon' Model: 'Canon PowerShot S95' Orientation: 1 XResolution: 180 YResolution: 180 ResolutionUnit: 'Inch' DateTime: '2014:06:28 19:07:32' YCbCrPositioning: 'Co-sited' DigitalCamera: [1x1 struct] ExifThumbnail: [1x1 struct]

That extra information is in the DigitalCamera field.

info.DigitalCamera ans = ExposureTime: 0.0040 FNumber: 4.9000 ISOSpeedRatings: 80 ExifVersion: [48 50 51 48] DateTimeOriginal: '2014:06:28 19:07:32' DateTimeDigitized: '2014:06:28 19:07:32' ComponentsConfiguration: 'YCbCr' CompressedBitsPerPixel: 3 ShutterSpeedValue: 7.9688 ApertureValue: 4.5938 ExposureBiasValue: 0 MaxApertureValue: 4.5938 MeteringMode: 'Pattern' Flash: 'Flash did not fire, no strobe return detect...' FocalLength: 22.5000 MakerNote: [1x2764 double] UserComment: [1x264 double] FlashpixVersion: [48 49 48 48] ColorSpace: 'sRGB' CPixelXDimension: 2816 CPixelYDimension: 1880 InteroperabilityIFD: [1x1 struct] FocalPlaneXResolution: 9.6438e+03 FocalPlaneYResolution: 9.6575e+03 FocalPlaneResolutionUnit: 2 SensingMethod: 'One-chip color area sensor' FileSource: 'DSC' CustomRendered: 'Normal process' ExposureMode: 'Auto exposure' WhiteBalance: 'Auto white balance' DigitalZoomRatio: 1 SceneCaptureType: 'Standard' UnknownTags: [1x1 struct]

Do you have questions about imfinfo? Do you ever use it for writing batch processing scripts? I'd be interested to hear about it, so please leave a comment below.

\n'); d.write(code_string); // Add copyright line at the bottom if specified. if (copyright.length > 0) { d.writeln(''); d.writeln('%%'); if (copyright.length > 0) { d.writeln('% _' + copyright + '_'); } } d.write('\n'); d.title = title + ' (MATLAB code)'; d.close(); } -->


Get the MATLAB code (requires JavaScript)

Published with MATLAB® R2014a

Categories: Blogs

Amazon vs Hachette is nothing: just WAIT for the audiobook wars!

Cory Doctorow - 2014, September 9 - 07:44


In my latest Locus column, Audible, Comixology, Amazon, and Doctorow’s First Law, I unpick the technological forces at work in the fight between Amazon and Hachette, one of the "big five" publishers, whose books have not been normally available through Amazon for months now, as the publisher and the bookseller go to war over the terms on which Amazon will sell books in the future.


The publishing world is, by and large, rooting for Hachette, but hasn't paid much attention to the ways in which Hachette made itself especially vulnerable to Amazon in this fight: by insisting that all its books be sold with Amazon's DRM, it has permanently locked all its customers into Amazon's ecosystem, and if Hachette tries to convince them to start buying ebooks elsewhere, it would mean asking their readers to abandon their libraries in the bargain (or maintain two separate, incompatible libraries with different apps, URLs, and even devices to read them).

Worse still: people in publishing who are alarmed about Hachette are still allowing their audiobooks to be sold by Audible, the Amazon division that controls 90% of the audiobook market and will only sell audiobooks in a format that can't be legally played with anything except Amazon-approved technology. Audible has already started putting the screws to its audiobook suppliers -- the publishers and studios that make most of the audiobooks it sells -- even as it has gone into business competing with them.

It's profoundly, heartbreakingly naive to expect that Amazon will be any less ruthless in exploiting the advantage it is being handed over audiobooks than it has been in its exploitation of ebooks.

Take Amazon’s subsidiary Audible, a great favorite among science fiction writers and fans. The company has absolute dominance over the audiobook market, accounting for as much as 90 percent of sales for major audio publishers. Audible has a no-exceptions requirement for DRM, even where publishers and authors object (my own audiobooks are not available through Audible as a result). Audible is also the sole audiobook supplier for iTunes, meaning that authors and publishers who sell audiobooks through iTunes are likewise bound to lock these to Amazon’s platform and put them in Amazon’s perpetual control.

As John Scalzi wrote recently:

These businesses and corporations are not your friends. They will seek to extract the maximum benefit from you that they can, and from others with whom they engage in business, consistent with their current set of business goals. This does not make them evil – it makes them business entities (they might also be evil, or might not be, but that’s a different thing). If you’re treating these businesses as friends, you’re likely to get screwed.

Anyone who believes that Audible would hesitate to use its market power to extract additional profit at the expense of its suppliers – that is, writers and publishers – is delusional. Not because Audible is evil, but because it is a for-profit corporation that is seeking to maximize its gain. The lesson of Hachette is that Amazon plays hardball when it can, and the more leverage Amazon has over its suppliers, the more it will use that leverage to its suppliers’ detriment.

Audible, Comixology, Amazon, and Doctorow’s First Law [Locus/Cory Doctorow]

(Image: DRM PNG 900 2, Listentomyvoice, CC-BY-SA)

Categories: Blogs

“Information Doesn’t Want to Be Free”

Cory Doctorow - 2014, September 8 - 09:24

Here's the audio of my closing keynote speech at last Friday's Dconstruct (this was the tenth Dconstruct; I'm pleased to say that I also gave the closing speech at the very first one!).

You can hear audio from the rest of the speakers too.

Categories: Blogs

Starred review in Kirkus for INFORMATION DOESN’T WANT TO BE FREE, my next book

Cory Doctorow - 2014, September 8 - 07:21


My next book, Information Doesn’t Want to Be Free, comes out in November, but the reviews have just started to come in. Kirkus gave it a stellar review. Many thanks to @neilhimself and @amandapalmer for their wonderful introductions!

In his best-selling novel Ready Player One, Ernest Cline predicted that decades from now, Doctorow (Homeland, 2013, etc.) should share the presidency of the Internet with actor Wil Wheaton. Consider this manifesto to be Doctorow’s qualifications for the job.

The author provides a guide to the operation of the Internet that not only makes sense, but is also written for general readers. Using straightforward language and clear analogies, Doctorow breaks down the complex issues and tangled arguments surrounding technology, commerce, copyright, intellectual property, crowd funding, privacy and value—not to mention the tricky situation of becoming “Internet Famous.” Following a characteristically thoughtful introduction by novelist Neil Gaiman, rock star Amanda Palmer offers a blunt summary of today’s world: “We are a new generation of artists, makers, supporters, and consumers who believe that the old system through which we exchanged content and money is dead. Not dying: dead.” So the primary thesis of the book becomes a question of, where do we go from here? Identifying the Web’s constituents as creators, investors, intermediaries and audiences is just the first smart move. Doctorow also files his forthright, tactically savvy arguments under three “laws,” the most important of which has been well-broadcast: “Any time someone puts a lock on something that belongs to you and won’t give you the key, that lock isn’t there for your benefit.”

Read the whole review

Categories: Blogs

High-school English study guide for Homeland, the sequel to Little Brother

Cory Doctorow - 2014, September 6 - 23:15

Neil Anderson from the Association from Media Literacy (which has a great-sounding upcoming conference) has produced an excellent study guide for my novel Homeland (the sequel to Little Brother) -- Anderson's guide encourages critical thinking about politics, literary technique, technology, privacy, surveillance, and history.

I'm immensely grateful to Anderson for his good work here. I often hear from teachers who want to know if there are any curricular materials they can use in connection with my books, and several of them have shared their own guides with me, but this one stands out as an unusually comprehensive and thoughtful one.

7. Word Meanings
Because communications technologies are central to Homeland‘s plot, the novel contains many tech-oriented words that might be unfamiliar to some readers. Because Marcus is a young adult, some words are specific to young adult culture. Explain how readers could use context to infer the meanings of unfamiliar words.

Some words that you might use for inferring meanings include:

*Rooted
*Pwned
*Faraday pouch
*Lulz
*Darknet
*Tor
*Distro

8. Representation

Marcus Yallow, Homeland’s protagonist, is a male. But there are several female characters: Ange is his girlfriend, Masha is an ally, Carrie is an enemy, and Flor is his campaign office boss.

Does Homeland represent a good balance of male and female characters or is it biased? Why?

Are the male and female characters fairly represented? Explain?

Homeland also includes representation from multiple racial/ethnic groups. Joe is African-American, Ange is Asian, etc.

How might this inclusiveness add to the novel’s authenticity and pleasure?

Some people think that it is important for audiences to see themselves represented in the media texts that they consume; that it helps them enjoy the texts and validates their own existence.

Does it really matter whether Homeland‘s characters represent a range of racial/ethnic groups?

Would the story be equally interesting and entertaining if all the characters were from only one racial/ethnic group?

Imagine that Marcus, Ange, Joe and Carrie are from other racial/ethnic groups, or that their genders are switched.

How might those changes influence readers’ responses to the story?

Homeland Study Guide [Neil Anderson/Association for Media Literacy]

Categories: Blogs

Excerpt from my story “The Man Who Sold the Moon”

Cory Doctorow - 2014, September 5 - 22:05


Medium have published an excerpt from "The Man Who Sold the Moon, my 36,000 word novella in Hieroglyph: Stories and Visions for a Better Future, a project to inspire optimism and ambition about the future and technology that Neal Stephenson kicked off (see also What Will it Take to Get Us Back to the Moon?).

“Hey,” someone said behind me. “Hey, dude?”

It occurred to me that I was the dude in question, and that this person had been calling out to me for some time, with a kind of mellow intensity — not angry, but insistent nonetheless. I turned around and found myself staring down at a surfer-looking guy half my age, sun-bleached ponytail and wraparound shades, ragged shorts and a grease-stained long-sleeved jersey and bare feet, crouched down like a Thai fisherman on his haunches, calf muscles springing out like wires, fingertips resting lightly on a gadget.

Minus was full of gadgets, half built, sanded to fit, painted to cover, with lots of exposed wiring, bare boards, blobs of hot glue and adhesive polymer clinging on for dear life against the forces of shear and torque and entropy. But even by those standards, surfer-guy’s gadget was pretty spectacular. It was the lens — big and round and polished, with the look of a precision-engineered artifact out of a real manufacturer’s shop — not something hacked together in a hacklab.

The Gadget and the Burn [Cory Doctorow/Medium]

Categories: Blogs

Free cybersecurity MOOC

Cory Doctorow - 2014, September 3 - 23:31



The Open University's "Introduction to Cyber Security" is a free online course -- with optional certificate -- that teaches the fundamentals of crypto, information security, and privacy; I host the series, which starts on Oct 13."

The course is designed to teach you to use privacy technologies and good practices to make it harder for police and governments to put you under surveillance, harder for identity thieves and voyeurs to spy on you, and easier for you and your correspondents to communicate in private.

I'm a visiting professor at the OU, and I was delighted to work on this with them.

We shop online. We work online. We play online. We live online. As our lives increasingly depend on digital services, the need to protect our information from being maliciously disrupted or misused is really important.

This free online course will help you to understand online security and start to protect your digital life, whether at home or work. You will learn how to recognise the threats that could harm you online and the steps you can take to reduce the chances that they will happen to you.

With cyber security often in the news today, the course will also frame your online safety in the context of the wider world, introducing you to different types of malware, including viruses and trojans, as well as concepts such as network security, cryptography, identity theft and risk management.


Introduction to Cyber Security

Categories: Blogs

Podcast: Petard from Tech Review’s Twelve Tomorrows

Cory Doctorow - 2014, September 1 - 09:55


Here's a reading (MP3) of the first part of my story "Petard: A Tale of Just Desserts" from the new MIT Tech Review anthology Twelve Tomorrows, edited by Bruce Sterling. The anthology also features fiction by William Gibson, Lauren Beukes, Chris Brown, Pat Cadigan, Warren Ellis, Joel Garreau, and Paul Graham Raven. The 2013 summer anthology was a huge hit -- Gardner Dozois called it "one of the year’s best SF anthologies to date, perhaps the best."

MP3

Categories: Blogs

Adversarial Compatibility: hidden escape hatch rescues us from imprisonment through our stuff

Cory Doctorow - 2014, August 27 - 05:33


My latest Guardian column, Adapting gadgets to our needs is the secret pivot on which technology turns, explains the hidden economics of stuff, and how different rules can trap you in your own past, or give you a better future.

Depending on your view, the stuff you own is either a boon to business or a tremendous loss of opportunity.

For example, your collection spice bottles in your pantry means that I could possibly sell you a spice rack. On the other hand, it also means that I can’t design a special spice rack that only admits spice bottles of my own patent-protected design, which would thereby ensure that if you wanted to buy spices in the future you’d either have to buy them from me or throw away that very nice spice rack I sold you.

In the tech world, this question is often framed in terms of “ecosystems” (as in the “Google/Chrome/Android ecosystem”) or platforms (as in the “Facebook platform”) but whatever you call it, the discussion turns on a crucial different concept: sunk cost.

That’s the money, time, mental energy and social friction you’ve already sunk into the stuff you own. Your spice rack’s sunk cost includes the money you spend on the rack, the time you spent buying fixings for it and the time you spent afixing it, the emotional toil of getting your family to agree on a spice rack, and the incredible feeling of dread that arises when you contemplate going through the whole operation again.

If you’ve already got a lot of sunk costs, the canny product strategy is to convince you that you can buy something that will help you organise your spices, rip all your CDs and put them on a mobile device, or keep your clothes organised.

But what a vendor really wants is to get you to sink cost into his platform, ecosystem, or what have you. To convince you to buy his wares, in order to increase the likelihood that you’ll go on doing so – because they match the decor, because you already have the adapters, and so on.

Adapting gadgets to our needs is the secret pivot on which technology turns [The Guardian]

(Image: David Joyce, CC-BY-SA: Story, Lumix G1 Adapter Breakdown, Chad Kainz, CC-BY)

Categories: Blogs

Tech Review’s annual science fiction issue, edited by Bruce Sterling, featuring William Gibson

Cory Doctorow - 2014, August 26 - 06:37


The summer annual features stories "inspired by the real-life breakthroughs covered in the pages of MIT Technology Review," including "Petard," my story about hacktivism; and "Death Cookie/Easy Ice," an excerpt from William Gibson's forthcoming (and stone brilliant) futuristic novel The Peripheral.

Other authors in the collection include Lauren Beukes, Chris Brown, Pat Cadigan, Warren Ellis, Joel Garreau, and Paul Graham Raven. The 2013 summer anthology was a huge hit -- Gardner Dozois called it "one of the year’s best SF anthologies to date, perhaps the best."

The 2014 edition is out this month, available direct from MIT Tech Review.

Twelve Tomorrows | MIT Technology Review

Categories: Blogs

Happy Birthday, Cleve!

Matlab Image processing blog - 2014, August 19 - 13:28

I just got back from a huge MathWorks party to celebrate Cleve Moler's 75th birthday. Cleve created the original MATLAB back in the late 1970s and then joined with Jack Little to cofound MathWorks in 1984.

At the party, we learned that Cleve is the winner of the 2014 IEEE John von Neumann Medal, which is awarded for outstanding achievements in computer-related science and technology.

Happy Birthday and Congratulations, Cleve! I've learned more just by working in the same hallway as you than in much of my formal education. Thanks for being so generous in sharing your knowledge and experience with so many of us for so many years.

Readers, be sure to check out Cleve's blog. Or listen to Cleve describe the three decades of mathematicians, computers, and technology (and a LINPACK license plate!) that led to the creation of MATLAB.

Categories: Blogs

Neal Stephenson and Cory speaking at Seattle’s Town Hall, Oct 26

Cory Doctorow - 2014, August 19 - 07:09


We're getting together to talk about Hieroglyph: Stories and Visions for a Better Future , a project that Stephenson kicked off -- I've got a story in it called "The Man Who Sold the Moon."

The project's mission is to promote "Asimovian robots, Heinleinian rocket ships, Gibsonian cyberspace… plausible, thought-out pictures of alternate realities in which... compelling innovation has taken place." Tickets are $5.


Neal Stephenson and Cory Doctorow: Reigniting Society’s Ambition with Science Fiction

Categories: Blogs

Please let this be lucky surgery #13!!!

Coal Trail - 2014, August 17 - 20:15

We have had an outstanding summer.  The kids have been living it up with visits to Fernie, the lake, the pools and local fun spots!

Calaway Park - where Maeve can ride most rides now...thrilling times!


Coal Creek, Fernie - an amazing trip with Lendrum cousins enjoying everything about our beloved Fernie!

Lunch time after a raft down the Elk River - wild times for the bravest kids around!


As far as the ranch, we have had an amazing and relatively stress-free hay year.  This means that we have been able to get childcare for the kids when Darren and I both need to be in tractors, we have had amazing people helping us to get the hay baled, etc (cousin Jenn, Pop Rick & neighbors!) the rains have cooperated (and there have not been many) and we have not had any major equipment breakdowns (there are usually many).
As far as Bennett's health, he continues along the path of recovery.  In mid-July, he became quite ill with strep throat.  Up until that point, the Epstein Barr Virus (can cause Post Transplant Lymphoproliferative Disorder - Lymphoma) had been testing high in his blood.  We were visiting the hospital frequently, cautiously monitoring for symptoms and undergoing frequent blood work.  One of the symptoms of PTLD is enlarged lymph nodes - so as you can imagine when we discovered that Bennett's lymph nodes were swollen one morning it was off to see the oncologist on a Sunday at Children's.  During that visit, the doctor explained several possibilities, took a throat swab (on the off chance it was strep throat), and basically explained that the next step would be to remove and biopsy the swollen lymph nodes.  It was during that same visit that the doctor checked on the growth underneath Ben's tongue which I had noticed the previous day.  I left the visit in a high state of worry about the lymphoma and the tongue issue.  It makes me wonder if there will ever be a day again with Bennett where we can go to the doctor and just be told of the most simple diagnosis (strep throat).  As opposed to hearing the possible worst case scenario every time.  
It turned out that it was strep throat accompanied of course by that pesky C. diff bug.  Needless to say, we had a sick little boy for a couple of days until all of the antibiotics started working their magic!
So now for the tongue issue.  We have had the same issue about one and half years ago.  Read about it here http://coaltrail.blogspot.ca/2013_01_01_archive.html
This time however we are still hopeful that it will only be a tongue ulcer - non issue.  I am again in a high state of worry because there are 3 options with his tongue 1) nothing - and because this is the second time around this is a small possibility  2) pre-malignant growth (erythoplakia or leukoplakia  3) squamous cell carcinoma (yes, the C word!).  Bennett will undergo the biopsy (removal of the large growth under his tongue) this Friday morning.
Because the ER is so booked and they could only "fit in" this urgent surgery in mid-september, we have been given the option to have it done under local anesthetic.  I can't even explain in the proper words how distraught and upset this made me in my day long dealings with the booking staff, but I can assure you that I may have been put on the "crazy parent" list.  Bennett is an incredibly tough kid, and the procedure is relatively quick and simple.  This being said, it is beyond me though why we need to subject a 9 year old boy undergoing his 13th surgery to only a local anesthetic so that he can witness the underside of his right tongue being removed.  This remains our only choice as we need to remove the growth before it changes, spreads and causes him pain.
This is where I am hoping we can get a little hope from our friends!  I told Bennett about his surgery yesterday...and yes the whole part about the local freezing ( I sort of left out the part of what this could mean if we found something in his tongue - cross that bridge if we get there!) - he really didn't have much nice or positive to say at all.  He has been asking non stop questions.  I gather that the non-stop questions are a hint to his state of worry. I am hoping that everyone can find sometime in their day over the next few days to send Bennett an email, a note, a letter, a hand drawn photo - to remind him of how strong he is and how much other people think that he is strong!  This way every time he has a question, I can respond also with a "letter of encouragement" for him!  The recovery for this surgery was one week last time until he could eat and talk normally again, so keep those well wishes coming as we need to keep his spirits high for the week!
My new email is [email protected]  Our mailing address is RR1, High River, T1V 1N1.  
And most of all, let's all cross our fingers and really hope that this is truly lucky surgery number 13 - local anesthetic and all!!!!

Categories: Blogs

It Ain’t Easy Seeing Green (Unless You Have MATLAB)

Matlab Image processing blog - 2014, August 12 - 10:37

I'd like to welcome guest blogger and ace MATLAB training content developer Matt Tearle for today's post. Thanks, Matt!

ContentsAn Unusual Assignment

What do you do if you don't have an image processing background and your boss asks you to produce a music video for a MATLAB-vs-Simulink rap battle? It's probably not a question you've given much thought to. I admit that I hadn't either. But that's the awkward situation I found myself in a little while back.

A MATLAB-vs-Simulink rap battle -- obviously I had to be a part of this project! There was just one significant problem: I'm not a video producer. Yes, I have a nice digital camera. I have some very basic editing software. And I certainly have some... "creative" ideas. But I don't have any software designed to do serious video editing.

In particular, as soon as the concept was explained to me, I decided that we needed to do a "green screen" video:

  • We'd record our rappers busting out their rhymes in front of a green backdrop
  • I'd make an entertaining background video
  • Then we'd put the two together, using the background video in place of the green screen:

[This background may not seem particularly "entertaining", but if I showed the real one we used, lawyers might get involved... And nobody wants that.]

MATLAB to the Rescue

With no purpose-made software to achieve this, and only a few days before it was due (thanks, boss!), I turned to my default standby: MATLAB!

A video is just a sequence of images, so all I needed to do was to write MATLAB code to "green-screen" two images, then read in two videos and apply my algorithm frame-by-frame. A quick hunt around in the documentation, and I had the framework code ready to go:

% Open the input video files v1 = VideoReader('background.mp4'); v2 = VideoReader('foreground.mp4'); % Determine the number of frames for the final video nFrames = min(v1.NumberOfFrames,v2.NumberOfFrames); % Open a video file to write the result to vOut = VideoWriter('mixedvideo.mp4','MPEG-4'); vOut.FrameRate = 24; open(vOut); % Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = read(v1,k); y = read(v2,k); % Mix them together z = magicHappensHere(x,y); % TODO: Write this... % Write the result to file writeVideo(vOut,z) end % And we're done! close(vOut);

Now all I needed to do was write the magic function that would do the greenscreening...

Real Life is Complicated

Actually, I soon discovered that I needed to do a bit more preprocessing first. I had created the background video on my computer, but filmed the foreground on my digital camera. Of course the dimensions didn't match... No worries! That's what Image Processing Toolbox is for. I added a line of code to define the desired dimensions of the output video. Then imresize took care of the rest:

% Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = imresize(read(v1,k),outDims); y = imresize(read(v2,k),outDims); % Mix them together z = magicHappensHere(x,y); % Write the result to file writeVideo(vOut,z) end

Wow, this image processing stuff is easy! What's next, then?

Developing a Green-Screen Algorithm

The first thing to try, of course, when developing an algorithm is to see if one already exists. Sadly, searching the Image Processing Toolbox documentation didn't turn up a greenscreen function or anything I could see that would do the job. So it looks like I have to do this from scratch.

If I can identify the green pixels, then I can just replace those pixels in the foreground image with the corresponding pixels in the background image. So all of this really just boils down to: how do I find the green pixels? I know that a true-color image in MATLAB is an m-by-n-by-3 array, where each of the three m-by-n "planes" represent red, green, and blue intensity, respectively:

"Green" would, ideally, be [0, 255, 0] (in uint8). So a simple way to find the green pixels would be to do some kind of thresholding:

isgreen = (y(:,:,1) < 175) & (y(:,:,2) > 200) & (y(:,:,3) < 175);

This didn't work too badly, but neither was it great. One of the problems is the use of magic threshold values -- three of them, no less! Playing around with three magic parameters to try to find the right combination doesn't sound like fun to me. And besides, using absolute values like this might not be the best way to judge "greenness". If you look at the example image above, you can see that there's a fair amount of variation in the green background. (This is mainly because we were using an unevenly lit conference room that happened to have a green wall -- this was clearly a very professional production!)

At this point, I had to ask myself "what does it really mean to be 'green'?". As a human, I can easily distinguish between the various shades of green on the wall, despite the difference in brightness and shading. At first, this lead me into thinking about color spaces and how a color is a point in some 3-D space (RGB, CYM, HSV, etc.). Perhaps I could define "green" as "sufficiently close to [0 1 0] in RGB space". And so followed a few experiments with rounding, distance calculations, even playing with rgb2ind. But to no great success:

yd = round(double(y)/255); isgreen = (yd(:,:,1)==0) & (yd(:,:,2)==1) & (yd(:,:,3)==0);

As this image shows, the problem with our makeshift green screen was that it wasn't particularly green -- more a yellow-green, with significant variations in brightness.

Just as I was started to get worried that this wasn't going to work at all, I realized that one obvious characteristic of the green pixels is that the green value is significantly greater than the blue and red values. This is, of course, embedded in my simple thresholding code above, but I can do away with at least some of the magic constants by looking at relative values. So how about calculating a "greenness" value from the three color channels:

yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3));

Now that looks very promising. If I threshold that, I should get what I'm looking for. But rather than use an absolute threshold value maybe I can use something based on the distribution of the greenness values. In particular, I can exploit one nice feature of the images: they have a lot of green pixels. The histogram of greenness values looks like this:

I tried a simple thresholding based on the average greenness value, ignoring the negative values:

thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh;

Success! OK, so there's one magic constant left in there, but it was pretty quick and easy to tune, and seemed to be quite robust to minor changes. I'm calling that a good result. Now that I know where the green pixels are, I just have to replace them with the corresponding pixels from the background.

% Start with the foreground (essentially preallocation) z = y; % Find the green pixels yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3)); thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh; % Blend the images % Loop over the 3 color planes (RGB) for j = 1:3 rgb1 = x(:,:,j); % Extract the jth plane of the background rgb2 = y(:,:,j); % Extract the jth plane of the foreground % Replace the green pixels of the foreground with the background rgb2(isgreen) = rgb1(isgreen); % Put the combined image into the output z(:,:,j) = rgb2; end

I love using logical indexing -- it's probably my favorite construct in the MATLAB language. Here I'm using it to replace the green pixels of the foreground (rgb2(isgreen)) with the corresponding background pixels (rgb1(isgreen)).

Going Further. Because I Can.

At this point I had a video that would have sufficed, but there was a noticeable green outline around my rappers. (It's not necessarily apparent in a single still frame.) It was only Sunday morning by this point, which meant that I still had a few hours left to tinker. Could I find a way to "shave" a pixel or two from the edge of the black silhouette in the above image of isgreen? To do that, I'd first need to find that edge. I don't know much about image processing, but I do know that "edge detection" is a thing that image people do, so it's time for me to search the doc... Sure enough, there's an edge function:

outline = edge(isgreen,'roberts');

Easy! Now if I can thicken that edge and combine it with the original isgreen, I'll have the slightly larger greenscreen mask that I need. Two more Image Processing Toolbox functions help me thicken the edge:

se = strel('disk',1); outline = imdilate(outline,se);

The edge variable outline is a logical array, so I can easily combine it with isgreen, to get my final result:

isgreen = isgreen | outline;

Put it all together and I have a pretty simple script:

% Open the input video files v1 = VideoReader('background.mp4'); v2 = VideoReader('foreground.mp4'); % Determine the number of frames for the final video nFrames = min(v1.NumberOfFrames,v2.NumberOfFrames); % Set the output dimensions outDims = [400 640]; % Open a video file to write the result to vOut = VideoWriter('mixedvideo.mp4','MPEG-4'); vOut.FrameRate = 24; open(vOut); % Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = imresize(read(v1,k),outDims); y = imresize(read(v2,k),outDims); % Mix them together z = y; % Preallocate space for the result % Find the green pixels in the foreground (y) yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3)); % Threshold the greenness value thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh; % Thicken the outline to expand the greenscreen mask a little outline = edge(isgreen,'roberts'); se = strel('disk',1); outline = imdilate(outline,se); isgreen = isgreen | outline; % Blend the images % Loop over the 3 color planes (RGB) for j = 1:3 rgb1 = x(:,:,j); % Extract the jth plane of the background rgb2 = y(:,:,j); % Extract the jth plane of the foreground % Replace the green pixels of the foreground with the background rgb2(isgreen) = rgb1(isgreen); % Put the combined image into the output z(:,:,j) = rgb2; end % Write the result to file writeVideo(vOut,z) end % And we're done! close(vOut);

The Moral of the Story

This is not the best greenscreen code ever written (although it is the best greenscreen code I've ever written). But the real point is that it shouldn't even exist -- I had no prior image processing knowledge, I was working with videos of different dimensions, the greenscreen was unevenly lit (and not even particularly green), and I had a weekend to make it happen. The fact that I was able to do this is one of the main reasons I love MATLAB (and, of course, the associated toolboxes): I was able to spend my time on the heart of my algorithm, not all the coding details. Different-sized images? Fixed with one function call (imresize). Need to find edges of a region? One function call (edge). Want to thicken that edge? Two function calls (strel and imdilate). The final script is less than 50 lines.

My time was spent wrestling with the core of the problem: how I was going to figure out what "green" looked like in my images. Because I could spend my time there, I was able to tinker with different ideas. This, to me, is what MATLAB is all about: rapid prototyping -- ideas becoming working code.

Post Script: Fortune Favors the Brave (and/or Crazy)

Having made the video and feeling pretty good about what I managed to pull together in a few hours of MATLAB, I later realized that I got lucky. The way I calculated greenness (G*(G-R)*(G-B)) was intended to give negative results for anything that didn't have more green than red or blue. But I simply overlooked the possibility of getting a high positive value if both G-R and G-B were negative. According to my formula, a light magenta -- e.g. [1 0.6 1] -- would be very green! Luckily for me, my source videos didn't include anything like that. A more robust approach would have been something like this:

yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*max(yd(:,:,2)-yd(:,:,1),0).*max(yd(:,:,2)-yd(:,:,3),0);

Now any pixel with more red or more blue than green will have a greenness of 0. Everything else works the same.

I think there's a nice moral in this postscript, as well. I love using MATLAB to solve a problem -- a real, immediate problem that I need to solve right now. I don't necessarily need the best solution, or the solution to the most general problem. The greenscreen algorithm I hacked together wasn't the best, but it worked for my application. If my image had light magenta in it, I would have discovered this bug and fixed it, but that didn't happen and didn't matter.

If I had approached this assignment like a professional software developer, I'd still be working on it. But as a MATLAB hacker, I was done in a weekend!

\n'); d.write(code_string); // Add copyright line at the bottom if specified. if (copyright.length > 0) { d.writeln(''); d.writeln('%%'); if (copyright.length > 0) { d.writeln('% _' + copyright + '_'); } } d.write('\n'); d.title = title + ' (MATLAB code)'; d.close(); } -->


Get the MATLAB code (requires JavaScript)

Published with MATLAB® R2014a

> % % [This background may not seem particularly "entertaining", but if I % showed the real one we used, lawyers might get involved... And nobody % wants that.] % %% MATLAB to the Rescue % With no purpose-made software to achieve this, and only a few days before % it was due (thanks, boss!), I turned to my default standby: MATLAB! % % A video is just a % sequence of images, so all I needed to do was to write MATLAB code to % "green-screen" two images, then read in two videos and apply my algorithm % frame-by-frame. A quick hunt around in the documentation, and I had the % framework code ready to go: %% % Open the input video files v1 = VideoReader('background.mp4'); v2 = VideoReader('foreground.mp4'); % Determine the number of frames for the final video nFrames = min(v1.NumberOfFrames,v2.NumberOfFrames); % Open a video file to write the result to vOut = VideoWriter('mixedvideo.mp4','MPEG-4'); vOut.FrameRate = 24; open(vOut); % Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = read(v1,k); y = read(v2,k); % Mix them together z = magicHappensHere(x,y); % TODO: Write this... % Write the result to file writeVideo(vOut,z) end % And we're done! close(vOut); %% % Now all I needed to do was write the magic function that would do the % greenscreening... %% Real Life is Complicated % Actually, I soon discovered that I needed to do a bit more preprocessing % first. I had created the background video on my computer, but filmed the % foreground on my digital camera. Of course the dimensions didn't match... % No worries! That's what Image Processing Toolbox is for. I added a line % of code to define the desired dimensions of the output video. Then % |imresize| took care of the rest: %% % Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = imresize(read(v1,k),outDims); y = imresize(read(v2,k),outDims); % Mix them together z = magicHappensHere(x,y); % Write the result to file writeVideo(vOut,z) end %% % Wow, this image processing stuff is *easy*! What's next, then? %% Developing a Green-Screen Algorithm % The first thing to try, of course, when developing an algorithm is to see % if one already exists. Sadly, searching the Image Processing Toolbox % documentation didn't turn up a |greenscreen| function or anything I could % see that would do the job. So it looks like I have to do this from % scratch. % % If I can identify the green pixels, then I can just replace those pixels % in the foreground image with the corresponding pixels in the background % image. So all of this really just boils down to: how do I find the green % pixels? I know that a true-color image in MATLAB is an m-by-n-by-3 % array, where each of the three m-by-n "planes" represent red, green, and % blue intensity, respectively: % % <> % % "Green" would, ideally, be [0, 255, 0] (in |uint8|). So a simple way to % find the green pixels would be to do some kind of thresholding: % %% isgreen = (y(:,:,1) < 175) & (y(:,:,2) > 200) & (y(:,:,3) < 175); %% % % <> % % This didn't work too badly, but neither was it great. One of the % problems is the use of magic threshold values REPLACE_WITH_DASH_DASH three of them, no less! % Playing around with three magic parameters to try to find the right % combination doesn't sound like fun to me. And besides, using absolute % values like this might not be the best way to judge "greenness". If you % look at the example image above, you can see that there's a fair amount % of variation in the green background. (This is mainly because we were % using an unevenly lit conference room that happened to have a green wall % REPLACE_WITH_DASH_DASH this was clearly a very professional production!) % % At this point, I had to ask myself % . As a human, I can easily % distinguish between the various shades of green on the wall, despite the % difference in brightness and shading. At first, this lead me into % and how a color is a point in some 3-D space % (RGB, CYM, HSV, etc.). Perhaps I could define "green" as "sufficiently % close to [0 1 0] in RGB space". And so followed a few experiments with % rounding, distance calculations, even playing with |rgb2ind|. But to no % great success: yd = round(double(y)/255); isgreen = (yd(:,:,1)==0) & (yd(:,:,2)==1) & (yd(:,:,3)==0); %% % <> % % <> % % % As this image shows, the problem with our makeshift green screen was that % it wasn't particularly green REPLACE_WITH_DASH_DASH more a yellow-green, with significant % variations in brightness. % % Just as I was started to get worried that this wasn't going to work at % all, I realized that one obvious characteristic of the green pixels is % that the green value is significantly *greater* than the blue and red % values. This is, of course, embedded in my simple thresholding code % above, but I can do away with at least some of the magic constants by % looking at *relative* values. So how about calculating a "greenness" % value from the three color channels: yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3)); %% % <> % % Now *that* looks very promising. If I threshold that, I should get what % I'm looking for. But rather than use an absolute threshold value maybe I % can use something based on the distribution of the greenness values. In % particular, I can exploit one nice feature of the images: they have a lot % of green pixels. The histogram of greenness values looks like this: % % <> % % I tried a simple thresholding based on the average greenness value, % ignoring the negative values: thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh; %% % <> % % Success! OK, so there's one magic constant left in there, but it was % pretty quick and easy to tune, and seemed to be quite robust to minor % changes. I'm calling that a good result. Now that I know where the green % pixels are, I just have to replace them with the corresponding pixels % from the background. %% % Start with the foreground (essentially preallocation) z = y; % Find the green pixels yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3)); thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh; % Blend the images % Loop over the 3 color planes (RGB) for j = 1:3 rgb1 = x(:,:,j); % Extract the jth plane of the background rgb2 = y(:,:,j); % Extract the jth plane of the foreground % Replace the green pixels of the foreground with the background rgb2(isgreen) = rgb1(isgreen); % Put the combined image into the output z(:,:,j) = rgb2; end %% % I love using logical indexing REPLACE_WITH_DASH_DASH it's probably my favorite construct in % the MATLAB language. Here I'm using it to replace the green pixels of % the foreground (|rgb2(isgreen)|) with the corresponding background pixels % (|rgb1(isgreen)|). % % <> % %% Going Further. Because I Can. % At this point I had a video that would have sufficed, but there was a % noticeable green outline around my rappers. (It's not necessarily % apparent in a single still frame.) It was only Sunday morning by this % point, which meant that I still had a few hours left to tinker. Could I % find a way to "shave" a pixel or two from the edge of the black % silhouette in the above image of |isgreen|? To do that, I'd first need % to find that edge. I don't know much about image processing, but I do % know that "edge detection" is a thing that image people do, so it's time % for me to search the doc... Sure enough, there's an |edge| function: %% outline = edge(isgreen,'roberts'); %% % % <> % % Easy! Now if I can thicken that edge and combine it with the original % |isgreen|, I'll have the slightly larger greenscreen mask that I need. % Two more Image Processing Toolbox functions help me thicken the edge: %% se = strel('disk',1); outline = imdilate(outline,se); %% % % <> % % The edge variable |outline| is a logical array, so I can easily combine % it with |isgreen|, to get my final result: %% isgreen = isgreen | outline; %% % % <> % % Put it all together and I have a pretty simple script: %% % Open the input video files v1 = VideoReader('background.mp4'); v2 = VideoReader('foreground.mp4'); % Determine the number of frames for the final video nFrames = min(v1.NumberOfFrames,v2.NumberOfFrames); % Set the output dimensions outDims = [400 640]; % Open a video file to write the result to vOut = VideoWriter('mixedvideo.mp4','MPEG-4'); vOut.FrameRate = 24; open(vOut); % Loop over all the frames for k = 1:nFrames % Get the kth frame of both inputs x = imresize(read(v1,k),outDims); y = imresize(read(v2,k),outDims); % Mix them together z = y; % Preallocate space for the result % Find the green pixels in the foreground (y) yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3)); % Threshold the greenness value thresh = 0.3*mean(greenness(greenness>0)); isgreen = greenness > thresh; % Thicken the outline to expand the greenscreen mask a little outline = edge(isgreen,'roberts'); se = strel('disk',1); outline = imdilate(outline,se); isgreen = isgreen | outline; % Blend the images % Loop over the 3 color planes (RGB) for j = 1:3 rgb1 = x(:,:,j); % Extract the jth plane of the background rgb2 = y(:,:,j); % Extract the jth plane of the foreground % Replace the green pixels of the foreground with the background rgb2(isgreen) = rgb1(isgreen); % Put the combined image into the output z(:,:,j) = rgb2; end % Write the result to file writeVideo(vOut,z) end % And we're done! close(vOut); %% % % <> % %% The Moral of the Story % This is not the best greenscreen code ever written (although it *is* the % best greenscreen code *I've* ever written). But the real point is that % it shouldn't even exist REPLACE_WITH_DASH_DASH I had no prior image processing knowledge, I % was working with videos of different dimensions, the greenscreen was % unevenly lit (and not even particularly green), and I had a weekend to % make it happen. The fact that I was able to do this is one of the main % reasons I love MATLAB (and, of course, the associated toolboxes): I was % able to spend my time on the heart of *my algorithm*, not all the coding % details. Different-sized images? Fixed with one function call % (|imresize|). Need to find edges of a region? One function call % (|edge|). Want to thicken that edge? Two function calls (|strel| and % |imdilate|). The final script is less than 50 lines. % % My time was spent wrestling with the core of the problem: how I was going % to figure out what "green" looked like in my images. Because I could % spend my time there, I was able to tinker with different ideas. This, to % me, is what MATLAB is all about: rapid prototyping REPLACE_WITH_DASH_DASH ideas becoming % working code. %% Post Script: Fortune Favors the Brave (and/or Crazy) % Having made the video and feeling pretty good about what I managed to % pull together in a few hours of MATLAB, I later realized that I got % lucky. The way I calculated greenness (|G*(G-R)*(G-B)|) was intended to % give negative results for anything that didn't have more green than red % or blue. But I simply overlooked the possibility of getting a high % positive value if *both* |G-R| and |G-B| were negative. According to my % formula, a light magenta REPLACE_WITH_DASH_DASH e.g. |[1 0.6 1]| REPLACE_WITH_DASH_DASH would be very green! % Luckily for me, my source videos didn't include anything like that. A % more robust approach would have been something like this: %% yd = double(y)/255; % Greenness = G*(G-R)*(G-B) greenness = yd(:,:,2).*max(yd(:,:,2)-yd(:,:,1),0).*max(yd(:,:,2)-yd(:,:,3),0); %% % Now any pixel with more red or more blue than green will have a greenness % of 0. Everything else works the same. % % I think there's a nice moral in this postscript, as well. I love using % MATLAB to solve a problem REPLACE_WITH_DASH_DASH a real, immediate problem that I need to % solve right now. I don't necessarily need the best solution, or the % solution to the most general problem. The greenscreen algorithm I hacked % together wasn't the best, but it worked for my application. If my image % had light magenta in it, I would have discovered this bug and fixed it, % but that didn't happen and didn't matter. % % If I had approached this assignment like a professional software % developer, I'd still be working on it. But as a MATLAB hacker, I was % done in a weekend! ##### SOURCE END ##### b2e543e264fb4f7899b3edb10445d7be -->

Categories: Blogs

Drizzt Short Story!

Flog - 2014, August 12 - 09:02

I’m a part of a cool project over at Audible, a collection of Drizzt short stories by RA Salvatore narrated by pretty familiar people! The project is to celebrate 40 years of D&D and I loved being able to participate in it!
You can get all the stories HERE free for a limited time. I loved Drizzt as a kid and re-reading some of the stories to prepare for this made me remember how much I loved escaping into the D&D worlds as a kid through the books.

Categories: Blogs

My London Worldcon schedule

Cory Doctorow - 2014, August 11 - 03:43


I'll be joining thousands of fans and hundreds of presenters at Loncon 3, the 72nd World Science Fiction Convention, later this week. I hope to see you there!

Weds, Aug 13
* 18h: Group signing at Forbidden Planet, Shaftesbury Ave, with Chris Achilleos,
Madeline Ashby,
Gregory Benford,
Adam Christopher,
Wesley Chu,
Phil & Kaja Foglio,
Anne Lyle,
Ramez Naam,
Kim Newman,
V. E. Schwab,
Charles Stross,
Mike Shevdon and
Danie Ware

Thurs, Aug 14
* 15.00-16.30 - Panel: Digital Vigilantes, Capital Suite 2 (ExCeL);
with: Kin-Ming Looi, Lilian Edwards, David Dingwall, Neil McKellar

Fri, Aug 15
* 11.00-12.00 - Panel: The Pleasures of a Good, Long Info-Dump, Capital
Suite 7+12 (ExCeL); with: Jack William Bell (M), Kim Stanley Robinson,
M. Darusha Wehm

Sat, Aug 16
* 12.00-13.30 - Panel: Fresh Perspectives: Comic Books for Young People,
London Suite 3 (ExCeL); with: Emily Wagner (M), Inko, Kaluas AE
Mogensen, Smuzz

* 14.30-15.00 - Reading, London Suite 1 (ExCeL)

* 16.00-17.00 - Kaffeeklatsch, London Suite 5 (ExCeL), with Anne Lyle

* 20.00-21.00 - The Sidewise, Prometheus, Seiun and Golden Duck Awards,
Capital Suite 8+11 (ExCeL)

Sunday, Aug 17
* 09.00-10.00 - Stroll with the Stars, front of Aloft (ExCeL), with:
Judith Clute, John Clute, Farah Mendlesohn, Joe Haldeman, Gay Haldeman,
Elizabeth Hand, Tricia Sullivan, Jonathan Strahan

Monday, Aug 18

* 12.00-13.30 - Panel: Brave Young World, Capital Suite 13 (ExCeL);
with: Heather Urbanski (M), David Farnell, Gillian Redfearn

* 13.30-15.00 - Panel: Young Adults in Fandom, Capital Suite 10 (ExCeL);
with: Kelley Armstrong (M), Monika Drzewiecka, Meg Frank

Categories: Blogs

DragonCon 2014 Schedule

Belmont - 2014, August 2 - 18:18

Another year, another DC to look forward to! Here is my schedule (so far) for this year:

Title: Halo Voice Actor Q&A
Description: Master Chief and friends answer your questions on all things Halo.
Time: Fri 11:30 am Location: Grand Ballroom West – Hilton (Length: 1 Hour)
Moderator / MC for panel
(Tentative Panelists: Steve Downes, Courtenay Taylor, Tim Dadabo, Veronica Belmont)

——————-
Title: Women in Science and Tech Careers
Description: A frank conversation on the issues women face in technology and science careers and what we can all do about it.
Time: Fri 01:00 pm Location: 201 – Hilton (Length: 1 Hour)
(Tentative Panelists: Dr. Pamela L. Gay, Kim Steadman, Trina Ray, Veronica Belmont)

——————-
Title: Sound of Silence: No One Listens To Your Podcast and that is Awesome
Description: You just started a podcast & no one listens. Or wait, you started a podcast 3 years ago & no one listens.
Time: Fri 04:00 pm Location: Crystal Ballroom – Hilton (Length: 1 Hour)
(Tentative Panelists: Veronica Belmont, Brian Brushwood, Justin Robert Young)

——————-
Title: Kickstarting your Project
Description: What does it take to run a successful crowdsourced campaign? Podcasters discuss their experiences using crowdsourcing sites to fund their projects
Time: Sat 11:30 am Location: 203 – Hilton (Length: 1 Hour)
(Tentative Panelists: Veronica Belmont, Justin Robert Young, Tom Merritt, Brian Brushwood)

——————-
Title: Science, Science News, and the Media
Description: Clickbait headlines. Mis-represented studies. Good science reporting is hard, but why? How could it be better?
Time: Sat 01:00 pm Location: Grand Ballroom West – Hilton (Length: 1 Hour)
Moderator / MC for panel
(Tentative Panelists: Jonathan Bradley Strickland, Annalee Newitz, David Shiffman, Veronica Belmont, Dr. Pamela L. Gay)

——————-
Title: Sword and Laser – LIVE
Description: Veronica Belmont and Tom Merritt bring their podcast about all things Sci-Fi and Fantasy back to Dragon*Con with a special guest.
Time: Sat 02:30 pm Location: Crystal Ballroom – Hilton (Length: 1 Hour)
Moderator / MC for panel
(Tentative Panelists: Veronica Belmont, Tom Merritt, Naomi Novik)

——————-
Title: Understanding Science Fiction and Fantasy Podcasting
Description: Comprehending the complexities of attracting an audience of different Sci-Fi and fantasy fandoms, keeping your audience and growing your reach.
Time: Sat 07:00 pm Location: 203 – Hilton (Length: 1 Hour)
(Tentative Panelists: Dr. Scott Viguié, Mike Faber, Veronica Belmont)

——————-
Title: DW New Series Chat: Capaldi First Impressions
Description: A chat into all things Peter Capaldi and the new Doctor on Doctor Who. What do we expect? What do we hope for? Ask the panel of experts!
Time: Sun 10:00 am Location: Grand Ballroom West – Hilton (Length: 1 Hour)
(Tentative Panelists: Rob Levy, Dr. Scott Viguie, Debbie Viguie, Veronica Belmont)

——————-
Title: Gamer Girls Unite!
Description: One of our most popular panels! We discuss for the role of women in gaming from players, to designers, to participants.
Time: Sun 11:30 am Location: Crystal Ballroom – Hilton (Length: 1 Hour)
(Tentative Panelists: Shanna R Germain, Veronica Belmont)

Categories: Blogs