From 968d94d4174c75dd8debfa62eff050dc0b9b42a8 Mon Sep 17 00:00:00 2001 From: Nikolaos Pappas Date: Wed, 3 Nov 2021 22:13:30 +0000 Subject: [PATCH] Fix trackbar in falsecolor cpp sample --- samples/cpp/falsecolor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/cpp/falsecolor.cpp b/samples/cpp/falsecolor.cpp index f73ffad4ce..bfe43a72ca 100644 --- a/samples/cpp/falsecolor.cpp +++ b/samples/cpp/falsecolor.cpp @@ -16,14 +16,14 @@ struct ParamColorMap { String winName="False color"; static const String ColorMaps[] = { "Autumn", "Bone", "Jet", "Winter", "Rainbow", "Ocean", "Summer", "Spring", "Cool", "HSV", "Pink", "Hot", "Parula", "Magma", "Inferno", "Plasma", "Viridis", - "Cividis", "Twilight", "Twilight Shifted", "Turbo", "User defined (random)" }; + "Cividis", "Twilight", "Twilight Shifted", "Turbo", "Deep Green", "User defined (random)" }; static void TrackColorMap(int x, void *r) { ParamColorMap *p = (ParamColorMap*)r; Mat dst; p->iColormap= x; - if (x == COLORMAP_TURBO + 1) + if (x == COLORMAP_DEEPGREEN + 1) { Mat lutRND(256, 1, CV_8UC3); randu(lutRND, Scalar(0, 0, 0), Scalar(255, 255, 255)); @@ -97,10 +97,10 @@ int main(int argc, char** argv) imshow("Gray image",img); namedWindow(winName); - createTrackbar("colormap", winName,&p.iColormap,1,TrackColorMap,(void*)&p); + createTrackbar("colormap", winName, NULL, COLORMAP_DEEPGREEN + 1, TrackColorMap, (void*)&p); setTrackbarMin("colormap", winName, COLORMAP_AUTUMN); - setTrackbarMax("colormap", winName, COLORMAP_TURBO+1); - setTrackbarPos("colormap", winName, -1); + setTrackbarMax("colormap", winName, COLORMAP_DEEPGREEN + 1); + setTrackbarPos("colormap", winName, COLORMAP_AUTUMN); TrackColorMap(0, (void*)&p);