91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

實現圖像的分形維數特征的提取,適合初學者;可用于影像分類特征之一。

資源截圖

代碼片段和文件信息


#include?“stdafx.h“
#include?“cv.h“
#include?“highgui.h“
#include?“cxcore.h“

//計算分形盒子維
//#undef的使用是為了解決一些亂七八糟的問題
#ifdef?min
#undef?min
#endif
#ifdef?max
#undef?max
#endif
#include?
#include?
#include?
#include?

using?namespace?std;

void?Calculate_Fractal_Dim(char*?Img_dataint?Img_size)
{
???//**********************************************//
???//the?width?and?height?of?the?Image?should?be?the?same
???//gray?level?:?256
???//points?for?Least?Square?method?:?20
???//**********************************************//
???int?i=0j=0;

???//分形盒子維數相關參數
???int?M=Img_size;????????????????????????????????????????//圖像尺寸
???int?G=256;?????????????????????????????????????????????//灰度級
???int?L_point=32;????????????????????????????????????????//最小二乘法樣本點數
???valarray?Image_VAL(Img_size*Img_size);
???valarray?L_VAL(L_point);??????????????????????????//網格尺寸
???valarray?h_VAL(L_point); ??//盒子高度
???valarray?r_VAL(L_point);???????????????????????//r=log10(1/(L/M))
???valarray?Nr_VAL((double)0L_point);????????????//覆蓋圖像所需的盒子數
???valarray?nNr_VAL((double)0L_point);???????????//臨時用,未做log運算的,非空有效盒子數
???valarray?Grid_Num(L_point);???????????????????????//網格數目
???valarray?fractal_D(0.0L_point);???????????????//分形維數
???
???//復制數據
???int?k=0;
???for(i=0;i???{
???for(j=0;j ???{
???Image_VAL[k]=Img_data[i*Img_size+j];
???k++;
???}
???}

???
???/*****************************************************************************
???根據論文《二維灰度圖像的分形維數計算》中提供的方法來估計網格的網格值及盒子高度
???網格大小的約束范圍為M^(1/3)<=L<=M/3
???******************************************************************************/
???//網格大小及相關參數
???int?L_min?=?(int)powf(M1/3.0);??????//網格塊的最小值
???int?L_max?=?(int)M/2;????????????????//網格塊的最大值
???int?L_step?=?(int)((L_max?-?L_min)/(float)L_point);???????//網格增加的步距

???/*********************************************************************************
???根據論文《An?efficient?approach?to?estimate?fractal?dimension?of?textural?images》
???中提供的方法來估計網格的網格值及盒子高度.
???網格大小的約束范圍為1???**********************************************************************************/
//????int?L_min?=?2;??????????//網格塊的最小值
//????int?L_max?=?(int)M/2;???//網格塊的最大值
//????int?L_step?=?1;?????????//網格增加的步距


???for(i=0;i???{
???L_VAL[i]?=?L_min?+?i*L_step;?????????????????//各樣本點對應的網格大小L
???h_VAL[i]?=?(G*L_VAL[i])/M;???????????????????//各樣本點對應的盒子高度h
???r_VAL[i]?=?log10(1/(L_VAL[i]/(float)M));?????//各樣本點對應的r???
???Grid_Num[i]?=?M/L_VAL[i];????????????????????//各樣本點對應的網格數目
???}


???int?m=0n=0t=0;
???int?grid_lt_x=0grid_lt_y=0grid_rd_x=0grid_rd_y=0;
???unsigned?char?grid_I_max=0grid_I_min=0;???????????//網格最大灰度值和最小灰度值
???int?dbc_l=0dbc_k=0nr=0;??????????????????????????//最小和最大灰度值所對應的單位網格高度
???int?gray_k=0gray_l=0;?????????????????????????????//不同網格高度中,最大灰度值和最小灰度

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-08-23?09:53??FD_test\
?????目錄???????????0??2018-08-23?09:52??FD_test\Debug\
?????文件??????289182??2018-08-23?09:52??FD_test\Debug\fd.obj
?????文件??????573495??2018-08-23?09:52??FD_test\Debug\FD_test.exe
?????文件??????838996??2018-08-23?09:52??FD_test\Debug\FD_test.ilk
?????文件?????4760880??2018-07-23?14:10??FD_test\Debug\FD_test.pch
?????文件?????1147904??2018-08-23?09:52??FD_test\Debug\FD_test.pdb
?????文件????????1848??2018-06-11?09:05??FD_test\Debug\StdAfx.obj
?????文件??????222208??2018-08-23?09:52??FD_test\Debug\vc60.idb
?????文件??????167936??2018-08-23?09:52??FD_test\Debug\vc60.pdb
?????文件???????13720??2018-08-23?09:52??FD_test\fd.cpp
?????文件???????????0??2018-06-07?13:40??FD_test\fd.h
?????文件????????4942??2018-06-11?09:07??FD_test\FD_test.dsp
?????文件?????????537??2018-06-07?13:37??FD_test\FD_test.dsw
?????文件???????50176??2018-08-23?09:53??FD_test\FD_test.ncb
?????文件???????55808??2018-08-23?09:53??FD_test\FD_test.opt
?????文件????????1662??2018-08-23?09:52??FD_test\FD_test.plg
?????目錄???????????0??2018-06-21?15:36??FD_test\images\
?????文件???????83158??2018-06-12?10:59??FD_test\images\00.png
?????文件??????740395??2018-06-11?16:01??FD_test\images\01-.png
?????文件??????202296??2018-06-11?17:15??FD_test\images\01.png
?????文件???????70564??2018-06-11?17:02??FD_test\images\02.png
?????文件?????2425883??2018-05-30?16:58??FD_test\images\053.png
?????文件?????5454985??2018-06-14?14:08??FD_test\images\DJI_0025.JPG
?????文件?????5253072??2018-06-21?15:36??FD_test\images\DJI_0025_1.JPG
?????文件?????8321324??2017-08-02?16:14??FD_test\images\DJI_0075.JPG
?????文件?????8398347??2018-06-21?15:33??FD_test\images\DJI_0075_1.JPG
?????文件???????13904??2018-06-12?13:38??FD_test\images\房屋1.png
?????文件????????6655??2018-06-12?13:44??FD_test\images\房屋2.png
?????文件??????196662??2018-06-15?14:08??FD_test\images\房屋3.bmp
?????文件???????51163??2018-06-12?13:49??FD_test\images\房屋3.png
............此處省略11個文件信息

評論

共有 條評論