第一范文网 - 专业文章范例文档资料分享平台

SLIC超像素分割算法和目前超像素算法的比较代码实现 - 图文

来源:用户分享 时间:2020-06-09 本文由远水孤云 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

Resource.h

//{{NO_DEPENDENCIES}}

// Microsoft Visual C++ generated include file. // Used by SLICSuperpixels.rc //

#define IDD_SLICSUPERPIXELS_DIALOG 102 #define IDR_MAINFRAME 128 #define IDC_BUTTON_CREATESUPERPIXELS 1000 #define IDC_EDIT_SPCOUNT 1001 #define IDC_EDIT2 1002 #define IDC_EDIT_COMPACTNESS 1002

// Next default values for new objects //

#ifdef APSTUDIO_INVOKED

#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NEXT_RESOURCE_VALUE 129 #define _APS_NEXT_COMMAND_VALUE 32771 #define _APS_NEXT_CONTROL_VALUE 1003 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif

Stdafx.h

// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, // but are changed infrequently

#pragma once

#ifndef _SECURE_ATL #define _SECURE_ATL 1 #endif

#ifndef VC_EXTRALEAN

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #endif

#include \

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit

// turns off MFC's hiding of some common and often safely ignored warning messages #define _AFX_ALL_WARNINGS

#include // MFC core and standard components #include // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT

#include // MFC support for Internet Explorer 4 Common Controls #endif

#ifndef _AFX_NO_AFXCMN_SUPPORT

#include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT

#include // MFC support for ribbons and control bars

SLIC.h

// SLIC.h: interface for the SLIC class.

//=========================================================================== // This code implements the superpixel method described in: //

// Radhakrishna Achanta, Appu Shaji, Kevin Smith, Aurelien Lucchi, Pascal Fua, and Sabine Susstrunk,

// \

// EPFL Technical Report no. 149300, June 2010.

//=========================================================================== // Copyright (c) 2012 Radhakrishna Achanta [EPFL]. All rights reserved. //=========================================================================== //////////////////////////////////////////////////////////////////////

#if !defined(_SLIC_H_INCLUDED_) #define _SLIC_H_INCLUDED_

#include #include #include using namespace std;

class SLIC { public:

SLIC();

virtual ~SLIC();

//============================================================================ // Superpixel segmentation for a given step size (superpixel size ~= step*step) //============================================================================

void DoSuperpixelSegmentation_ForGivenSuperpixelSize(

const unsigned int* ubuff,//Each 32 bit unsigned int contains ARGB pixel values.

const int const int int*& int&

width, height, klabels,

superpixelsize,

numlabels,

const int&

const double& compactness);

//============================================================================ // Superpixel segmentation for a given number of superpixels

//============================================================================

void DoSuperpixelSegmentation_ForGivenNumberOfSuperpixels( const unsigned int* ubuff,

const int const int int*& int&

width, height, klabels,

K,//required number of superpixels

numlabels,

const int& good value for CIELAB space

const double& compactness);//10-20 is a

//============================================================================ // Supervoxel segmentation for a given step size (supervoxel size ~= step*step*step) //============================================================================ void DoSupervoxelSegmentation(

unsigned int**&

ubuffvec,

const int& const int& const int& int**& int&

width, height, depth, klabels,

supervoxelsize,

numlabels,

const int&

private:

const double& compactness);

//============================================================================ // Save superpixel labels in a text file in raster scan order

//============================================================================ void SaveSuperpixelLabels(

const int*& const int& const int&

labels, width, height,

const string& const string&

filename, path);

//============================================================================ // Save supervoxel labels in a text file in raster scan, depth order

//============================================================================ void SaveSupervoxelLabels(

const int**& const int& const int& const int&

labels,

width, height, depth,

const string& const string&

filename, path);

//============================================================================ // Function to draw boundaries around superpixels of a given 'color'.

// Can also be used to draw boundaries around supervoxels, i.e layer by layer. //============================================================================ void DrawContoursAroundSegments(

unsigned int*& int*&

const int& const int&

segmentedImage, labels, width, height, color );

const unsigned int&

//============================================================================ // The main SLIC algorithm for generating superpixels

//============================================================================

void PerformSuperpixelSLIC(

vector& vector& vector& vector& vector& int*&

const int&

kseedsl, kseedsa, kseedsb, kseedsx, kseedsy, klabels, STEP,

edgemag,

const vector&

const double&

m = 10.0);

//============================================================================ // The main SLIC algorithm for generating supervoxels

//============================================================================ void PerformSupervoxelSLIC(

vector& vector& vector& vector& vector& vector& int**& const int&

kseedsl, kseedsa, kseedsb, kseedsx, kseedsy, kseedsz, klabels, STEP,

const double& compactness);

//============================================================================ // Pick seeds for superpixels when step size of superpixels is given.

//============================================================================ void GetLABXYSeeds_ForGivenStepSize(

vector& vector& vector& vector& vector& const int&

const bool&

kseedsl, kseedsa, kseedsb, kseedsx, kseedsy, STEP,

perturbseeds,

const vector& edgemag);

//============================================================================ // Pick seeds for supervoxels

//============================================================================ void GetKValues_LABXYZ(

vector& vector&

kseedsl, kseedsa,

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新IT计算机SLIC超像素分割算法和目前超像素算法的比较代码实现 - 图文 全文阅读和word下载服务。

SLIC超像素分割算法和目前超像素算法的比较代码实现 - 图文 .doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/1078828.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top