Huskylens object classification switched in code

userHead TonyEllis 2022-09-13 00:08:30 1031 Views1 Replies

With Huskylens, can “object classification” be switched in code (Arduino) like all the other functions - i.e. go from “face recognition” to “object classification” with a few lines of code?

 

If so, could you please show the code required?

 

Many thanks for any help, it is much appreciated.

 

Tony

2022-09-13 05:17:13

This is using the Arduino API:

 

#include "HUSKYLENS.h"                            //Import the required libraries 

HUSKYLENS huskylens;                              //Create a new Huskeylens object

int ID1 = 1;

 

void setup()

{

  Serial.begin(115200);                                       //Start serial communication

  Wire.begin();                                               //Connect to Huskylens

  while (!huskylens.begin(Wire))

  {

      Serial.println(F("Begin failed!"));

      Serial.println(F("1.Please recheck the \"Protocol Type\" in HUSKYLENS (General Settings>>Protocol Type>>I2C)"));

      Serial.println(F("2.Please recheck the connection."));

      delay(100);

  }

  huskylens.writeAlgorithm(ALGORITHM_OBJECT_CLASSIFICATION);  

 

Later, when you want facial recognition, you would do something like the following line:

huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);       

 

It is very easy to use the Arduino API.

userHeadPic embeddedprogrammer