Logo
  • Home
  • Equipment
  • Tutorials
  • Calendar
  • TPZ Staff Page
  • (Beta) Tech Ai Support
The Possible Zone
Fab Lab Website
Fab Lab Website
/
Tutorials
/
Main Tutorials Database
/Husky Lens Computer Vision
Husky Lens Computer Vision
Husky Lens Computer Vision
Husky Lens Computer Vision

Husky Lens Computer Vision

Project

Date Created
Author
U
Untitled
Tools & Skills
arduinocodingroboticsAi
[CoF] Careers of the Future
Technology
Launch Lab Connection
Beyond Possible
Competency
STEAM AgencyContinuous LearningProblem Solving
Status
Complete
  • What is a Husky lens?
  • Wiring with Arduino
  • Machine Learning with Husky Lens
  • Color Recognition
  • Face Recognition
  • Husky lens can also do line tracking, object tracking, object recognition, tag recognition, & object classification….
  • Installing Husky Lens Arduino Library
  • Connecting to Arduino Uno
  • Not sure what port you are using?
  • Getting Started Code (Husky Lens + Arduino)
  • Let’s Upload Some Testing Code!

What is a Husky lens?

HuskyLens is an easy-to-use AI machine vision sensor with 7 built-in functions: face recognition, object tracking, object recognition, line tracking, color recognition, tag recognition and object classification AND CAT EARS :))).

Through the UART / I2C port, HuskyLens can connect to Arduino and micro:bit to help you make creative projects without playing with complex algorithms.

image

Wiring with Arduino

To start creating a project with the Husky Lens we have to start by connecting it to a microcontroller. Let’s start with Arduino!

Husky Lens comes with its own connection wires so we will use those.

GREEN WIRE → PIN 10

BLUE WIRE → PIN 11

BLACK WIRE → GND (GROUND)

RED WIRE → 5V (POWER)

‣

Beyond Possible Board Hook-up

image
‣

Plain Arduino Hook-up

image

Adding Husky Lens to Base Bot

To mount the Husky Lens you will need Husky Lens bracket, laser cut spacer, 2 long bolts, 2 locking washers, & 2 nuts.

Make sure all your parts are in the same order as this nifty diagram :)

image
image

Machine Learning with Husky Lens

‣

Color Recognition

1.

Use selection wheel to scroll to “Color Recognition” mode.

image

2.

Put colorful object in front of the camera.

MAKE SURE THE CAMERA HIGHLIGHTS THE OBJECT WITH A BOX.

Hold down training button to start learning that new color. The more angles the camera sees the color from the better it will be able to identify it later!

image

3.

Test to see if the camera now knows the color.

Pull the object in and out of the frame and see if it is highlighted and labeled with “Color:ID 1”.

image

Want to try a different color?

Click the learning button once fast to enter forget mode.

Click one more time to forget the last color and learn a new one.

image

ADD LEARNING MORE THAN ONE COLOR HERE!

‣

Want to learn more than one color?

1.

Make sure you are still on color recognition mode.

image

2.

Long press the dial to look at more settings for color recognition mode.

Click down on the wheel over the Learn multiple section.

Slide the wheel from left to right to make the bar blue.

Click wheel again to exit Learn Multiple mode.

Scroll over to save & return. Click wheel to confirm saving.

image

3.

Time to learn again!

Using the same technique for learning, holding down on the button once a color is framed by a box.

Once you've learned one color go ahead and grab another and learn that one too.

Tip: It’s best to collect all the colors you want to learn before you start training.

image

4.

Check and make sure it worked.

Color:ID1 and ColorID:2 should be boxed and labeled when they are in frame.

image
‣

Face Recognition

1.

Use selection wheel to scroll to “Face Recognition” mode.

image

Husky Lens boots up in face recognition mode so you may not need to change it.

2.

Put a face in front of the camera.

MAKE SURE THE CAMERA HIGHLIGHTS THE OBJECT WITH A BOX.

Hold down training button to start learning that new face. The more angles the camera sees the face from the better it will be able to identify it later!

image

3.

Test to see if the camera now knows the face.

Pull the object in and out of the frame and see if it is highlighted and labeled with “Face:ID 1”.

image

Want to learn a different face?

Click the learning button once fast to enter forget mode.

Click one more time to forget the last color and learn a new one.

image
‣

Husky lens can also do line tracking, object tracking, object recognition, tag recognition, & object classification….

This video is SUPER BORING but is a great resource if you are interested in learning more!

Installing Husky Lens Arduino Library

The Husky Lens library gives us the ability to take to values given to us by the camera and easily use them in our code. We have to add this library to our Arduino IDE manually to be able to use it.

VV Click on this link to open a drive folder holding the Husky Lens library. VV

drive.google.com

drive.google.com

Click with two fingers and download “HuskyLens Library.zip”

image

Go to Arduino IDE

Sketch → Include Library → Add .zip Library → Downloads Folder → HuskyLens Library.zip

Open!

image

If you did it right you should see a “Library installed” message in the black box at the bottom of your sketch!

Connecting to Arduino Uno

When you plug your Arduino into your computer it does not automatically connect.

We need to tell our computer what kind of Arduino we are using and where we plugged it in before we can upload any code to it.

Arduino Uno → Select other board and port → type in and select “uno” → select port

image
‣

Not sure what port you are using?

Try unplugging and replugging your board in the computer with the “Select other board and port” window open and see what disappears and reappears.

Yippee! You’ve found your port. :)

image

Getting Started Code (Husky Lens + Arduino)

We will be using on of Husky Lens’s library examples in Arduino to test that our camera is trained correctly and giving us the data we need.

YOU NEED TO HAVE THE HUSKY LENS LIBRARY INSTALLED TO USE THIS EXAMPLE!

FILE → EXAMPLES → HUSKYLENS → HUSKYLENS_GET_STARED

image

This will open a new sketch that helps us better understand the data we're receiving from our Husky Lens.

Let’s Upload Some Testing Code!

Click on the “→” button on the top left and see the progress bar as the code uploads to Arduino.

Click the “” button on the top right to open the serial monitor and view data coming from the Husky Lens.

image

Husky lens gives us the position and size of a block (the boundary edge of a face, color, object, or tag it has been trained on) or the length and position of a line (used in line tracking).

Husky Lens will give us a string of values

Block: xCenter, yCenter, width, height, Block ID #

or

Arrow: xOrigin, yOrigin, xTarget, yTarget, Arrow ID #

We will use this string of values to code our project do different things triggered by the Husky Lens’s camera vision.

If you are getting values back…. CONGRATS YOU DID IT!!! Time to incorporate Husky Lens into a new project :)