I am using yolo for image detection on my custom dataset, where i train to identiy certain object in the dataset. And post training, the algorithm correctly predicted these objects in the images. I would like to get the rbg values of the predicted objects alone, in opencv i didnot find a way to check the rgb values for objects inside a detected box. In the sample image attached, i would like to see the rgb value of the cup detected.
For example, result = [x, y, w, h] or [x1, y1, x2, y2]
For example, if your result is [x1, y1, x2, y2] and your image shape is img[640,480,3]
rgb_values = img[x1:x2, y1:y2, 0:2]
you will get rgb value of object you detect