资源简介

生成的超像素如同细胞一般紧凑整齐,邻域特征比较容易表达。这样基于像素的方法可以比较容易的改造为基于超像素的方法。不仅可以分割彩色图,也可以兼容分割灰度图。需要设置的参数非常少,默认情况下只需要设置一个预分割的超像素的数量。 相比其他的超像素分割方法,SLIC在运行速度、生成超像素的紧凑度、轮廓保持方面都比较理想。

资源截图

代码片段和文件信息

//=================================================================================
//=================================================================================
//
// PictureHandler.cpp: implementation of the PictureHandler class.
//
//===========================================================================
// Copyright (c) 2013 Radhakrishna Achanta.
//
// For commercial use please contact the author:
//
// Email: firstname.lastname@epfl.ch
//===========================================================================

#include “stdafx.h“
#include “PictureHandler.h“
#include   

//=================================================================================
// Construction/Destruction
//=================================================================================

PictureHandler::PictureHandler()
{
StartUpGdiPlus();
}

PictureHandler::~PictureHandler()
{
ShutDownGdiPlus();
}

//=================================================================================
// StartUpGdiPlus()
//
// Starts up GdiPlus. Can also be used for other things like memory allocation.
//=================================================================================
void PictureHandler::StartUpGdiPlus()
{
m_gdiplusStartupInput = new GdiplusStartupInput();
Status stat = GdiplusStartup(&m_gdiplusToken m_gdiplusStartupInput NULL);
_ASSERT( stat == Ok );
}

//=================================================================================
// ShutDownGdiPlus()
//
// Shuts down GdiPlus. Can also be used for other things like memory deallocation.
//=================================================================================
void PictureHandler::ShutDownGdiPlus()
{
if (m_gdiplusToken != NULL)
{
GdiplusShutdown(m_gdiplusToken);
delete m_gdiplusStartupInput;
m_gdiplusStartupInput = NULL;
m_gdiplusToken = NULL;
}
}


//=================================================================================
// GetEncoderClsid()
//
// The encoder CLSID provided depends on the format string provided;
// L“image/jpeg“ for JPEG CLSID and L“image/bmp“ for BMP CLSID
//=================================================================================
int PictureHandler::GetEncoderClsid(const WCHAR* format CLSID* pClsid)
{
   UINT  num = 0;          // number of image encoders
   UINT  size = 0;         // size of the image encoder array in bytes

   ImageCodecInfo* pImageCodecInfo = NULL;

   GetImageEncodersSize(&num &size);
   if(size == 0)
      return -1;  // Failure

   pImageCodecInfo = (ImageCodecInfo*)(malloc(size));
   if(pImageCodecInfo == NULL)
      return -1;  // Failure

   GetImageEncoders(num size pImageCodecInfo);

   for(UINT j = 0; j < num; ++j)
   {
      if( wcscmp(pImageCodecInfo[j].MimeType format) == 0 )
      {
         *pClsid = pImageCodecInfo[j].Clsid;
         free(pImageCodecInfo);
         return j;  // Success
      }    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1771520  2013-11-19 16:00  SLICSuperpixels\Release\SLICSuperpixels.exe

     文件      10078  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\PictureHandler.cpp

     文件       2538  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\PictureHandler.h

     文件       3460  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\ReadMe.txt

     文件      67777  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\res\SLICSuperpixels.ico

     文件        406  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\res\SLICSuperpixels.rc2

     文件        687  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\resource.h

     文件      26606  2013-11-19 16:05  SLICSuperpixels\SLICSuperpixels\SLIC.cpp

     文件       7758  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLIC.h

     文件       1717  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixels.cpp

     文件        562  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixels.h

     文件       4720  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixels.rc

     文件       5842  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixels.vcproj

     文件       1433  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixels.vcproj.LENOVO-73CDB26E.RK.user

     文件       7029  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixelsDlg.cpp

     文件        961  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\SLICSuperpixelsDlg.h

     文件        217  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\stdafx.cpp

     文件       1075  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\stdafx.h

     文件       1432  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\targetver.h

     文件        911  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels.sln

     文件       3124  2013-11-19 16:00  SLICSuperpixels\USAGE_SLIC.txt

     文件         90  2018-05-15 18:30  SLICSuperpixels\运行提示.txt

     目录          0  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels\res

     目录          0  2013-11-19 16:00  SLICSuperpixels\Release

     目录          0  2013-11-19 16:00  SLICSuperpixels\SLICSuperpixels

     目录          0  2018-05-15 18:28  SLICSuperpixels

----------- ---------  ---------- -----  ----

              1919943                    26


评论

共有 条评论