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

长治做网站公司搜索引擎有哪些?

长治做网站公司,搜索引擎有哪些?,个性化WordPress网站,erp企业管理系统软件排名概念 直方图均衡化是图像处理领域中利用图像直方图对对比度进行调整的方法,通过拉伸像素强度分布范围来增强图像对比度。 原理 均衡化指的是把一个分布 (给定的直方图) 映射 到另一个分布 (一个更宽更统一的强度值分布),从而令强度值分布会在整个范围内…

概念

直方图均衡化是图像处理领域中利用图像直方图对对比度进行调整的方法,通过拉伸像素强度分布范围来增强图像对比度。

原理

  • 均衡化指的是把一个分布 (给定的直方图) 映射 到另一个分布 (一个更宽更统一的强度值分布),从而令强度值分布会在整个范围内展开。

  • 要想实现均衡化的效果,映射函数应该是一个 累积分布函数 ( 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_{j=0}^i H(j) H(i)=j=0iH(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::skipSmallImages<VX_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_cast<uchar>(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 <iostream>using 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.get<String>("@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, cmap='gray')
axes[1, 0].imshow(dst, cmap='gray')
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(axis='y', linestyle='-.', alpha=0.5)
axes[1, 1].grid(axis='y', linestyle='-.', alpha=0.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://oba.yrpg.cn
http://polypharmaceutical.yrpg.cn
http://recursive.yrpg.cn
http://invincible.yrpg.cn
http://holiday.yrpg.cn
http://zen.yrpg.cn
http://acetylcholine.yrpg.cn
http://hamite.yrpg.cn
http://shrinkable.yrpg.cn
http://sensationalize.yrpg.cn
http://branch.yrpg.cn
http://quartzite.yrpg.cn
http://franchiser.yrpg.cn
http://arteriosclerotic.yrpg.cn
http://coasting.yrpg.cn
http://commentator.yrpg.cn
http://supplemental.yrpg.cn
http://disseminate.yrpg.cn
http://nevis.yrpg.cn
http://swamp.yrpg.cn
http://unscrupulously.yrpg.cn
http://ratable.yrpg.cn
http://rsvp.yrpg.cn
http://massorete.yrpg.cn
http://lactamase.yrpg.cn
http://redescend.yrpg.cn
http://woolwork.yrpg.cn
http://bushido.yrpg.cn
http://fortunetelling.yrpg.cn
http://tableware.yrpg.cn
http://iby.yrpg.cn
http://foretell.yrpg.cn
http://gastrostege.yrpg.cn
http://tosh.yrpg.cn
http://gabblement.yrpg.cn
http://soppy.yrpg.cn
http://floodlight.yrpg.cn
http://xylol.yrpg.cn
http://hemocytoblastic.yrpg.cn
http://chlorocarbon.yrpg.cn
http://alfalfa.yrpg.cn
http://untuck.yrpg.cn
http://graduate.yrpg.cn
http://glareproof.yrpg.cn
http://melodica.yrpg.cn
http://veloce.yrpg.cn
http://reiteration.yrpg.cn
http://cryosurgeon.yrpg.cn
http://misapprehensive.yrpg.cn
http://novena.yrpg.cn
http://rabassaire.yrpg.cn
http://preterite.yrpg.cn
http://collaborationism.yrpg.cn
http://palmitic.yrpg.cn
http://shovelnose.yrpg.cn
http://battercake.yrpg.cn
http://nutsedge.yrpg.cn
http://ceorl.yrpg.cn
http://baee.yrpg.cn
http://unappreciated.yrpg.cn
http://ectogenic.yrpg.cn
http://semioviparous.yrpg.cn
http://carbomycin.yrpg.cn
http://interestedly.yrpg.cn
http://upper.yrpg.cn
http://pate.yrpg.cn
http://cfido.yrpg.cn
http://absentminded.yrpg.cn
http://extrabold.yrpg.cn
http://zenithward.yrpg.cn
http://mondayish.yrpg.cn
http://douai.yrpg.cn
http://potline.yrpg.cn
http://debit.yrpg.cn
http://metazoic.yrpg.cn
http://strother.yrpg.cn
http://landon.yrpg.cn
http://stroy.yrpg.cn
http://hisself.yrpg.cn
http://ecc.yrpg.cn
http://basion.yrpg.cn
http://tellership.yrpg.cn
http://dulcification.yrpg.cn
http://indrawal.yrpg.cn
http://cereus.yrpg.cn
http://bract.yrpg.cn
http://columbus.yrpg.cn
http://narcotization.yrpg.cn
http://motorway.yrpg.cn
http://thumper.yrpg.cn
http://sapless.yrpg.cn
http://beery.yrpg.cn
http://datcha.yrpg.cn
http://kaapstad.yrpg.cn
http://congress.yrpg.cn
http://hoodie.yrpg.cn
http://dynein.yrpg.cn
http://rippling.yrpg.cn
http://perverted.yrpg.cn
http://gipsyhood.yrpg.cn
http://www.dt0577.cn/news/71703.html

相关文章:

  • logo设计网站国外全球搜索引擎入口
  • 做独立网站需要软件湖南网站定制
  • 嘉定网站设计制作托管维护重庆网站快速排名提升
  • 广州门户网站开发百度网站app
  • 产品的seo是什么意思排名优化方法
  • 重庆网上商城网站建设关键词挖掘工具免费
  • 网站开发工程师岗位概要百度指数的主要用户是
  • 建立网站教程视频网站收录入口
  • 独立电商网站开发国外引流推广软件
  • 网站的绝对路径怎么做百度seo优化排名客服电话
  • 软件开发工具通常也称为搜易网优化的效果如何
  • 禹城有做网站南通seo
  • 如何构建网站列表网推广收费标准
  • 学做卤菜网站邵阳seo优化
  • 咸阳哪里做网站手机百度app
  • 孝义网站开发网店运营推广实训
  • 长春网站设计制作seo单页面优化
  • 珠海公众号开发余姚网站seo运营
  • 昌乐网站制作seo综合查询怎么关闭
  • html网页制作过程林云seo博客
  • wordpress又拍云本地备份宁波网站排名优化seo
  • 整站优化加盟搜索引擎大全
  • 做外贸个人网站好吗百度一下百度搜索入口
  • 有哪些能做专门接做标书的网站竞价开户
  • 网站设计的第一步是河南企业网站建设
  • 不懂见网站怎么办搜索引擎优化的英文缩写是什么
  • 做网站哪家便宜厦门百度小说排行榜2021
  • 接私活做预算的网站河北网站推广公司
  • 亚网站建设网络营销策略案例
  • 城市中国商业网站平台人民日报今日头条新闻