一分钟了解"用matlab计算信杂比SCR 以及 背景区域的标准差"
来源:互联网 发布:淘宝人气值是什么 编辑:程序博客网 时间:2024/05/16 05:43
%求SCR和方差的方法
clear,clc,close all
imgName=input('请输入bmp文件名,要有单引号,要有后缀:');
img=imread(imgName);
figure,imshow(img,[])
leftupPointRow=input('请输入目标的左上角的行数(第二坐标):');
leftupPointCol=input('请输入目标的左上角的列数(第一坐标):');
clear,clc,close all
imgName=input('请输入bmp文件名,要有单引号,要有后缀:');
img=imread(imgName);
figure,imshow(img,[])
leftupPointRow=input('请输入目标的左上角的行数(第二坐标):');
leftupPointCol=input('请输入目标的左上角的列数(第一坐标):');
rightdownPointRow=input('请输入目标的右下角的行数(第二坐标):');
rightdownPointCol=input('请输入目标的右下角的列数(第一坐标):');
rightdownPointCol=input('请输入目标的右下角的列数(第一坐标):');
backgroundAreaWidth=10;
targetVector=img(leftupPointRow:rightdownPointRow,leftupPointCol:rightdownPointCol)
targetSize=size(targetVector);
targetVector=double( targetVector(:) );
targetSize=size(targetVector);
targetVector=double( targetVector(:) );
backgroundVector1=img(leftupPointRow-10:rightdownPointRow+10,leftupPointCol-backgroundAreaWidth:leftupPointCol-1)
backgroundVector2=img(leftupPointRow-10:rightdownPointRow+10,rightdownPointCol+1:rightdownPointCol+10)
backgroundVector3=img(leftupPointRow-10:leftupPointRow-1,leftupPointCol:rightdownPointCol)
backgroundVector4=img(rightdownPointRow+1:rightdownPointRow+10,leftupPointCol:rightdownPointCol)
backgroundVector=[backgroundVector1(:);backgroundVector2(:);backgroundVector3(:);backgroundVector4(:)];
backgroundVector=double(backgroundVector);
scr=(mean(targetVector)-mean(backgroundVector))/std(backgroundVector);
fprintf(['目标的尺寸是',num2str(targetSize(1)),'x',num2str(targetSize(2)),'\n']);
fprintf(['SCR=',num2str(scr),'\n']);
fprintf(['std(background)=',num2str(std(backgroundVector)),'\n']);
fprintf(['SCR=',num2str(scr),'\n']);
fprintf(['std(background)=',num2str(std(backgroundVector)),'\n']);
阅读全文
0 0
- 一分钟了解"用matlab计算信杂比SCR 以及 背景区域的标准差"
- 一分钟了解“Matlab直接求矩阵所有元素的标准差std2”
- 一分钟了解“Matlab的squeeze函数”
- matlab 计算图像的峰值信噪比PSNR以及均方根误差MSE
- 如何用matlab计算正态分布的标准差
- 一分钟了解"形容背景很复杂的英语词汇"
- 一分钟了解“Matlab矩阵 [~,a,b,c]的~是什么意思”
- 一分钟了解“Matlab中ismember函数的用法”
- 一分钟了解“Matlab抹去图像边界的无效像素”
- 一分钟了解“matlab的switch-case语句”
- 一分钟了解“matlab的警告语句warning”
- 一分钟了解“matlab把矩阵串联的cat函数”
- 一分钟了解“matlab产生不重复的随机数序列”
- 一分钟了解“matlab用矩阵写法代替for循环”
- matlab 计算均值,方差,标准差
- 一分钟了解"matlab用meshgrid实现for循环的遍历功能"
- 一分钟了解“matlab实现用对话框手选的方式打开文件”
- 一分钟了解“Matlab中求散度函数divergence”
- HDU 6096 String(2017 Multi-University Training Contest
- 小白学tkinter(tags(标签)的用法)
- 计算器(版本1)
- HashMap源码阅读
- u-boot
- 一分钟了解"用matlab计算信杂比SCR 以及 背景区域的标准差"
- 一行Spark代码的诞生记(深度剖析Spark架构)
- Matlab中数组元素引用——三种方法
- 20170811
- ACM-ICPC Asia Regional Contest HDU 5974 A Simple Math Problem(数论)
- Effective Modern C++翻译系列之Item2
- 【POJ1795】DNA Laboratory(状态压缩DP)
- Linux 小功能
- 最小方差生成树(最小生成树)