c++ - Build heatmap/attention map over an image from points coordinates with OpenCV -
I want to create a heatmap from the number that is overlapping an image (in grayscale). I have X and Y coordinates of my points, this idea is easily to see the attention / density, where the points are centered (red area if there is a significant number).
I think I can use OpenCV for this. The following function looks interesting: Do anyone know how to make a heatmap from the coordinates please direct? Thanks to @Berk's code and using Do anyone have more clues? Here's my idea, - Apply a distance change to see the point density: applyColorMap (src, result, cv :: COLORMAP_JET); . But I do not know how this map should be linked to numbers and not on the image.
COLORMAP_RAINBOW instead of using
COLORMAP_JET :
It is near the result that I want it to be very discrete and" smooth "/" fuzzy "is not enough. I do not want to show the points (especially those who are "alone"), I want to show the density area clearly. As some of you said, I think that I need to "just" change the intensity of pixels around my ROI.
// Generate demo data, you can set your pixels here: RNG and RPN (RRNG)); Matt IMG (300,300, CV_8U, scalar (255)); // Inverted B / W for the scheme (int i = 0; i <600; i ++) {int x = ran.uniform (0,300); Int y = ran Size (0,300); Img.at & lt; Uchar & gt; (y, x) = 0; } Draw the mat; DistanceTransform (img, draw, cv_DIST_L2,5); // For the uchar back float, here is an approximant scale factor needed (10 works good for display) draw.convertTo (Draw, CV_8U, 10); // cerr & lt; & Lt; Drew (Reit (30,30,10,10)) & lt; & Lt; Endl; // Peeking in Figures, does it look good? ApplyColorMap (Draw, Draw, CV :: COLORMAP_JET); imshow ("jetmap", draw); WaitKey ();
Comments
Post a Comment