Digital Image Processing ?????? - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Digital Image Processing ??????

Description:

Digital Image Processing What s An Image Image Type Gray Gray Image Color Image Image Features Feature: ... – PowerPoint PPT presentation

Number of Views:148
Avg rating:3.0/5.0
Slides: 13
Provided by: nasTakmi5
Category:

less

Transcript and Presenter's Notes

Title: Digital Image Processing ??????


1
Digital Image Processing??????
  • ???

2
Whats An Image
????
Unit Pixel
3
Image Type
  • Gray ????
  • Color ????

800x600480000 pixels
??pixel??????? (R, G, B)
??pixel???????
4
Gray Image
Image I ?????
or
double ImageNULL Image (double )
malloc(width height sizeof(double)) // read
a gray image file for (i 0 i lt height i
) for (j 0 j lt width j)
fscanf(fpin, "c", pixel)
(Imageiwidthj)(double)pixel //the pixel
at (i, j)
5
Color Image
Image I ?????
or
double ImageNULL Image (double )
malloc(width height sizeof(double)3) //
read a gray image file for (i 0 i lt height
i ) for (j 0 j lt width j)
fscanf(fpin, "c", pixel) (Imageiwidthj)(d
ouble)pixel //R at pixel (i, j)
fscanf(fpin, "c", pixel) (Imageiwidthj1)(
double)pixel //G at pixel (i, j)
fscanf(fpin, "c", pixel) (Imageiwidthj2)(
double)pixel //B at pixel (i, j)
6
Image Features
  • Feature ??
  • ???pixel??????, ???????????????????
  • ?????????????, ???
  • Color ?????
  • Texture ?????
  • Shape ?????

7
Pixel Feature
  • ??????????
  • ???pixel????
  • ????????????, ????icon?32x321024 pixels???face
    detection??????pixel feature????????

8
Color Histogram
pixel??
0
255
???
histogram ?????????????????
histogram ???????????????????
???????, color histogram????256?????
?color image, ????R, G, B ???histogram
9
Color Moments
  • ??color histogram????????, ?????????????
  • ?480000??????????????, ?????????????
  • Color Image
  • R, G, B channels, ?????????
  • ??????, ???6????

10
OpenCV Setup in VC
  • Library project-gtsetting-gtlink
  • cv.lib cvaux.lib highgui.lib cxcore.lib
  • Directories
  • Include
  • C\PROGRAM FILES\OPENCV\CV\INCLUDE
  • C\PROGRAM FILES\OPENCV\CVAUX\INCLUDE
  • C\PROGRAM FILES\OPENCV\OTHERLIBS\HIGHGUI
  • C\PROGRAM FILES\OPENCV\CXCORE\INCLUDE
  • Library
  • C\PROGRAM FILES\OPENCV\LIB
  • FilePathName
  • C\PROGRAM FILES\OPENCV\bin
  • Include in programs
  • include "cv.h, "cvaux.h, "highgui.h,
    "cxcore.h"

11
include ltstdio.hgt include ltcxcore.hgt include
lthighgui.hgt include ltmath.hgt int main( int
argc, char argv ) CvPoint center
double scale-3 IplImage image
cvLoadImage("Beach 2.jpg") if(!image) return
-1 / ????????pixel??????????? center
cvPoint(image-gtwidth/2,image-gtheight/2)
for(int i0iltimage-gtheighti) for(int
j0jltimage-gtwidthj) double
dx(double)(j-center.x)/center.x
double dy(double)(i-center.y)/center.y
double weightexp((dxdxdydy)scale)
uchar ptr CV_IMAGE_ELEM(image,uchar,i,j3)
ptr0 cvRound(ptr0weight)
ptr1 cvRound(ptr1weight)
ptr2 cvRound(ptr2weight)
cvSaveImage("copy.png", image ) /
cvNamedWindow("test", 1 ) cvShowImage("test",
image ) cvWaitKey() return 0
Including files
?????
OpenCV??????? ?????
??jpeg?, ????, ???????
????????
?????????
??????
12
? ?
  • ??Visual C (or VC .net)
  • ?OpenCV???????
  • ?? ??????, ????????
  • ??face detection??????????
Write a Comment
User Comments (0)
About PowerShow.com