当前位置:首页 » 操作系统 » cannon算法

cannon算法

发布时间: 2022-04-12 06:46:34

① 佳能相机为什么显示屏好多噪点

jpg默认是经过相机处理器降噪处理的,佳能算法倾向于抹,特别是6d。另外同样iso400,暗处的噪点也比亮处多

② 佳能相机为什么raw格式有好多噪点。。。

JPG默认是经过相机处理器降噪处理的,佳能算法倾向于抹,特别是6D。另外同样ISO400,暗处的噪点也比亮处多

③ 谁能帮忙写一个用MPICH2和VC++写的一个矩阵乘法

很简单的啊
// MatrixMultiply.cpp : Defines the entry point for the console application.
//

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

class CMatrix
{
public:
CMatrix() : row(0), col(0), mat(NULL) {}
CMatrix(const CMatrix& rhs);
CMatrix(const CMatrix& rhs, // original matrix
int r, int c, // sub matrix start at row and col
int height, int width); // sub matrix height and width
CMatrix(int row, int col);
~CMatrix();

public:
CMatrix& operator=(const CMatrix& rhs);

public:
void Create(int r, int c);
void Clear();
int Get(int i, int j) const { return mat[i][j]; }
void Set(int i, int j, int val) { mat[i][j] = val; }
int GetRow() const { return row; }
int GetCol() const { return col; }

public:
void Input(istream& is);
void Print(ostream& os);

protected:
int row;
int col;
int** mat;
};

bool NormalMatrixMul(const CMatrix& A, const CMatrix& B, CMatrix& C);

bool MAdd(const CMatrix& A, const CMatrix& B, CMatrix& C);
bool MSub(const CMatrix& A, const CMatrix& B, CMatrix& C);
bool MMul(const CMatrix& A, const CMatrix& B, CMatrix& C);

CMatrix MatrixAdd(const CMatrix& A, const CMatrix& B);
CMatrix MatrixSub(const CMatrix& A, const CMatrix& B);
CMatrix MatrixMul(const CMatrix& A, const CMatrix& B);

//////////////////////////////////////////////////////////////////////
// main() fuction

int main(int argc, char* argv[])
{
CMatrix A, B, C;

ifstream ifs("Input.txt");
ofstream ofs("Output.txt");

// cout<< "Input Matrix A:"<< endl;
A.Input(ifs);
// cout<< "Input Matrix B:"<< endl;
B.Input(ifs);
ofs<< endl<< "Matrix A is:"<< endl;
A.Print(ofs);
ofs<< endl<< "Matrix B is:"<< endl;
B.Print(ofs);

C = MatrixMul(A, B);
ofs<< endl<< "Matrix C = A * B(Using Strassen Algorithm):"<< endl;
C.Print(ofs);

NormalMatrixMul(A, B, C);
ofs<< endl<< "Matrix C = A * B(Using Normal Algorithm):"<< endl;
C.Print(ofs);

return 0;
}

//////////////////////////////////////////////////////////////////////
// CMatrix implementation

CMatrix::CMatrix(const CMatrix& rhs)
{
mat = NULL;
Create(rhs.GetRow(), rhs.GetCol());
for(int i=0; i<row; ++i)
for(int j=0; j<col; ++j)
mat[i][j] = rhs.Get(i, j);
}

CMatrix::CMatrix(const CMatrix& rhs, int r, int c, int height, int width)
{
mat = NULL;
Create(height, width);
for(int i=0; i<height; ++i)
for(int j=0; j<width; ++j)
mat[i][j] = rhs.Get(r+i, c+j);
}

CMatrix::CMatrix(int row, int col)
{
mat = NULL;
Create(row, col);
}

CMatrix::~CMatrix()
{
Clear();
}

void CMatrix::Create(int r, int c)
{
Clear();
row = r;
col = c;
mat = new int*[row];
for(int i=0; i<row; ++i)
{
mat[i] = new int[col];
for(int j=0; j<col; ++j)
mat[i][j] = 0;
}
}

void CMatrix::Clear()
{
if(mat)
{
for(int i=0; i<row; ++i)
delete[] mat[i];
delete[] mat;
row = col = 0;
}
}

CMatrix& CMatrix::operator=(const CMatrix& rhs)
{
Clear();
row = rhs.GetRow();
col = rhs.GetCol();
Create(row, col);
for(int i=0; i<row; ++i)
for(int j=0; j<col; ++j)
mat[i][j] = rhs.Get(i, j);
return *this;
}

void CMatrix::Input(istream& is)
{
// cout<< "Input dimension of the matrix (row col):";
is>> row>> col;
Create(row, col);
// cout<< "Input elements values of the matrix:"<< endl;
for(int i=0; i<row; ++i)
{
// cout<< "Row["<< i+1<< "]"<< endl;
for(int j=0; j<col; ++j)
is>>mat[i][j];
}
}

void CMatrix::Print(ostream& os)
{
for(int i=0; i<row; ++i)
{
for(int j=0; j<col; ++j)
os<< setw(4)<< mat[i][j];
os<< endl;
}
}

//////////////////////////////////////////////////////////////////////
// Matrix calculating

CMatrix MatrixAdd(const CMatrix& A, const CMatrix& B)
{
CMatrix C;
MAdd(A, B, C);
return C;
}

CMatrix MatrixSub(const CMatrix& A, const CMatrix& B)
{
CMatrix C;
MSub(A, B, C);
return C;
}

CMatrix MatrixMul(const CMatrix& A, const CMatrix& B)
{
CMatrix C;
MMul(A, B, C);
return C;
}

bool MAdd(const CMatrix& A, const CMatrix& B, CMatrix& C)
{
int ra, ca, rb, cb;
ra = A.GetRow();
ca = A.GetCol();
rb = B.GetRow();
cb = B.GetCol();

if(ra!=rb || ca!=cb)
return false;

C.Create(ra, ca);

for(int i=0; i<ra; ++i)
{
for(int j=0; j<ca; ++j)
C.Set(i, j, A.Get(i,j)+B.Get(i,j));
}
return true;
}

bool MSub(const CMatrix& A, const CMatrix& B, CMatrix& C)
{
int ra, ca, rb, cb;
ra = A.GetRow();
ca = A.GetCol();
rb = B.GetRow();
cb = B.GetCol();

if(ra!=rb || ca!=cb)
return false;

C.Create(ra, ca);

for(int i=0; i<ra; ++i)
{
for(int j=0; j<ca; ++j)
C.Set(i, j, A.Get(i,j)-B.Get(i,j));
}
return true;
}

bool MMul(const CMatrix& A, const CMatrix& B, CMatrix& C) // Strassen Matrix Multiplication
{
int ra, ca, rb, cb;
ra = A.GetRow();
ca = A.GetCol();
rb = B.GetRow();
cb = B.GetCol();

if(ca!=rb)
return false;

if(ra<=2)
{
C.Create(ra, cb);
for(int i=0; i<ra; ++i)
for(int j=0; j<cb; ++j)
for(int k=0; k<ca; ++k)
C.Set(i, j, C.Get(i,j)+A.Get(i,k)*B.Get(k,j)); // C[i][j] += A[i][k]*B[k][j]
return true;
}

int midHA = ra/2;
int midWA = ca/2;
int midHB = midHA;
int midWB = cb/2;

CMatrix A11(A, 0, 0, midHA, midWA );
CMatrix A12(A, 0, midWA, midHA, ca-midWA);
CMatrix A21(A, midHA, 0, ra-midHA, midWA );
CMatrix A22(A, midHA, midHA, ra-midHA, ra-midWA);

CMatrix B11(B, 0, 0, midHB, midWB );
CMatrix B12(B, 0, midWB, midHB, ca-midWB);
CMatrix B21(B, midHB, 0, ra-midHB, midWB );
CMatrix B22(B, midHB, midHB, ra-midHB, ra-midWB);

CMatrix P, Q, R, S, T, U, V;

P = MatrixMul(MatrixAdd(A11, A22), MatrixAdd(B11, B22));
Q = MatrixMul(MatrixAdd(A21, A22), B11);
R = MatrixMul(A11, MatrixSub(B12, B22));
S = MatrixMul(A22, MatrixSub(B21, B11));
T = MatrixMul(MatrixAdd(A11, A12), B22);
U = MatrixMul(MatrixSub(A21, A11), MatrixAdd(B11, B12));
V = MatrixMul(MatrixSub(A12, A22), MatrixAdd(B21, B22));

CMatrix C11 = MatrixAdd(MatrixSub(MatrixAdd(P, S), T), V);
CMatrix C12 = MatrixAdd(R, T);
CMatrix C21 = MatrixAdd(Q, S);
CMatrix C22 = MatrixAdd(MatrixSub(MatrixAdd(P, R), Q), U);

int rc11=C11.GetRow(), cc11=C11.GetCol();
int rc12=C12.GetRow(), cc12=C12.GetCol();
int rc21=C21.GetRow(), cc21=C21.GetCol();
int rc22=C22.GetRow(), cc22=C22.GetCol();

C.Create(ra, cb);
int i, j;
for(i=0; i<rc11; ++i)
for(j=0; j<cc11; ++j)
C.Set(i, j, C11.Get(i, j));
for(i=0; i<rc12; ++i)
for(j=0; j<cc12; ++j)
C.Set(i, j+cc11, C12.Get(i, j));
for(i=0; i<rc21; ++i)
for(j=0; j<cc21; ++j)
C.Set(i+rc11, j, C21.Get(i, j));
for(i=0; i<rc22; ++i)
for(j=0; j<cc22; ++j)
C.Set(i+rc11, j+cc21, C22.Get(i, j));

return true;
}

bool NormalMatrixMul(const CMatrix& A, const CMatrix& B, CMatrix& C)
{
int ra=A.GetRow(), ca=A.GetCol();
int rb=B.GetRow(), cb=B.GetCol();

if(ca!=rb)
return false;

C.Create(ra, cb);

for(int i=0; i<ra; ++i)
for(int j=0; j<cb; ++j)
for(int k=0; k<ca; ++k)
C.Set(i, j, C.Get(i,j)+A.Get(i,k)*B.Get(k,j)); // C[i][j] += A[i][k]*B[k][j]

return true;
}

④ 求一个mpi并行的矩阵乘法VC++程序

希望以下程序会对你有帮助
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "mpi.h"

#define VERSION "0.1"

void usage(char * argv)
{
printf("Usage: %s [-h] [-V] \n\t\t[-m matrix_input_file] [-v vector_input_file]\n", argv);
exit(0);
}

void show_version()
{
printf("matrix_plus_vector v%s icymoon@NKU\n", VERSION);
exit(0);
}

void my_exit(char * msg, int quit)
{
printf("%s\n", msg);
exit(quit);
}

void record(int * result, int row_num)
{
int i;
printf("==================================================\nThe result is:\n");
for(i = 0; i < row_num; i ++)
printf("%d\n", result[i]);
}

int main(int argc, char * argv[])
{
int opt,rank, size, row, col, i,j, k;
char * mfile = NULL;
char * vfile = NULL;
FILE * matrix_file;
FILE * vector_file;
int * rows; //temp buffer for the row of matrix.
int sum;
int flag = 0;
MPI_Status status;
MPI_Request request;
//get options from command line
while((opt = getopt(argc, argv, "hVm:v:")) != EOF)
{
switch(opt)
{
case 'h':
usage(argv[0]);
break;
case 'V':
show_version();
break;
case 'm':
mfile = optarg;
break;
case 'v':
vfile = optarg;
break;
default:
usage(argv[0]);
break;
}
}

//check input files mfile & vfile
if(mfile == NULL || vfile == NULL)
my_exit("Invalid input file(s)!", 100);
if((matrix_file = fopen(mfile, "r")) == NULL)
my_exit("Can't open matrix file!", 101);
if((vector_file = fopen(vfile, "r")) == NULL)
my_exit("Can't open vector file!", 101);

//MPI initialization
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank); //rank -- process ID
MPI_Comm_size(MPI_COMM_WORLD, &size); //size -- total of processes

if(rank == 0)
{
char buf[1024];
char * tmp_col;

fclose(vector_file);
//Broadcast, inputdata error
if(fgets(buf, 1024, matrix_file)==NULL)
{
flag = -1;
printf("Invalid matrix input file!\n");
fclose(matrix_file);
exit(0);
}
else
{
tmp_col = strstr(buf, " ");
*tmp_col = '\0';
row = atoi(buf);
col = atoi(tmp_col + 1);
printf("%d rows %d colums\n", row, col);
if(row <= 0 || col <= 0)
{
flag = -1;
printf("Invalid matrix input file!\n");
fclose(matrix_file);
exit(0);
}
else
flag = 1;
// MPI_Barrier(MPI_COMM_WORLD);
}
}

MPI_Bcast(&flag, 1, MPI_INT, 0, MPI_COMM_WORLD);
if(flag < 0)
{
MPI_Finalize();
my_exit("All the processes were terminated!", 254);
}

MPI_Bcast(&col, 1, MPI_INT, 0, MPI_COMM_WORLD);
MPI_Bcast(&row, 1, MPI_INT, 0, MPI_COMM_WORLD);

MPI_Barrier(MPI_COMM_WORLD);

if(rank == 0)
{
char buf[1024];
int * result = (int*)malloc(sizeof(int)*row);
rows = (int*)malloc(sizeof(int)*col);
if(rows == NULL)
{
MPI_Finalize();
my_exit("malloc error!", 254);
}

if(row <= (size-1))
{
int slave_process = 1;
while(fgets(buf, 1024, matrix_file) != NULL)
{
char * get_row;
char * head = buf;
//initiate every row of the matrix
for(j = 0; j < col - 1; j ++)
{
get_row = strstr(head, " ");
*get_row = '\0';
rows[j] = atoi(head);
printf("%d ", rows[j]);
head = get_row + 1;
}
rows[j] = atoi(head);
printf("%d\n", rows[j]);
//send the data to slave processes.
MPI_Isend(rows, col, MPI_INT, slave_process, 0, MPI_COMM_WORLD, &request);
slave_process++;
}
//gather the result
for(j = 0; j < row; j ++)
MPI_Recv(&result[j], 1, MPI_INT, j+1, 0, MPI_COMM_WORLD, &status);
record(result, row);
}
else
{
int steps = row/(size-1);
for(i = 1; i <= steps; i ++)
{
for(k = 1; k <= (size-1); k ++)
{
if(fgets(buf, 1024, matrix_file) != NULL)
{
char * get_row;
char * head = buf;
//initiate every row of the matrix
for(j = 0; j < col - 1; j ++)
{
get_row = strstr(head, " ");
*get_row = '\0';
rows[j] = atoi(head);
printf("%d ", rows[j]);
head = get_row + 1;
}
rows[j] = atoi(head);
printf("%d\n", rows[j]);
//send the data to slave processes.
MPI_Isend(rows, col, MPI_INT, k, 0, MPI_COMM_WORLD, &request);
}
}
for(j = 0; j < (size-1); j ++)
{
MPI_Recv(&result[j+(i-1)*(size-1)], 1, MPI_INT, j+1, 0, MPI_COMM_WORLD, &status);
}
}

for(i = 1; i <= row-steps*(size-1); i ++)
{
if(fgets(buf, 1024, matrix_file) != NULL)
{
char * get_row;
char * head = buf;
//initiate every row of the matrix
for(j = 0; j < col - 1; j ++)
{
get_row = strstr(head, " ");
*get_row = '\0';
rows[j] = atoi(head);
printf("%d ", rows[j]);
head = get_row + 1;
}
rows[j] = atoi(head);
printf("%d\n", rows[j]);
//send the data to slave processes.
MPI_Isend(rows, col, MPI_INT, i, 0, MPI_COMM_WORLD, &request);
}
}
for(j = 0; j < row-steps*(size-1); j ++)
{
MPI_Recv(&result[j+steps*(size-1)], 1, MPI_INT, j+1, 0, MPI_COMM_WORLD, &status);
}
record(result, row);
}
free(rows);
}
else
{//slave processes
char buf[32];
sum = 0;
int * line; //buffer to save the vector;
//initiate the vector
line= (int *)malloc(sizeof(int) * col);

for(i = 0; i < col; i ++)
{
if(fgets(buf, 32, vector_file) != NULL)
line[i] = atoi(buf);
}

rows = (int *)malloc(sizeof(int) * col);
if(row <= (size - 1))
{
MPI_Recv(rows, col, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
for(i = 0; i < col; i ++)
sum += rows[i] * line[i];

MPI_Send(&sum, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
else
{
int steps = row/(size - 1);
for(j = 1; j <= steps; j ++)
{
sum = 0;
MPI_Recv(rows, col, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
for(i = 0; i < col; i ++)
sum += rows[i] * line[i];
MPI_Send(&sum, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
if(rank <=(row - steps*(size-1)))
{
sum = 0;
MPI_Recv(rows, col, MPI_INT, 0, 0, MPI_COMM_WORLD, &status);
for(i = 0; i < col; i ++)
sum += rows[i] * line[i];
MPI_Send(&sum, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
}
}

free(line);
}
MPI_Finalize();
return 1;
}

⑤ 佳能5d3后期暗部偏绿正常吗

佳能竟然也有这情况。一般暗部偏绿是正常的,因为暗部光信号不足,导致机器猜色的时候出错,而马赛克阵列里面绿色占一半,所以很容易偏绿,但我记得佳能算法比较先进,不容易出现这情况的

⑥ 请问佳能相机的文件夹编号是怎么个算法的呢,如canon188是什么意思

8800如果没有清零的情况是下应该是代表佳能的快门实际次数

⑦ 尼康D7100怎样设置白平衡,才能拍出佳能那样白里透红的肤色

对于RAW格式图片,佳能尼康都一样。而对于JPG格式图像尼康相机是不可能调出佳能的色彩的,这是不同品牌相机的图像转换的算法不同造成的,与白平衡无关。尼康的算法偏灰、偏黄,而佳能的算法偏红。对于色彩的真实还原,尼康比佳能更精准,而佳能更接近人眼。
JPG直出的话,拍人像D7100的优化校准建议设置为人像模式,拍风景或扫街建议为鲜艳模式。如果对色彩还不满意,可以微调一下优化校准。

⑧ 用MPI来实现并行矩阵乘Cannon算法的程序

我是在linux上运行的,在windows上应该也行

⑨ ae特效里cannon是什么意思

Simuation
Particle Playground——是“粒子场”,也就是 After Effects中的粒子效果。粒子在后期制作中的应用十分广泛,是高级后期制作软件的标志。可以用粒子系统来模拟雨雪、火和矩阵文字等。
1)Cannon控制项,用于设置粒子发射器:
Position用于定位粒于发射器;
Particles Per Second每秒产生粒子数目;
Direction粒子方向。
Direction Random Spread方向随机性;
Velocity 初始速度;
Velocity Random Spread速度随机性;
Color粒子颜色;
Particle Radius粒子半径;
2)Gird控制项,在每个网格的节点处产生新粒子,用于产生一个均匀的粒子面,产生的粒子不存在速度问题,完全由重力、斥力墙和属性映射来控制。默认的设置,由于重力打开,所以都向下运动。
Position用于确定网格中心的位置;
Width网格宽度。
Height网格高度。
Particles Across确定水平方向上产生的粒子数,默认的情况为0,所以看不到粒子;
Particies Down确定垂直方向上产生的粒子数;
Color粒子颜色。
Particie Radius粒子半径。
注意:默认的情况下,使用Cannon产生粒子,如果要使用Gird,则需要将 Cannon中的Particle Per Second设为0,同时设置适当的Particles Across/Down的数值。
3)Layer Exploder控制项,用于设置层爆破,从而分裂一个层作为粒子。我们经常可以看到把一个画面粉碎成小块,同时可以模拟烟火和增加粒子数量。
Layer Explode设置应用粒子的层;
Radius of New Particles新产生粒子半径;
Velocity Dispersion速度分布;
4)Particle Exploder选择项,用于对粒子场应用爆破效果
Radius of New Particles新产生粒子半径。
Velocity Dispersion速度分布。
Affects对粒子场影响,必须应用本属性才能应用于一个粒子集;
5)Layer Map控制项,用新的物件代替由 Cannon、 Gird和Layer/Particle Exploder产生的粒子。
Use Layer用于指定作为映射的层;
Time offset Type时间位移类型;
Affects影响属性;
6)Gravity控制项,用于设置重力场:
Force重力大小;
Force Random Spread重力随机性;
Direction重力方向;
Affects影响属性;
7)Repel选择项,设置斥力:
Force斥力大小;
Force Radius斥力半径;
Repller斥力控制器;
Affects影响属性;
8)Wall选择项,设置墙属性:
Boundary选择封闭遮罩作为边界;
Affects影响属性;
9)Persistent Property Mapper选择项,用于指定持久的属性映射器。
Use Layer As Map选择一个层修改粒子属性;
Affects影响属性;
Map Red/Green/Blue to映射粒子的 RGB通道的算法;
Min/Max指定最小/最大变化范围;
10)Ephemeral Property Mapper选择项,用于指定暂时属性映射器,其中的子属性和上面持久的属性映射器相同。总之,我们可以用After Effects的粒子场来产生很多的纷乱复杂的事物,通过替换粒子映射,也就是说粒子是由其它物件构成,产生不同的效果。

⑩ 佳能raw文件标准大小是多大

这个不一定,和所照的场景有关系,大概的说,1000万像素的照片大约10m,我只用过佳能和松下的,稍有差别,但差别不大,松下的似乎要大一些,可能佳能的算法好点。
各个品牌的应该都差不太多。

热点内容
怎么给安卓手机加小插件 发布:2024-09-28 17:01:08 浏览:798
微信sdkpython 发布:2024-09-28 16:57:36 浏览:750
系统配置如何设为默认 发布:2024-09-28 16:32:07 浏览:402
不用审核的我的世界宝可梦服务器 发布:2024-09-28 16:12:11 浏览:110
mc服务器怎么刷钱 发布:2024-09-28 16:07:53 浏览:532
c语言棱形 发布:2024-09-28 16:02:46 浏览:4
宽带账号密码有什么用呢 发布:2024-09-28 15:49:31 浏览:667
内置脚本属于什么 发布:2024-09-28 15:45:19 浏览:688
哈啰单车编号怎么查是什么配置的 发布:2024-09-28 15:35:13 浏览:353
wifi管家在哪里改密码 发布:2024-09-28 15:34:18 浏览:834