cnt_total = np.vstack((cnt_total, cnt))
    return cnt_total


#Set the dataset folder
folder = "/home/amaranth/Desktop/Robot_UPAO/seedling_dataset_11_01_20/"

#GUI and mouse
cv2.namedWindow("depthimage")
cv2.setMouseCallback("depthimage", click_depth_rgb)

#Set the sample number
sample_num = 38

#Open the sample
DB = seedb.seedling_dataset(folder)
sample = DB.read_sample(sample_num)
depth_orig = sample.depth
depth_rgb = sample.toprgb
hsv_img = cv2.cvtColor(depth_rgb, cv2.COLOR_BGR2HSV)

depth = np.ones(depth_orig.shape)
depth[450:, 380:1150] = depth_orig[450:, 380:1150]

#colorized=colorize(depth)

#Segment rgb image using depth information
binarized_coords = zip(
    *np.where((depth < 0.41) & (depth > 0.28)))  # pixels between 3cm and 33 cm
binarized_coords = list(binarized_coords)
Exemplo n.º 2
0
#For sample reading it's only necessary to use the libseedlingdb library

from libseedlingdb import Sample, seedling_sample, seedling_dataset

folder = "/home/amaranth/Desktop/Robot_UPAO/seedling_dataset_11_01_20/"  #put the dataset folder here
sample_number = 0

my_ds = seedling_dataset(folder)
print(my_ds.samplenum)  # Print the number of samples inside de dataset
sample = my_ds.read_sample(sample_number)  # read the a sample.
rgb_image = sample.toprgb  # read the RGB image of the sample.
quality = sample.quality  #read the seedlings' quality present in the image.
print(sample.quality)