日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

图像中添加二项式分布噪声

發(fā)布時間:2025/4/16 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 图像中添加二项式分布噪声 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
clc,clear,close all warning off feature jit off im = imread('coloredChips.png'); Z0 = imnoise_B(im,size(im,1),size(im,2),0.5); Z1 = im2uint8(Z0); % 類型轉(zhuǎn)換 figure('color',[1,1,1]), im(:,:,1) = im(:,:,1) + Z1; % R im(:,:,2) = im(:,:,2) + Z1; % G im(:,:,3) = im(:,:,3) + Z1; % B subplot(121); imshow(im);title('加二項式分布噪聲圖像') subplot(122); imhist(Z1); title('加二項式分布噪聲圖像直方圖') function R = imnoise_B(im,M, N, b) % input: % 二項式B分布,噪聲的類型; % M,N:輸出噪聲圖像矩陣的大小 % a,b:各種噪聲的分布參數(shù) % output: % R: 輸出的噪聲圖像矩陣,數(shù)據(jù)類型為double型 % 設(shè)定默認(rèn)值 % 考慮第floor(a/2)次命中 if nargin < 4b = 0.5; end% 產(chǎn)生二項式分布噪聲for i = 1:Mfor j=1:Na = double( floor(im(i,j)/30)+1 );R(i,j) = nchoosek(a,floor(a/2)) * b.^(floor(a/2)) .* (1-b).^(a- floor(a/2));endend end

nchoosek?Binomial coefficient or all combinations

Syntax

?? C = nchoosek(n,k)

?? C = nchoosek(v,k)

Description

C = nchoosek(n,k) where n and k are nonnegative?integers, returns n!/((n–k)! k!).
This is the number of combinations of n things taken k at a time.

C = nchoosek(v,k), where v is a row vector of length n, creates a matrix whose rows consist of all possible combinations of the n elements of v?taken k at a time.

Matrix C contains n!/((n–k)! k!) rows and k columns.

Inputs n, k, and v support classes of float double and float single.

Examples

The command nchoosek(2:2:10,4) returns the even numbers from two to ten, taken four at a time:?

????? 2???? 4???? 6???? 8
???? 2???? 4???? 6??? 10
???? 2???? 4???? 8??? 10
???? 2???? 6???? 8??? 10
???? 4???? 6???? 8??? 10


總結(jié)

以上是生活随笔為你收集整理的图像中添加二项式分布噪声的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。