Skip to navigation Skip to content
  • 1800 266 6123
  • Customer Support
  • My Orders
  • Track your order
  • My Account
    • My Account
    • My Cart
    • Checkout
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
0 ₹ 0.00
All Categories
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
  • Home
  • Shop
    • Shop
    • Featured Brands
    • Track your order
    • Payment Options
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
    • Blogs
    • Tutorials
    • Videos
  • BOM Tool
  • Careers
  • Sell on Robu
  • Shop by Brands
  • New Arrivals
  • SmartElex
    • SmartElex Development Boards
    • SmartElex Modules
      • SmartElex Relay Modules
      • SmartElex IOT & Wireless Modules
    • SmartElex Motor Drivers
      • SmartElex Motor Drivers
      • SmartElex Smart Motor Drivers
  • Electronic Components
    • Resistors
    • Capacitors
    • Inductors
    • Diodes
    • Crystal , Oscillators
    • Power Transistors
    • Component Kit
    • Semiconductor ICs
      • Microcontroller IC
      • Interface ICs
      • Clock & Timing IC
      • Sensor ICs
      • Optocoupler ICs
      • ADC & DAC Converter IC
      • Comparator ICs
      • Motor and Display Driver ICs
      • Audio Amplifier ICs
      • IC Base
    • LEDs and Panel Indicator Lights
      • LED Diode Kit
      • Panel Indicator Lights
      • LEDs with Multi Hole Holders
      • Through Hole DIP LEDs
      • SMD LED
    • Miscellaneous Component
      • Potentiometer & Trimmers
      • Fuse Kits
      • Buzzer/Speaker
      • Aluminium Heat Sink
      • Bread Board and Zero PCB
    • PCT Wire Connectors
    • RF Connectors
    • Interface Connector
    • FFC, FPC, Berg connectors
  • DIY Learning and Robot Kits
    • Orange Premium Learning Kits
      • Orange Kits for Arduinos
      • Orange Kits for Raspberry Pi
      • Orange Electronic Component Kits
      • Orange Electronic Hobby kits
    • DIY Hobby Project Parts
    • Robot Kits and Parts
    • Drone Kit
    • DIY 3D Printer Kits
    • Ebike Kit
    • Official Raspberry Pi Kits
    • Kits compatible with Arduino
    • Sensor Kits
    • Component Kit
  • Drone Parts
    • Kits
    • Frames and Accessories
    • Flight Controller & Accessories
    • Motors
    • Speed Controllers (ESC)
    • Drone Propellers
      • Upto 3 Inch
      • 3 Inch to 7 Inch
      • 8 Inch to 10 Inch
      • 11 Inch and Above
      • Carbon Fiber Propeller
      • Triblades
      • Propeller Nuts and Accessories
    • Drone Transmitter & Receiver
    • Antennas
    • FPV Cameras
    • FPV Antennas and Trans-Receivers
    • Accessories
    • Camera Gimbal
  • Electric Vehicle Parts
    • E-Bike Parts
      • E-Bike Motors
      • E-Bike Controllers
      • HMI Display for E-Bikes
      • E-Bike Mechanical Accessories
      • E-Bike Electronics Accessories
      • E-Bike Batteries and Case
        • Ebike Battery
      • Ebike Kit
    • E-Rikshaw Parts
      • E-Rikshaw Motors
      • E-Rikshaw Controllers
    • E-Mini Tricycle Parts
      • E-mini Tricycle Motors
      • E-mini Tricycle Controllers
    • E-Wheelchair Parts
      • E-Wheelchair Motors
      • E-Wheelchair Controllers
    • E-Forklift Parts
      • E-forklift Motors
      • E-forklift Controllers
    • E-Gokarts Parts
      • E-GOKARTS Motors
      • E-GOKARTS Controllers
  • Laser Engraver and CNC Machines
    • Atomstack Laser Engraver
    • Two Trees Laser Engraver
    • Creality Laser Engraver
    • CNC Engraver Machines
  • 3D Printers and Parts
    • 3D Printer Filaments & Resins
      • eSun Resins
      • ESUN Filaments
      • Numakers Filaments
      • FlashForge Filaments
      • Creality Filaments
      • Sovol Filaments
      • ORANGE Premium Filaments
    • Prusa 3D Printers and Parts
    • Elegoo 3D Printers and Parts
    • Creality 3D Printers and Parts
    • BIQU 3D Printers and Parts
    • Bambu Lab 3D Printers
    • FlashForge 3D Printers
    • Goofoo 3D printer
    • Sovol 3D Printers
    • Other 3D Printers
    • 3D Printing Pen
    • Electronics Parts
      • 3D Printer Display and Controllers
      • 3D Printer Extruder Kit
      • 3D Printer Extruder Parts and Fans
      • Stepper Motors
      • 3D Printer Display and Controller
      • Limit Switch
    • Mechnical Parts
      • 3D Printer Heatbed Assembly
      • 3D Printer Nozzle
      • Lead Screw and Nut
      • Linear Rail Guides
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • 3D Printer Coupling
      • Timing Belt and Pulley
      • Sleeves and Drag Chain
  • Batteries, Chargers and Accessories
    • Custom Battery Pack
    • Orange LiPo Battery
      • 1 Cell (3.7-4.2)V
      • 2 Cell (7.4-8.4)V
      • 3 Cell (11.1-12.6)V
      • 4 Cell (14.8-16.8)V
      • 6 Cell (22.2-25.2)V
    • Micro LiPo Batteries
    • Lithium-Ion Batteries
      • 1 Cell Li-Ion Battery (3.6V~4.2V)
      • 2 Cell Li-Ion Battery (7.4V~8.4V)
      • 12V Li-Ion Battery (11.1V~12.6V)
      • 15V Li-Ion Battery (14.8V~16.8V)
      • 18V Li-Ion Battery (18.5V)
      • 24V Li-Ion Battery (22.2V~25.2V)
      • 36V Li-Ion Battery (36V~42V)
      • 48V Li-Ion Battery (46.8V~54.6V)
    • Orange Prismatic 1 cell (3.2V~3.6V) Battery
    • Other Batteries
      • Coin Cell Battery
      • CNC and PLC Machine Battery
    • Battery Accessories
      • Battery Protection Board
      • Battery Pack Accessories & Holders
      • Battery Chargers
      • Battery Connector
      • Battery Harness
      • Power Adapter and Cable
      • Lipo Voltage Checker
      • Parallel Charging Board
      • LiPO Battery Sack, Covers & Mats
  • Motors, Drivers, Actuators
    • DC Planetary Gear Motors
      • Orange High Torque Planetary Gears Motors
      • Orange Planetary Geared BLDC Motors
      • Cytron DC Planetary Geared Motors
    • Brushed DC Motor
      • Orange 12V Johnson Geared Motor
      • Johnson Geared Motor (Grade B)
      • DC Motor with Encoder
      • 25 GA Motors
      • Orange 12V OG 555 DC Gear Motor
      • RS 50 Geared Motor
      • Orange RS775 High RPM Base Motor
      • Orange PM33 Motor
      • Orange 12V Square Gear Box Motor
      • Orange 12V Rectangular Gearbox Motor
    • Other DC Motors
      • BO Motors
      • 12V DC Centre Shaft Metal Gear Motor
      • Plastic Gear Box Motors
      • Vibratory Motors
      • Drone Motor
    • Motor Drivers
      • Brushed DC Motor Driver
      • Servo Motor Drivers
      • Stepper Motor Drivers
      • Brushless DC Motor Driver (ESC)
    • Micro Metal Geared Motors
      • Micro Gear Motor with Encoder
      • Micro Gear Motor without Encoder
    • Stepper Motor
    • Motor Accessories
      • Motor Mounting Brackets
      • Bearings
      • Couplings
    • RC Servo Motors
      • Orange RC Servo Motors
      • Emax Servo Motor
      • Hitec Servo Motors
      • TowerPro and Other Servo Motors
      • JR Servo Cable
      • Futaba Servo Cable
      • Pull and Push Rod for Servo
      • Other Servo Accessories
    • Mini Pumps and Accessories
      • Kamoer Peristaltic Pump
      • Generic Mini Pumps
      • Pneumatic Connectors and Valves
    • Cooling Fans
    • Linear Actuators
    • Solenoids & Electromagnets
  • Development Board
    • Single Board Computer
      • Seeed Studio SBC
      • Khadas SBC
      • ODROID SBC
      • BBC MicroBit Board
      • Chipsee Mini PC
      • LATTEPANDA Boards
      • AAEON SBC
      • Intel SBC
    • Raspberry Pi
      • Official Boards and Hats
      • Official Raspberry Pi Accessories
      • Kits
      • Raspberry Pi Hats
      • Raspberry Pi Case
      • Display
      • Camera
      • Accessories
    • Official Arduino Boards
      • Original Arduino Boards
      • Official Arduino Shields
      • Official Arduino Kits
    • 8051 Development Board
    • Teensy Board
    • Udoo Board
    • ARM Microcontroller
    • PIC Development board
    • PIC Programmer
    • Advance Development Boards
    • Compatible with Arduino Boards
      • Boards
      • Shields
      • Cables for Arduino
      • Displays
      • Case for Arduino
  • Raspberry Pi
    • Official Raspberry Pi Kits
    • Official Raspberry Pi Accessories
  • Official Arduino Boards
    • Original Arduino Boards
    • Official Arduino Shields
    • Official Arduino Kits
  • Display modules
    • HMI LCD Display
    • TFT LCD Displays
    • OLED Display
    • e-Ink Paper Display
    • Seven Segment Display
    • LED Dot Matrix Display
  • Sensors Modules
    • Sensor Kits
    • Ultrasonic and Proximity
      • MAXBOTIX Ultrasonic Sonar
      • Ultrasonic Sensors and Modules
      • Orange Proximity Sensor
      • Autonics Proximity Sensor
      • Other Proximity Sensor & Modules
      • LiDAR Sensor
      • Other Ultrasonic Sensors
    • Temp., Humidity, Gas & Environmental
      • Temperature & Humidity Sensor
      • Environmental Sensors
      • Gas and Dust Sensor
      • Thermoelectric Cooler
    • Motion, Light and Sound
      • PIR / IR and Optical Sensor
      • RFID Card, Tags & Reader
      • Light/Color Sensor
      • Line Sensor
      • Sound Sensor
    • Biometric, Rotation, and Current
      • Biometric/ECG/EMG Sensor
      • Rotary Encoder
      • Current and Voltage Sensor
    • Load, Pressure, Flow & Vibration
      • Water TDS, pH, Flow, Level Sensor
      • Vibration/Tilt Sensor and Modules
      • Load Sensor
  • Cameras
    • IoT Cameras
    • FPV Cameras
    • Smart Vision Camera
    • Thermal Cameras
    • Raspberry Pi Camera
  • IoT and Wireless
    • Ai Thinker ESP Modules
    • Other ESP WIFI Modules
    • IoT Development Boards
    • xBee Zigbee Module
    • LORA Module
    • Bluetooth and NRF Modules
    • GSM GPRS and GNSS Modules
    • Transmitter and Receivers
    • IoT WIFI Smart Switches
  • Electronic Modules
    • Programming Module
    • Memory Interfacing
    • Communication Module
    • Bluetooth Interfacing
    • Ethernet Module
    • USB Interface Module
    • LED Module
    • LASER Module
    • RGB LED Strips and Drivers
    • Breakout Board
    • Relay Modules
    • Electronic Switches/Keypads Modules
    • Solar Panels and Controllers
    • Wearable Electronic
    • Real Time Module (RTC)
    • Audio Amplifier Module
    • Logic Level Converter
    • Buck Boost Voltage Regulators
      • Boost Converter (Step-Up )
      • Buck Converter (Step-Down)
    • Measuring Instruments
      • Digital Multimeters and Clampmeter
      • Temperature Meter
      • Digital Voltage, Current and Frequency Meter
      • Signal Generator Module & Oscilloscopes
      • Other Measuring Instrument
    • Power Supply
      • Transformers
      • Switch Mode Power Supply
      • Hi-Link Power Supply Module
    • Display modules
  • Wires and Cables
    • PVC and Silicone Wires
      • PVC Wire
      • 6 to 10 AWG
      • 12 to 16 AWG
      • 18 to 22 AWG
      • 24 to 30 AWG
    • Multi-Color Project Cables
      • DuPont / Jumper Cable
      • Interfacing and USB Cables
      • JR Servo cable
      • Futaba servo cable
      • FFC Cable
    • Heat Shrink Tubing / Sleeve
      • Heat Shrink Combos
      • 1 mm to 4 mm
      • 5 mm to 10 mm
      • 11 mm and Above
      • PVC Heat Shrink
    • Tools and Accessories
      • Wire Cutter / Stripper
      • Cable Ties
      • Sleeves and Drag Chain
  • Mechanical Parts and Workbench Tools
    • Mechanical Robotic Parts
      • Robot Chassis
      • Aluminum Extrusion and Accessories
      • Smooth Rods
      • Lead Screw
      • Linear Rail Guides
      • Couplings
      • Bearings
      • Motor Mounting Brackets
      • Gears
    • Robot Wheels
      • Omni Wheels
      • Heavy Duty Wheel
      • Mecanum Wheels
      • RC Car Wheel
      • Pulley Wheel & Track Belt
      • Caster Wheels
    • Carbon Fiber
      • Carbon Fiber Sheets and Strips
      • Carbon Fiber Tubes and Rods
    • Nuts-Bolts and Spacers
      • Countersunk(CSK) Screws
      • Socket Set Screws (Allen Grub)
      • Socket Head Cap Screw (Allen Bolt)
      • CHHD Screws
      • Nut and Washers
      • Nylon Nuts and Bolts
      • Spacer and Standoff
    • Soldering Tools
    • Workbench Tools
  • Services
    • PCB Manufacturing Service
    • Custom Battery Pack
    • Online SLA 3D Printing Service
    • Online FDM 3D Printing Service
    • Metal Laser Cutting Service
    • Non-Metal Laser Cutting Service
  • Refurbished & Partial Working
    • Refurbished
    • Partial Working
  • SmartElex Environmental Sensors
  • SmartElex Line Tracing Sensors
  • SmartElex Temperature Sensors
  • SmartElex Humidity Sensors
  • SmartElex Weather Sensors
  • SmartElex Pressure Sensors
  • SmartElex Magnetometer Sensors
  • SmartElex Sound Sensors
Robu.in | Indian Online Store | RC Hobby | Robotics
  • Search
  • 0
  • Home
  • Shop
  • Forum
  • Bulk Enquiry
  • New Arrivals
  • ATL Kits Enquiry
  • Blogs
  • BOM Tool
  • Careers
  • Sell on Robu
HomeBlogsDevelopment boardsRaspberry PiReal-time Face Detection using Raspberry Pi – Connections and Code

Real-time Face Detection using Raspberry Pi – Connections and Code

Raspberry Pi, Tutorials  1  comments  5665 Views  Tuesday, April 6, 2021











In this article, we will create our own Face Recognition system using the Open CV Library on Raspberry Pi.

Face Detectionb Raspberry Pi Thumbnail

A face detection system has become very popular these days, as it can be very secure compared to fingerprint and typed passwords. You may have seen the face unlock feature in your smartphone which makes things very easy. Face detection is also used in many places such as airports, railway stations, and roads for surveillance.

Here, we will build a Face Recognition system using the OpenCV Library on Raspberry Pi, as it is portable to work as a surveillance system. This system is tested by me and will surely work without any issue.

Like every other Face Recognition system, it includes two python scripts, of which one is a training program that will analyze the set of photos of a particular person and create a dataset(YML File) from it.

The second program here is the Recognizer program, which detects a face and then uses this YML file to recognize the face to mention the person's name. The programs here, are optimized for Raspberry Pi (Linux).

What is OpenCV and How to Use it for Face Recognition?

OpenCV is an open-source library for computer vision, machine learning, and image processing. Now it plays a major role in real-time operation which is very important in today’s systems.

By using this library, anyone can process images and videos to identify objects, faces, and even handwriting. When integrated with various libraries, such as NumPy & python, which is capable of processing the OpenCV array structure for analysis.

It Identifies, image patterns and their features, which will be used in vector space to perform mathematical operations.

If you want to know more about OpenCV, you can read this article. You will have to go through this to install OpenCV first and make it ready for face detection.

Working Process

Before we start, it's important to grasp that Face Detection and Face Recognition are two different things. In Face Detection, only the face of an individual will be detected by the software.

In Face Recognition, the software won't only detect the face but will recognize the person. Now, it should be clear that we'd like to perform Face Detection before performing Face Recognition.

A video feed from a webcam is nothing but a long sequence of images being updated one after the other and each of those images is simply a set of pixels of various values put together in its respective position.

There are plenty of algorithms behind detecting a face from these pixels and further recognize the person in it and trying to explain them is beyond the scope of this tutorial, but since we are using the OpenCV library, which is incredibly simple to perform, face Recognition can be understood without getting deeper into the concepts.

So now, let's install the packages required for face detection.

Note - Please install OpenCV before proceeding with further steps.

Setup Procedure

Power your Pi with an adapter and connect it to a display monitor via HDMI cable you can also do the process with headless mode.

Install dlib: Dlib is a toolkit for real-world Machine Learning and data analysis applications. To Install dlib, just enter the following command within the terminal.

pip install dlib
  • This should install dlib and when successful, you'll get a screen like this on entering the command again. Here, I have the setup already ready for face recognition, so all the packages are already pre-installed.
  • You can do the same as me and check by typing the command again if it is installed properly.

Install pillow: Pillow also called PIL, stands for Python Imaging Library which is known to open, manipulate and save images in an exceedingly different format, to install PIL use the following command
Once installed, you'll get a successful message as shown below.

pip install pillow


Install face_recognition: The face_recognition library for python is taken into account to be the only library to acknowledge and manipulate faces. we'll be using this library to coach and recognize faces. To install this library follow the command.

pip install face_recognition –no –cache-dir
  • Once installed you will get a success message as shown below.

The library is heavy and the general public will face memory exceeding problems, hence I've got the “—no –cache-dir” code to install the library without saving the cache files.

Train the system (How to feed the data)

Let’s take a glance at the Face_Trainer.py program. The target of the program is to open all the pictures within the Face_Images directory and seek faces.

You can get the code files here.

Once the face is detected, it crops the face and converts it to grayscale, then to a NumPy array. Then we finally use the face_recognition library that we installed earlier to coach and put it aside as a file called face-trainner.yml. the information during this file can later be accustomed to recognize the faces.

The whole Trainer program is given at the tip, here I will explain the foremost important lines.

  • We start the program by importing the specified modules. The cv2 module is deployed for Image Processing & Numpy is used to convert images to mathematical equivalents, the OS module is employed to navigate through directories and PIL is deployed to handle images.
import cv2 #For Image processing
import numpy as np #For converting Images to Numerical array
import os #To handle directories
from PIL import Image #Pillow lib for handling images
  • Next, we've got to use the haarcascade_frontalface_default.xml classifier to detect faces in images. To confirm, you have got placed this XML, go in your project folder else you'll face errors.
  • Then we use the recognizer variable to form a Local Binary Pattern Histogram (LBPH) Face Recognizer.
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
recognizer = cv2.createLBPHFaceRecognizer()
  • Then we've to go into the Face_Images Directory to access the pictures inside it. This directory should be placed inside your current working directory (CWD).
  • The subsequent line is employed to go into the folder which is placed within the CWD.
Face_Images = os.path.join(os.getcwd(), "Face_Images") #Tell the program where we have saved the face images
  • We then use for loops to get into each sub-directory of the directory Face_Images and open any files that end with jpeg, jpg, or png. The trail of every image is stored during a variable called path and also the folder name (which is going to be the person’s name) within which the pictures are placed & stored in a variable called person_name.
for root, dirs, files in os.walk(Face_Images): #go to the face image directory
for file in files: #check every directory in it

if file.endswith("jpeg") or file.endswith("jpg") or file.endswith("png"): #for image files ending with jpeg,jpg or png
path = os.path.join(root, file)
person_name = os.path.basename(root)
  • If the name of the person has changed, we increment a variable called Face_ID, this can help us in having a special Face_ID for a person which we are going to later use to spot the name of the person.
if pev_person_name!=person_name: #Check if the name of person has changed
Face_ID=Face_ID+1 #If yes increment the ID count
pev_person_name = person_name
  • As we all know, it's plenty easier for OpenCV to figure with grayscale images than with colored images, since the BGR values will be ignored. So to cut back the values within the image, we convert it to grayscale and also resize the image to 550 in order that all images stay uniform.
  • Ensure the face is within the middle, else the face is cropped out. Finally, convert these images to NumPy array to get a mathematical value for the photographs, so use the cascade classifier to detect the faces within the images and store the data to a variable called faces.
Gery_Image = Image.open(path).convert("L") # convert the image to greysclae using Pillow
Crop_Image = Gery_Image.resize( (550,550) , Image.ANTIALIAS) #Crop the Grey Image to 550*550 (Make sure your face is in the center in all image)
Final_Image = np.array(Crop_Image, "uint8")
faces = face_cascade.detectMultiScale(Final_Image, scaleFactor=1.5, minNeighbors=5) #Detect The face in all sample image
  • Once the face has been detected, we'll crop that area and consider it as our Region of Interest (ROI). The ROI region is used to train the face recognizer. We've got to append every ROI face within a variable called x_train.
  • Then we offer these ROI values together with the Face ID value to the recognizer which can provide us the training data. The info obtained is saved after you compile this program you may find that the face-trainner.yml file gets updated anytime.
for (x,y,w,h) in faces:
roi = Final_Image[y:y+h, x:x+w] #crop the Region of Interest (ROI)
x_train.append(roi)
y_ID.append(Face_ID)

recognizer.train(x_train, np.array(y_ID)) #Create a Matrix of Training data
recognizer.save("face-trainner.yml") #Save the matrix as YML file
  • So ensure to compile this program whenever you create any changes to the photos within the Face_Images directory.
  • When compiled you may get the Face ID, pathname, person name, and NumPy array printed like shown below for debugging purposes.

Face detection results

Now, that we've our trained data ready, we are able to use it to acknowledge faces. Within the Face Recognizer program, we'll get a live video feed from a USB webcam then convert it to a picture.

  • Then we've got to use our face detection technique to detect faces in those photos then compare them with all the Face ID that we've created earlier.
  • If we discover a match, we will then box the face and write the name of the one that has been recognized. The entire program is again given at the tip, the reason for the identical is as follows.
  • The program shares plenty of similarities with the trainer program, so import the identical modules that we used earlier and also use the classifier since we want to perform face detection again.
import cv2 #For Image processing
import numpy as np #For converting Images to Numerical array
import os #To handle directories
from PIL import Image #Pillow lib for handling images
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
recognizer = cv2.createLBPHFaceRecognizer()
  • Next within the variable labels, you've got to jot down the name of the persons who were mentioned within the folder. Confirm you follow the identical order. In my case, it's my name “Apurva” and “Paul”.
labels = ["Apurva", "Paul"]
  • We then should load the face-trainner.yml file into our program since we are going to just use the information from that file to acknowledge faces.
recognizer.load("face-trainner.yml")
  • The video feed is obtained from the USB webcam. If you have got over one camera connected replace 0 with 1 to access the secondary camera.
cap = cv2.VideoCapture(0) #Get vidoe feed from the Camera
  • Next, we break the video into frames (Images) and convert it into grayscale and so detect the faces within the image.
  • Once the faces are detected we've got to crop that area rather like we did earlier and reserve it separately as roi_gray.
ret, img = cap.read() # Break video into frames
gray  = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) #convert Video frame to Greyscale
faces = face_cascade.detectMultiScale(gray, scaleFactor=1.5, minNeighbors=5) #Recog. faces
for (x, y, w, h) in faces:
roi_gray = gray[y:y+h, x:x+w] #Convert Face to greyscale

id_, conf = recognizer.predict(roi_gray) #recognize the Face
  • The variable conf tells us how confident the software is recognizing the face. If the detection level is bigger than 80, we get the name of the person using the ID number using the below line of code.
  • Then draw a box around the face of the person and write the name of the person on top of the box.
if conf>=80:
        font = cv2.FONT_HERSHEY_SIMPLEX #Font style for the name
        name = labels[id_] #Get the name from the List using ID number
        cv2.putText(img, name, (x,y), font, 1, (0,0,255), 2)
cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
  • Finally, we have to display the video feed that we just analyzed and then break the feed when a wait key (here q) is pressed.
cv2.imshow('Preview',img) #Display the Video
if cv2.waitKey(20) & 0xFF == ord('q'):
   break
  • Make sure the Pi is connected to a monitor through HDMI when this program is executed. Run the program and you will find a window popping up with name preview and your video feed in it.
  • If a face is recognized in the video feed you will find a box around it and if your program could recognize the face it will also display the name of the person.
  • We have trained our program to recognize me and Paul and you can see both getting recognized in the below snapshot.

Conclusion

In this tutorial, we got to learn, how to make a face detection system with a raspberry pi. We have created a trainer program and converted images into an array and further used those to detect faces. This program will surely work for you, in case of any issues comment down below. I'll try my best to resolve it. We detected my face and Paul Walker's face here. You can try inserting your photo.

Let me know your thoughts. See you later.

Until Next Time! Peace out!


Tags : face detection on raspberry pi , opencv face detection

Share This Article


About Robu

Robu Single Logo

India's biggest robotics E-commerce company. Robu deals with Arduino, Raspberry Pi, Sensors, Drone parts, 3D printer parts, E-bike accessories and Electronics components etc. Click here to explore range of Robotics products available at Robu. Also, do not forget to follow us on Facebook, Instagram and YouTube because we are constantly contributing to the community by creating content around Arduino, Raspberry Pi, Drones, Sensors etc.


Related Posts

card image
Blinking LED using GPIO pins of RaspberryPi

 Tuesday March 12, 2019      3479 Views

The article guide you through blinking a LED using the GPIO pins of Raspberry Pi.... Read More

card image
Programming Raspberry Pi Pico using Micro-Python

 Saturday April 24, 2021      2148 Views

Raspberry Pi Pico became a very popular board due to its price tag and is very easy to start with Micro Python. Here will set up Pico for Micro Python.... Read More

card image
How To Interface HC-05 Bluetooth Module With Arduino Uno?

 Tuesday January 28, 2020      6457 Views

This blog will cover the interfacing of HC-05 bluetooth module with Arduino board.... Read More

card image
Face tracking using Raspberry Pi.

 Tuesday December 21, 2021      878 Views

Hey guys, In this blog we will be making a simple face tracking device using Raspberry Pi.... Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

Comments (1)

  • Sakshi desai says:
    October 30, 2022 at 11:17 am

    How can we detect the face of whole class I mean a group of people in once

    Reply

Search Post


Related Posts

Geometry Management In Tkinter APP - Place, Pack, Grid Managers
How You Can Create Your Own Sound Reactive WS2812B Led Strip Using Raspberry Pi Pico
Host your own Discord Bot on Raspberry Pi 5
How to Setup Naze 32 Flight Controller


Subscribe to our Newsletter
to get promotional offers & discounts
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Services

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • Investor Relations
  • MACFOS CSR
  • Privacy policy
  • Terms of Service
  • Shipping & Refund
  • E-Waste Collection

Download Our App

google-play-badge
iOS App Link
© Robu.in is registered trademark of MACFOS LIMITED - All Rights Reserved

Subscribe to our Newsletter

Information

  • Track Your Order
  • Videos
  • FAQ
  • Careers

My Account

  • Cart
  • Checkout
  • My Account
  • Payment Options

Why Choose us

  • ABOUT US
  • Contact Us
  • Robu B2B

Policies

  • ABOUT US
  • Shipping & Refund Policy
  • Terms of Service
  • Privacy policy
  • Shipping Time / Delivery Time
  • Guarantee/Warranty
  • Changing or Canceling An Order
  • Payment Options
  • MACFOS LIMITED CSR
  • Investor Relations

Download Our App

google-play-badge
Robu.in | Indian Online Store | RC Hobby | Robotics
Got Questions ? Call us between 9:15 AM to 6:15 PM Monday-Saturday 1800 266 6123, 020 68197600

Plese Fill this details