Commit bb81d8fa authored by luroth's avatar luroth
Browse files

fix: lp01 processing

parent 16b9a6b3
......@@ -28,10 +28,9 @@ def tiller_prediction(LA, GDD_BBCH30):
:return: Estimation of tiller count
"""
# LA is m^2/m^2 (= mm^2/mm^2)
# scale to plot size of 125 * 50 * 3 (mm)
LA = (LA / 1.0) * (0.125 * 0.15)
# scale to mm^2
LA = LA * 10**(6)
LA = LA * (125 * 50 * 3)
#Asym: Model was fit to plot size of 125 * 50 * 3 (mm)
Asym = 125 * 50 * 3
......@@ -52,6 +51,7 @@ def tiller_prediction(LA, GDD_BBCH30):
# x = (a/y - 1)^(-s) (e^m - (a/y - 1)^s)
# Therefore:
tiller_count = (Asym / LA - 1)**(-scal) * (math.exp(xmid) - (Asym / LA - 1) ** scal)
tiller_count = tiller_count if tiller_count > 0 else 0
# Scale count to 1 m^2
tiller_count = (tiller_count / (0.125 * 0.15) ) * 1.0
......@@ -132,10 +132,10 @@ def plant_prediction(image, delta_to_BBCH30, GSD):
w_plant_count_total = np.sum(w_plant_counts)
# Extract ground coverage > 50, normalize to 3 microplots (divide by sampling area, multiply by 3-microplot-area)
a_area_gc50 = ( np.sum(image>255 * 0.5) ) / (image.shape[0] * image.shape[1] * (GSD*1000)**2) * (150 * 150)
a_area_gc50 = ( np.sum(image>255 * 0.5) ) / (image.shape[0] * image.shape[1] * (GSD*1000)**2) * (150 * 125)
# Calculate plant counts
gc_plant_counts_total = a_area_gc50 * gc_slope + gc_intercept
gc_plant_counts_total = gc_plant_counts_total / (150 * 150) * (image.shape[0] * image.shape[1] * (GSD*1000)**2)
gc_plant_counts_total = gc_plant_counts_total / (150 * 125) * (image.shape[0] * image.shape[1] * (GSD*1000)**2)
return(w_plant_count_total, gc_plant_counts_total)
......@@ -165,6 +165,9 @@ def process_plant_count(path_campaign, delta_to_BBCH30,
design_label = parts[0]
plot_label = parts[1][:-4]
elif (len(parts) == 3):
if parts[1] == "lp01":
print(LA_image, " is lp01 overview image, skip")
continue
design_label = parts[0] + "_" + parts[1]
plot_label = parts[2][:-4]
elif (len(parts) == 4):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment