尝试对视频上的帧执行灰度转换,但是当我到达cvCvtColor时,继续获取Assertation failed错误.有谁看到我的错误在哪里?
IplImage *frame, *frame_copy = 0;
// capture frames from video
CvCapture *capture = cvCaptureFromFile( "lightinbox1.avi");
//Allows Access to video propertys
cvQueryFrame(capture);
//Get the number of frames
int nframe=(int) cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT);
//Name window
cvNamedWindow( "video:", 1 );
//start loop
for(int i=0;i<nframe;i++){
//prepare capture frame extraction
cvGrabFrame(capture);
cout<<"We are on frame "<<i<<"\n";
//Get this frame
frame = cvRetrieveFrame( capture );
con2txt(frame);
frame_copy = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,frame->nChannels );
//show and destroy frame
cvCvtColor( frame,frame,CV_RGB2GRAY);
cvShowImage("video:",frame);
cvWaitKey(33);}
cvReleaseCapture(&capture);
Run Code Online (Sandbox Code Playgroud)
}
我试着写一个简单的max和min方法,正如我写的那样,我不能帮助它感觉它不应该是这么复杂.......我可能错了吗?我的最大代码就是这样,原谅我糟糕的伪代码:
用10个随机数填充数组.创建一个初始化为0的max变量,因为0是最低的最大值.将每个元素与max进行比较如果元素大于max,则将max的值替换为相关元素
我不喜欢我必须将max初始化为0的事实,我觉得可能有更好的方法呢?
我的min代码工作类似,除了I:比较我的min低于数组元素.如果元素较低,则替换min.
我真的不喜欢这个是我必须将我的min初始化为最大随机数,在这种情况下为50.
我的问题是:有更好的方法吗?有没有更有效的方法来编写这段代码?
import java.util.Random;
public class Main {
public static void main(String[] args) {
//Declare min and max
int max=0;
int min;
//Array of 10 spaces
int[] ar=new int[10];
//fill an array with random numbers between 0 and 50
for(int i=0;i<10;i++)
{
ar[i]=new Random().nextInt(50);
}
//Test max algorithm
//loop trough elements in array
for(int i=0;i<10;i++)
{
//max is set to 0, there should always be a maximum of 0
//If there isnt 0 will be the …Run Code Online (Sandbox Code Playgroud) http://sourceforge.net/projects/hibernate/files/hibernate4/
上面我有一个链接到Hibernate下载页面,你可以看到,至少今天顶级文件夹是:
4.1.7-Final
虽然它说下载最新版本:
hibernate-search-4.1.1.Final-dist.zip (31.0 MB)
我的问题是:
4.1.7的测试版本吗?为什么有些文件称为final,其他文件称为:
Alpha
Beta
CR1-5?