vision sensor, C++

Hiii
I am having problems with object detection from my vision sensor, when I put the camera live it finds it but my code does not do what it should do, could you help me or give me suggestions please

#include "vex.h"
using namespace vex;
/*vex-vision-config:begin*/
signature Vision10__DONAZUL = signature (1, -3441, -2785, -3113, 8975, 10355, 9665, 2.5, 0);
signature Vision10__SIG_2 = signature (2, 0, 0, 0, 0, 0, 0, 3, 0);
signature Vision10__DONAROJA = signature (3, 6657, 7879, 7268, 1115, 1581, 1348, 2.5, 0);
vision Vision10 = vision (PORT10, 50, Vision10__DONAZUL, Vision10__SIG_2, Vision10__DONAROJA);
/*vex-vision-config:end*/
motor Motor8 = motor(PORT8, ratio18_1, true);
int main() {
    Vision10.setBrightness(150);
    Vision10.setLedBrightness(100);
    
    while(1) {
        Vision10.takeSnapshot(Vision10__DONAZUL);
        wait(20, msec);
        
        // Solo un mensaje en pantalla que muestra lo esencial
        Brain.Screen.clearScreen();
        Brain.Screen.print("Objetos: %d", Vision10.objectCount);
        
        // Control del motor basado en la detección
        if(Vision10.largestObject.exists) {
            Motor8.setVelocity(20, percent);
            Motor8.spin(forward);
        } else {
            Motor8.setVelocity(50, percent);
            Motor8.spin(forward);
        }
        
        wait(50, msec);
    }
    return 0;
}