KAP to the Rescue! (or "All for one and one for all!")

edited January 2013 in General
This is my third time typing this because I keep inadvertently closing the window I'm typing in. So I'm making a long story very very short for the sake of my nerves. But this is a fun KAP story, so I figured I'd share:

I asked Santa for an RC airplane for Christmas. I guess I was a good boy last year, because I found one under the tree with my name on it. Over the last month I've learned how much fun it is to fly an RC plane. I've also found out just how much more stressful it is than flying a kite! But I've also learned that the two play very nicely together.

Last Friday evening the light was good and the wind was almost not there, so I grabbed my plane and went flying in town. Things were going so well, when I swapped to my second battery, I decided to try inverted flying. After launching and getting up to a safe altitude, I put the plane into a roll and gave it some down nose to keep it in the air. Less than a second later I saw the canopy pop off, and the battery come tumbling out of the plane. I lost all control of the plane at that point, of course, and had to watch in horror as it slowly tumbled to earth.

The plane was largely unharmed, and I was able to recover it and the canopy with no problem. But the battery was nowhere to be found. I quartered the field until sunset without finding it, and even another two hours of searching the next day didn't turn anything up. I was about ready to give up on it. But then I decided to give KAP a try.

A couple of years ago I was asked to overfly the interface between two lava flows. The idea was to identify the iron rich rock from the older flow, and separate it from the newer flow. To do that I ran the photos through a filter that generated a grayscale image in which each pixel value was calculated from the (R-B)/(R+B) values of the original photo. This preferentially found red objects in the frame.

I figured something similar would work. My batteries are blue, so I ran the KAP photos through a filter that used the (B-R)/(B+R) values of the source image. Should work, right?

After a fashion, it did. It found every piece of surveyor's tape, PVC pipe, glass bottles, plastic bottles, plastic bags, and all other trash in the field where I was flying. It also highlighted every shadow cast by anything taller than a blade of grass. But it also found a curious rectangular shape on the far side of the fence that borders the edge of the field.

IMG_1820 Original and Blue-Red

(These are full 4000x3000 photos, uploaded full-size to Flickr. If you want to play with the photos I was using, feel free.)

It's hard to see at this zoom level, but there's a little rectangle on the far side of the fence line. The more I zoomed in, the more rectangular it looked.

IMG_1820 Original and Blue-Red Zoomed

I finally zoomed in to 200% and looked at it really closely. It looked like a blue rectangle with a square of black in the middle of it, and maybe something sticking out of its upper left corner. That was enough for me! "Found it!" I yelled to my wife.

"Then you'd better go get it!" she yelled back. I grabbed my keys and headed out. It took me only a few minutes to walk out to the fence and look over. Sure enough, there it was:

Porthos Retrieved

And sure enough, the wires were poking out from the upper left corner, and the Velcro I'd stuck on it to keep it in the plane was facing up. Just as I'd guessed from the KAP photo!

In case you're wondering about the sticker on the side of the battery that says, "Porthos 2", I name my batteries so I can keep track of which one was used last, how many times I've charged it, etc. The first battery in this set is Athos. The third is Aramis. You get the idea.

KAP to the (search and) rescue!


P.S. In my defense, I never searched over the fenceline. I figured the battery couldn't have fallen that far from the plane. KAP proved me wrong. Excellent!


  • Funny (and neat) story, Tom. Bravo!
  • This is seriously fascinating!

    What plane are you flying? Did you put a camera on it yet?

    Cheers, Jorre
  • Tom,
    I like your story. I'm glad you found your battery. I have to keep this in mind for future experiment. Thanks for sharing.
  • Glad you liked it, Brooks!

    Jorre, the plane is a Bixler 2 from Hobbyking. I'm still in the very very early stages of learning to fly, so I haven't put a camera on it yet. Some day, maybe. But not just yet.

    For what it's worth, I haven't seen much overlap between KAP and RC airplane aerial photography. I do think I'll eventually put a camera on this, but in no way will it be a replacement for my kites and KAP rigs. I just hope I get good enough at flying it that the videos make me less motion sick than my attempts at kite aerial video.

    Oh! And I think I forgot to mention: The battery landed on a really thick clump of grass, and was completely unharmed. I tested it thoroughly before trusting it, but then wound up flying with it the next day.

  • Smile. Great hi-tec solution to a low-tec problem
  • Great Story Tom, Love the outcome - plane ok, battery recovered, had fun with kites and KAP. Like the wavelength filter for the blue. (glad it was not a green battery!).

  • Hi Benedict,

    I'm on my way to rig up a Multiplex EasyStar drone (which is nearly identical to the Bixler) with APM 2.5 autopilot and a Canon S 100 for long range vertical mapping - that's why I ask. At the moment, the EasyStar itself flies perfectly (without camera and autopilot). And no, it will definitely not replace my kites :o)

    Cheers, Jorre
  • Have you looked up rc kites? It's a kite with and rc engine which is multi directional.
  • I enjoyed reading your adventure, Tom! You should start a blog :-)
    Thanks for sharing the filter stuff. Was an eye-opener! How did you implement the (B-R)/(B+R) thing? Photshop or some dedicated sw? How does it handle negative values and overflows (i.e. R>B or B+R>255)?
  • like Hans I want to know more about the image manipulation. I can think of several possible uses.
  • edited January 2013
    That is SOOOO CUUEL! That is awesome, and exciting too.

    Admittedly, you are a very sharp-eyed person (I had to hold Ctrl and click + several times to see the battery on Flickr), but I am anxious to find out exactly how you do the filter thing...something we can do in Photoshop?

    Which wonderful camera was used on the kite itself? You should name your kites as well as your batteries..."Discovery" perhaps.
  • Jorre, let me know how your EasyStar works out. Yeah, I think they're both made in the same factory, too. The only difference I know of is decals, what servos are installed, and the box. The foam is the same.

    nedkelldog, I've seen those in the Into The Wind catalog. Cool stuff! But I've never played with one. I'd be curious to see how well they deal with wind. It seems like they'd be awesome to fly indoors. We're trying to get permission from a local school to use their basketball court after-hours for indoor flying. I can't do that with the Bixler 2, but I might be able to with something like that.

    Phil, I used a Canon A650IS for that session. Even after using a DSLR, it's still probably my favorite KAP camera. Plenty sharp for this kind of thing, and way WAY lighter than my T2i. And I like the idea of naming my kites. I need to think about that!

    Hans, Martin, and Phil, right now I'm using ImageMagick for the filter. It's a shareware set of command-line image manipulation tools. Great for working on large collections of images once you have a recipe worked up. There are binary-only installs for Linux, Windows, OSX, and iOS. You can also download the source and compile by hand, but some porting may be required, depending on the platform.

    ImageMagic does its channel math in floating point, and only assigns it to bit values on output. So when you do something like the filter I did, there's a lot of room to tell the filter how you want it to behave. B+R>255 was solved by normalizing. Basically it found the largest value and assigned it to 255. A bigger problem I ran into in another project was having everything zero. That results in a divide-by-zero error. The solution to that is to add some miniscule value to the denomenator that will be taken out in normalization. This will show up in one of my examples, so I won't go into it here.

    Here's one I did a while back:

    Fun with channel math

    It's uploaded quite large, so if you want to play with this you can use this as a source image set.

    I did this using two exposures. The first was a normal RGB shot on the Canon A650IS. The second was an IR shot using a Hoya R72 filter. The left side of the image has each of the channels laid out in Blue, Red, Green, Infrared order. The right side of the image has some channel math manipulations. The first is the reconstructed RGB image. The second is a simulation of what this would have looked like on color infrared film, which takes RGB film, but shifts things so red corresponds to infrared, green corresponds to red, and blue corresponds to green. Blue is not represented in color infrared film.

    The final image on the right side is an NDVI representation of the image. I'd have to search back through the forum to see who first introduced me to NDVI filtering, but the credit goes to them, not me. NDVI is the Normalized Difference Vegetation Index. It's a way of finding photosynthesizing plants in an image. If I remember right it was originally used on Landsat images to look at crop growth and arable land area measurement. But it works just as well in a KAP image, or on a ground image like this one. The NDVI filter looks like this:


    Because of the divide-by-zero problem, mine looked more like this:


    Here's the ImageMagick command line to pull this off:

    convert Image-IR.jpg Image-RGB.jpg -channel RGB -fx '(u.r-v.r)/(u.r+v.r+0.001)' -normalize Image-NDVI.jpg

    In this case I'm using the R channel from the infrared image as my infrared channel - hence all the ".r" variables in there.

    And here's the ImageMagick command line I used to pull off the "find all my blue stuff" filter:

    convert Image.jpg -channel RGB -fx '(u.b-u.r)/(u.b+u.r+0.001)' -normalize Image-Blue.jpg

    I use ImageMagick in Cygwin, a Unix-like shell that can run inside Windows. So to process a whole stack of photos I run something like this:

    for i in `ls .JPG`; do echo $i; convert $i -channel RGB -fx '(u.b-u.r)/(u.b+u.r+0.001)' -normalize converted/`basename $i .JPG`-Blue.JPG; done

    This takes every JPG image in the directory where you're located, runs this filter on it, and puts the resulting images in a directory called "converted" (that you have to create beforehand!), and appends "-Blue" to the filename. It sounds messy, but it's not too bad. And the nice thing with command line tools is that once you find a recipe you like, you can store it in a script or batch file and just run it like a command.

    Sorry for the long drawn-out answer. But I hope this either answers the questions, or gets more ideas flowing!

  • Benedict, I will, when I finally get the cables for connecting the autopilot... (And I should name my kites, too!)
  • Hi Tom,

    Great story with a happy ending. I am so impressed with your ability to manipulate digital images.

    Regarding your comment about how much fun flying RC is... Welcome to the dark side ;) And regarding the relative stress of RC versus KAP, I'm the other way around. As someone with a whole lot more hours flying model planes than kites, I feel more at ease flying a plane than a kite. I feel like I have more control if the wind dies, or changes direction, or gets gusty. Probably 90% of the aerial photos on my website were taken from RC planes.

    This guy has some very smooth video from a fixed wing model, though I see that he now also flys multi-rotor helis:

    Have Fun,

  • Great story. I am flying an easystar too, with autopilot. Just started, learning to fly! And also, nice as an addition to kites, surely no replacement...
    I think the bixler is a bit better than the easystar actually; ailerons and more canopy space...
  • Thanks for all the the details. Tom! I've been using ImageMagick once in a while for at least 15 years I think, but I didn't know it could do this. I implemented your formula in a small C program yesterday (using openCV, didn't know about the easier ImageMagick way then): works great. It could work for any color after a shift in HSV mode... Nice stuff to play with in ling rainy weekends, when the next rig is finished and all KAP images are sorted :-/
  • @ Jasja: I fly the EasyStar II, which is an updated version of the original EasyStar (which my wife flies). Much roomier, brushless motor and ailerons-ready, you just have to fit the servos and cut the ailerons free in the wings.
  • Nice work Tom,
    Looks like some of the math could have been done in Filter Factory which used to come with Photoshop.

  • I told this story to a friend who flies model airplanes. He immediately said you should ditch that fallen LiPo battery - too much risk of damage to the battery leading to instability, leading to fire or explosion. Then he related a tale of a friend of his who had a LiPo battery burn up, fill room with smoke and set off fire alarm. The plane was mostly made of carbon fiber and it was totally consumed.
  • Thanks for the warning. I'm certainly not trusting it like the other batteries.

    So this raises a question: When can you say that a LiPo is safe? I'm still learning to fly, so I've had some rough landings. If I ditch my battery every time I don't have a super-clean landing, I'm going to go broke before I learn how to fly. For the record, in order to test this one I did a drain/charge cycle on my charger while the battery was in a metal box. It came back completely clean. Since then I've put it through a full flight, after which it charged fine. I'm still treating it like a questionable device, but eventually I either trust it or I don't.

  • Well, I know nothing about LiPo, but I'd say there's a difference between rough landing and dropping it out of the cockpit! BTW, your image processing solution to finding the original battery was brilliant.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion