當前位置:首頁 » 操作系統 » 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,我只用過佳能和松下的,稍有差別,但差別不大,松下的似乎要大一些,可能佳能的演算法好點。
各個品牌的應該都差不太多。

熱點內容
java查 發布:2024-09-28 19:21:51 瀏覽:625
pythontimestr 發布:2024-09-28 19:07:30 瀏覽:866
山村詠懷的演算法 發布:2024-09-28 18:37:54 瀏覽:597
網上存儲空間哪家好 發布:2024-09-28 18:07:19 瀏覽:642
未公開演算法 發布:2024-09-28 18:02:02 瀏覽:359
如何知道優酷會員賬號和密碼 發布:2024-09-28 17:50:01 瀏覽:436
php當頁顯示 發布:2024-09-28 17:37:51 瀏覽:467
怎麼給安卓手機加小插件 發布:2024-09-28 17:01:08 瀏覽:801
微信sdkpython 發布:2024-09-28 16:57:36 瀏覽:753
系統配置如何設為默認 發布:2024-09-28 16:32:07 瀏覽:404