资源简介
How do humans sketch objects 一文的代码,结果不太准,没有文中说得好,有可能是特征提取这一步有问题,也有可能是训练的问题。
代码只对十类进行测试,详情可见博客http://blog.csdn.net/tinyway/article/details/9240115
代码片段和文件信息
#include “StdAfx.h“
#include “CvvImage.h“
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CV_INLINE RECT NormalizeRect( RECT r );
CV_INLINE RECT NormalizeRect( RECT r )
{
int t;
if( r.left > r.right )
{
t = r.left;
r.left = r.right;
r.right = t;
}
if( r.top > r.bottom )
{
t = r.top;
r.top = r.bottom;
r.bottom = t;
}
return r;
}
CV_INLINE CvRect RectToCvRect( RECT sr );
CV_INLINE CvRect RectToCvRect( RECT sr )
{
sr = NormalizeRect( sr );
return cvRect( sr.left sr.top sr.right - sr.left sr.bottom - sr.top );
}
CV_INLINE RECT CvRectToRect( CvRect sr );
CV_INLINE RECT CvRectToRect( CvRect sr )
{
RECT dr;
dr.left = sr.x;
dr.top = sr.y;
dr.right = sr.x + sr.width;
dr.bottom = sr.y + sr.height;
return dr;
}
CV_INLINE IplROI RectToROI( RECT r );
CV_INLINE IplROI RectToROI( RECT r )
{
IplROI roi;
r = NormalizeRect( r );
roi.xOffset = r.left;
roi.yOffset = r.top;
roi.width = r.right - r.left;
roi.height = r.bottom - r.top;
roi.coi = 0;
return roi;
}
void FillBitmapInfo( BITMAPINFO* bmi int width int height int bpp int origin )
{
assert( bmi && width >= 0 && height >= 0 && (bpp == 8 || bpp == 24 || bpp == 32));
BITMAPINFOHEADER* bmih = &(bmi->bmiHeader);
memset( bmih 0 sizeof(*bmih));
bmih->biSize = sizeof(BITMAPINFOHEADER);
bmih->biWidth = width;
bmih->biHeight = origin ? abs(height) : -abs(height);
bmih->biPlanes = 1;
bmih->biBitCount = (unsigned short)bpp;
bmih->biCompression = BI_RGB;
if( bpp == 8 )
{
RGBQUAD* palette = bmi->bmiColors;
int i;
for( i = 0; i < 256; i++ )
{
palette[i].rgbBlue = palette[i].rgbGreen = palette[i].rgbRed = (BYTE)i;
palette[i].rgbReserved = 0;
}
}
}
CvvImage::CvvImage()
{
m_img = 0;
}
void CvvImage::Destroy()
{
cvReleaseImage( &m_img );
}
CvvImage::~CvvImage()
{
Destroy();
}
bool CvvImage::Create( int w int h int bpp int origin )
{
const unsigned max_img_size = 10000;
if( (bpp != 8 && bpp != 24 && bpp != 32) ||
(unsigned)w >= max_img_size || (unsigned)h >= max_img_size ||
(origin != IPL_ORIGIN_TL && origin != IPL_ORIGIN_BL))
{
assert(0); // most probably it is a programming error
return false;
}
if( !m_img || Bpp() != bpp || m_img->width != w || m_img->height != h )
{
if( m_img && m_img->nSize == sizeof(IplImage))
Destroy();
m_img = cvCreateImage( cvSize( w h ) IPL_DEPTH_8U bpp/8 );
}
if( m_img )
m_img->origin = origin == 0 ? IPL_ORIGIN_TL : IPL_ORIGIN_BL;
return m_img != 0;
}
void CvvImage::CopyOf( CvvImage& image int desired_color )
{
IplImage* img = image.GetImage();
if( img )
{
CopyOf( img desired_color );
}
}
#define HG_IS_IMAGE(img) \
((img) != 0 && ((const IplImage*)(img))->nSize == sizeof(IplImage) && \
(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 34633 2011-12-02 21:01 images\128.png
文件 49753 2011-12-02 21:01 images\173.png
文件 28664 2011-12-02 21:02 images\240.png
文件 26393 2011-12-02 21:02 images\250.png
文件 30814 2011-12-02 21:02 images\284.png
文件 29035 2011-12-02 21:03 images\390.png
文件 16725 2011-12-02 21:03 images\461.png
文件 12466 2011-12-02 21:03 images\480.png
文件 38762 2011-12-02 21:03 images\541.png
文件 23666 2011-12-02 21:04 images\622.png
文件 25530 2011-12-02 21:01 images\66.png
文件 20198 2011-12-02 21:04 images\703.png
文件 52186 2011-12-02 21:04 images\800.png
文件 143 2013-07-09 17:02 images\Readme.txt
文件 236 2013-07-09 17:05 SketchRec\Readme.txt
文件 292857 2013-07-02 09:44 SketchRec\SketchRec\center.txt
文件 6541 2013-04-05 12:24 SketchRec\SketchRec\CvvImage.cpp
文件 1521 2013-04-05 12:24 SketchRec\SketchRec\CvvImage.h
文件 4183 2013-07-08 15:09 SketchRec\SketchRec\Debug\SketchRec.Build.CppClean.log
文件 431 2013-07-08 15:09 SketchRec\SketchRec\Debug\SketchRec.log
文件 1270634 2013-07-09 14:06 SketchRec\SketchRec\model\model10.xm
文件 173735 2013-07-09 14:16 SketchRec\SketchRec\model\model_0.xm
文件 103302 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_1.xm
文件 143887 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_2.xm
文件 214312 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_3.xm
文件 167335 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_4.xm
文件 254915 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_5.xm
文件 139620 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_6.xm
文件 141734 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_7.xm
文件 205854 2013-07-09 14:02 SketchRec\SketchRec\model\model_0_8.xm
............此处省略127个文件信息
相关资源
- RapidMiner7数据挖掘与实战csv数据包
- OPENCV实现ORB/SURF/SIFT + RANSAC 图像自动拼
- ippicv_2017u3_lnx_intel64_general_20180518.tgz
- LearningOpenCV中文版-于仕琪书源码.zip
- qtOpenCVTools v1.7.0.rar
- mingw64编译好的OpenCV3.4.10
- OpenCV 4.2.0 && Qt5.14.1 编译好的库
- 基于LabWindows/CVI的虚拟仪器设计.pd
-
OpenCV的haarcascades 各种分类器xm
l文件 - OpenCV计算机视觉编程攻略 第三版
- opencv-4.1.0样例图片和视频.zip
- OpenCv3.3 32位版本
- OpenCV 的opencv_createsamples.exe和opencv_ha
- Kinect + openni+opencv 获取深度图
- opencv-3.4.1-windows版本
- opencv 2计算机视觉编程手册_中文_+图片
- opencv-3.4.7.zip
- 深入理解OpenCV 实用计算机视觉项目解
- vgg_generated_120.i等.tar.gz
- opencv4.5.0-cmake错误解决
- OpenCV 3.1 离线文档(包括contrib部分)
- QT实现的Opencv图像处理、点云显示、演
- 《opencv3编程入门》 毛星云完整版--
- 自定义图像识别
- opencv2.4.1-源码
- OpenCV-2.4.1_build&tbb;_vs_(x64)05/08/10三种
- OpenCvSharp 读摄像头及图像拼接功能
- opencv 3.1.0 3rdparty\\ffmpeg\\download
- open_cv 人头统计
- 《OpenCV图像处理编程》完整版(高清
评论
共有 条评论