Home Water Flow/Leak Detection using ESP32 Camera Module - Part II
#include "esp_camera.h" //#include <WiFi.h> // // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality // Ensure ESP32 Wrover Module or other board with PSRAM is selected // Partial images will be transmitted if image exceeds buffer size // // Select camera model #define CAMERA_MODEL_WROVER_KIT // Has PSRAM #include "camera_pins.h" // theta and rho arrays for Hough transform float thetas [ 90 ]; int rs [ 270 ]; int accumulator [ 270 ][ 90 ]; // accumulator for Hough transform for line detection int last_theta = 0 ; int go = 1 ; // function to convert RGB to HSV void rgb2hsv ( int r , int g , int b , int * h , int * s , int * v) { float rf = float ( r ) / 255 ; float gf = float ( g ) / 255 ; float bf = float ( b ) / 255 ; float mx; float mn; float df; // find max if (( rf > gf ) && ( rf > bf )) { mx = rf; } else if (( gf > rf ) &&