我遇到了一个奇怪的问题.我试着安装x264.运行sudo ./configure --enable-shared时,它给出了:
找不到汇编程序最低版本是yasm-0.7.0如果你真的想在没有asm的情况下编译,请使用--disable-asm进行配置.
但我已经安装了yasm-0.7.0,以证明,我运行yasm --version,它给出了:
*yasm 0.7.0.2066编译于2012年5月8日.版权所有(c)2001-2008 Peter Johnson和其他Yasm开发人员.运行yasm --license以获取许可概述和摘要.*
我将yasm安装到/ usr/local/yasm,为什么找不到yasm?
我需要像entropyfilt()matlab 这样的函数,它在opencv中不存在.
在matlab中,J = entropyfilt(I)返回数组J,其中每个输出像素包含输入图像I中相应像素周围的9×9邻域的熵值.
我写了一个函数来用c ++实现它,foreach像素得到它的熵如下:
cvCalHist适当设置的mask参数来获得图像ROI(这是一个9*9的矩形).我列出了下面的C++代码:
GetLocalEntroyImage( const IplImage*gray_src,IplImage*entopy_image){
int hist_size[]={256};
float gray_range[]={0,255};
float* ranges[] = { gray_range};
CvHistogram * hist = cvCreateHist( 1, hist_size, CV_HIST_SPARSE, ranges,1);
for(int i=0;i<gray_src.width;i++){
for(int j=0;j<gray_src.height;j++){
//calculate entropy for pixel(i,j)
//1.set roi rect(9*9),handle edge pixel
CvRect roi;
int threshold=Max(0,i-4);
roi.x=threshold;
threshold=Max(0,j-4);
roi.y=threshold;
roi.width=(i-Max(0,i-4))+1+(Min(gray_src->width-1,i+4)-i);
roi.height=(j-Max(0,j-4))+1+(Min(gray_src->height-1,j+4)-j);
cvSetImageROI(const_cast<IplImage*>(gray_src),roi);
IplImage*gray_src_non_const=const_cast<IplImage*>(gray_src);
//2.calHist,here I chose CV_HIST_SPARSE to speed up
cvCalcHist( &gray_src_non_const, hist, 0, 0 );*/
cvNormalizeHist(hist,1.0);
float total=0;
float entroy=0; …Run Code Online (Sandbox Code Playgroud)