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

資源簡(jiǎn)介

在做《學(xué)習(xí)opencv》例2-10時(shí),發(fā)現(xiàn)書中源碼有些問題,經(jīng)過我的修改,該代碼可以將彩色視頻完美輸出和保存為灰度格式和極坐標(biāo)格式的視頻,并且解決了很多朋友存在的灰度視頻輸出是以翻轉(zhuǎn)形式輸出的問題,代碼有我的詳細(xì)注解,很容易理解和掌握。

資源截圖

代碼片段和文件信息

//?Eg2.10.cpp?:?定義控制臺(tái)應(yīng)用程序的入口點(diǎn)。
//

#include?“stdafx.h“


/*?License:
???Oct.?3?2008
???Right?to?use?this?code?in?any?way?you?want?without?warrenty?support?or?any?guarentee?of?it?working.

???BOOK:?It?would?be?nice?if?you?cited?it:
???Learning?OpenCV:?Computer?Vision?with?the?OpenCV?Library
?????by?Gary?Bradski?and?Adrian?Kaehler
?????Published?by?O‘Reilly?Media?October?3?2008
?
???AVAILABLE?AT:?
?????http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134
?????Or:?http://oreilly.com/catalog/9780596516130/
?????ISBN-10:?0596516134?or:?ISBN-13:?978-0596516130????

???OTHER?OPENCV?SITES:
???*?The?source?code?is?on?sourceforge?at:
?????http://sourceforge.net/projects/opencvlibrary/
???*?The?OpenCV?wiki?page?(As?of?Oct?1?2008?this?is?down?for?changing?over?servers?but?should?come?back):
?????http://opencvlibrary.sourceforge.net/
???*?An?active?user?group?is?at:
?????http://tech.groups.yahoo.com/group/OpenCV/
???*?The?minutes?of?weekly?OpenCV?development?meetings?are?at:
?????http://pr.willowgarage.com/wiki/OpenCV
*/
#include?“cv.h“
#include?“highgui.h“
#include?


//?Convert?a?video?to?grayscale
//?argv[1]:?input?video?file
//?argv[2]:?name?of?new?output?file
//

//#define?NOWRITE?1;???//Turn?this?on?(removed?the?first?comment?out?“//“?if?you?can‘t?write?on?linux

int?main(?int?argc?char*?argv[]?)?{
????cvNamedWindow(?“Example2_10“?CV_WINDOW_AUTOSIZE?);
????cvNamedWindow(?“Log_Polar“?CV_WINDOW_AUTOSIZE?);
????CvCapture*?capture?=?cvCreateFileCapture(?“D:\\sample.avi“?);//地址輸入你的視頻地址
????if?(!capture){
????????return?-1;
????}
????IplImage*?bgr_frame;
????double?fps?=?cvGetCaptureProperty?(
????????capture
????????CV_CAP_PROP_FPS
????);
printf(“fps=%d\n“(int)fps);

????CvSize?size?=?cvSize(
????????(int)cvGetCaptureProperty(?capture?CV_CAP_PROP_frame_WIDTH)
????????(int)cvGetCaptureProperty(?capture?CV_CAP_PROP_frame_HEIGHT)
????);
????
????printf(“frame?(w?h)?=?(%d?%d)\n“size.widthsize.height);
//#ifndef?NOWRITE
?CvVideoWriter*?writer?=?cvCreateVideoWriter(??//?建立第一個(gè)寫入視頻的容器
????????“D:\\sample3.avi“???????????????????????????????//地址輸入一個(gè)你想把灰度視頻輸出到的位置
????????CV_FOURCC(‘M‘‘J‘‘P‘‘G‘)????
????????fps
????????size
0?//0表示寫入的是灰度圖像
????);
??CvVideoWriter*?writer2?=?cvCreateVideoWriter(??//?建立第二個(gè)寫入視頻的容器
????????“D:\\sample4.avi“???????????????????????????????//地址輸入一個(gè)你想把極坐標(biāo)視頻輸出到的位置
????????CV_FOURCC(‘M‘‘J‘‘P‘‘G‘)????
????????fps
????????size
1?//1表示寫入的是彩色圖像
????);
//#endif
????IplImage*?logpolar_frame?=?cvCreateImage(
????????size
????????IPL_DEPTH_8U
????????3
????);

????IplImage*?gray_frame?=?cvCreateImage(
????????size
????????IPL_DEPTH_8U
????????1
????);

?
????while(?(bgr_frame=cvQueryframe(capture))?!=?NULL?)?{
????????cvShowImage(?“Example2_10“?bgr_frame?);
????????cvCvtColor(?bgr_frame?gray_frame?CV_RGB2GRAY?);//每幀都變成灰度圖
????????cvLogPolar(?bgr_frame?logpolar_frame??//This?is?just?a?fun?conversion?the?mimic‘s?the?human?visual?system
????????????????????cvPoint2D32f(bgr_

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????65024??2014-12-04?18:49??Eg2.10\Debug\Eg2.10.exe

?????文件?????788676??2014-12-04?18:49??Eg2.10\Debug\Eg2.10.ilk

?????文件????1813504??2014-12-04?18:49??Eg2.10\Debug\Eg2.10.pdb

?????文件???????1522??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\cl.command.1.tlog

?????文件??????22702??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\CL.read.1.tlog

?????文件????????832??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\CL.write.1.tlog

?????文件?????????77??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\Eg2.10.lastbuildstate

?????文件???????1949??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\Eg2.10.log

?????文件?????254354??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\Eg2.10.obj

?????文件????1245184??2014-12-04?16:09??Eg2.10\Eg2.10\Debug\Eg2.10.pch

?????文件??????????2??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link-rc.read.1.tlog

?????文件??????????2??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link-rc.write.1.tlog

?????文件???????2174??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link.command.1.tlog

?????文件???????5372??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link.read.1.tlog

?????文件????????570??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\link.write.1.tlog

?????文件??????11717??2014-12-04?16:09??Eg2.10\Eg2.10\Debug\stdafx.obj

?????文件?????674816??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\vc110.idb

?????文件????1363968??2014-12-04?18:49??Eg2.10\Eg2.10\Debug\vc110.pdb

?????文件???????3949??2014-12-04?18:49??Eg2.10\Eg2.10\Eg2.10.cpp

?????文件???????4543??2014-12-04?16:09??Eg2.10\Eg2.10\Eg2.10.vcxproj

?????文件???????1310??2014-12-04?16:07??Eg2.10\Eg2.10\Eg2.10.vcxproj.filters

?????文件???????1503??2014-12-04?16:07??Eg2.10\Eg2.10\ReadMe.txt

?????文件????????211??2014-12-04?16:07??Eg2.10\Eg2.10\stdafx.cpp

?????文件????????233??2014-12-04?16:07??Eg2.10\Eg2.10\stdafx.h

?????文件????????236??2014-12-04?16:07??Eg2.10\Eg2.10\targetver.h

?????文件???15728640??2014-12-04?18:50??Eg2.10\Eg2.10.sdf

?????文件????????885??2014-12-04?16:07??Eg2.10\Eg2.10.sln

????..A..H.?????25600??2014-12-04?18:50??Eg2.10\Eg2.10.v11.suo

............此處省略10個(gè)文件信息

評(píng)論

共有 條評(píng)論