均值濾波對高斯雜訊的效果

function FuShiPengZhangI=imread('C:\Users\user\Desktop\data\Gabor-5-80-0.5-0.5\2-5.jpg');%讀取映像 J=imnoise(I,'gaussian',0,0.005);%加入均值為0,方差為0.005的高斯雜訊 subplot(2,3,1);imshow(I);title('原始映像');subplot(2,3,2);imshow(J);title('加入高斯雜訊之後的映像');

輸入檔案路徑,則列印出檔案中的內容,每行列印出每個單詞

#include <fstream>#include <iostream>#include <vector>#include<string>using namespace std;istream& get(istream& in){ int ival; while(in >> ival, !in.eof()) {  if(in.bad())   throw runtime_error("IO stream

二維自適應維納濾波對高斯雜訊的濾除效果

function FuShiPengZhangI=imread('C:\Users\user\Desktop\data\Gabor-5-80-0.5-0.5\2-5.jpg'); %讀取映像 J=imnoise(I,'gaussian',0,0.005); %加入均值為0,方差為0.005的高斯雜訊 K1=wiener2(J,[3 3]); %對加噪映像進行二維自適應維納濾波 K2=wiener2(J,[5 5]); %對加噪映像進行二維自適應維納濾波 K3=wiener2(J,[7 7]);

【100題】String TO Int

#include <iostream>#include <limits>using namespace std;enum status{Valid = 0,Invalid};int g_status = Valid;int StrToInt(const char *str){g_status = Invalid;long long num = 0;if(str != NULL){const char *digit = str;//第一個字母是加減號嗎?bool

字元指標數組

 #include <iostream>#include <vector>#include <string>using namespace std;int main(){vector<string> svec;string str;cout << "enter strings :"<<endl;while(cin >> str){svec.push_back(str);}char **parr = new

分別使用二維統計濾波對椒鹽雜訊和高斯雜訊進行濾波

function FuShiPengZhangI=imread('C:\Users\user\Desktop\data\Gabor-1-120\2-1.jpg');J1=imnoise(I,'salt & pepper',0.004); subplot(2,3,1);imshow(I); title('原始映像'); subplot(2,3,2);imshow(J1);title('加椒鹽雜訊後的映像'); J= ordfilt2(J1,5,ones(3,4));%

Hanoi塔問題_經典

#include <iostream>using namespace std;//移動盤子,從A到Bvoid Move(int n,char A,char B){cout << "move " <<n<<" from "<<A<<" To " <<B<< endl;}//目的從A移動到B上去,過程中盤子要保持有序void Hanoi(int n,char A,char B,char

【STL】find的用法

#include <iostream>#include <algorithm>using namespace std;#define SIZE 100 int iarray[SIZE];int main() { iarray[20] = 50; int* ip = find(iarray, iarray + SIZE, 50); if (ip == iarray + SIZE) {cout << "50 not found in array"

【中科大洋筆試題】定義一個不能被繼承的類,並且只能執行個體化3個對象。

以下代碼是轉載的。覺得不錯。#include <iostream>using namespace std;class A{public : static A*GetInstance() { if(count<=0) { return NULL; } count--; return new A; } static void DeleteInstance(A* pInstance) {

itoa函數實現

//整形轉成字串函數實現//題目不難,重點考察面試者對問題考慮的全面程度#include <iostream>using namespace std;void itoa_mf(int num,char str[]){int sign = num;int i = 0;int j = 0;char temp[100];//如果是負數就去掉符號,將-1234轉成1234if(sign < 0){num = -num;}//轉成字串,1234轉成"4321"do{temp[i] =

輸出一個整數的所有因子

//求一個整數的所有因子~~#include <iostream>using namespace std;//判斷一個數是不是質數int isPrime(int a){int i;for(i=2; i<=a-1; ++i){if(a % i == 0){return 0;}}return 1;}//求因子void PrimeFactor(int n){int i;//如果是質數if(isPrime(n)){cout << n << endl;}else{

ZigZag變換_儲存版!

//ZigZag.cpp #include "Zigzag.h" void ZigZag(float *DCTMatrix,int width,int height,float *zigzagVector){int h = 1,v = 1;int vmin = 1,hmin = 1;int vmax = height, hmax = width;    //vertical, horizontalint i;memset(zigzagVector, 0, sizeof(float) *

atoi實現_字串中含有字母_處理的不好哎

#include <iostream>using namespace std;int isspace(int x){ if(x==' '||x=='/t'||x=='/n'||x=='/f'||x=='/b'||x=='/r'){return 1;} else {return 0;}}int isdigit(int x){ if(x<='9'&&x>='0') {return 1; } else {return 0;

【100題】兩個棧類比一個隊列

#include <iostream>#include <stack>#include <assert.h>using namespace std;template <typename T>class queue{public://入隊void push(T node){m1.push(node);}//出隊列void pop(){if(m2.empty()){while(!m1.empty()){m2.push(m1.top());m1.pop(

二級指標的申請與釋放

#include <iostream>using namespace std;class A{public:A(){cout << "建構函式";count++;cout <<count<<endl;}~A(){cout << "解構函式"<<count<<endl;count--;}private:int x;int y;static int count;};int A::count=0;void main()

atoi函數實現_buwanmei

//字串轉換成整數atoi函數的實現#include <iostream>#include <assert.h>using namespace std;int atoi_mf(char s[]){assert(s != NULL);int i = 0;int sum = 0;int sign;//跳過空格和定位字元while(' ' == s[i] || '\t' == s[i]){i++;}//檢測整數的符號sign = ('-'==s[i] ?

二分尋找——遞迴和非遞迴

#include <iostream>#include <assert.h>using namespace std;//二分尋找,非遞迴形式int binarySearch(int *a, int b, int e, int v) { assert(a != NULL); int *begin = a+b;int *end = a+e;int *mid; //異常處理 if (!a || b >= e) {return -1; }//折半尋找

迴文數_但程式中使用了strcpy和strlen

#include <iostream>#include <stdlib.h>#include <assert.h>#include <stdio.h>using namespace std;bool isPalindrome(char *input){assert(input != NULL);//定義緩衝char s[100];strcpy(s,input);//計算輸入字串的長度int length = strlen(input);//int

【面試題】冒泡排序&快速排序

#include <iostream>using namespace std;//改進後的冒泡排序,沒有交換則結束戰鬥!int BubbleSort(int R[] , int n){//int i, j;int tmp;int exchange;for(int i = 0; i < n-1; ++i){exchange = 0;for(int j = n-1; j > i; --j){if(R[j] < R[j-1]){tmp = R[j];R[j] = R[j-

把檔案中每一行存於vector的每個元素中

#include <iostream>#include <vector>#include <fstream>#include <string>using namespace std;/*把檔案中的每一行存於vector中的每個元素中*/int fileToVector(string fileName,vector<string>& svec){ ifstream

總頁數: 61357 1 .... 21099 21100 21101 21102 21103 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.