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
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
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
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
const bool&
kseedsl, kseedsa, kseedsb, kseedsx, kseedsy, STEP,
perturbseeds,
const vector
//============================================================================ // Pick seeds for supervoxels
//============================================================================ void GetKValues_LABXYZ(
vector
kseedsl, kseedsa,
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新IT计算机SLIC超像素分割算法和目前超像素算法的比较代码实现 - 图文 全文阅读和word下载服务。
相关推荐: