// this program is test code for studying the watershed algoritm
#include <iostream>
#include <string>
#include <opencv2/opencv.hpp>
const std::string readImageDirectory("D:\\Codes\\VS\\VC\\DoCpp\\Image\\");
const std::string readImageFile("testImage4Watershed.png");
// *randomColor
// generate a 3-channels color corresponding to the given parameter
// *input arguments
// -value
// the given parameter for generating the random color
// *output type
// -cv::Vec3b
// the representation of the random 3-channels color
cv::Vec3b randomColor(int value);
int main(int argc, char **argv)
{
std::string readImagePath = readImageDirectory + readImageFile;
std::cout << "Image Path\t : " << readImagePath << std::endl;
cv::namedWindow("Origin Image", CV_WINDOW_NORMAL);
cv::namedWindow("Gray Image", CV_WINDOW_NORMAL);
cv::namedWindow("GaussianBlur Image", CV_WINDOW_NORMA
OpenCV用分水岭算法进行图像分割代码示例
最新推荐文章于 2024-05-24 11:52:33 发布