Blog of things

Tag archives: RaspberryPi

OpenCV Baby steps 6: From VM to metal, OpenCV 3.4.2 on RaspberryPi

2018-8-8

Last weekend a fellow PiWars competitor (Vishal) pinged me and said my instructions for installing OpenCV on RaspberryPi were not working. OpenCV was getting installed but Python wouldn't load it, with missing dependency errors. My entire OpenCV series is for the sole purposes of a gentle introduction to OpenCV including how to set it up. If it wasn't working, we had a major problem. It was time to go digging...

read more

OpenCV baby steps 5b: Tweaking HSV masks using Morphological transformations

2018-7-19

Well I did think I'll get to blogging so quickly again, but I am currently 'marooned' at one of the most scenic places on earth - Columbia Ice Fields, Jasper, Canada. Our bus has been impounded by the DoT and we are waiting for a replacement. I've done the nearby hikes and now sitting around in a sun lounger. This was too good a place to not write some code or write about code 🤓. So today I'll just add a couple of lines of code to our previous application, that will improve the HSV mask and make the circles more contiguous.

read more

OpenCV baby steps 5: Tracking multiple colours

2018-7-17

Sorry, its been a while since I took my last baby step. I have been in the midst of a few things and funnily enough, as I start typing this, I am actually holidaying in Canada. The drive from Vancouver to Kamloops is very very scenic :D. Eitherways, learning never stops, holidaying or not. I have been struggling to go ahead with my plans to track multiple coloured objects in the same frame. I mean in the last post we saw how we can identify four coloured balls using HSV masking. Also in step 3 we saw how to detect circles using OpenCV's HoughCircles function. What I wanted was a combination of the two - Detect position of a ball of my choice e.g. Red ball is placed here (x,y,radius). Turns out it was my lack of Python knowledge than OpenCV that got in the way. OpenCV continues to amaze me for its versatility and ease of use.

read more

OpenCV baby steps 4: Building a HSV calibrator

2018-6-26

So far we have taken small bits of OpenCV goodness and explored them independently. Today we are going to see how we can combine a few things together and build ourselves a small app that helps us convert a coloured image into its Hue, Saturation and Value equivalent, and then adjust the HSV range to isolate one or more colours in the image.

read more

Open CV Baby steps 3: Circle detection

2018-6-19

So far we have seen how to install OpenCV and capture images from a video stream. Today we'll see how we can detect circles (or balls) in an image. Last year, the biggest challenge of PiWars was to be able to detect coloured balls kept on four corners of an arena and drive a robot towards it. Now I don't know if they will have the same challenge this year, however we can use this as a starting point to use a few more OpenCV tricks. Today we'll learn about how to use Hough transforms in OpenCV and how we can use it to detect balls in an image.

read more

Open CV Baby steps 2: Capturing video frames

2018-6-18

In the introductory post we saw how to setup OpenCV on a Raspbian (Desktop) and run a small sample application to convert an image into greyscale. Today we'll see how easy it is to capture frames from a camera and write some text on to each frame and save them.

read more

Open CV Baby Steps 01: Installation

2018-6-14

I always wanted to learn OpenCV, because it was a massive step up from my Computer Graphics theory class back in the University days. Also I dream that all my the pictures I have ever taken will one day be collated, indexed and searchable with context like place, scene, people in the image so on and so forth. So learning OpenCV is the natural first step towards that (no, I will not use a my images as training material for some corporate AI engine, I wear a tin-foil-hat, sue me!). Of course everything had to run off (one or more) RaspberryPi!

read more

Cost of building a robot for PiWars

2018-4-30

This maybe a controversial topic and I fully expect to get panned for it, however, I thought I should write down what I spent on my PiWars bot (First time and in the Beginners category) for two reasons:

read more

PiWars 2018: The Aftermath - 2 (Lessons learnt)

2018-4-25

In the last post I wrote what went right and wrong with the build. However, build is only a small part of the event preparation. Attending PiWars is a full scale project. To be successful you need to manage your team's time well and split the work up correctly for things to line up correctly for success. Work needs to be split up into Software, Hardware, Design, Fabrication and Integration.

read more

PiWars 2018: The Aftermath - 1

2018-4-24

... and just like that it is all over. PiWars 2018 was a smashing event last Sunday (and we did smash a few things literally :D)

read more

Update 9: Light at the end of the tunnel...

2018-4-16

... is often the headlights of an oncoming train 🤣🤣🤣.

read more

Update 7: Zoom Zoom... some progress at last

2018-3-28

It's been a while since I posted an update. We have been head down in a - coding, building, designing printing and repeat loop. Unfortunately, it still doesn't mean we are done with all the challenges. However, we have made some progress in understanding how computer vision works. Must add Pixy has made our life much easier. We have done a part of ball follow and redone straight line speed using PixyCam.

read more

Update 6: Pan, tilt, see... Vision challenges in progress...

2018-3-12

Another weekend... and yet another, smaller than expected turnaround... but we have made progress. As mentioned in the last post, I have been racing to complete the Pixy camera integration before I finalize the routing logic for Pi-o-steer. I thought this week would be it, but we had a scope creep... we ended up designing, 3D Printing and assembling a full Pan-Last mechanism. On any other day I would have considered that a big achievement but in the big scheme of things it wasn't as big.

read more

Update 5: Getting started with Pixy camera

2018-3-6

Getting snowed in last week caused a lots of problems for UK but it resulted in some unexpected gains towards our PiWars project.

read more

Update 4: Sound, Vision and fury, stumbling along...

2018-2-25

Two weeks have flown by since the last update and as I sit down to write this I realize, inspite of what seems like quite a bit of progress, we maybe falling behind. Anyway, we made some progress in the last couple of weeks. Following are the highlights in no particular order in which they were achieved.

read more

Update 3: We are going to PiWars 2018!

2018-2-7

Happy new year everyone; Oh wait, it's February already (how did that happen O_o ?!?). January just flew past and among all the excitement of New Year, squat in the middle of NDC London, I got the magic email from Mike Horne, one of the organisers of PiWars - there had been a drop off and our team had been bumped into the qualifiers list. So team Pi-o-steer is going to PiWars, Yaba daba doooooooo! This news provided impetus to my sagging morale that had seen me procrastinate about the bot for over a month.

read more

Putting together a digital photo frame using a Raspberry Pi

2018-1-12

I have had this idea of a portable Pi tablet style computer for a while. My first touchscreen purchase was specifically for building such a portable Pi device. However the driver for the WaveShare display went bust and with that it got consigned to my heap of "Todo later" projects.

read more

PiWars Update Two: Steering Geometry, say what now?

2017-12-2

As I mentioned at the end of my last post, I was planning to re-design the front motor mounts and the entire steering mechanism. While this would cause a delay, I thought might as well get as deep as we can given we didn't have any time pressure. Even if we got the bot moving with sensor input by Christmas 2016, it would leave enough time to hone the software for guidance. Though chances of getting the nerf dart launcher built looks a little sketchy now.

read more

PiWars Update One: Steering (out of) control

2017-11-7

It's been a couple of weeks since I posted, thought I would share an update.

read more

Getting started with PiWars!

2017-10-26

... and how not to apply for it! Beginning of the month we found out our maiden application hadn't made the cut for PiWars 2018. Made me sad, momentarily, but it faded away fairly quickly. We were too invested in this to not do it. Sadly for us our commitment and intensity wasn't evident in our application.

read more