当前位置: 首页 > news >正文

app定制开发网站有哪些阳网站建设

app定制开发网站有哪些,阳网站建设,wordpress那个版本好,模板 网站 教程概念 直方图均衡化是图像处理领域中利用图像直方图对对比度进行调整的方法#xff0c;通过拉伸像素强度分布范围来增强图像对比度。 原理 均衡化指的是把一个分布 (给定的直方图) 映射 到另一个分布 (一个更宽更统一的强度值分布)#xff0c;从而令强度值分布会在整个范围内…概念 直方图均衡化是图像处理领域中利用图像直方图对对比度进行调整的方法通过拉伸像素强度分布范围来增强图像对比度。 原理 均衡化指的是把一个分布 (给定的直方图) 映射 到另一个分布 (一个更宽更统一的强度值分布)从而令强度值分布会在整个范围内展开。 要想实现均衡化的效果映射函数应该是一个 累积分布函数 ( cumulative distribution function, cdf ) 。对于直方图 H ( i ) H(i) H(i)它的累积分布函数 H ′ ( i ) H^{}(i) H′(i) H ′ ( i ) ∑ j 0 i H ( j ) H^{}(i) \sum_{j0}^i H(j) H′(i)∑j0i​H(j) 要使用其作为映射函数我们必须对最大值为255 (或者用图像的最大强度值) 的累积分布 H ′ ( i ) H^{}(i) H′(i) 进行归一化。 最后我们使用一个简单的映射过程来获得均衡化后像素的强度值假设原图为 I ( x , y ) I(x,y) I(x,y)均衡化后像素强度值 I ′ ( x , y ) I^{}(x,y) I′(x,y) I ′ ( x , y ) H ′ ( I ( x , y ) ) I^{}(x,y) H^{}(I(x,y)) I′(x,y)H′(I(x,y)) 代码实现 以 OpenCV 为例其直方图均衡化函数为 equalizeHist()代码实现如下 /** brief Equalizes the histogram of a grayscale image.The function equalizes the histogram of the input image using the following algorithm:- Calculate the histogram \f$H\f$ for src . - Normalize the histogram so that the sum of histogram bins is 255. - Compute the integral of the histogram: \f[H_i \sum _{0 \le j i} H(j)\f] - Transform the image using \f$H\f$ as a look-up table: \f$\texttt{dst}(x,y) H(\texttt{src}(x,y))\f$The algorithm normalizes the brightness and increases the contrast of the image.param src Source 8-bit single channel image. param dst Destination image of the same size and type as src .*/ CV_EXPORTS_W void equalizeHist( InputArray src, OutputArray dst );void cv::equalizeHist( InputArray _src, OutputArray _dst ) {CV_INSTRUMENT_REGION();CV_Assert( _src.type() CV_8UC1 );if (_src.empty())return;CV_OCL_RUN(_src.dims() 2 _dst.isUMat(),ocl_equalizeHist(_src, _dst))Mat src _src.getMat();_dst.create( src.size(), src.type() );Mat dst _dst.getMat();CV_OVX_RUN(!ovx::skipSmallImagesVX_KERNEL_EQUALIZE_HISTOGRAM(src.cols, src.rows),openvx_equalize_hist(src, dst))CALL_HAL(equalizeHist, cv_hal_equalize_hist, src.data, src.step, dst.data, dst.step, src.cols, src.rows);Mutex histogramLockInstance;const int hist_sz EqualizeHistCalcHist_Invoker::HIST_SZ;int hist[hist_sz] {0,};int lut[hist_sz];EqualizeHistCalcHist_Invoker calcBody(src, hist, histogramLockInstance);EqualizeHistLut_Invoker lutBody(src, dst, lut);cv::Range heightRange(0, src.rows);if(EqualizeHistCalcHist_Invoker::isWorthParallel(src))parallel_for_(heightRange, calcBody);elsecalcBody(heightRange);int i 0;while (!hist[i]) i;int total (int)src.total();if (hist[i] total){dst.setTo(i);return;}float scale (hist_sz - 1.f)/(total - hist[i]);int sum 0;for (lut[i] 0; i hist_sz; i){sum hist[i];lut[i] saturate_castuchar(sum * scale);}if(EqualizeHistLut_Invoker::isWorthParallel(src))parallel_for_(heightRange, lutBody);elselutBody(heightRange); }应用举例 C 代码如下 #include opencv2/imgcodecs.hpp #include opencv2/highgui.hpp #include opencv2/imgproc.hpp #include iostreamusing namespace cv; using std::cout; using std::endl;int main(int argc, char** argv) {CommandLineParser parser(argc, argv, {input | wukong.png | input image});Mat src imread(samples::findFile(parser.getString(input)), IMREAD_COLOR);if (src.empty()){cout Could not open or find the image!\n endl;cout Usage: argv[0] Input image endl;return EXIT_FAILURE;}// 转换为灰度图像cvtColor(src, src, COLOR_BGR2GRAY);Mat dst;// 直方图均衡化equalizeHist(src, dst);imshow(Source image, src);imshow(Equalized Image, dst);waitKey();return EXIT_SUCCESS;}Python 代码如下 import cv2 import matplotlib.pyplot as plt# 读取图像 img cv2.imread(../data/wukong.png, cv2.IMREAD_COLOR) # 转换为灰度图 src cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 直方图均衡化 dst cv2.equalizeHist(src) # 显示原图和均衡化后的图 fig, axes plt.subplots(2, 2, figsize(18, 9)) axes[0, 0].imshow(src, cmapgray) axes[1, 0].imshow(dst, cmapgray) axes[0, 1].hist(src.ravel(), 256, [0, 256], color#fc8403) axes[1, 1].hist(dst.ravel(), 256, [0, 256], color#fc8403) # 显示直方图网格 axes[0, 1].grid(axisy, linestyle-., alpha0.5) axes[1, 1].grid(axisy, linestyle-., alpha0.5) # 设置标题 axes[0, 0].set_title(Original Image) axes[1, 0].set_title(Equalized Image) axes[0, 1].set_title(Histogram of Original Image) axes[1, 1].set_title(Histogram of Equalized Image) # 显示图表 plt.show()
http://www.hkea.cn/news/14320115/

相关文章:

  • 站长之家域名解析镇江网页
  • 常见c2c网站有哪些新手网站
  • 潍坊昌乐县城乡建设局网站南通seo网站诊断
  • zhi做网站深圳营销型网站建设-龙华信科
  • 个人网站备案名字重要吗网架公司办公室规章制度范本
  • app自助建站西安seo培训学校
  • 领秀网站建设wordpress生成原生app
  • 做自己的博客网站wordpress 防伪系统
  • 台州地区网站建设福州网站定制设计
  • 高端网站开发公司有哪些域名地址查询网
  • 广州企业模板建站wordpress meta 插件
  • 云匠网投诉电话网站页面结构怎么做有利于优化
  • 新建网站网络空间大连响应式网站
  • 高端网站建设kgu做特卖的网站怎么赚钱
  • 温州做网站哪里好济南室内设计学校
  • 网站建设中html模板浙江建设工程造价信息网站
  • 建网站要多少钱 东莞建设企业网站官方登录
  • 做一款app需要网站吗建筑公司资质甲级乙级
  • app网站建设开发那些网站需要备案
  • 网站建设公司正规吗python配合wordpress
  • 做耳鼻喉医院网站多少钱WordPress 长文 阅读
  • ps网站交互设计网站优化我自己可以做吗
  • 安康市建设局网站网站开发实战项目
  • 如何做物流网站笑话网站开发
  • 网站服务器排行榜泸州网站开发
  • 网站建设做得好名词解释 网站规划
  • 企业门户网站 意义东莞大岭山镇
  • 下载软件的网站网站一般用什么语言做
  • 校园网子网站建设管理意见或策划智能手机app开发
  • 网站建设报价word文档我做动作你来猜的网站