sp_distributionT_sp_distributionSpDistributionSpDistributionsp_distribution (算子)
名称
sp_distributionT_sp_distributionSpDistributionSpDistributionsp_distribution — 生成椒盐噪声分布。Sp:salt and pepper。
签名
描述
sp_distributionsp_distributionSpDistributionSpDistributionSpDistributionsp_distribution generates a noise distribution with the
values 0 and 255. The parameters PercentSaltPercentSaltPercentSaltPercentSaltpercentSaltpercent_salt and
PercentPepperPercentPepperPercentPepperPercentPepperpercentPepperpercent_pepper determine the percentage of white and black
noise pixels, respectively. The sum of these parameters must be
smaller than 100. Usually, the result DistributionDistributionDistributionDistributiondistributiondistribution is
used as input for the operator add_noise_distributionadd_noise_distributionAddNoiseDistributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
PercentSaltPercentSaltPercentSaltPercentSaltpercentSaltpercent_salt (输入控制) number → HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Percentage of salt (white noise pixels).
默认值:
5.0
建议值:
1.0, 2.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0
值范围:
0.0
≤
PercentSalt
PercentSalt
PercentSalt
PercentSalt
percentSalt
percent_salt
≤
100.0
最小增量:
0.1
建议增量:
1.0
限制:
PercentSalt + PercentPepper <= 100
PercentPepperPercentPepperPercentPepperPercentPepperpercentPepperpercent_pepper (输入控制) number → HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Percentage of pepper (black noise pixels).
默认值:
5.0
建议值:
1.0, 2.0, 5.0, 7.0, 10.0, 15.0, 20.0, 30.0
值范围:
0.0
≤
PercentPepper
PercentPepper
PercentPepper
PercentPepper
percentPepper
percent_pepper
≤
100.0
最小增量:
0.1
建议增量:
1.0
限制:
PercentSalt + PercentPepper <= 100
DistributionDistributionDistributionDistributiondistributiondistribution (输出控制) distribution.values-array → HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Resulting noise distribution.
元素数量:
513
示例(HDevelop)
read_image(Image,'fabrik')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
示例(C)
read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
create_tuple(&PerSalt,1);
set_d(PerSalt,30.0,0);
create_tuple(&PerPepper,1);
set_d(PerPepper,30.0,0);
T_sp_distribution(PerSalt,PerPepper,&Dist);
T_add_noise_distribution(Image,&ImageNoise,Dist);
disp_image(ImageNoise,WindowHandle);
示例(HDevelop)
read_image(Image,'fabrik')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
示例(HDevelop)
read_image(Image,'fabrik')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
示例(HDevelop)
read_image(Image,'fabrik')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
可能的后继
add_noise_distributionadd_noise_distributionAddNoiseDistributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution
替代
gauss_distributiongauss_distributionGaussDistributionGaussDistributionGaussDistributiongauss_distribution,
noise_distribution_meannoise_distribution_meanNoiseDistributionMeanNoiseDistributionMeanNoiseDistributionMeannoise_distribution_mean
另见
gauss_distributiongauss_distributionGaussDistributionGaussDistributionGaussDistributiongauss_distribution,
noise_distribution_meannoise_distribution_meanNoiseDistributionMeanNoiseDistributionMeanNoiseDistributionMeannoise_distribution_mean,
add_noise_whiteadd_noise_whiteAddNoiseWhiteAddNoiseWhiteAddNoiseWhiteadd_noise_white
模块
基础