cellUview 1.0.0
A real-time image processing and analysis suite for digital microscopy.
Loading...
Searching...
No Matches
kMeansCluster.h
1
2#ifndef CELLUVIEW_K_MEANS_CLUSTER_H
3#define CELLUVIEW_K_MEANS_CLUSTER_H
4
5
6#include <opencv2/core.hpp>
7#include <opencv2/videoio.hpp>
8#include <iostream>
9#include <stdlib.h>
10#include <thread>
11#include "imageProcessor.h"
12#include <list>
13#include <cmath>
14
15
20public:
21 kMeansCluster() = default;
22 void receiveFrame(frame newFrame);
26 std::string getParamLabel(){return paramLabel;};
27 int num_clusters = 0; //number of clusters used in kmeans operation
28 int clusterSlider = 2;
29 void updateClusterCount(int value);
30 void updateSettings(std::map<std::string, std::string>);
31 void centroidPercentage();
32 std::list<std::pair<cv::Vec3b, std::string>> getClusterAnalysis();
33
34private:
35 //add any other methods here
36 void updateKMeans(frame, bool);
37 void kMeans(frame);
38 std::string paramLabel = "kMean";
39 // Define a vector of colors
40 std::vector<cv::Vec3b> colors = {cv::Vec3b(0xB4, 0x77, 0x1F), cv::Vec3b(0x0F, 0x7F, 0xFF), cv::Vec3b(0x2C, 0xA0, 0x2C),cv::Vec3b(0x28, 0x27, 0xD6), cv::Vec3b(0xBD, 0x67, 0x94), cv::Vec3b(0x4B, 0x56, 0x8C),cv::Vec3b(0xC2, 0x77, 0xE3), cv::Vec3b(0x7F, 0x7F, 0x7F), cv::Vec3b(0x22, 0xBD, 0xBC), cv::Vec3b(0xCF, 0xBE, 0x17)};
41 cv::Mat current_k_means;
42 cv::Mat current_centers;
43 bool calculatePercentageEnabled = false;
44 bool percentageCalculated = false;
45 //std::list<std::pair<std::string, cv::Mat>>
46 std::list<std::pair<cv::Vec3b, std::string>> percentageDisplay;
47};
48#endif // CELLUVIEW_K_MEANS_CLUSTER_H
Definition: frame.h:20
Definition: imageProcessor.h:15
Definition: kMeansCluster.h:19
std::list< std::pair< cv::Vec3b, std::string > > getClusterAnalysis()
Definition: kMeansCluster.cpp:210
void centroidPercentage()
Definition: kMeansCluster.cpp:201
void updateClusterCount(int value)
Definition: kMeansCluster.cpp:192
std::string getParamLabel()
Definition: kMeansCluster.h:26
void updateSettings(std::map< std::string, std::string >)
Definition: kMeansCluster.cpp:219
void receiveFrame(frame newFrame)
Definition: kMeansCluster.cpp:11