From b457daf9bc93f3cba9e5cc9d56fee5fc83ca13da Mon Sep 17 00:00:00 2001 From: Dennis Shtatnov Date: Sun, 4 Sep 2022 18:59:43 -0700 Subject: [PATCH] boards/OPENMVPT: Use IR rather than color image for temperature stats. Before this change, the mean temperature of a blob is calculated based on the color values of the image. When running on the Pure Thermal this has the effect of labeling every blob with the min temperature of the entire scene. This change fixes this bug by using the IR image instead of the color image to get the right value. --- src/omv/boards/OPENMVPT/main_py.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/omv/boards/OPENMVPT/main_py.h b/src/omv/boards/OPENMVPT/main_py.h index f1635dca1..e35298bff 100644 --- a/src/omv/boards/OPENMVPT/main_py.h +++ b/src/omv/boards/OPENMVPT/main_py.h @@ -52,8 +52,8 @@ static const char fresh_main_py[] = " # Collect stats into a list of tuples\n" " blob_stats = []\n" " for b in blobs:\n" -" blob_stats.append((b.rect(), map_g_to_temp(img.get_statistics(thresholds = threshold_list,\n" -" roi = b.rect()).mean())))\n" +" blob_stats.append((b.rect(), map_g_to_temp(fir_img.get_statistics(thresholds = threshold_list,\n" +" roi = b.rect()).mean())))\n" " x_scale = img.width() / fir_img.width()\n" " y_scale = img.height() / fir_img.height()\n" " img.draw_image(fir_img, 0, 0, x_scale = x_scale, y_scale = y_scale,\n"