Wednesday 29 February 2012

R2D2 Robot Vision & Motion Tracking Software


Part 3 - R2D2 Robot Computer Vision

How to use a webcam to detect movement and then track that movement on a X & Y coordinate. Once we have the XY, I then show how to turn that in to real motion.
So, in this blog we I will tackle probably the second most difficult part of a robot - VISION.

My Other R2D2 building blogs...



Part 1) R2D2 DIY / How To / Building Guide
Part 2) R2D2 Electronics, Motors, Servos And Control
Part 3) R2D2 Webcam Vision (C#), Motion Tracking, Robot Head Control



Vision Software - written by me for R2D2 in C#

1) The Vision Application - General overview
2) How it works in user english
3) Physical interfacing - Pololo Maestro and StepperBee+
4) Configuration and tuning
5) Integration into your robot project
6) User / setup / configuration guide
7) Link to C# developers guide in case you writing your own and need help.


Section 1: The Vision Application (making your R2D2 robot see)

Okay so you have read my previous blogs and made yourself a new friend call r2d2 but now you want him to be able to see. As you can imagine this can be pretty tricky for even good programmers but with this application you can add vision to your r2d2 robot in less than half an hour.

Let's start by seeing it in action fitted to a R2D2 on the X-axis (head rotation) for this purpose. The Y-axis for moving his projector eye up and down.




Now we have an idea of what it does let's take a look at the application:



The basic steps to create robot vision are:

1) Capture live video from a camera (webcam, IP Cam)
2) Detect motion
3) Analyse the motion to understand what's happened
4) Move the head or subject to look at the moving item (or follow it)
5) Perform some other action on movement if required or feedback what we are doing to a central core (brain)


There you go now you know what to do...off you go and write one :-)  okay to save you a months work you can download mine.

Capturing Video

The VCS (Vision Control Software) opens any connected USB webcam and takes a stream from there. The default resolution is 640x480 and the more expensive the web cam you have the better the definition and frame rate you will get. I'd not go above 640x480 as you don't really need too. The software uses VFW and is in C#

Motion and Movement Detection in C#

Motion detection is accomplished by comparing each video frame (a stream of still images) to the last to look for movement / changes in real time. A video stream is just a series of still picture just like an 19th century picture card book. 

Once VCS has a stream it looks for areas that have moved above a certain size and then joins them together to form a moving area. Once it has this area the VCS then morphs it to a circle and finds the centre. This centre then forms the red dot target and the X and Y coordinates are stored for tracking.

There are some good resources for motion and video handling using OpenGL or AForge.

Understand what's changed / motion

The nesxt step after detecting somekind of change is to decide if we need to do anything, if so what and also if we see anything we recognise. For the purpose of robot head movement we simply need to decide if an object is away from the center region and if move the head so that it appears central. The static region that is a non-motion zone is called the vision dead zone and is set by default to the 100 centre pixels  ie a column at 320px +- 50 (ie 270 to 370). If motion happens here, r2d2 does nothing on the X axis (Horizontal / Left / Right).

Moving the head and eye / interfacing in the physical world.

For this I have created two class libraries, one for the Polou Maestro 6/12/18 and 24  (costs about £20) and one for the Stepper Bee Plus (StepperBee+) which is a heavier (7amp) stepper motor controller that costs about £50. THe VCS can interface with both at the same time should you need to create something big or have two heads !

The Pololu Maestro


The StepperBee+

...to be continued











http://Three-Shop.com



Monday 27 February 2012

The "Home Stretch"


Our home was delayed ... again.  Eric, you told me so - happy?!  We're planning on closing this Wednesday (hopefully Tuesday afternoon) and I'll take a day off the day following to get everything out to the house.  Our boxes and furniture here at home, a healthy dose of new furniture from IKEA, and a sofa from the RC Willey warehouse.  We're expecting the Certificate of Occupancy on Monday - the final timing of everything will come down to how quickly we can get things wrapped up with our lender.

Anyway, we found ourselves with a second additional weekend to get some home improvement work done at the new digs before we move in.  This weekend the main event was the kitchen backsplash!  The picture that came out best for "how it all really looks" is the one of the counter next to the fridge.  Leila chose a pairing of stainless steel and dark blue glass. It was a fun project.  After we're moved in, we'll apply the finishing caulk around all the edges. We purchased the materials just over a month ago - it was good to finally get it all installed.

I purposefully included a picture of the ceiling to showcase the surround speaker mounts I installed this weekend as well. :)  Since our patio concrete was poured incorrectly, we had it cut back to allow for more grass area in the spring.  There will be a good place for a gas grill, and a patio set.  We're already looking for ideas.  Just hoping now that we don't have to wait much longer for spring and summer to come around.

Enjoy the pics!


Leila using the grout bag on the tile behind the stove.
This one came out the best for how the countertops and backsplash tiles really look.

So yeah, we're a little happy about how our kitchen has turned out.  You should come and see it sometime!
Here are the two speaker mounts I put in for our surround sound.
This is our backyard - it's a pretty good plot of land to have fenced in to ourselves for a townhouse.  They'll put in the lawn come springtime.  We've got the gas line right next to the A/C unit that we'll be hooking up a BBQ to for the summer.  Much better than having to deal with the propane tanks!   (BBQ yet to be acquired) ;)



Purchase Your Dr.Cam Software and Plug-in accessories today!

Dr. Cam Software



The OctoScope (Plug-in) Accessory


Confidential Medicial History Form


Welcome Dr.Cam user

Welcome to Dr. Cam where we bring your Doctor to you, to get started simply fill out the patient medical history form below and we will connect you with your physician so your appointment may begin shortly.


Sunday 26 February 2012

Test

Test...Requirements:
-----------------

 - Basic Scripting Knowledge
 - How to access the CurrentCamera
 - Understanding of LocalScripts
 - Understanding of For loops
 - Basic GUI Creation Knowledge
 - Roblox Studio
 - CFrame Knowledge


 [Best viewed with the forum enhancer]

 Introduction
---------------

 Welcome guys, our lesson plan here is to first get all the client side stuff done first. Like inserting the scripts and making the GUI's. We will then get into the coding, it is quite simple. This tutorial is for your learning purposes, please do not redistribute it.

 Creating The GUI
---------------------

 First we should think of descriptive names for the GUI. I named my ScreenGui "IntroCover" and my Frame "Cover". The reason we are making this GUI is to restrict access to clicking and right clicking. This prevents the user from doing any harm to the intro.

 Set the Frame's size(Scale not Offset) to 1, on both the X and Y Axis. This will cover the whole screen, next we want events to not be passed through. So we will be checking the Active property making it true. This will disallow any clicks that are fired while the frame's state is visible.

 Inserting The Script, Getting Into The Good Stuff
 --------------------------------------------------------

 We will be using a LocalScript so we can access the players CurrentCamera. Lets insert this script into the StarterPack.

 ** Note: if you want to use this with a tool or when a player first enters you will place it in the lighting then clone it when the players enters/selects the tool. **

 This localscript will control our camera's movement, before we get started with scripting we need a few points of interest on your map. So get about 4 points using a 1x1 block, you want it's position. So copy that and place it somewhere safe, we will be using it later.

 Lets get started shall we? We want to declare three variables, tha player's PlayerGui and the players Character and The Players Camera, four if you want to shorten the typing to get to the local player.

    wait()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Cam = game.Workspace.CurrentCamera
    local ICover = Player.PlayerGui.IntroCover -- Replace intro cover with whatever you used for your Gui's Name
   
Now we must make the player not able to move, We do this by setting the players walkspeed to 0

    wait()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Cam = game.Workspace.CurrentCamera
    local ICover = Player.PlayerGui.IntroCover -- Replace intro cover with whatever you used for your Gui's Name
   
    Char.Humanoid.WalkSpeed = 0
   
Now that the player cannot move we want to activate the GUI to block all click events.

    wait()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Cam = game.Workspace.CurrentCamera
    local ICover = Player.PlayerGui.IntroCover -- Replace intro cover with whatever you used for your Gui's Name
   
    Char.Humanoid.WalkSpeed = 0
    ICover.Cover.Visible = true
   
All clicks that are fired will now be handled by that GUI, so nobody can right click and mess with your Intro. Since we have finished all the basic stuff we will now move onto to actual camera stuff. We need to set two things at the same exact time or it will not work correctly, these two things are:

**CoordinateFrame** - *Where your camera will be placed*
**Focus** - *What your camera wil be focusing at (Pointing at)*

For this tutorial I will set the CoordinateFrame to 0,20,0 but you can change the value of the coordinate frame the same way as we are the focus. You just need to do a lot more positioning to get it right. Lets start programming this son of a gun, we will first determine how many points we have. For this example I will settle with three random points.

5,1,22
55,44,2
12,34,1

For this part we will only be setting the Focus, as said above you can edit the coordinate frame to have a better looking Intro. We have three points so that means we will be using three for loops. You will be using as many for loops as you have points. Since this is a basic tutorial we will be leaving it at that, there are ways to make it more efficient but it is a bit more advanced. Lets get with it:
   
    wait()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Cam = game.Workspace.CurrentCamera
    local ICover = Player.PlayerGui.IntroCover -- Replace intro cover with whatever you used for your Gui's Name
   
    Char.Humanoid.WalkSpeed = 0
    ICover.Cover.Visible = true
   
    Cam.CoordinateFrame = CFrame.new(0,20,0)
    Cam.Focus = CFrame.new(0,0,0) -- Will fix this in the next steps
   
    for pos=0,1,.01 do -- First Position
    end
    wait(1) -- The time it takes before the next point shows.
    for pos=0,1,.01 do -- Second Position
    end
    wait(1)
    for pos=0,1,.01 do -- Third Position
    end
   
We now have established the basic outlines for our intro, we will be multiplying CFrame values to get a smooth animation. As you can see in our for loop we have the range set from 0-1 and the interval set to .01, the interval will control how long the animation takes. If your animation does not get to its destination in time just modify the range. The higher the number the longer it will take. Also, to make it smooth and not jumpy we compose two CFrames after the first for loop. This is so is smoothly goes from one position to another.

    wait()
    local Player = game.Players.LocalPlayer
    local Char = Player.Character
    local Cam = game.Workspace.CurrentCamera
    local ICover = Player.PlayerGui.IntroCover -- Replace intro cover with whatever you used for your Gui's Name
   
    Char.Humanoid.WalkSpeed = 0
    ICover.Cover.Visible = true
   
    Cam.CoordinateFrame = CFrame.new(0,20,0)
    Cam.CameraType = Enum.CameraType.Fixed -- We added this so we can manipulate the camera freely.
   
    for pos=0,1,.01 do -- First Position and figure
        Cam.Focus = CFrame.new(5*pos,1*pos,22*pos)
        wait() -- We add this so the animation is smooth and does not finish instantly.
    end
    wait(1) -- The time it takes before the next point shows.
    for pos=0,1,.01 do -- Second Position
        Cam.Focus = CFrame.new(5,1,22)*CFrame.new(55*pos,44*pos,2*pos) -- We removed the *pos from the first one because we already animated that, The first CFrame value is where the camera last left off.
        wait()
    end
    wait(1)
    for pos=0,1,.01 do -- Third Position
        Cam.Focus = CFrame.new(55,44,2)*CFrame.new(12*pos,34*pos,1*pos)
        wait()
    end
   
    ICover.Cover.Visible = false
    Cam.CameraType = Enum.CameraType.Follow -- I assume this is what it originally is.
    Char.Humanoid.WalkSpeed = 16
   
You can reset the cameras position if you like, but the main thing to change is the CameraType. Now we are just reseting the values to the default settings and we are good to go.

There we have it, a fully functioning camera cutscene. I will have some notes below if you want to expand it...


## Notes ##

 - You might want to check where the camera is pointing at using some sort of marker, just to make sure it is pointing in the direction you want.
 - When composing the before and after CFrames you might have to change the Y Value to a negative or positive for it to point correctly.
 - If you want to position the coordinateframe like we did the focus, use the same method. You will just have to get three more points.



Ask Questions Below!!

Saturday 25 February 2012

I went to Superdrug today and decided to pick up two things from the love hearts for MUA collection. I thought that the colour choice wasn't amazing so I ended up getting two nude coloured things. First of all I got a nail varnish in I <3 u, which is a pinker nude.

I love this colour and it'll be great for work or school.
I also bought a lip balm in Great lips, which is a browner nude.

P.s please excuse my nail painting skills...




I love the faint smell that the lip balm has, it smells a bit like toffee and it has a very creamy texture.
Both of the pieces were £2 each.


Have you tried out any of this collection? If you have which bits are your favourite?
Cam xx

Friday 24 February 2012

Câu chuyện dại trai tuổi mới lớn

Và nỗi đau này em chỉ biết chôn sâu trong lòng

Định nghĩa về vẻ đẹp đối với mình rất đơn giản và không cầu kỳ. Và có lẽ bởi chính lí do ấy, khi chợt nhận thấy anh ấy từ xa với nét đẹp không quá hào nhoáng, và đầy nghiêm nghị trong ánh đèn nhập nhoè của buổi về đêm, mình đã thót tim lại kèm theo tiếng la "What the fuck!".
Tim mình bỗng dưng đập thình thịch. Mình tiến gần lại anh ấy theo quán tính, và tim lại càng đập mạnh hơn khi anh ấy nhoẻn miệng cười "Chào em".
Và chỉ sau 5 phút trò chuyện, anh ấy đã khiến mình phải tình nguyện móc ví ra, nhẹ nhàng đưa anh ấy 100k.Lần đầu tiên trong đời mình bắt gặp một người có sức mạnh thôi miên đến vậy. Anh cầm lấy, chẳng nói gì, cũng không lời cám ơn. Anh phẩy tay, đuổi mình đi. Có lẽ bên cạnh anh có quá nhiều cô gái váy ngắn đi SH nên anh ấy chẳng ngó ngàng gì đến mình nữa.
Mình buồn. Buồn đến mức tức tối. Trên đường đi, lòng cứ tấm tức nghĩ về anh, mình và bạn mình không ngớt bàn luận về sự đào hoa, sát gái (lẫn trai), cũng như sự vô tình của anh

Và anh, không ai khác, chính là những chàng trai áo vàng vẫn hay đứng đường để chờ đợi các cô gái "dại trai" như mình. Đặc biệt các anh cực kỳ không thích phô trương nên hay núp lùm.

Sau đây là các quan điểm khác nhau về việc này

Mình: "Chết vì tình là cái chết bất thình lình, chết vì công an là cái chết đầy xốn xang"
Quỳnh Anh: "Có thể chị Linh biết chửi bằng 6 thứ tiếng, nhưng chị nên chửi bằng tiếng mẹ đẻ"
Bạn mình: "Chúng ta đều thật ngây ngô" (và vì vậy nên luôn rơi vào lưới tình/tiền của anh)

Hôm nay nhờ các anh đã trở thành một ngày thật đáng nhớ.
Hăm bốn tháng hai hai không mười hai.
Em sẽ ghim sâu trong lòng.

P/s: Nếu bạn đã đọc hết đến đây rồi thì hãy bật luôn bài "Lưới tình" của Vĩnh Thuyên Kim để cảm nhận trọn vẹn cảm xúc


Thursday 23 February 2012

Sürdürülebilirlik...

Genel çerçevesi ilk olarak 1987 yılında Brundtland Raporu ile çizilen sürdürülebilirlik kavramı,"Bugünün gereksinimlerini, gelecek kuşakların gereksinimlerini karşılama yeteneğinden ödün vermeden karşılama" olarak tanımlanmıştır. 
Bu perspektiften hareketle çevresel sürdürülebilirlik enerjinin kullanımında yenilenebilir enerji kaynaklarının kullanımına öncelik verilmesini gerektirir. Toplam enerji tüketimindeki payı dikkate alındığında binalarda tüketilen enerjinin azaltılmasında tasarımcı mimar ve mühendislere büyük sorumluluk düşmektedir. "Sürdürülebilir Enerji"  platformu bu noktadan hareketle ülkemizde sürdürülebilir bina kavramını hayata geçirmek üzere kurulmuştur.

Wednesday 22 February 2012

Tuesday 21 February 2012

Zoë Update

Well, as long as things work out to be moving in this weekend, we'll be getting Zoë Saturday night!  The breeder, Melissa, of Moon Baby Minis, has recently sent us some pictures of Zoë playing in the snow.






Almost There!

We're only waiting on the countertops to be installed (they were originally cut backwards for our unit) and they'll be on to final touch-ups and finishing details.  We've now got running water, garage door is on, back fence is up, cabinets are in. Right now we're scheduled to get Zoë this Saturday night.  It's crazy to think how very near the end we are right now.

So close ... so excited!
 
Our Cabinets - knotty, knotty alder.
Finished living room wall - turned out great!  Much better than halfway through on last week's pictures.
Major appliances await installation in the garage.






Monday 20 February 2012

A Walk on Washington's Birthday

I didn't see anything especially patriotic, unless you include an eagle:


Hey, an osprey is a fish eagle, I swear.  He was enjoying a nice picnic of sushi:




But this isn't the only raptor I saw on my walk around Sailboat Bend: this Kestrel, or Sparrow Hawk found himself a nice roost:

 And to think, I was going to find some cute lil' ducklings and call it a day...

Prueba


www.tuporno.tvendofvid[starttext]prueba[endtext]

Sleek Blush by 3 collection.

This is going to be my first post on this blog, so here it goes!
 I love Sleek makeup and when they brought out their new blush by 3 range I got rather excited! So I currently only have one of their trio's but I also picked up a single blush while I was at Superdrug.



The single blush I bought is Suede which is part of the Sleek Nude collection, so I'm not sure if this will be available permanently. This blush is the perfect nude/brown for paler skin tones.  It blends lovely and is higly pigmented.

Sleek packaging is fine in my opinion, i like the design, although one con is that I find that similar to Nars products they do get dirty fairly quickly.
The single blush is £4.29 which is very reasonable for 8g of product and the pigmentation of the blush is amazing. 



The blush by 3 palette I decided to buy was the Pumpkin 363. I fell in love with the colour and cannot wait to buy another palette. These colours will be beautiful for summer.
The red in this palette seems as though it has glitter in it but when it's blended out the glitter can't be seen at all. The red is the only blush in this palette that isn't matt.
All of the colour in this palette have great pigmentation and they're pretty easy to blend.

The blush by 3 palette is £9.99 which makes it under £4.00 per blush- excellent value!


I love Sleek blushers and I think they are great quality for the price, I will definately be purchasing more. Have you tried Sleek blush? What did you think about them? 
Cam xx



IP CAM

IP CAMERA

Em điên chứ em đâu có dại


Thật buồn cười khi nhìn lại, gần như một thói quen hằng ngày của mình là do một người vô tình tạo ra.Cái thói quen xuất phát từ sự háo hức mỗi sáng thức dậy, vồ lấy cái cellphone thật nhanh, bật nó lên bằng với tất cả sự chờ đợi, và tiếp tục sự chờ đợi đó đến lúc tối trong vô vọng, rồi lại tắt nó đi. Khi chẳng còn một chút cảm xúc với người đó, thói quen đó chẳng còn tồn tại nữa.


Mình tội nghiệp những người hiện diện trong cuộc sống của những người thuộc cung Thiên Yết.  Nhưng thật ra những người cung Thiên Yết mới là những người đáng thương nhất. Họ yêu, ghét rõ ràng. Khi yêu thì dành trọn cả trái tim, yêu cuồng say và trái tim luôn bị dày vò bới thứ tình cảm đó, và họ sẽ hoàn toàn không quan tâm tới tình cảm của những người khác dành cho họ. Trong mắt họ chỉ có một và chỉ một người, Thiên Yết sẵn sàng làm bất kể mọi thứ vì người họ yêu, thậm chí đánh mất cả lòng tự trọng và danh dự. Nếu bạn có một người yêu là Thiên Yết, thì đó thật sự là một may mắn với bạn, chỉ là đôi khi bạn sẽ phải chịu sự kiểm soát và quản lí gắt gao của người đó. Họ chỉ muốn người đó là của mình, chỉ mình duy nhất sở hữu cái tình cảm đó – một loại tình cảm độc quyền theo chủ nghĩa có hơi cực đoan.

Nhưng một khi đã hết yêu rồi, những cảm xúc đó như chưa từng hiện hữu trong con người họ, quá khứ như bị cuốn phăng theo một cơn lốc, mọi thứ như trở về số 0. Vết sẹo sẽ vẫn còn chễm chệ ở đó, nhưng họ không màng đến. Họ vẫn tiếp tục cuộc sống. Và không thể nói đấy là cái tội được vì Thiên yết không hề cảm thấy ray rứt lương tâm. Họ chỉ cảm thấy ray rứt khi phải mang một bộ mặt nạ và giả vờ thích một người nào đó để không làm người đó buồn. Người ngoài nhìn vào nghĩ Thiên Yết là những con người máu lạnh, nhưng người ta nào có biết chính cái sự yêu ghét hết mình của Thiên yết, cái sự “ăn cả ngã về không” đó là một thuộc tính đặc trưng của Thiên yết, chẳng thể nào di dịch được.

Thấy cũng tội mà thôi cũng kệ chứ biết sao giờ ?  

"Sometimes love works in myterious way
One day you wake up, gone without-a-trace"

Saturday 18 February 2012

Sitemiz Yayına Başlamıstır.

1-3-6-12 Aylık Satıslara Dewam.

Friday 17 February 2012

Cee-Cee Resident New Yorker

Dear CC,

You know Lucy, it cracks me up that to this point your understanding of life (how it works, where you live, what people sound and dress like) is based on New York City. Almost 3 years old and yet you have never played in a back-yard or lived in a place with stairs. You think elevators and bodegas are part of every child's daily routine and perhaps even worse you think it is normal to pick out what you want to eat online and have someone bring it to your door.

Last week we took you on vacation to San Francisco. That first night when we walked down along the Fisherman's Wharf you were totally entranced by the little shops and the fishing boats.  You were dawdling so far behind that we ended up putting Cam in the Urgo and your in the stroller so we could get back faster. We figured it was just the novelty of the new surroundings and thought little of it until later that week when we were in the financial district of the city.  It was lunchtime and the streets were crowed with people and cars. However this time, you were all business as we walked along the sky scrappers amidst the busy car and pedestrian traffic. A concrete jungle is your habitat and once we went to that part of town, you assumed your preferred position of holding onto the right side of the stroller as we pushed along the city streets. Almost bored in a place that would frighten most toddlers with its loud noises and enormous structures, you probably thought we were just a few blocks from your home out on a daily trip to get groceries or lunch.

Today we are back in the city and we're down in our financial district looking for a cab back home. We had just been at Whole Foods for a kids cooking class with friends and had walked from Tribecca all the way over to Water street. You were walking alongside the stroller, eating your "black seed" bagel and starting to tire out. You pleaded. "Mommy, I go home?"  I explained as soon as we could find a cab we would head straight home. You stopped dead in your tracks. Replied, "Mama, hold Cee-cee's bagel." And put your other arm out and up in the "hail a cab" position and started looking for a taxi. You are two and half! Oh how I love my little new yorker.

(I just have to document also that you were in a pink tutu today with silver slippers. Your choice.)

love
Mama







A Letter to Cee-Cee and Cam



Dear Cam and Cee-Cee,

For some time now I have wanted to start recording our daily New York adventures and conversations. If fear if I don't I am going to start forgetting some of our earliest memories together.  Because I am your mother, I am privy to some of your greatest achievements to date. Perhaps in the grand scheme of things, these "firsts" are pretty small.  But to me, on the day they occur they signify growth and are something you could not do yesterday. So I celebrate them. Usually just by myself with a smile. And yet they make me excited and happy in a way that even my own greatest success never quite did. Quitting work 8 months ago while a scary financial and personal decision, has brought me greater joy than I ever imagined. And it has given me a front row seat to the story your life. And I am loving watching this adventure unfold. 

Some of these stories or anecdotes may seem trivial or even too mundane to retell to anyone else, but I must record them, because I am your mother and that's what mom's do.

Love,
mama

Wednesday 15 February 2012

ترحيب

اهلا بالجميع

Ear's crosses

Support boucle d'oreille argentée
2 croix argentées
8 euros

Montage argentée

Chaîne fine de couleur argentée
Lien de tissu blanc
Vespa
Perles argentées montées
Petit noeud blanc
17 euros

wearing gold

Chaîne fine de couleur argentée
Perles couleur or montées
8 euros

TRIcolors

Chaîne fine de couleur argentée
3 sortes de perles différentes montées
10 euros

Fraise mania !

Chaîne fine de couleur argentée
5 sortes de perles différentes montées
17 euros