Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,173 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,83 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>CannyCapture</name> | |||
<comment></comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | |||
<triggers>clean,full,incremental,</triggers> | |||
<arguments> | |||
<dictionary> | |||
<key>?name?</key> | |||
<value></value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.append_environment</key> | |||
<value>true</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key> | |||
<value>all</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.buildArguments</key> | |||
<value></value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.buildCommand</key> | |||
<value>make</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.buildLocation</key> | |||
<value>${workspace_loc:/CannyCapture/Debug}</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key> | |||
<value>clean</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.contents</key> | |||
<value>org.eclipse.cdt.make.core.activeConfigSettings</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.enableAutoBuild</key> | |||
<value>false</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.enableCleanBuild</key> | |||
<value>true</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.enableFullBuild</key> | |||
<value>true</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key> | |||
<value>all</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.stopOnError</key> | |||
<value>true</value> | |||
</dictionary> | |||
<dictionary> | |||
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key> | |||
<value>true</value> | |||
</dictionary> | |||
</arguments> | |||
</buildCommand> | |||
<buildCommand> | |||
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> | |||
<triggers>full,incremental,</triggers> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>org.eclipse.cdt.core.cnature</nature> | |||
<nature>org.eclipse.cdt.core.ccnature</nature> | |||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | |||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> | |||
</natures> | |||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
/*c | |||
* main.cpp | |||
* | |||
* Created on: 2011-4-17 | |||
* Author: itrufeng | |||
*/ | |||
|
|||
#include <opencv/cv.h> | |||
#include <opencv/highgui.h> | |||
// aperture 光圈 | |||
IplImage* canny(IplImage *inputImage,float lowThresh,float highThresh,float aperture){ | |||
IplImage *outputImage; | |||
if(inputImage->nChannels>1){ | |||
printf("not gray image."); | |||
} | |||
outputImage = cvCreateImage(cvGetSize(inputImage),IPL_DEPTH_8U,1); | |||
cvCanny(inputImage,outputImage,lowThresh,highThresh,aperture); | |||
return outputImage; | |||
} | |||
|
|||
int main(int args,char *argv[]){ | |||
CvCapture *capture = NULL; | |||
IplImage *image; | |||
cvNamedWindow("inputImage",CV_WINDOW_AUTOSIZE); | |||
cvMoveWindow("inputImage",100,100); | |||
capture = cvCreateCameraCapture(CV_CAP_ANY); | |||
while(image=cvQueryFrame(capture)){ | |||
IplImage *grayImage = cvCreateImage(cvGetSize(image),image->depth,1); | |||
IplImage *cannyImage = cvCreateImage(cvGetSize(grayImage),IPL_DEPTH_8U,1); | |||
cvCvtColor(image,grayImage,CV_RGB2GRAY); | |||
// float lowThresh 内部轮廓。数字越大越模糊 | |||
// float highThresh //外部轮廓。数字越大越模糊 | |||
// float aperture | |||
cannyImage = canny(grayImage,20,20,3); | |||
cvShowImage("inputImage",cannyImage); | |||
if(cvWaitKey(2)>0) | |||
break; | |||
cvReleaseImage(&cannyImage); | |||
cvReleaseImage(&grayImage); | |||
} | |||
// | |||
cvDestroyWindow("inputImage"); | |||
cvReleaseCapture(&capture); | |||
return 0; | |||
} |
Oops, something went wrong.