You are hereFeed aggregator

Feed aggregator

  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.
  • warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /Users/thor/Sites/modules/aggregator/aggregator.pages.inc on line 259.

Burbank! I’ll see you tonight at 7PM at the Buena Vista library

Cory Doctorow - 2017, August 10 - 09:09

My Walkaway book-tour is basically over, but I’m taking a little victory lap tonight at my local library, the Buena Vista Branch of the Burbank Public Library. Hope to see you there!

Categories: Blogs

Walkaway is a finalist for the Dragon Awards and is #1 on Locus’s hardcover bestseller list

Cory Doctorow - 2017, August 5 - 08:26

Dragon Con’s Dragon Award ballot was just published and I’m delighted to learn that my novel Walkaway is a finalist in the “Best Apocalyptic Novel” category, along with Daniel Humphreys’ A Place Outside the Wild, Omar El Akkad’s American War, Declan Finn and Allan Yoskowitz’s Codename: Unsub, N.K. Jemisin’s The Obelisk Gate, Rick Heinz’s The Seventh Age: Dawn, and J.F. Holmes’s ZK: Falling.


I’m also delighted to note that Walkaway is currently Locus Magazine’s #1 top-selling hardcover at science fiction and fantasy bookstores in the USA and Canada.

Many thanks to all those who nominated Walkaway for the Dragon Award, and everyone who shopped for a copy at their friendly neighborhood sf store!

Categories: Blogs

A Hopeful Look At The Apocalypse: interview with Innovation Hub

Cory Doctorow - 2017, July 29 - 06:27

I’m on the latest episode of Innovation Hub (MP3):

Science-fiction is a genre that imagines the future. It doesn’t necessarily predict the future (after all, where are flying cars?), but it grapples with the technological and societal changes happening today to better understand our world and where it’s heading.

So, what does it mean when so much of our most popular science-fiction – The Handmaid’s Tale, The Walking Dead, and The Hunger Games – present bleak, depressing futures? Cory Doctorow might just have an answer. He’s a blogger, writer, activist, and author of the new book Walkaway, an optimistic disaster novel.

Three Takeaways

* Doctorow thinks that science-fiction can give people “ideas for what to do if the future turns out in different ways.” Like how William Gibson’s Neuromancer didn’t just predict the internet, it predicted the intermingling of corporations and the state.

* When you have story after story about how people turn on each other after disaster, Doctorow believes it gives us the largely false impression that people act like jerks in crises. When in fact, people usually rise to the occasion.

* With Walkaway, his “optimistic” disaster novel, Doctorow wanted to present a new narrative about resolving differences between people who are mostly on the same side.

Categories: Blogs

Hey, Little Rock, AR: there’s a special stage performance of Little Brother coming your way for Banned Books Week!

Cory Doctorow - 2017, July 27 - 13:38

Adapted by Josh Costello from the novel by Cory Doctorow
September 15, 16, 22, 23, 24, 28, 29, 30, 2017
Directed by Ryan Whitfield and Jason Green

SYNOPSIS
While skipping school and playing an alternate reality game, San Francisco teenager Marcus Yallow ends up in the middle of a terrorist attack and on the wrong side of the Department of Homeland Security. This play asks “What is the right thing to do when authorities become oppressors?”

CAST
LITTLE BROTHER CAST LIST
Marcus – Jeffrey Oakley
Ange – Kayley Shettles
Jolu – Yusuf Richardson
Daryl – Jack Clay

ENSEMBLE
Severe Haircut – Madison McMichael
Benson/Sutherland – Robert Gatlin
Guard – Essence Robinson
Mom – Isabelle Marchese
Dad – Max Green
Turk/CHP Officer – Braden Hammock
Ms. Galvez – Anais Moore
Charles – Elijah White
Police Officer 1 – Kyndall Jackson
Police Officer 2- Mia Simone Parker
Trudy Doo – Emily Shull
NPR Announcer – Allison Boggs
Concertgoer – Rachel Worthington
Reporter – Hannah Livingston
Fox Commentator – Katie Rasure
BBC Reporter – Olivia Ward
Pirate Queen – Abigail Harris
On stage light/sound/projection tech – Trenton Gorman, Claire Green

TICKETS & TIMES
$16— Adults
$12— Students & Seniors
Thursday, Friday and Saturday night curtain time is 7:30 pm.
Sunday afternoon curtain time is 2:30 pm.

The Box Office and the theater open one (1) hour prior to curtain.
The House opens 30 minutes prior to curtain.
Please arrive promptly. There will be no late admission.

Categories: Blogs

Colormap Test Image

Matlab Image processing blog - 2017, July 24 - 12:57

Today I want to tell you how and why I made these images:

After the MATLAB R2014b release, I wrote several blog posts (Part 1, Part 2, Part 3, and Part 4) about the new default colormap, parula, that was introduced in that release.

Sometime later, I came across some material by Peter Kovesi about designing perceptually uniform colormaps (or colourmaps, as Peter writes it).

I was particularly intrigued by a test image that Peter designed for the purpose of visually evaluating the perceptual characteristics of a colormap. Here is the test image:

The image is constructed by superimposing a sinusoid on a linear ramp, with the amplitude of the sinusoid getting smaller as you move away from the top row. Here are three cross-sections of the image: row 1, row 64, and row 128.

url = 'http://peterkovesi.com/projects/colourmaps/cm_MATLAB_gray256.png'; I = im2double(imread(url)); subplot(3,1,1) plot(I(1,:)) axis([1 512 0 1]) title('Row 1') subplot(3,1,2) plot(I(64,:)) axis([1 512 0 1]) title('Row 64') subplot(3,1,3) plot(I(128,:)) axis([1 512 0 1]) title('Row 128')

Here is the basic code for making this test image. I'm going to vary Kovesi's image slightly. I'll add an extra half-cycle of the sinusoid so that it reaches a peak at the right side of the image, and I'll add a full-range linear ramp section at the bottom. (If you look closely at the cross-section curves above, you'll see that the linear ramp goes from 5% to 95% of the range.)

First, compute the ramp.

num_cycles = 64.5; pixels_per_cycle = 8; A = 0.05; width = pixels_per_cycle * num_cycles + 1; height = round((width - 1) / 4); ramp = linspace(A, 1-A, width);

Next, compute the sinusoid.

k = 0:(width-1); x = -A*cos((2*pi/pixels_per_cycle) * k);

Now, vary the amplitude of the sinusoid with the square of the distance from the bottom of the image.

q = 0:(height-1); y = ((height - q) / (height - 1)).^2; I1 = (y') .* x;

Superimpose the sinusoid on the ramp.

I = I1 + ramp;

Finally, add a full-range linear ramp section to the bottom of the image.

I = [I ; repmat(linspace(0,1,width), round(height/4), 1)]; clf imshow(I) title('Colormap test image')

Last week, I posted Colormap Test Image to the File Exchange. It contains the function colormapTestImage, which does all this for you.

I = colormapTestImage;

The function has another syntax, too. If you pass it the name of a colormap, it will display the test image using that colormap. For example, here is the test image with the old MATLAB default colormap, jet.

colormapTestImage('jet')

This test image illustrates why we replaced jet as the default MATLAB colormap. I have annotated the image below to show some of the issues.

Now compare with the new default colormap, parula.

colormapTestImage('parula')

I think that illustrates what we were trying to achieve with parula: perceptual fidelity to the data.

Since I'm talking about parula, I'll finish by mentioning that we need some very subtle tweaks to parula in the R2017b release. So you can compare, I'll show you the original version that shipped with R2014b.

colormapTestImage('parula_original')

Readers, can you tell what is different? Let us know in the comments.

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

> % % After the MATLAB R2014b release, I wrote several blog posts % (, % , % , and % ) % about the new % default colormap, % , that was introduced in that release. % % Sometime later, I came across some material by Peter Kovesi about % (or colourmaps, as Peter writes % it). % % I was particularly intrigued by a test image that Peter designed for the % purpose of visually evaluating the perceptual characteristics of a % colormap. Here is the test image: % % <> % % The image is constructed by superimposing a sinusoid on a linear ramp, % with the amplitude of the sinusoid getting smaller as you move away from % the top row. Here are three cross-sections of the image: row 1, row 64, % and row 128. url = 'http://peterkovesi.com/projects/colourmaps/cm_MATLAB_gray256.png'; I = im2double(imread(url)); subplot(3,1,1) plot(I(1,:)) axis([1 512 0 1]) title('Row 1') subplot(3,1,2) plot(I(64,:)) axis([1 512 0 1]) title('Row 64') subplot(3,1,3) plot(I(128,:)) axis([1 512 0 1]) title('Row 128') %% % Here is the basic code for making this test image. I'm going to vary % Kovesi's image slightly. I'll add an extra half-cycle of the % sinusoid so that it reaches a peak at the right side of the image, and % I'll add a full-range linear ramp section at the bottom. (If you % look closely at the cross-section curves above, you'll see that the % linear ramp goes from 5% to 95% of the range.) % % First, compute the ramp. num_cycles = 64.5; pixels_per_cycle = 8; A = 0.05; width = pixels_per_cycle * num_cycles + 1; height = round((width - 1) / 4); ramp = linspace(A, 1-A, width); %% % Next, compute the sinusoid. k = 0:(width-1); x = -A*cos((2*pi/pixels_per_cycle) * k); %% % Now, vary the amplitude of the sinusoid with the square of the distance % from the bottom of the image. q = 0:(height-1); y = ((height - q) / (height - 1)).^2; I1 = (y') .* x; %% % Superimpose the sinusoid on the ramp. I = I1 + ramp; %% % Finally, add a full-range linear ramp section to the bottom of the image. I = [I ; repmat(linspace(0,1,width), round(height/4), 1)]; clf imshow(I) title('Colormap test image') %% % Last week, I posted to the File Exchange. It contains % the function |colormapTestImage|, which does all this for you. I = colormapTestImage; %% % The function has another syntax, too. If you pass it the name of a % colormap, it will display the test image using that colormap. For % example, here is the test image with the old MATLAB default colormap, % |jet|. colormapTestImage('jet') %% % This test image illustrates why we replaced |jet| as the default MATLAB % colormap. I have annotated the image below to show some of the issues. % % <> % % Now compare with the new default colormap, |parula|. colormapTestImage('parula') %% % I think that illustrates what we were trying to achieve with |parula|: % perceptual fidelity to the data. % % Since I'm talking about |parula|, I'll finish by mentioning that we need % some very subtle tweaks to |parula| in the R2017b release. So you can compare, % I'll show you the original version that shipped with R2014b. colormapTestImage('parula_original') %% % Readers, can you tell what is different? Let us know in the comments. ##### SOURCE END ##### 17a638dae0bb42cdae93c6e4992f2d18 -->

Categories: Blogs

Come see me at San Diego Comic-Con!

Cory Doctorow - 2017, July 22 - 06:14


There are three more stops on my tour for Walkaway: tomorrow at San Diego Comic-Con, next weekend at Defcon 25 in Las Vegas, and August 10th at the Burbank Public Library.


My Comic-Con day is tomorrow/Sunday, July 23: first, a 10AM signing at the Tor Books booth (#2701); then a panel, The Future is Bleak, with Annalee Newitz, Scott Westerfeld, Scott Reintgen and Alex R. Kahler; and finally a 1:15PM signing at autographic area AA06.


(Image: Gage Skidmore, CC-BY-SA)

Categories: Blogs

Jackie Returns...

Casey McKinnon - 2017, July 20 - 16:17

I'm pleased to announce that I'll be playing Jackie Kennedy again, this time in a free reading of a new play called Prince Jack. Written by Graham Barnard, and directed by Apollo Dukakis, this classical retelling of the tragic demise of president John F. Kennedy is written entirely in iambic pentameter!

Time Winters and Casey McKinnon

I'm looking forward to revisiting the role with my friend Time Winters who is playing LBJ again as well, and the talented Will Rothhaar who played an amazing Lee Harvey Oswald in Killing Kennedy. We have a great cast, and I'm so excited to be a part of it.

Details:

Prince Jack
Wednesday, August 2nd at 8pm
Studio/Stage, 520 N.Western Ave, Los Angeles, CA 90004
Tickets: Free at the door.

Categories: Blogs

Rudy Rucker on Walkaway

Cory Doctorow - 2017, July 19 - 14:39



Walkaway is my first novel for adults since 2009 and I had extremely high hopes (and not a little anxiety) for it as it entered the world, back in April. Since then, I’ve been gratified by the kind words of many of my literary heroes, from William Gibson to Bruce Sterling to the kind cover quotes from Edward Snowden, Neal Stephenson and Kim Stanley Robinson.


Today I got a most welcome treat on those lines: a review by Rudy Rucker, lavishly illustrated with some of his excellent photos. Rucker really got the novel, got excited about the parts that excited me, and you can’t really ask for better than that.

“I’m groundhog daying again, aren’t I?”

Who’s saying this? It’s the character Dis. Her body is dead, but before she died, they managed (thanks to Dis’s work) to copy or transfer the brain processes into the cloud, that is, into a network of computers. And she can run as a sim in there. And she’s having trouble getting her sim to stabilize. It keeps freaking out and crashing. And each time she restarts the character Iceweasel sits there talking to the computer sim, trying to mellow it out, and Dis will realize she’s been rebooted, or restarted like Bill Murray in that towering cinematic SF masterpiece Groundhog Day. And Cory has the antic wit to make that verb.

The first half of the book is kind of a standard good young people against evil corporate rich people thing. But then, when Dis is talking about groundhog dayhing, it kicks into another gear. Cory pulls out a different stop on the mighty SF Wurlitzer organ: the software immortality trope. As I’m fond of saying, in my 1980 novel Software, I became one of the very first authors to write about the by-now-familiar notion of the mind as software. That is, your mind is in some sense like software running on your physical body. If we could create a sufficiently rich and flexible computer, the computer might be able to emulate a person.

There’s been a zillion movies, TV shows, SF stories and novels using this idea since then. What I liked so much about Walkaway is that Cory finds a way to make this (still fairly fantastic and unlikely) idea seem real and new.

Cory Doctorow’s WALKAWAY [Rudy Rucker]

Categories: Blogs

San Diego! Come hear me read from Walkaway tomorrow night at Comickaze Liberty Station!

Cory Doctorow - 2017, July 17 - 13:19

I’m teaching the Clarion Science Fiction writing workshop at UCSD in La Jolla this week, and tomorrow night at 7PM, I’ll be reading from my novel Walkaway at Comickaze Liberty Station, 2750 Historic Decatur Rd #101, San Diego, CA 92106. Hope to see you!

Categories: Blogs

I’m profiled in the new issue of Locus Magazine

Cory Doctorow - 2017, July 17 - 06:46

Cory Doctorow: Bugging In:

‘‘Walkaway is an ‘optimistic disaster novel.’ It’s about people who, in a crisis, come together, rather than turning on each other. Its villains aren’t the people next door, who’ve secretly been waiting for civilization’s breakdown as an excuse to come and eat you, but the super-rich who are convinced that without the state and its police, the poors are coming to eat them.

‘‘In Walkaway, the economy has comprehensively broken down, and so has the planet. Climate refugees drift in huge, unstoppable numbers from place to place, seeking refuge. The world has no jobs for most people, because when robots do all the work, the forces of capital require a few foremen to boss the robots, and a few unemployed people mooching around the factory gates to threaten the supervisors with if they demand higher wages. Everyone else is surplus to requirements.

‘‘Awareness of self-deception is a tactic that’s deployed very usefully by a lot of people now. It’s at the core of things like cognitive behavioral therapy – the idea that you must become an empiricist of your emotions because your recollections of emotions are always tainted, so you have to write down your experiences and go back to see what actually happened. Do you remember the term Endless September? It’s from when AOL came on to the net, and suddenly new people were getting online all the time, who didn’t know how things worked. The onboarding process to your utopian project is always difficult. It’s a thing Burning Man is struggling with, and it’s a thing fandom is struggling with right now. We were just talking about what it’s like to go to a big media convention, a San Diego Comic-Con or something, and to what extent that’s a new culture, or it’s continuous with the old culture, or it’s preserving the best things or bringing in the worst things, or it’s overwhelming the old, or whatever. It’s a real problem, and there is a shibboleth, which is, ‘I don’t object to all these newcomers, but they’re coming in such numbers that they’re overwhelming our ability to assimilate them.’ This is what every xenophobe who voted for Brexit said, but you hear that lament in science fiction too, and you hear it even about such things as gender parity in the workplace.”

*

‘‘For me, I live by the aphorism, ‘fail better, fail faster.’ To double your success rate, triple your failure rate. What the walkaways figured out how to do is reduce the cost of failure, to make it cheaper to experiment with new ways of succeeding. One of the great bugaboos of the rationalist movement is loss aversion. There is another name for it, ‘the entitlement effect’: basically, people value something they have more than they would pay for it before they got it. How much is your IKEA furniture worth before and after you assemble it? People grossly overestimate the value of their furniture after they’ve assembled it, because having infused it with their labor and ownership, they feel an attachment to it that is not economically rational. Sunk cost is another great fallacy. You can offer somebody enough money to buy the furniture again, and pay somebody to assemble it, and they’ll turn you down, because now that they have it, they don’t want to lose it. That was the wisdom of Obama with Obamacare. He understood that Obamacare is not sustainable, that basically letting insurance companies set the price without any real limits means that the insurance companies will eventually price it out of the government’s ability to pay, but he also understood that once you give 22 million people healthcare, when the insurance companies blew it up, the people would then demand some other healthcare system be found. The idea of just going without healthcare, which was a thing that people were willing to put up with for decades, is something they’ll never go back to. Any politician who proposes that when Obamacare blows up that we replace it with nothing, as opposed to single payer – where it’s going to end up – that politician is dead in the water. ”


More…

Categories: Blogs

Juno Delivers

Matlab Image processing blog - 2017, July 14 - 08:32

Wow.

Categories: Blogs

Talking Walkaway with Reason Magazine

Cory Doctorow - 2017, July 12 - 07:21


Of all the press-stops I did on my tour for my novel Walkaway, I was most excited about my discussion with Katherine Mangu-Ward, editor-in-chief of Reason Magazine, where I knew I would have a challenging and meaty conversation with someone who was fully conversant with the political, technological and social questions the book raised.

I was not disappointed.


The interview, which was published online today, is a substantial and challenging one that gets at the core of what I’d hoped to do with the book. I hope you’ll give it a read.

But I think Uber is normal and dystopian for a lot of people, too. All the dysfunctions of Uber’s reputation economics, where it’s one-sided—I can tank your business by giving you an unfair review. You have this weird, mannered kabuki in some Ubers where people are super obsequious to try and get you to five-star them. And all of that other stuff that’s actually characteristic of Down and Out in the Magic Kingdom. I probably did predict Uber pretty well with what would happen if there are these reputation economies, which is that you would quickly have a have and a have-not. And the haves would be able to, in a very one-sided way, allocate reputation to have-nots or take it away from them, without redress, without rule of law, without the ability to do any of the things we want currency to do. So it’s not a store of value, it’s not a unit of exchange, it’s not a measure of account. Instead this is just a pure system for allowing the powerful to exercise power over the powerless.

Isn’t the positive spin on that: Well, yeah, but the way we used to do that allocation was by punching each other in the face?


Well, that’s one of the ways we used to. I was really informed by a book by David Graeber called Debt: The First 5,000 Years, where he points out that the anthropological story that we all just used to punch each other in the face all the time doesn’t really match the evidence. That there’s certainly some places where they punched each other in the face and there’s other places where they just kind of got along. Including lots of places where they got along through having long arguments or guilting each other.

I don’t know. Kabuki for stars on the Uber app still seems better than the long arguments or the guilt.

That’s because you don’t drive Uber for a living and you’ve never had to worry that tomorrow you won’t be able to.


Cory Doctorow’s ‘Fully Automated Luxury Communist Civilization’
[Katherine Mangu-Ward/Reason]


(Photo: Julian Dufort)

Categories: Blogs

How to write pulp fiction that celebrates humanity’s essential goodness

Cory Doctorow - 2017, July 6 - 09:34


My latest Locus column is “Be the First One to Not Do Something that No One Else Has Ever Not Thought of Doing Before,” and it’s about science fiction’s addiction to certain harmful fallacies, like the idea that you can sideline the actual capabilities and constraints of computers in order to advance the plot of a thriller.


That’s the idea I turned on its head with my 2008 novel Little Brother, a book in which what computers can and can’t do were used to determine the plot, not the other way around.

With my latest novel Walkaway, I went after another convenient fiction: the idea that in disasters, people are at their very worst, neighbor turning on neighbor. In Walkaway, disaster is the moment at which the refrigerator hum of petty grievances stops and leaves behind a ringing moment of silent clarity, in which your shared destiny with other people trumps all other questions.


In this scenario — which hews much more closely to the truth of humanity under conditions of crisis — the fight isn’t between good guys and bad guys: it’s between people of goodwill who still can’t agree on what to do, and between people who are trying to help and people who are convinced that any attempt to help is a pretense covering up a bid to conquer and subjugate.


In its own way, man-vs-man-vs-nature is every bit as much a fantasy as the technothriller’s impos­sible, plot-expedient computers. As Rebecca Solnit documented in her must-read history book A Paradise Built in Hell, disaster is not typically attended by a breakdown in the social order that lays bare the true bestial nature of your fellow human. Instead, these are moments in which people rise brilliantly to the occasion, digging their neighbors out of the rubble, rushing to give blood, opening their homes to strangers.

Of course, it’s easy to juice a story by ignoring this fact, converting disaster to catastrophe by pitting neighbor against neighbor, and this approach has the added bonus of pandering to the reader’s lurking (or overt) racism and classism – just make the baddies poor and/or brown.

But what if a story made the fact of humanity’s essential goodness the center of its conflict? What if, after a disaster, everyone wanted to help, but no one could agree on how to do so? What if the argument was not between enemies, but friends – what if the fundamental, irreconcilable differences were with people you loved, not people you hated?

As anyone who’s ever had a difficult Christmas dinner with family can attest, fighting with people you love is a lot harder than fighting with people you hate.

Be the First One to Not Do Something that No One Else Has Ever Not Thought of Doing Before [Cory Doctorow/Locus]

Categories: Blogs

My presentation from ConveyUX

Cory Doctorow - 2017, July 5 - 09:44

Last March, I traveled to Seattle to present at the ConveyUX conference, with a keynote called “Dark Patterns and Bad Business Models”, the video for which has now been posted: “The Internet’s broken and that’s bad news, because everything we do today involves the Internet and everything we’ll do tomorrow will require it. But governments and corporations see the net, variously, as a perfect surveillance tool, a perfect pornography distribution tool, or a perfect video on demand tool—not as the nervous system of the 21st century. Time’s running out. Architecture is politics. The changes we’re making to the net today will prefigure the future our children and their children will thrive in—or suffer under.”

Categories: Blogs

Interview with Wired UK’s Upvote podcast

Cory Doctorow - 2017, July 5 - 09:31

Back in May, I stopped by Wired UK while on my British tour for my novel Walkaway to talk about the novel, surveillance, elections, and, of course, DRM. (MP3)

Categories: Blogs

I’ll see you this weekend at Denver Comic-Con!

Cory Doctorow - 2017, June 29 - 11:44




I just checked in for my o-dark-hundred flight to Denver tomorrow morning for this weekend’s Denver Comic-Con, where I’m appearing for several hours on Friday, Saturday and Sunday, including panels with some of my favorite writers, like John Scalzi, Richard Kadrey, Catherynne Valente and Scott Sigler:


Friday:


* 1:30-2:30pm The Future is Here :: Room 402
How have recent near-future works fared in preparing us for the realities of the current day? What can near-future works being published now tell us about what’s coming?
Mario Acevedo, Cory Doctorow, Sherry Ficklin, Richard Kadrey, Dan Wells

* 2:30-4:30pm Signing :: Tattered Cover Signing Booth


* 4:30-5:30pm Fight The Power! Fiction For Political Change :: Room 402
Some authors incorporate political themes and beliefs into their stories. In this tumultuous political climate, even discussions of a political nature in fiction can resonate with readers, and could even be a source of change. Our panelists will talk about what they have done in their books to cause change, and the (desired) results.
Charlie Jane Anders, Cory Doctorow, John Scalzi, Emily Singer, Ausma Zehanat Khan

Saturday:

* 12:00-1:00pm The Writing Process of Best Sellers :: Room 407
The authors of the today’s best sellers discuss their technical process and offer creative insight.
Eneasz Brodski, Cory Doctorow, John Scalzi, Catherynne Valente


* 1:30-2:30pm Creating the Anti-Hero :: Room 402
Millennial both read and write YA, and they’re sculpting the genre to meet this generation’s needs. Authors of recent YA titles discuss writing for the modern YA audience and how their books contribute to the genre.
Pierce Brown, Delilah Dawson, Cory Doctorow, Melissa Koons, Catherynne Valente, Dan Wells

* 3:30-4:30pm Millennials Rising – YA Literature Today :: Room 402
Millennial both read and write YA, and they’re sculpting the genre to meet this generation’s needs. Authors of recent YA titles discuss writing for the modern YA audience and how their books contribute to the genre.
Pierce Brown, Delilah Dawson, Cory Doctorow, Melissa Koons, Catherynne Valente, Dan Wells

* 4:30-6:30pm Signing :: Tattered Cover Signing Booth

Sunday:

11:00am-12:00pm Economics, Value and Motivating your Character :: Room 407
How does money and economics figure into writing compelling characters. The search for money In our daily lives fashions our character, and in fiction can be the cause of turning good people into bad, making characters do things that are, well, out-of-character. Money is the great motivator – and find out how these authors use it to shape their characters and move along the story.
Dr. Jason Arentz, Cory Doctorow, Van Aaron Hughes, Matt Parrish, John Scalzi

12:30-2:30pm Signing :: Tattered Cover Signing Booth

3:00-4:00pm Urban Science Fiction :: DCCP4 – Keystone City Room
The sensibility and feel of Urban Fantasy, without the hocus-pocus. They tend to be stories that could be tomorrow, with the direct consequences of today’s technologies, today’s societies. Urban Science Fiction authors discuss writing the world we don’t yet live in, but could!
Cory Doctorow, Sue Duff, Richard Kadrey, Cynthia Richards, Scott Sigler

(Image: Pat Loika, CC-BY)

Categories: Blogs

Audio from my NYPL appearance with Edward Snowden

Cory Doctorow - 2017, June 25 - 17:18


Last month, I appeared onstage with Edward Snowden at the NYPL, hosted by Paul Holdengraber, discussing my novel Walkaway. The library has just posted the audio! It was quite an evening

Categories: Blogs

Bruce Sterling reviews WALKAWAY

Cory Doctorow - 2017, June 25 - 16:59

Bruce Sterling, Locus Magazine: Walkaway is a real-deal, generically traditional science-fiction novel; it’s set in an undated future and it features weird set design, odd costumes, fights, romances, narrow escapes, cool weapons, even zeppelins. This is the best Cory Doctorow book ever. I don’t know if it’s destined to become an SF classic, mostly because it’s so advanced and different that it makes the whole genre look archaic.

For instance: in a normal science fiction novel, an author pals up with scientists and popularizes what the real experts are doing. Not here, though. Cory Doctorow is such an Internet policy wonk that he’s ‘‘popularizing’’ issues that only he has ever thought about. Walkaway is mostly about advancing and demolishing potential political arguments that have never been made by anybody but him…

…Walkaway is what science fiction can look like under modern cultural conditions. It’s ‘‘relevant,’’ it’s full of tremulous urgency, it’s Occupy gone exponential. It’s a novel of polarized culture-war in which all the combatants fast-talk past each other while occasionally getting slaughtered by drones. It makes Ed Snowden look like the first robin in spring.

…The sci-fi awesome and the authentically political rarely mix successfully. Cory had an SF brainwave and decided to exploit a cool plot element: people get uploaded into AIs. People often get killed horribly in Walkaway, and the notion that the grim victims of political struggle might get a silicon afterlife makes their fate more conceptually interesting. The concept’s handled brilliantly, too: these are the best portrayals of people-as-software that I’ve ever seen. They make previous disembodied AI brains look like glass jars from 1950s B-movies. That’s seduc­tively interesting for a professional who wants to mutate the genre’s tropes, but it disturbs the book’s moral gravity. The concept makes death and suffering silly.

…I’m not worried about Cory’s literary fate. I’ve read a whole lot of science fiction novels. Few are so demanding and thought-provoking that I have to abandon the text and go for a long walk.

I won’t say there’s nothing else like Walkaway, because there have been some other books like it, but most of them started mass movements or attracted strange cults. There seems to be a whole lot of that activity going on nowadays. After this book, there’s gonna be more.

Categories: Blogs

Canada: Trump shows us what happens when “good” politicians demand surveillance powers

Cory Doctorow - 2017, June 23 - 13:17

The CBC asked me to write an editorial for their package about Canadian identity and politics, timed with the 150th anniversary of the founding of the settler state on indigenous lands. They’ve assigned several writers to expand on themes in the Canadian national anthem, and my line was “We stand on guard for thee.”

I wrote about bill C-51, a reckless, sweeping mass surveillance bill that now-PM Trudeau got his MPs to support when he was in opposition, promising to reform the bill once he came to power.


The situation is analogous to Barack Obama’s history with mass surveillance in the USA: when Obama was a Senator, he shepherded legislation to immunize the phone companies for their complicity with illegal spying under GW Bush, promising to fix the situation when he came to power. Instead, he built out a fearsome surveillance apparatus that he handed to the paranoid, racist Donald Trump, who now gets to use that surveillance system to target his enemies, including 11 million undocumented people in America, and people of Muslim origin.


Now-PM Justin Trudeau has finally tabled some reforms to C-51, but they leave the bill’s worst provisions intact. Even if Canadians trust Trudeau to use these spying powers wisely, they can’t afford to bet that Trudeau’s successors will not abuse them.


Within living memory, our loved ones were persecuted, hounded to suicide, imprisoned for activities that we recognize today as normal and right: being gay, smoking pot, demanding that settler governments honour their treaties with First Nations. The legitimization of these activities only took place because we had a private sphere in which to agitate for them.

Today, there are people you love, people I love, who sorrow over their secrets about their lives and values and ambitions, who will go to their graves with that sorrow in their minds — unless we give them the private space to choose the time and manner of their disclosure, so as to maximize the chances that we will be their allies in their struggles. If we are to stand on guard for the future of Canada, let us stand on guard for these people, for they are us.


What happens after the ‘good’ politicians give away our rights? Cory Doctorow shares a cautionary tale.

[Cory Doctorow/CBC]


(Image: Jean-Marc Carisse, CC-BY; Trump’s Hair)

Categories: Blogs

Customizing REGIONPROPS With Your Own Measurements

Matlab Image processing blog - 2017, June 20 - 04:00

I saw a presentation last month that mentioned a user request to have the ability to customize regionprops. That is, a user wanted to be able to add their own measurement to regionprops.

Today, I'll show you how to do this yourself.

First, here's a brief recap on what regionprops does. The function computes measurements of image regions. Some of these measurements are based purely on a region's shape, while others incorporate pixel values within the regions. Here's an example using the coins.png sample image.

I = imread('coins.png'); imshow(I)

Let's convert this image to binary, using adaptive thresholding, filling holes, and removing small "noise" pixels.

bw = imbinarize(I,'adaptive'); bw = imfill(bw,'holes'); bw = bwareafilt(bw,[100 Inf]); imshow(bw)

You can count the "blobs" (object) yourself; there are 10 of them.

The simplest regionprops call, regionprops(bw) computes the Area, Centroid, and BoundingBox for each object.

s = regionprops(bw) s = 10×1 struct array with fields: Area Centroid BoundingBox

But I don't think this is the best way to call regionprops anymore. You can now tell regionprops to return the results as a table.

t = regionprops('table',bw) t = 10×3 table Area Centroid BoundingBox ____ ________________ ____________ 2635 37.133 106.85 [1x4 double] 1846 56.131 49.693 [1x4 double] 2672 96.199 146.05 [1x4 double] 1839 109.97 84.848 [1x4 double] 2744 120.37 208.73 [1x4 double] 2520 148.57 34.404 [1x4 double] 2589 174.83 120.01 [1x4 double] 2518 216.81 70.649 [1x4 double] 1857 236.03 173.36 [1x4 double] 1829 265.96 102.64 [1x4 double]

The table form is a lot more convenient for many tasks. For today's topic, one especially nice thing thing about tables is how easy it is to add your own variables to the table.

To illustrate, let's add a measurement that I've seen called Roundness. One definition for roundness is:

$R = \frac{4A}{\pi L^2}$

where $A$ is the object area and $L$ is the major axis length of the best-fit ellipse for the object. Here's how to compute roundness and add it directly to the measurements returned by regionprops.

First, note that both Area and MajorAxisLength are supported by regionprops, so let's start with those.

t = regionprops('table',bw,'Area','MajorAxisLength') t = 10×2 table Area MajorAxisLength ____ _______________ 2635 60.08 1846 50.178 2672 59.792 1839 49.674 2744 60.374 2520 58.08 2589 58.676 2518 58.162 1857 49.77 1829 49.564

You access table variables using dot notation, like t.Area. Similarly, you can create a new table variable using dot notation and assignment, like t.MyVariable = .... So adding Roundness to the table returned by regionprops is this simple.

t.Roundness = 4 * t.Area ./ (pi * t.MajorAxisLength.^2) t = 10×3 table Area MajorAxisLength Roundness ____ _______________ _________ 2635 60.08 0.92945 1846 50.178 0.93352 2672 59.792 0.9516 1839 49.674 0.94893 2744 60.374 0.9585 2520 58.08 0.95118 2589 58.676 0.95745 2518 58.162 0.94772 1857 49.77 0.95453 1829 49.564 0.94798

Let's try this computation with an image containing objects that are not quite as round.

I2 = imread('rice.png'); imshow(I2) bw2 = imbinarize(I2,'adaptive'); bw2 = imfill(bw2,'holes'); bw2 = bwareafilt(bw2,[100 Inf]); imshow(bw2) t2 = regionprops('table',bw2,'Area','MajorAxisLength'); t2.Roundness = 4 * t2.Area ./ (pi * t2.MajorAxisLength.^2); head(t2) ans = 8×3 table Area MajorAxisLength Roundness ____ _______________ _________ 138 23.594 0.31562 120 18.152 0.4637 169 28.123 0.27207 157 23.793 0.3531 284 43.757 0.18885 200 26.259 0.36929 141 21.647 0.38311 177 29.087 0.26636

I'm a big fan of the (relatively) new histogram function in MATLAB, so let's use it to compare our roundness numbers. I will follow the advice given in the histogram reference page for normalizing multiple histograms so that they can be more easily compared. I'll set the y-axis limits to [0 1], which is appropriate for probability normalization, and I'll set the x-axis limits to [0 1], which is the range for Roundness.

h1 = histogram(t.Roundness); hold on h2 = histogram(t2.Roundness); hold off h1.Normalization = 'probability'; h2.Normalization = 'probability'; h1.BinWidth = 0.02; h2.BinWidth = 0.02; xlim([0 1]); ylim([0 1]); title('Histogram of roundness (probability normalization)') legend('coins','rice')

There you have it. You can add your own object measurements to the output of regionprops. It's especially easy if you tell regionprops to return a table.

I'll leave you with this question, dear reader: Are there measurements you would like us to add to regionprops? I am aware of an enhancement request for the Feret diameter. What else would you like to see?

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

function in % MATLAB, so let's use it to compare our roundness numbers. I will % follow the advice given in the for % normalizing multiple histograms so that they can be more easily % compared. I'll set the y-axis limits to [0 1], which is % appropriate for probability normalization, and I'll set the x-axis % limits to [0 1], which is the range for |Roundness|. h1 = histogram(t.Roundness); hold on h2 = histogram(t2.Roundness); hold off h1.Normalization = 'probability'; h2.Normalization = 'probability'; h1.BinWidth = 0.02; h2.BinWidth = 0.02; xlim([0 1]); ylim([0 1]); title('Histogram of roundness (probability normalization)') legend('coins','rice') %% % There you have it. You can add your own object measurements to the % output of |regionprops|. It's especially easy if you tell % |regionprops| to return a table. % % I'll leave you with this question, dear reader: Are there % measurements you would like us to add to |regionprops|? I am aware % of an enhancement request for the Feret diameter. What else would % you like to see? ##### SOURCE END ##### a48d6dda1b9448eb98f5c08436b13322 -->

Categories: Blogs