Histograms and matching
Download
1 / 49

Histograms and Matching - PowerPoint PPT Presentation


  • 102 Views
  • Updated On :

Histograms and Matching. 主講人:虞台文. Content. Overview Basic Histogram Structure Accessing Histograms Basic Manipulations with Histograms Color Spaces Histogram Comparisons Back Projection. Histograms and Matching. Overview. Histograms. Histogram of an Image. Histogram for Skin Color.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Histograms and Matching' - morag


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Histograms and matching l.jpg

Histograms and Matching

主講人:虞台文


Content l.jpg
Content

  • Overview

  • Basic Histogram Structure

  • Accessing Histograms

  • Basic Manipulations with Histograms

  • Color Spaces

  • Histogram Comparisons

  • Back Projection






Applications l.jpg
Applications

  • Object Detection

  • Image Retrieval

  • Gesture Recognition


Histograms and matching8 l.jpg

Histograms and Matching

Basic

Histogram Structure


Cvhistogram multidimensional histograms l.jpg
CvHistogram Multidimensional Histograms

typedef struct CvHistogram

{

int type;

CvArr* bins;

float thresh[CV_MAX_DIM][2]; // for uniform histograms

float** thresh2; // for nonuniform histograms

CvMatND mat; // embedded matrix header

// for array histograms

} CvHistogram;


Create histogram l.jpg
Create Histogram

CvHistogram* cvCreateHist(

int dims,

int* sizes,

int type,

float** ranges = NULL,

int uniform = 1

);


Defer set ranges l.jpg
Defer Set Ranges

Used when calling cvCreateHist with ranges = NULL.



Histograms and matching13 l.jpg

Histograms and Matching

Accessing Histograms



Direct access of bin data l.jpg
Direct Access of Bin Data

typedef struct CvHistogram

{

int type;

CvArr* bins;

float thresh[CV_MAX_DIM][2]; // for uniform histograms

float** thresh2; // for nonuniform histograms

CvMatND mat; // embedded matrix header

// for array histograms

} CvHistogram;

hist->mat.data.fl


Direct access of histogram information l.jpg
Direct Access of Histogram Information

typedef struct CvHistogram

{

int type;

CvArr* bins;

float thresh[CV_MAX_DIM][2]; // for uniform histograms

float** thresh2; // for nonuniform histograms

CvMatND mat; // embedded matrix header

// for array histograms

} CvHistogram;


Histograms and matching17 l.jpg

Histograms and Matching

Basic Manipulations with Histograms


Calculate histogram l.jpg
Calculate Histogram

void cvCalcHist(

IplImage** image,

CvHistogram* hist,

int accumulate=0,

const CvArr* mask=NULL

);



Example graylevel histogram l.jpg
Example  Graylevel Histogram


Example graylevel histogram21 l.jpg
Example  Graylevel Histogram

Download

Test Program








Color space conversion l.jpg

Article

Color Space Conversion

Some Algorithms

Applet


Opencv color space conversion l.jpg
OpenCV Color Space Conversion

void cvCvtColor(

const CvArr* src,

CvArr* dst,

int code

)





Example hue sat histogram l.jpg
Example  Hue-Sat Histogram


Example hue sat histogram34 l.jpg

Download

Test Program

Example  Hue-Sat Histogram


Histograms and matching35 l.jpg

Histograms and Matching

Histogram Comparisons


Histogram comparisons in opencv l.jpg
Histogram Comparisons in OpenCV

#define CV_COMP_CORREL 0#define CV_COMP_CHISQR 1#define CV_COMP_INTERSECT 2#define CV_COMP_BHATTACHARYYA 3


Histogram comparisons in opencv37 l.jpg
Histogram Comparisons in OpenCV

Correlation Method

(CV_COMP_CORREL)

maximum

mismatch

perfect

match

#define CV_COMP_CORREL 0

#define CV_COMP_CHISQR 1

#define CV_COMP_INTERSECT 2

#define CV_COMP_BHATTACHARYYA 3


Histogram comparisons in opencv38 l.jpg
Histogram Comparisons in OpenCV

Chi-square Method

(CV_COMP_CHISQR)

perfect

match

bad

mismatch

#define CV_COMP_CORREL 0

#define CV_COMP_CHISQR 1

#define CV_COMP_INTERSECT 2

#define CV_COMP_BHATTACHARYYA 3


Histogram comparisons in opencv39 l.jpg
Histogram Comparisons in OpenCV

Intersection Method

(CV_COMP_INTERSECT)

H1 and H2 are normalized to one before comparing

total

mismatch

perfect

match

#define CV_COMP_CORREL 0

#define CV_COMP_CHISQR 1

#define CV_COMP_INTERSECT 2

#define CV_COMP_BHATTACHARYYA 3


Histogram comparisons in opencv40 l.jpg
Histogram Comparisons in OpenCV

BHATTACHARYYA Method

(CV_COMP_BHATTACHARYYA)

perfect

match

total

mismatch

#define CV_COMP_CORREL 0

#define CV_COMP_CHISQR 1

#define CV_COMP_INTERSECT 2

#define CV_COMP_BHATTACHARYYA 3



Histograms and matching42 l.jpg

Histograms and Matching

Back Projection


Back projection l.jpg
Back Projection

  • Back projection is a way of recording how well the pixels or patches of pixels fit the distribution of pixels in a histogram model

    • cvCalcBackProject()

    • cvCalcBackProjectPatch()


Back projection44 l.jpg
Back Projection

  • Back projection is a way of recording how well the pixels or patches of pixels fit the distribution of pixels in a histogram model

    • cvCalcBackProject()

    • cvCalcBackProjectPatch()



Example l.jpg
Example

Download

Test Program





ad