小编la *_*via的帖子

openCV中的小波变换

有人试图在opencv或C++中实现DWT吗?我看到关于这个主题的老帖子,我发现它们对我没用,因为我需要一个近似系数和细节作为小波变换的结果.

我试图将这个(http://wavelet2d.sourceforge.net/)添加到我的项目中,但它没有按计划运行.

这很简单,因为参数我需要近似系数和细节:

void haar1(float *vec, int n, int w)
{
int i=0;
float *vecp = new float[n];
for(i=0;i<n;i++)
    vecp[i] = 0;

    w/=2;
    for(i=0;i<w;i++)
    {
        vecp[i] = (vec[2*i] + vec[2*i+1])/sqrt(2.0);
        vecp[i+w] = (vec[2*i] - vec[2*i+1])/sqrt(2.0);
    }

    for(i=0;i<(w*2);i++)
            vec[i] = vecp[i];

        delete [] vecp;
}
void haar2(float **matrix, int rows, int cols)
{
    float *temp_row = new float[cols];
    float *temp_col = new float[rows];

    int i=0,j=0;
    int w = cols, h=rows;
while(w>1 || h>1)
{
    if(w>1)
    {
        for(i=0;i<h;i++)
        {
            for(j=0;j<cols;j++) …
Run Code Online (Sandbox Code Playgroud)

c++ opencv dwt haar-wavelet

18
推荐指数
2
解决办法
3万
查看次数

合并一个txt文件中所有子目录中的所有.txt文件

我想将我的目录(包含子目录)中的所有.txt文件的内容合并到一个txt文件中.我需要这样做:

xcopy text1.txt + text2.txt text3.txt
Run Code Online (Sandbox Code Playgroud)

但是在一个for循环中,它接受当前目录中的所有文本文件.我假设这样的事情:

for \r ___ in ___ do copy list.txt
Run Code Online (Sandbox Code Playgroud)

提前致谢.

merge text xcopy batch-file

5
推荐指数
1
解决办法
6287
查看次数

在批处理文件中连接字符串和数字

如何在for循环中连接数字和字符串?我试过这样但是它不起作用:

SET PATH=C:\file
FOR /L %%x IN (1,1,5) DO (
    SET "NUM=0%%x"
    SET VAR=%PATH%%NUM%
    ECHO %VAR%
)
Run Code Online (Sandbox Code Playgroud)

string for-loop concatenation batch-file

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

batch-file ×2

c++ ×1

concatenation ×1

dwt ×1

for-loop ×1

haar-wavelet ×1

merge ×1

opencv ×1

string ×1

text ×1

xcopy ×1