You are hereFeed aggregator

# Feed aggregator

## A Thing Explainer word checker

XKCDblog - 2015, September 22 - 11:07

Want to try writing using only simple words? Here’s a writing checker you can use: xkcd.com/simplewriter.

To help me write the words in my Up Goer Five picture, I taught my computer to watch my writing and tell me when one of the words I used wasn’t in the top ten hundred. After I put up my Up Goer picture, other people made things to check writing, too (like this one).

When I decided to write Thing Explainer, I went back to the writing checker I had used and made it better. Now, I’m happy to be able to share it with everyone!

To use it, just touch here and start writing. If you use a word that’s not in Thing Explainer’s set of the ten hundred, the word will turn red. (I usually count all forms of a word, like “kick” and “kicked,” together as one word, although there are a few special cases where I don’t.)

Have fun explaining things!

A note on the words: Some words are used more often in certain kinds of writing and talking than in others, which means different ways of counting words will give different answers for which ones we use the most. The set of ten hundred words in Thing Explainer comes from putting together many ways of counting how much people use a word to come up with a single set of ten hundred words that should sound familiar and simple to lots of people.

Thank you to James Zetlen, who helped make the word checker work on other people’s computers and not just mine.

Categories: Blogs

## I’m going on a book trip!

XKCDblog - 2015, September 22 - 09:07

I made a book that explains things. It’s called Thing Explainer. It will be out soon! It’s a big flat book full of pictures of things with lots of parts. There are also little words that tell you what all the parts do. You can read more about it here!

When my book comes out next month, I’m going to visit a lot of places with it! I’m going to New York, Seattle and Portland, San Francisco and Berkeley, Houston, Chicago and Naperville, and Toronto. If you live near one of those cities, maybe you can come see me!

In each city I visit, I’ll be standing in a big room and talking to people. I’ll also be writing my name in people’s books, but only if they want me to.

Here’s how you can come see me in each city. (This part doesn’t use simple words, but that’s because I like the people whose buildings I’m visiting and don’t want to make problems by using different words from the ones on their signs and stuff.)

TUESDAY, NOVEMBER 24
NEW YORK, NY
BARNES & NOBLE UNION SQUARE | 6:00pm
33 E 17th Street
Note: A limited number of wristbands and seats will be available to those who provide proof of purchase of Thing Explainer from a Barnes & Noble retail location or BN.COM. For details, click here.

MONDAY, NOVEMBER 30
SEATTLE, WA
TOWN HALL SEATTLE AT THE GREAT HALL | 7:30pm
In Conversation with Hank Green
1119 8th Avenue
Tickets: $5 includes admission. Seating is limited. A portion of proceeds from ticket sales will be donated to Zeno: Math Powered. To purchase tickets and for details, click here. TUESDAY, DECEMBER 1 BEAVERTON, OR POWELL’S BOOKS AT CEDAR HILLS CROSSING | 5:00pm 3415 SW Cedar Hills Boulevard Note: Book signing only. Purchase of Thing Explainer from Powell’s is required for admission. Space is limited. For details, click here. WEDNESDAY, DECEMBER 2 SAN FRANCISCO, CA THE BOOKSMITH AT THE RICKSHAW STOP | 7:00pm 155 Fell Street Tickets:$35 includes one book and admission. Seating is limited. To purchase tickets and for details, click here.

THURSDAY, DECEMBER 3
BERKELEY, CA
BERKELEY ARTS & LETTERS | 7:00pm
First Congregational Church
2345 Channing Way
Tickets: $35 includes one book and admission. Seating is limited. To purchase tickets and for details, click here. MONDAY, DECEMBER 7 HOUSTON, TX SPACE CENTER HOUSTON | 11:00am 1601 NASA Parkway Tickets: Free with the price of admission to Space Center Houston. Seating is limited to those who RSVP here. To purchase tickets and for more information about Space Center Houston, click here. WEDNESDAY, DECEMBER 9 NAPERVILLE, IL NAPERVILLE READS | 7:00pm North Central College at Pfeiffer Hall 310 E Benton Avenue Tickets: Free, but required for admission. Seating is limited. To get tickets and details from Anderson’s Bookshop, click here. THURSDAY, DECEMBER 10 CHICAGO, IL ILLINOIS SCIENCE COUNCIL AT 1871 | 6:00pm 222 W Merchandise Mart Plaza Tickets:$43 includes one book and admission. Seating is limited. To purchase tickets and for details, click here.

FRIDAY, DECEMBER 11
TORONTO, ON
INDIGO BOOKS & MUSIC AT THE ISABEL BADER THEATER | 6:30pm
In Conversation with Ryan North
93 Charles Street W
Tickets: $40 includes one book and admission. Seating is limited. To purchase tickets and for details, click here. Other places Can’t make any of these events, but still want a signed copy? A limited quantity of signed Thing Explainers are available to pre-order from Harvard Bookstore, Porter Square Books, and Brookline Booksmith. Already pre-ordered your copy? Email your proof of pre-order for the print edition of Thing Explainer—either a copy of your e-receipt or photo of print receipt—and mailing address to [email protected] by November 15, 2015 and you’ll be entered to win one of 300 signed bookplates, which look like this: Winners will be chosen at random. Winners will be notified and bookplates will ship the week of November 23, 2015. (U.S. participants only—sorry!) Categories: Blogs ## Pluto’s majestic mountains and frozen plains Matlab Image processing blog - 2015, September 18 - 07:07 Image credit: NASA/JHUAPL/SwRI Isn’t that amazing? The image was captured by NASA’s New Horizons spacecraft just 15 minutes after its closest approach to Pluto back in July. On July 19, I posted a note about how MATLAB and its image processing and optimization tools were used as part of the optical navigation system for New Horizons. Since then we have learned more about how Simulink was used for the flight control system design and implementation. I have updated the July 19 post with that additional information. Take a look. Categories: Blogs ## ICIP 2015 Matlab Image processing blog - 2015, September 16 - 15:18 Are you attending ICIP (IEEE International Conference on Image Processing) in Québec City, Canada later this month? Then register for my industry workshop presentation, MATLAB Today. It’s 12:30 - 14:00 on Monday, September 28, and it’s free for registered conference attendees. Or stop by the MathWorks booth to chat with me and Jeff Mather from the Image Processing Toolbox development team. See you there! Categories: Blogs ## My novel “Utopia” will hit shelves in 2017 Cory Doctorow - 2015, September 12 - 14:37 My biggest (and, IMO, best) adult novel has just sold to Tor for a very pleasing sum of money; it will hit shelves in 2017. Here’s my editor in Publishers Weekly: The novel, which marks Doctorow’s first solo adult fiction effort since 2009’s Makers, is set in the latter part of this century; Hayden described it as a “big, sprawling story” about what happens when advancements in technology make peace and abundance for all a possibility, allowing humans to “simply walk away from the systems of work and coercive authority that have run the world since agriculture began.” Here’s what I sent to my publicist by way of a quote: Of all the novels I’ve written, I’m most proud of Utopia. In it, I finally found a way to express all my fears about where we’re heading and all my hopes for how we might head it off. Everyone I know feels that incohate dread that Occupy shorthanded as ‘things are fucked up and shit’, and that feeling’s given me the cold grue for most of a decade. Finally, I’m managed to get that feeling and where it comes from into an orderly narrative that — I hope — transfers it from my brain to yours. I want to make a world that works even when it’s broken down, a world where we see ourselves with a common destiny, where every person is owed a debt to, and owes a debt to, every other person. I want to make the world where our coming disasters are attended by outpourings of cooperation and empathy. Not because I find this aesthetically pleasing: because I want to live through those disasters, and I want my child to live through them. I want you to live through them, too, and your children. And here’s an essay I wrote when I started work on the book: Lately, though, I’ve been thinking that writing books in which people act good while not facing much existential adversity is a kind of easy optimism. Much more interesting are stories about people who behave well when they are at risk for life and limb: the person who shares with his neighbor when doing so might mean his own starvation; the person who takes in an orphan when she can hardly feed her own children. In short, the most optimistic fiction you can write is fiction where people treat each other well under conditions of crisis. This is a narrative we desperately need to hear. In crisis – in the horrible, slow-motion, global economic/environmental catastrophe that we inhabit – we form theories about how everyone else will react and plan accordingly. When Katrina hit, people nodded when soldiers and mercenaries shot ‘‘looters’’ in New Orleans, convinced that looting was the sort of thing that transpired after disasters. That was news. Hardly noticed, months after the fact, was the truth that there was practically no looting in post-Katrina New Orleans, and that those shot – particularly those shot by Blackwater mercenaries – were innocents who’d been killed in the service of a lie: the lie that human beings are bad, and that the first thing we do when the veneer of civilization falls away is kill, rape, and/or eat one another. This lie was a racist lie, and it was a speciest lie, too. This is the worst kind of lie: the lie that makes itself true. When enough people believe the libel against the human race, the vile calumny that ‘‘human nature’’ would have us all at each others’ throats were it not for coercive force, it becomes a truth. If you are sure your neighbor will kill you when the lights go out, the natural thing to do is kill him at the first flicker – and even if you’re more reasonable than that, you still won’t want to let a potential killer into your shelter; you won’t want to share your food with him; you won’t want to take in his children when they need it. Utopia will have a 20 city book-tour and will be attended by some rather exciting news that I will be revealing in good time. Many, many thanks to my agent, Russell Galen, for all his hard work on this; and thank you to my editor, Patrick Nielsen Hayden, for making it happen. (Thanks, Old Miser!) (Image: Utopia, Felipe Venâncio, CC-BY) Categories: Blogs ## NYC to-do: “Art, Design, and The Future of Privacy,” Sept 17 Cory Doctorow - 2015, September 9 - 11:02 A night of talks and conversations about privacy and tech, centered on humane design and user-experience — I’m speaking there! There’s a really full roster of hackers, cryptographers, designers, writers, architects, critical theorists, sociologists and others appearing. The event’s at 1930h at Brooklyn’s Pioneer Works, and it’s free! Join artists, cryptographers, critical theorists, architects, designers, sociologists, user experience researchers and other bright luminaries for a casual evening discussing privacy, the culture of technology, and possibilities for creative intervention in the age of ubiquitous digital tracking. Taking place at Pioneer Works on Thursday, September 17th at 7:30pm, the conversation will move from the stage to the audience to end the night with a party atmosphere and plenty of shared discussion. Categories: Blogs ## Dear Internet of Things: human beings are not things Cory Doctorow - 2015, September 9 - 10:44 My new Locus column is What If People Were Sensors, Not Things to be Sensed? The column’s argument is that the Facebook model for the IoT is a nightmare: your devices are emissaries of distant corporations that gather data on you and decide what information to derive from it and to feed back to you. But there’s another model: things that belong to you, that monitor your life on your behalf, keeping the data to themselves. When a company wants to interact with your network and devices, it sends your network a message, and your network decides whether to pay attention to it. You are a person being served by the Internet of Things, not a thing being managed by a cluster of devices that see you as an ambulatory wallet to be A/B split into penury. It’s good product design, it’s good ethics, and it’s a good business-model. Imagine a location service that sold itself on the fact that your personal information was securely contained in its environs, used by you and you alone. You could have devices on your person that used their sensors to know things about you – when you last ate, what your dining preferences are, what your blood-sugar is, and so on, but these devices would have no truck with the cloud, and they would not deliver that information to anyone else for analysis. Instead, as you passed through space, stores, toilets, restaurants, grocers and other entities would emit information about their offerings. These would be seen and analyzed by your personal network, and it would decide, on your behalf, whether to tell you about them, based on the preferences you’ve set, or that it’s learned from you. The fact that you’ve been shown some piece of information would be between you and the computers you own, and – again – shared with no one. It’s the opposite of the Facebook model, where Facebook owns all the feeds and decides which one you’re allowed to see. This is more like the email model, where your systems download all the messages someone wants to send you, then use your own filters and rules to decide which ones to discard and which ones to display. This gets even more crucial in the medical sensing and implant world. Today, med-tech companies talk about the kinds of important facts we’ll be able to learn about rare diseases once we can collect longitudinal, deep, granular data on the biological histories of people who contract them. If you get a weird cancer, the doctor will be able to contact the company that sold you the gadget and trawl through your health history to rewind your body through its whole past, looking for clues about how you ended up with your current problems. But if there’s one thing we’ve learned about huge repositories of sensitive data, it’s that they leak. From Sony to the Office of Personnel Management to Hacking Team to Ashley Madison, they all leak eventually. Putting a bunch of valuable stuff in one place makes it an irresistible target – and then there’s the obvious question: why would all that data need to be held by the manufacturer of your implant, anyway? Why shouldn’t it live in your implant, or your personal network? What If People Were Sensors, Not Things to be Sensed? [Locus Magazine] Categories: Blogs ## Little Brother optioned by Paramount Cory Doctorow - 2015, September 8 - 17:13 My bestselling 2008 novel YA novel Little Brother has been optioned by Paramount, with Don Murphy (Natural Born Killers, Transformers) as the producer. Suffice it to say, I’m pretty excited about this. The rights to the Orwellian-themed novel were picked up by Angry Films in 2010, with Don Murphy now bringing the property to Paramount. Murphy will continue to produce via his shingle, with Gaby Canton developing for Paramount. Sources cite that the studio is currently securing a writer to script, seeing the project tonally as a cross between the Bourne series, the Divergent series, and the acclaimed BBC anthology TV series Black Mirror. books,ya,movies,book,science fiction,happy mutants Categories: Blogs ## Many D65 values to choose from Matlab Image processing blog - 2015, August 25 - 11:42 I am a crazy person. Late last week I was chasing down some numerical precision questions I had about certain color-space computations. I found myself trying to determine, once and for all, what tristimulus values to use for the CIE standard illuminant called D65. CIE defines D65 using a table of spectral values, 1 nm spacing, over the range 300 nm to 830 nm. So how do you get the corresponding tristimulus values for the CIE 1931 standard color observer? The CIE technical report on colorimetry, CIE 15:2004, suggests that the “rigorous” way to do it is using a dot product of the 1 nm spectral values with the 1 nm xbar, ybar, and zbar tables for the standard observer. But the technical report contains written tristimulus values that do not quite agree with that computation. And there are other values in use out there as well. This table shows everything I was able to track down: If you round all these values to five fractional digits, there are 10 unique triples among the 13 rows shown above. Even if you round to just four fractional digits, there are 6 unique triples. Sigh. Categories: Blogs ## Embrace Your Weird Flog - 2015, August 25 - 11:12 Over the last two weeks I’ve been overwhelmed in a lot of ways. With the traveling and meeting thousands of people, and it’s all good, but a lot to take in! The book has done so much better than I’d hoped (although I’m a pessimist so anything above zero exceeds my expectations, EVER haha) and hitting the New York Times bestsellers list? Unbelievable. Overall though, the most amazing thing has been meeting parents of young kids and teens who have thanked me for writing something that encourages their children to stand up for themselves. And kids themselves. To stay strong and not be ashamed of their weirdnesses. It’s the most fulfilling byproduct of writing this book (besides making people laugh): Helping influence young people to not be ashamed of who they are. Peer pressure, bullying, conformity, all causes us to abandon those things that make us different and makes it hard for us to fit in. But those differences are our superpowers, ya’ll! Never get rid of those things that make you an individual! So I had a shirt designed by Natalia over at Geek and Sundry to be able to raise money for the anti-bullying charity “Stomp Out Bullying”. All proceeds go to this amazing cause, and will hopefully encourage lots of people to embrace their weirdnesses. If you want to order, go to represent.com/felicia, the shirt will be available until September 9th! Categories: Blogs ## On Studying at RADA: "Parting is such sweet sorrow..." Casey McKinnon - 2015, August 24 - 18:09 The cast of As You Like it at the Royal Academy of Dramatic Art in July 2015 (Photo courtesy of Nathanael Taylor) So many people have been asking me what it was like to study Shakespeare at the Royal Academy of Dramatic Art (RADA). If I could describe it in a few words, I would say that it was: tiring; fun; hard; and satisfying. Though the time was short, we worked on so much. We worked every day on scenes and speeches from most of Shakespeare’s plays, especially the more difficult and lesser known ones, and my acting toolkit has expanded exponentially. During the course of the Acting Shakespeare program, we had a number of presentations (or showings) for the faculty and our fellow students, including: • Period dance - We presented at least six different styles from the Renaissance under Dancing Master Darren Royston, focusing more on dances done during the reign of Henry VIII and Elizabeth I. • Sonnets - My sonnet teacher (and now one of my favorite people in the whole world), Zoe Waites, chose Sonnet #40 for me to perform: “Take all my loves, my love, yea take them all.” It was scandalous. • Stage combat - We presented the fight scene in Act 1, Scene 1 of Romeo and Juliet. Our particular scene was set in a school rec room where a group of nerds (Capulets) were playing an RPG, when suddenly a bunch of Jocks (Montagues) came in and started causing trouble. We had some wonderfully choreographed hand-to-hand combat thanks to Master of Combat Bret Yount. • Scenes - My amazing scene teacher Tim Hardy thoughtfully selected a role for me to work on; I played Helena in in Act 1, Scene 3 of All’s Well That Ends Well. It ended very well… :) • Singing - Our choir of 28 students sung two madrigals together under the arrangement of Andrew Charity: “Since First I Saw Your Face” and “Adieu, Sweet Amaryllis.” • Monologues - I chose to work on a Queen Margaret speech from Henry VI, Part 3. With the gentlest of touches, my teacher (Alan David) pushed me to test new boundaries within the character. Someday I hope to play this character on stage; Queen Margaret is one of my favorite females in all of Shakespeare. The three Rosalinds. (Photo courtesy of Nathanael Taylor) Our last two weeks were devoted to producing an entire play, from a shortened rehearsal process to three performances. The director, Nona Shepphard, chose to work on As You Like It, which she set in Andy Warhol’s factory in the late 1960s, and I was absolutely thrilled to be cast as Rosalind. Due to the time constraints of preparing to put on a play in a week and a half, I shared the role with two other actresses, Amanda Gann and Shanna Sweeney. The role was broken up into thirds, and I got to play the final Rosalind who comes into her own and gets her happy ending. It was incredibly tough to rehearse and perform a Shakespeare play on such a tight schedule, but spending 12+ hours a day on my craft was so satisfying. I’ve always wanted to work in TV as well, so I consider this training for my future series regular jobs. Overall, I think the most beneficial things I got out of my training was an ease of stage physicality and a stronger confidence in my instincts and abilities. Though the program was difficult at times because I was learning from a number of teachers with conflicting views ranging from simple breathing to iambic pentameter, I also had teachers that trusted me with the text and let me do my thing. I was a bit like Dumbo learning that he didn’t need a feather to fly! Rosalind prepares in her Ganymede costume. (Photo courtesy of Nathanael Taylor) In addition to the teachers mentioned above, I’m grateful for the opportunity to do Alexander Technique and Laban under the tutelage of Katya Benjamin. Though I had taken Alexander before getting to RADA, her classes were pivotal to my development. I’d also like to say that I wish I had more time with Alison Hardy, who taught the Character in Text class, and Nick Hutchison, whose knowledge of history was so detailed that I took notes on every word that came out of his mouth. All of these great teachers will be in my heart and mind forevermore; it was a life-altering experience to learn from such brilliant people. At this point, I’m back in Los Angeles and excited about the future. I have a new work ethic and schedule that’s perfect for television, as well as a toolkit for Shakespeare that’s overflowing. I will miss you, RADA, but more than anything I’m grateful for the knowledge that you’ve given me. Stay in touch. We're glad you came MT @caseymckinnon: Parting is such sweet sorrow. I'll miss you terribly, RADA! pic.twitter.com/QLPnkHew8Y — radalondon (@RADA_London) July 25, 2015 Categories: Blogs ## Coming to Reno’s Grassroots Books this Friday! Cory Doctorow - 2015, August 22 - 09:55 I’m doing a Q&A and signing at Reno’s Grassroots Books — a local, indie store with an emphasis on affordable reading for all — this Friday, Aug 28 at 6:30PM — just a quick stop on the way to That Thing in the Desert. I hope you’ll come by and say hello! Categories: Blogs ## Moving the origin of a structuring element Matlab Image processing blog - 2015, August 21 - 04:00 A customer contacted Tech Support recently to ask the following question about structuring elements and dilation: If I created a structuring element from the matrix [1 1; 1 1], then the origin of the structuring element is the (1,1) or upper-left element. How do I create a structuring element so that the origin is at (1,2) or (2,1)? There are two equivalent ways to accomplish this. In the first way, you add a row or column (or both) to the matrix that you pass to strel or imdilate so that the center of the new matrix is the desired structuring element origin. For example: se = strel([0 1 1; 0 1 1; 0 0 0]) se = Flat STREL object containing 4 neighbors. Neighborhood: 0 1 1 0 1 1 0 0 0 In the second way, you pass the original 2-by-2 matrix to strel and then call the function translate to "move" the origin to the desired location. se = strel([1 1; 1 1]) se = Flat STREL object containing 4 neighbors. Neighborhood: 1 1 1 1 se2 = translate(se,[-1 0]) se2 = Flat STREL object containing 4 neighbors. Neighborhood: 0 1 1 0 1 1 0 0 0 \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® R2015a Categories: Blogs ## Guardian column: Ulysses pacts and spying hacks: warrant canaries and binary transparency Cory Doctorow - 2015, August 20 - 07:24 As the world’s governments exercise exciting new gag-order snooping warrants that companies can never, ever talk about, companies are trying out a variety of “Ulysses pacts” that automatically disclose secret spying orders, putting them out of business. A “Ulysses pact” is a negotiating tactic in which one party voluntarily surrenders some freedom of action, named for the story of Ulysses ordering his men to tie him to the mast of his ship so that he couldn’t jump into the sea when he heard the sirens’ song. For example, a union leader heading into a negotiation might promise to resign rather than take a pay cut, making pay-cut demands useless (because if she acceded to such a demand, she’d have to resign before she could formalize the agreement). In the world of secret spying orders, companies use “warrant canaries” as a kind of dead man’s switch: at regular intervals, they publish a transparency report with statistics for each kind of government request they’ve received, including “Secret spying orders: 0.” After receiving their first secret spying order, they stop publishing that line altogether. If the company sells its service as privacy-oriented, this is, effectively, suicide: the service’s users quit using it, and the spies have nothing. But it’s a weak kind of Ulysses pact, because a CEO contemplating suicide-by-canary might just decide that one teensy lie isn’t such a big deal after all — and if spy agencies believe that this is the case, they’ll have every reason to use secret warrants, forcing the issue. But technology gives us a new, stronger kind of Ulysses pact, one that takes the choice out of management’s hands — a self-enforcing self-destruct button, which has the potential to make some secret warrants totally useless: binary transparency. There’s another kind of secret spying: malware implantation. This is when a government body orders a company to send some of its customers a software update that includes a backdoor. For example, the Saudi government once convinced Research in Motion to backdoor Blackberry devices within its borders. In May, 2014, the anonymously maintained Truecrypt project mysteriously shut down, leaving behind a cryptic note (possibly with a Dan-Brown-esque secret message in it). Many believe that they shut down in response to a government demand to weaken some or all of the Truecrypt programs in the wild. In the case of programs that run on user’s computers there’s “binary transparency.” When a program with binary transparency receives an update, it computes that update’s “hash” (a mathematical fingerprint) and sends it to a server maintained by a disinterested third party. It also checks the hashes of all the other updates that have been received by all the other versions of the program that have checked in. If it sees that it has got a special update, it refuses to install it and alerts the user. This is much stronger, more effective Ulysses pact. If a spy agency knows that any attempt to implant malware on a user’s computer through a software update will both fail and raise an alarm, there is absolutely no reason even to try. (Image: Herbert James Draper – Ulysses and the Sirens (1910), public domain) Categories: Blogs ## Ellipse visualization and regionprops Matlab Image processing blog - 2015, August 17 - 13:22 A blog reader asked me recently how to visualize the ellipse-based measurements computed by regionprops. The reader wanted to superimpose the estimated ellipses on the image. To refresh your memory: The function regionprops, which computes geometrical measurements of image regions, offers several measurements that are based on fitting an ellipse to the region. (If you must know, the ellipse fit is computing by matching second-order moments.) These measurements are: • MajorAxisLength • MinorAxisLength • Orientation I would plot an ellipse using a parametric equation. Conveniently, the Wikipedia article on ellipses has a parametric equation in a form that's just right: $$X(t) = X_c + a \cos t \cos \phi - b \sin t \sin \phi$$ $$Y(t) = Y_c + a \cos t \sin \phi + b \sin t \cos \phi$$ where$(X_c,Y_c)$is the ellipse center,$a$and$b$are the major and minor axis lengths, and$\phi$is the angle between the x-axis and the major axis. Let's try it with this image, which contains a bunch of ellipse-like objects: url = 'http://blogs.mathworks.com/steve/files/rice-bw.png'; bw = imread(url); imshow(bw) Ask regionprops to compute all the ellipse-related measurements: s = regionprops(bw,{... 'Centroid',... 'MajorAxisLength',... 'MinorAxisLength',... 'Orientation'}) s = 69x1 struct array with fields: Centroid MajorAxisLength MinorAxisLength Orientation Here's what the measurements look like for the seventh object: s(7) ans = Centroid: [37.9286 226.9732] MajorAxisLength: 30.9655 MinorAxisLength: 9.7466 Orientation: -64.8058 Now write a loop that computes the ellipse curves one at a time, for each object, and superimposes the curve on the image. figure imshow(bw,'InitialMagnification','fit') t = linspace(0,2*pi,50); hold on for k = 1:length(s) a = s(k).MajorAxisLength/2; b = s(k).MinorAxisLength/2; Xc = s(k).Centroid(1); Yc = s(k).Centroid(2); phi = deg2rad(-s(k).Orientation); x = Xc + a*cos(t)*cos(phi) - b*sin(t)*sin(phi); y = Yc + a*cos(t)*sin(phi) + b*sin(t)*cos(phi); plot(x,y,'r','Linewidth',5) end hold off That's it! Enjoy. \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® R2015a . The % reader wanted to superimpose the estimated ellipses on the image. % % To refresh your memory: The function |regionprops|, which computes geometrical % measurements of image regions, offers several measurements that are based on % fitting an ellipse to the region. (If you must know, the ellipse fit is % computing by matching second-order moments.) These measurements are: % % * MajorAxisLength % * MinorAxisLength % * Orientation % % I would plot an ellipse using a parametric equation. Conveniently, the % has a % parametric equation in a form that's just right: % % $$X(t) = X_c + a \cos t \cos \phi - b \sin t \sin \phi$$ % % $$Y(t) = Y_c + a \cos t \sin \phi + b \sin t \cos \phi$$ % % where$(X_c,Y_c)$is the ellipse center,$a$and$b$are the major and minor % axis lengths, and$\phi\$ is the angle between the x-axis and the major axis. % % Let's try it with this image, which contains a bunch of ellipse-like objects: url = 'http://blogs.mathworks.com/steve/files/rice-bw.png'; bw = imread(url); imshow(bw) %% % Ask |regionprops| to compute all the ellipse-related measurements: s = regionprops(bw,{... 'Centroid',... 'MajorAxisLength',... 'MinorAxisLength',... 'Orientation'}) %% % Here's what the measurements look like for the seventh object: s(7) %% % Now write a loop that computes the ellipse curves one at a time, for each % object, and superimposes the curve on the image. figure imshow(bw,'InitialMagnification','fit') t = linspace(0,2*pi,50); hold on for k = 1:length(s) a = s(k).MajorAxisLength/2; b = s(k).MinorAxisLength/2; Xc = s(k).Centroid(1); Yc = s(k).Centroid(2); phi = deg2rad(-s(k).Orientation); x = Xc + a*cos(t)*cos(phi) - b*sin(t)*sin(phi); y = Yc + a*cos(t)*sin(phi) + b*sin(t)*cos(phi); plot(x,y,'r','Linewidth',5) end hold off %% % That's it! % % Enjoy. ##### SOURCE END ##### 097d844e16914f228cb6f4c0d2dc7a43 -->

Categories: Blogs

## Interview with O’Reilly Radar podcast

Cory Doctorow - 2015, August 17 - 09:15

I did an interview (MP3) with the O’Reilly Radar podcast at the Solid conference last month; we talked about the Apollo 1201 project I’m doing with EFF.

In the absence of any other confounding factors, obnoxious stuff that vendors do tends to self-correct, but there’s an important confounding factor, which is that in 1998, Congress passed the Digital Millennium Copyright Act. In order to try and contain unauthorized copying, they made it a felony to break a lock that protects access to a copyrighted work or to tell people information that they could use to break that lock.

I’m way more worried about the fact that the [DMCA] law also criminalizes disclosing information about vulnerabilities in these systems.

Lawrence Lessig, who was on our board for many years and is a great friend and fellow of Electronic Frontier Foundation, talks about how there are four factors that regulate our society. There’s code, what’s technologically possible. There is law, what’s allowed. There’s norms, what’s socially acceptable. And then there are markets, what’s profitable. In many cases, the right thing is profitable and also socially acceptable and legal and also technologically possible. Every now and again you run up against areas where one or more of those factors just aren’t in harmony.

This summer, the EFF is launching its own certificate authority called ‘Let’s Encrypt‘ to try and overcome the fact that in order to have secure Web sessions, you effectively need permission from a big corporation that issues you a certificate. We’re going to issue free certificates to all comers starting this summer.

I think we’re already in a world where markets don’t solve all of our problems, but markets actually do discipline firms.

Categories: Blogs

## Out-of-gamut colors

Matlab Image processing blog - 2015, August 11 - 04:00

The set of colors that can be represented using a particular color space is called the gamut. Some L*a*b* color values may be out of gamut when converted to RGB. You know that a converted RGB color is out of gamut when any of its component values is less than 0 or greater than 1.

lab = [80 -130 85]; lab2rgb(lab) ans = -0.6210 0.9537 -0.1926

The negative values demonstrate that the L*a*b* color [80 -130 85] is not in the gamut of the sRGB color space, which is the default RGB color space used by lab2rgb. A different RGB color space, Adobe RGB (1998), has a larger gamut than sRGB. Use the 'ColorSpace' parameter to convert a L*a*b* color to the Adobe color space.

lab2rgb(lab,'ColorSpace','adobe-rgb-1998') ans = 0.1234 0.9522 0.1073

Because all the output values are between 0.0 and 1.0 (inclusive), you can conclude that the L*a*b* color [80 -130 85] is inside the Adobe RGB (1998) gamut.

\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® R2015a

Categories: Blogs

## iPhone and Android sensor measurements

Matlab Image processing blog - 2015, August 10 - 04:00

Here's something cool to try ...

I just downloaded the MATLAB Support Package for Apple iOS Sensors and the latest MATLAB Mobile app for my iPhone.

So the first thing I did was throw and catch my phone while logging the phone's acceleration sensors.

Here's the result:

You can see the toss at 1 second, the catch at 2 seconds, and the free fall in between.

If you have an Android phone, try the MATLAB Support Package for Android Sensors.

Be sure to look at the system requirements for these support packages. You'll need the latest release of MATLAB, R2015a, to use the iOS package. You need R2014a or later to use the Android package, or you can try this earlier package to use with releases R2013a and R2013b.

Just don't blame me if you drop your phone!

Categories: Blogs

## This is Book Release Week!

Flog - 2015, August 9 - 13:09

ITS HERE! I’m on a plane to NYC right now to start my book tour. 12 cities, ending in PAX. And then DragonCon, SLC Comicon, and then NYCC to wrap it all up. Whew, definitely a vacation after that. Involving Mai Tais hopefully

I’m really nervous because even today some people got early copies in the mail, and they’re currently reading through my life story, and it feels a bit ticklish, like someone poking through my underwear drawer, lol. A sensation I’ll get used to as the launch happens, I’m sure. I’m slightly afraid they might find something embarrassing or someone might get mad at me about a fact they dispute, etc etc. Already some of the press headlines are provoking some ass-y comments from the fringe negative gaming elements, so I’ve cut myself off reading reviews and such that aren’t directed at me. But ultimately, I’m so happy with the book, and I hope most people will be too! It’s so hard to put a creation out there though, especially one you’re invested in emotionally, so I can just take comfort in the fact that I did the very best book I could, and even if a few people are touched by it, it’s enough. Creativity isn’t about ourselves, it’s about the way the things we create affect other people. (Effect? Grr. I always forget).

If any of you can make it out to the cities I’m touring that would be wonderful! The links are on my Facebook Events Page and if you’re in the UK your orders will help a lot, here’s a Sweepstakes UK link if you want some possible prize incentive!

And leave a comment if you’ve started reading, let me know what you think, what picture you laughed at most, or if you were inspired to try something new because of it!

Categories: Blogs

## Typecast got faster in R2014b

Matlab Image processing blog - 2015, August 7 - 13:26

Some years ago we added the function typecast to MATLAB. I've been wanting to write about this useful little function ever since we significantly speeded it up in the R2014b release.

The function typecast converts numeric values from one type to another based on the underlying bytes in the numeric representation.

Clear as mud, right? Let me try a simple example to illustrate. Here is a vector of two numbers, each of which is represented using one byte:

x = uint8([128 6]) x = 128 6

The call typecast(x,'uint16') takes those two one-byte numbers and converts them to one 16-bit number by jamming together the original bytes.

y = typecast(x,'uint16') y = 1664

Here's how the number 1664 is related to the original pair of numbers:

128 + 6*2^8 ans = 1664

If you give typecast four one-byte numbers, it will happily convert them into a pair of two-byte numbers.

p = uint8([128 6 200 3]) p = 128 6 200 3 typecast(p,'uint16') ans = 1664 968

Or, if you prefer, it will convert them into one four-byte number:

typecast(p,'uint32') ans = 63440512

The function typecast performs these conversions between all of the integer and floating-point numeric types. These days I tend to use typecast (together with its cousin swapbytes) when writing low-level binary file reading code. For files that fit easily into memory, I might just read all the file bytes at once using fileread, and then I'll use indexing, swapbytes, and typecast into meaningful MATLAB data.

Let's examine how long it takes to perform this conversion. First, make a vector containing 256 one-byte values.

bytes = uint8(0:255);

Now use timeit to estimate how long it takes to convert those values to 128 two-byte values.

f = @() typecast(bytes,'uint16'); t_microseconds = timeit(f) * 1e6 t_microseconds = 19.8762

How would you expect the computation time to change as the input vector gets longer?

Here's a plot of computation times that I measured using MATLAB R2014a.

r2014a = load('typecast speedup R2014a ah-eddins-maci'); plot(r2014a.n*256,r2014a.times*1e6) xlabel('Number of input bytes') ylabel('Conversion time (microseconds)') ax = gca; ax.YLim(1) = 0; title('typecast performance (R2014a)')

The computation time appears to be proportional to the input vector length, which is not too surprising.

And here are the results measured using the latest MATLAB (R2015a).

r2015a = load('typecast speedup R2015a ah-eddins-maci'); plot(r2015a.n*256,r2015a.times*1e6) xlabel('Number of input bytes') ylabel('Conversion time (microseconds)') ax = gca; ax.YLim(1) = 0; title('typecast performance (R2015a)')

To make the comparison easier, show the results on the same plot.

plot(r2014a.n*256,r2014a.times*1e6) hold on plot(r2015a.n*256,r2015a.times*1e6) xlabel('Number of input bytes') ylabel('Conversion time (microseconds)') ax = gca; ax.YLim(1) = 0; title('typecast performance') legend({'R2014a','R2015a'})

Now that is a little surprising! Not only is the R2015a computation time lower, it appears to be independent of the input vector length. That's because the implementation has been optimized to avoid making a copy in memory of the input vector's data. (For more about this kind of optimization, see Loren's 2006 blog post about MATLAB memory use for functions and variables.)