c_cpp dlib min_cut

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp dlib min_cut相关的知识,希望对你有一定的参考价值。

#include "pch.h"
#include <sstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <dlib/graph_cuts.h>
#include <dlib/graph_utils.h>
#include <dlib/directed_graph.h>
#include <dlib/graph.h>
#include <dlib/rand.h>
#include <dlib/matrix/matrix.h>


using namespace std;
using namespace dlib;


int main(void)
{
	directed_graph<double, double>::kernel_1a g_flow;
	g_flow.set_number_of_nodes(6);

	g_flow.add_edge(0, 1);	edge(g_flow, 0, 1) = 16;
	g_flow.add_edge(0, 2);	edge(g_flow, 0, 2) = 13;
	
	g_flow.add_edge(1, 2);	edge(g_flow, 1, 2) = 12;
	g_flow.add_edge(1, 3);	edge(g_flow, 1, 3) = 10;
	
	g_flow.add_edge(2, 1);	edge(g_flow, 2, 1) = 4;
	g_flow.add_edge(2, 4);	edge(g_flow, 2, 4) = 14;
	
	g_flow.add_edge(3, 2);	edge(g_flow, 3, 2) = 9;
	g_flow.add_edge(3, 5);	edge(g_flow, 3, 5) = 20;
	
	g_flow.add_edge(4, 3);	edge(g_flow, 4, 3) = 7;
	g_flow.add_edge(4, 5);	edge(g_flow, 4, 5) = 4;
	
	min_cut minc;

	minc(g_flow, 0, 5);
	return 0;
}

以上是关于c_cpp dlib min_cut的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp dlib bobyqa

c_cpp dlib矩阵运算

c_cpp 转换为dlib垫

c_cpp dlib_LearnSVM

c_cpp dlib_utils

c_cpp mat to dlib to eigen