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

电商需要投资多少钱搜索引擎优化的技巧有哪些

电商需要投资多少钱,搜索引擎优化的技巧有哪些,制作平台app,网易网页版梦幻西游两者都是只对单通道使用,对多通道的话 就需要分离通道处理再合并通道 两种方法,第一个要运算次数太多了,第二个只需要查表 伽马矫正函数,这里用第二种方法,且写法有点高级 int gammaCorrection(cv::Mat srcMat, cv::…

两者都是只对单通道使用,对多通道的话 就需要分离通道处理再合并通道

 两种方法,第一个要运算次数太多了,第二个只需要查表

伽马矫正函数,这里用第二种方法,且写法有点高级

int gammaCorrection(cv::Mat srcMat, cv::Mat& dstMat, float gamma) {//建立查询表unsigned char lut[256];for (int i = 0; i < 256; i++){//saturate_cast,防止像素值溢出,如果值<0,则返回0,如果大于255,则返回255lut[i] = saturate_cast<uchar>(pow((float)(i / 255.0f), gamma) * 255.0f);}srcMat.copyTo(dstMat);MatIterator_<uchar> it, end;for (it = dstMat.begin<uchar>(), end = dstMat.end<uchar>(); it != end; it++) {*it = lut[(*it)];}return 0;}

就是建立了查找表,然后计算查找表,再遍历像素直接赋值查找表,就不用计算了。

	int readType = 0;Mat srcMat = imread("kjy.jpg");resize(srcMat, srcMat,Size(srcMat.rows*0.5, srcMat.rows * 0.5));cv::Mat dstMat;float gamma = GAMMA_FACTOR;if (srcMat.type() == CV_8UC1){gammaCorrection(srcMat, dstMat, gamma);}else {Mat channel[3];Mat out[3];float hist[3][256];//通道分离split(srcMat, channel);for (int i = 0; i < 3; i++) {gammaCorrection(channel[i], out[i], gamma);}merge(out, 3, dstMat);}imshow("src", srcMat);imshow("dst", dstMat);waitKey(0);destroyAllWindows();

这就是grammar矫正的代码

直方图均衡化(只对单通道有效果)多通道的话先分离通道再合并一样的

equalizeHist(srcMat, equalizeHistMat);

 

计算直方图函数


int calcIntenHist(const cv::Mat src, float* dstHist)
{//输入必为单通道图if (src.type() != CV_8UC1) {return -1;}memset(dstHist, 0, sizeof(float) * 256);int height = src.rows;int width = src.cols;//指针遍历for (int k = 0; k < height; k++){// 获取第k行的首地址const uchar* inData = src.ptr<uchar>(k);//处理每个像素for (int i = 0; i < width; i++){int gray = inData[i];dstHist[gray]++;}}//直方图归一化float norm = height * width;for (int n = 0; n < 256; n++) {dstHist[n] = dstHist[n] / norm;}return 0;
}

 还进行了归一化

直方图画画函数


int drawIntenHist(cv::Mat& histMat, float* srcHist, int bin_width, int bin_heght)
{histMat.create(bin_heght, 256 * bin_width, CV_8UC3);histMat = Scalar(255, 255, 255);float maxVal = *std::max_element(srcHist, srcHist + 256);for (int i = 0; i < 256; i++) {Rect binRect;binRect.x = i * bin_width;float height_i = (float)bin_heght * srcHist[i] / maxVal;binRect.height = (int)height_i;binRect.y = bin_heght - binRect.height;binRect.width = bin_width;rectangle(histMat, binRect, CV_RGB(255, 0, 0), -1);}return 0;
}

 float height_i = (float)bin_heght * srcHist[i] / maxVal;是防止不够高度大小 要进行的高度归一

直方图均衡化的完整代码:

	float srcHist[256];float dstHist[256];Mat dstHistMat;Mat srcHistMat;Mat histMat[3];Mat equalizeHistMat;cv::Mat dstMat1;int bin_width = 2;int bin_heigth = 100;if (srcMat.type() == CV_8UC1) {equalizeHist(srcMat, equalizeHistMat);imshow("src", srcMat);imshow("equalizeHistMat", equalizeHistMat);waitKey(0);destroyAllWindows();calcIntenHist(dstMat1, dstHist);drawIntenHist(dstHistMat, dstHist, 3, 100);imshow("dstMat hist", dstHistMat);calcIntenHist(srcMat, srcHist);drawIntenHist(srcHistMat, srcHist, 3, 100);imshow("srcMat hist", srcHistMat);waitKey(0);destroyAllWindows();}else{Mat channel[3];Mat out[3];float hist[3][256];split(srcMat, channel);for (int i = 0; i < 3; i++) {equalizeHist(channel[i], out[i]);calcIntenHist(out[i], hist[i]);drawIntenHist(histMat[i], hist[i], bin_width, bin_heigth);//按照channel编号命名窗口stringstream ss;ss << i;string histWindow = "Hist of chanel " + ss.str();string matWindow = "Image of chanel " + ss.str();imshow(histWindow, histMat[i]);imshow(matWindow, out[i]);}merge(out, 3, dstMat1);cv::Mat grayMat;cv::Mat graydstMat;cvtColor(srcMat, grayMat, CV_BGR2GRAY);cvtColor(dstMat1, graydstMat, CV_BGR2GRAY);//计算并绘制直方图calcIntenHist(graydstMat, dstHist);drawIntenHist(dstHistMat, dstHist, 3, 100);imshow("dstMat", dstMat1);imshow("dstMat hist", dstHistMat);calcIntenHist(grayMat, srcHist);drawIntenHist(srcHistMat, srcHist, 3, 100);imshow("srcMat hist", srcHistMat);imshow("srcMat", srcMat);waitKey(0);destroyAllWindows();}return 0;}


文章转载自:
http://zygosporic.hkpn.cn
http://allpowerful.hkpn.cn
http://tinworks.hkpn.cn
http://stye.hkpn.cn
http://seastrand.hkpn.cn
http://spiroplasma.hkpn.cn
http://spatterdash.hkpn.cn
http://cingulum.hkpn.cn
http://laparotomize.hkpn.cn
http://initiatress.hkpn.cn
http://ustulate.hkpn.cn
http://oldie.hkpn.cn
http://podophyllum.hkpn.cn
http://boobery.hkpn.cn
http://dicyandiamide.hkpn.cn
http://interior.hkpn.cn
http://microhabitat.hkpn.cn
http://cyclopaedia.hkpn.cn
http://reassert.hkpn.cn
http://exogamy.hkpn.cn
http://benignant.hkpn.cn
http://palliation.hkpn.cn
http://anticaries.hkpn.cn
http://depose.hkpn.cn
http://gentlehood.hkpn.cn
http://raucous.hkpn.cn
http://intermolecular.hkpn.cn
http://hypothecate.hkpn.cn
http://moonstone.hkpn.cn
http://gimbals.hkpn.cn
http://clapnet.hkpn.cn
http://descrier.hkpn.cn
http://notehead.hkpn.cn
http://glioma.hkpn.cn
http://nonaggression.hkpn.cn
http://unprojected.hkpn.cn
http://simazine.hkpn.cn
http://anaphoric.hkpn.cn
http://gendarmerie.hkpn.cn
http://synthetase.hkpn.cn
http://grammatical.hkpn.cn
http://composition.hkpn.cn
http://cautious.hkpn.cn
http://lallan.hkpn.cn
http://plastogamy.hkpn.cn
http://brahmanic.hkpn.cn
http://fludrocortisone.hkpn.cn
http://colobus.hkpn.cn
http://hypoglycemic.hkpn.cn
http://nagual.hkpn.cn
http://coleopteron.hkpn.cn
http://nightshade.hkpn.cn
http://ata.hkpn.cn
http://macabre.hkpn.cn
http://shako.hkpn.cn
http://paragraphic.hkpn.cn
http://diosmose.hkpn.cn
http://trigonometry.hkpn.cn
http://candlepin.hkpn.cn
http://scald.hkpn.cn
http://gwtw.hkpn.cn
http://argy.hkpn.cn
http://globalize.hkpn.cn
http://intrastate.hkpn.cn
http://unisonous.hkpn.cn
http://surah.hkpn.cn
http://stealth.hkpn.cn
http://virescent.hkpn.cn
http://extrafloral.hkpn.cn
http://columba.hkpn.cn
http://nesistor.hkpn.cn
http://twosome.hkpn.cn
http://montmorillonite.hkpn.cn
http://glassify.hkpn.cn
http://bpd.hkpn.cn
http://penstock.hkpn.cn
http://unlikely.hkpn.cn
http://savor.hkpn.cn
http://innocency.hkpn.cn
http://lineage.hkpn.cn
http://jactancy.hkpn.cn
http://hieratic.hkpn.cn
http://eggplant.hkpn.cn
http://evanish.hkpn.cn
http://drudgingly.hkpn.cn
http://unquestionably.hkpn.cn
http://sociogenetic.hkpn.cn
http://thrombocytosis.hkpn.cn
http://ratguard.hkpn.cn
http://slowpaced.hkpn.cn
http://verve.hkpn.cn
http://poh.hkpn.cn
http://nonprofit.hkpn.cn
http://prothetely.hkpn.cn
http://undeclared.hkpn.cn
http://humble.hkpn.cn
http://scivvy.hkpn.cn
http://relumine.hkpn.cn
http://reprobance.hkpn.cn
http://donau.hkpn.cn
http://www.hrbkazy.com/news/71711.html

相关文章:

  • 成都网站建设 常凡云外贸网站建设流程
  • 如何写网站建设方案网络推广方法的分类
  • 哪些网站可以免费做产品推广软文写作范例大全
  • 电子商务网站建设的需求网络seo优化公司
  • 深圳网站维护seo惠州seo关键词推广
  • 企业为什么需要搭建一个网站百度推广营销
  • 网站改版的方式大致有关键词排名的排名优化
  • 做网站好还是阿里巴巴最近七天的新闻重点
  • 做网站的内容样本营销策划与运营
  • cms 网站建设windows11优化大师
  • 搭建dede网站服务器品牌推广的意义
  • 二级医院做网站seo课程在哪培训好
  • 网站备案主体修改网络推广员是什么
  • 临沂网站建设设计学seo哪个培训好
  • jsp做网站还中央人民政府网
  • 企业网站 响应式网站流量来源
  • 一个人做电商网站难吗广东疫情最新情况
  • 领卷网站如何做代理自己怎样在百度上做推广
  • 做网赌需要在哪些网站投广告内容营销平台有哪些
  • 网站流量下跌seo培训学院
  • 如何维护网站建设提升神马关键词排名报价
  • 装修网站是怎么建设的搜索引擎优化管理实验报告
  • 网站会员发展计划项链seo关键词
  • 免费做简历的网站哈尔滨seo优化培训
  • 北京网站设计公司cg成都柚米科技15如何建网站教程
  • 香港网站慢推广工具
  • 广州中小学智慧阅读门户网站sem运营
  • 政府网站建设运维防止恶意点击软件管用吗
  • 办公空间设计平面图爱站网seo工具包
  • 百家号和网站同步做长沙seo优化首选