Thursday, June 22, 2017

Separating Color Layers in a Digital Image

I'm learning to use Matlab to do image analysis this summer at Northwest Nazarene University (Nampa, ID). The task before me is to learn how to use images taken from drones to count the number of blooms or fruits on a tree. All digital images are three dimensional arrays. The first two dimensions are easy to understand, they're the height and width of the image. The third dimension is color and there are three layers there. So a digital image might be a 2,000 by 3,000 by 3 array. And arrays are an easy mathematical structure to analyze in Matlab.

To mathematically manipulate an image using Matlab, one must first load the image and then split it into three color layers. In Matlab, this is done with the following script.

image = imread('IMGT1818.bmp');  %load the image
imshow(image)                                  %show  the color image
imageRed = image(:,:,1);                  %separate out the first layer, red
imageGreen = image(:,:,2);               %separate out the second layer, green
imageBlue = image(:,:,3);                 %separate out the third layer, blue
figure,imshow(imageRed)                %show the red layer
figure,imshow(imageGreen)             %show the green layer
figure,imshow(imageBlue)               %show the blue layer

A couple of notes here.

First, Matlab is case sensitive. There's a huge difference between the variable f and F.

Second, digital images loaded into Matlab must be enclosed with hyphens because the name of a file is not a variable

Third, the semicolon (;) suppresses output. Without it, the Command Window in Matlab fills with the decimal values of each pixel as an array is loaded or mathematically manipulated.

And fourth, the percent sign (%) signifies a comment. Any text after it is ignored in the script.

So what is the final result of this script? Below is a screen shot of Matlab after splitting a thermal image taken during descent at GPSL 2017.

From left to right, color image, red layer, green layer, and blue layer
Now that the layers have been split apart, further analysis can be done, like making a histogram of each color or finding edges in the image. My goal is to segment images or break them into two portions, those of the things I want to see and then the background. So there's a lot to learn and accomplish yet. I'll post more about my summer research as I learn more.

Meanwhile, readers can try to do this separation of color layers themselves, and without using Matlab (a very expensive matrix mathematics program). The Freeware program, Octave should be nearly identical to Matlab. So you might want to install this program and try out the script I give above.

Many successful image splittings  

Tuesday, June 20, 2017

Recovery Image from Near Space

Whoa! Near Spacecraft on its way down!
Jim Emmert of the Pella in Near Space (PENS) just sent me this image taken by his camera during the ascent of NearSys-17G. This is an image taken at an altitude of 95,000 feet. Within seconds of balloon burst, the parachute is open. APRS Data indicates the near spacecraft is descending at a speed greater than 6,000 feet per minute or around 70 mph. Above the black and yellow parachutes can be seen the scrap of balloon that survived the burst. The payloads at the end of the balloon line are swinging wildly during the early descent when chaos reigns supreme. Jim's camera just happen to take a picture as its module whipped around    

Thermal Infrared

I flew three balloons at GPSL 2017. One of them carried a thermal imager along with other cameras. The signal wire for the cameras accidentally slipped off it's port before launch (so this cable will be taped on next time). This leaves me using Google Maps for identify ground features in the thermal images. The first match I found is over Gypsum Creek. Here's the matching images.

The creek and the trees lining the creek are cooler than the neighboring farm fields. The yellow fields to the north have been plowed, so they get warmer than the crops in the other farm fields.  
 

Tuesday, June 13, 2017

Racing Drones

I received a grant for racing drones from PCS Edventures. The drone is the RubiQ and we're learning to assemble them now. Cool stuff!

Now that it's assembled, we're getting ready to test the electronics.


Wednesday, June 7, 2017

Prepping for NearSys-17E

The flight train for my next launch is ready to go. Just watching the weather and the flight predictions. Surface winds promise to be a bit higher than I like.

The trackers are KD4STH-9 and KD4STH-12. Total weight is six pounds on a 1200 gram balloon. With three pounds of positive lift, the balloon should make close to 100,000 feet in 100 minutes.

NearSys-17E sans the client payload

Thursday, June 1, 2017

Carbon Capture Plant in Switzerland

Salon has an interesting article on a carbon capture plant just starting up in Switzerland. The plant captures CO2 from the atmosphere for industrial purposes. Purposes like fertilizer for greenhouses is listed as one example.

In time, the Climeworks plant would like to extract upwards of 1% of the CO2 in the atmosphere. The reason being that if we can't get our carbon hunger under control, then let's try removing the gas from the atmosphere before it can do more harm. Cool idea and one that I hope will work.

Can the atmospheric processors from the Aliens movie (1986) be far behind?  

From http://www.therpf.com
The Salon Article: http://www.salon.com/2017/06/01/worlds-first-commercial-co2-capture-plant-goes-live_partner/

The Aliens Movie: https://en.wikipedia.org/wiki/Aliens_(film)

Wednesday, May 31, 2017

May Weather for NearSys Station

The temperature for May increased slightly with a few days uncharacteristically exceeding 90 *F. There are two gaps in the data because of travel days.

There was no snow in May and the month only saw 0.26 inches of rain.