Understanding blobdetector in 4.5.4

Hi all, currently been working to implement a blob detection code and then take the giving bounding box and feed it into a image tracker. I have the tracker working seperately but am struggling with getting the code to actually compile. Do note: I am using a reference for this code as a starting point.

#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/features2d.hpp"
#include <opencv2/core/utility.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/video/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
using namespace cv;
// Read image
Mat im = imread( "blob.jpg", IMREAD_GRAYSCALE );

// Set up the detector with default parameters.
SimpleBlobDetector detector;

// Detect blobs.
std::vector<KeyPoint> keypoints;
detector.detect( im, keypoints);

// Draw detected blobs as red circles.
// DrawMatchesFlags::DRAW_RICH_KEYPOINTS flag ensures the size of the circle corresponds to the size of blob
Mat im_with_keypoints;
drawKeypoints( im, keypoints, im_with_keypoints, Scalar(0,0,255), DrawMatchesFlags::DRAW_RICH_KEYPOINTS );

// Show blobs
imshow("keypoints", im_with_keypoints );

Ptr<Feature2D> detector = SimpleBlobDetector::create();

as the blobdetector creator yes?

The error here is detector.detect with this “this declaration has no storage class or type specifierC/C++(77)”. I feel like this is a library install issue?

detector->detect( im, keypoints);

no luck, I believe I’m missing some dll files but I am not sure. It is missing imshow, waitkey, and drawkeypoints as well.

nvm I am a moron, it wasn’t in a main class, that’s a stupid oversight… thanks! That did fix the detector afterwards.

Thought once I did get it compiling my test image wasn’t actually having any keypoints drawn on it…