资源简介
MFC实现的基于内容的图像检索,主要用到颜色特征,可以作为MFC和图像开发方面的学习资料

代码片段和文件信息
/******************************************************************
CqOctree.CPP
Performing Color Quantization using Octree algorithm
The 2 functions for global use is
HPALETTE CreateOctreePalette (HBITMAP hImage UINT nMaxColors UINT nColorBits)
HPALETTE CreateOctreePalette (LPSTR lpDIB UINT nMaxColors UINT nColorBits)
For using convenience define it in DIBAPI.H
******************************************************************/
#include “stdafx.h“
#include “dibapi.h“
// structure use internally
// store the necessary info of a node in octree
typedef struct _NODE
{
BOOL bIsLeaf; // TRUE if node has no children
UINT nPixelCount; // Number of pixels represented by this leaf
UINT nRedSum; // Sum of red components
UINT nGreenSum; // Sum of green components
UINT nBlueSum; // Sum of blue components
struct _NODE* pChild[8]; // Pointers to child nodes
struct _NODE* pNext; // Pointer to next reducible node
} NODE;
// Function prototypes
//Global use define it in dibapi.h
//HPALETTE CreateOctreePalette (HDIB hDIB UINT nMaxColors UINT nColorBits)
//HPALETTE CreateOctreePalette (LPSTR lpDIB UINT nMaxColors UINT nColorBits)
//Local use only
HPALETTE BuildOctreePalette(HANDLE hImage UINT nMaxColors UINT nColorBits);
void AddColor (NODE** BYTE BYTE BYTE UINT UINT UINT* NODE**);
NODE* CreateNode (UINT UINT UINT* NODE**);
void ReduceTree (UINT UINT* NODE**);
void DeleteTree (NODE**);
void GetPaletteColors (NODE* PALETTEENTRY* UINT*);
int GetRightShiftCount (DWORD);
int GetLeftShiftCount (DWORD);
// Function body
/*************************************************************************
*
* CreateOctreePalette()
*
* Parameters:
*
* HDIB hDIB - Handle to source DIB
* UINT nMaxColors - destination color number
* UINT nColorBits - destination color bits
*
* Return Value:
*
* HPALETTE - Handle to the result palette
*
* Description:
*
* This function use Octree color quantization algorithm to get
* optimal m kinds of color to represent total n kinds of color
* in a DIB and use the m kinds of color to build a palette.
* With the palette we can display the DIB on reasonable accuracy.
*
************************************************************************/
HPALETTE CreateOctreePalette(HDIB hDIB UINT nMaxColors UINT nColorBits)
{
HANDLE hImage;
hImage = DIBToDIBSection(hDIB);
if (! hImage)
return NULL;
return BuildOctreePalette(hImage nMaxColors nColorBits);
}
/*************************************************************************
*
* CreateOctreePalette()
*
* Parameters:
*
* LPBYTE lpDIB - Pointer to DIB data buffer
* UINT nMaxColors - destination color number
* UINT nColorBits - destination color bits
*
* Return Value:
*
* HPALETTE
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14512 2001-11-06 00:53 retrieval\CqOctree.cpp
文件 14875 2010-04-15 19:39 retrieval\Debug\CqOctree.obj
文件 0 2010-04-15 19:39 retrieval\Debug\CqOctree.sbr
文件 144724 2010-04-15 19:39 retrieval\Debug\Dib.obj
文件 0 2010-04-15 19:39 retrieval\Debug\Dib.sbr
文件 174157 2010-04-15 19:39 retrieval\Debug\dibapi.obj
文件 0 2010-04-15 19:39 retrieval\Debug\dibapi.sbr
文件 4234 2010-04-15 19:39 retrieval\Debug\Huffman.obj
文件 0 2010-04-15 19:39 retrieval\Debug\Huffman.sbr
文件 60729 2010-04-15 19:39 retrieval\Debug\IP.obj
文件 0 2010-04-15 19:39 retrieval\Debug\IP.sbr
文件 31549 2010-04-15 19:39 retrieval\Debug\Jpeg.obj
文件 0 2010-04-15 19:39 retrieval\Debug\Jpeg.sbr
文件 22242 2010-04-15 19:39 retrieval\Debug\MainFrm.obj
文件 0 2010-04-15 19:39 retrieval\Debug\MainFrm.sbr
文件 20408 2010-04-15 19:39 retrieval\Debug\ResultView.obj
文件 0 2010-04-15 19:39 retrieval\Debug\ResultView.sbr
文件 3834880 2010-04-15 19:39 retrieval\Debug\retrieval.bsc
文件 516170 2010-04-15 19:39 retrieval\Debug\retrieval.exe
文件 714212 2010-04-15 19:39 retrieval\Debug\retrieval.ilk
文件 23232 2010-04-15 19:39 retrieval\Debug\retrieval.obj
文件 6869072 2010-04-15 19:39 retrieval\Debug\retrieval.pch
文件 656384 2010-04-15 19:39 retrieval\Debug\retrieval.pdb
文件 8216 2010-04-15 19:39 retrieval\Debug\retrieval.res
文件 0 2010-04-15 19:39 retrieval\Debug\retrieval.sbr
文件 58872 2010-04-15 19:39 retrieval\Debug\retrievalDoc.obj
文件 0 2010-04-15 19:39 retrieval\Debug\retrievalDoc.sbr
文件 97643 2010-04-15 19:39 retrieval\Debug\RetrievallView.obj
文件 0 2010-04-15 19:39 retrieval\Debug\RetrievallView.sbr
文件 105670 2010-04-15 19:39 retrieval\Debug\StdAfx.obj
............此处省略402个文件信息
- 上一篇:OPENCV人脸检测加角点检测并输出坐标
- 下一篇:大家来找茬源码(MFC)
相关资源
- C++头文件转delphi工具 + 源码
- 基于MFC的TCP调试助手源码95706
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- 基于mfc的多线程文件传输
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- MFC数字钟(基于VC6.0)
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- ChartCtrl控件库(可在VS2019中使用)
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
评论
共有 条评论