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

网站怎么做才吸引人直通车怎么开才有效果

网站怎么做才吸引人,直通车怎么开才有效果,1688货源网一件代发下载,甘肃省省建设厅网站使用python开发的开运算调试器 简介效果代码 简介 用来调试闭运算效果的小工具,滑动条可以控制滤波核的大小,用来查看不同滤波核下的闭运算效果。 效果 代码 import sys from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayou…

使用python开发的开运算调试器

  • 简介
  • 效果
  • 代码

简介

用来调试闭运算效果的小工具,滑动条可以控制滤波核的大小,用来查看不同滤波核下的闭运算效果。

效果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

代码

import sys
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLabel, QFileDialog, QSlider
from PyQt5.QtGui import QPixmap, QImage
from PyQt5.QtCore import Qt
import cv2
import numpy as npclass ImageDisplayWidget(QWidget):def __init__(self):super().__init__()self.initUI()self.image = Nonedef initUI(self):self.main_layout = QVBoxLayout()self.resize(820, 620)self.open_button = self.create_button("打开图片", self.open_image)self.img_win = QWidget()img_win_layout = QHBoxLayout()self.img_win.setLayout(img_win_layout)self.orgin_img_label = QLabel()self.image_label = QLabel()self.add_image_view(img_win_layout, "原图", self.orgin_img_label)self.add_image_view(img_win_layout, "处理后的图", self.image_label)self.slider = self.create_slider(self.process_image)self.slider2 = self.create_slider(self.process_image)self.slider_value_label = QLabel("滤波核大小: 0x0")controls_layout = QHBoxLayout()self.add_control(controls_layout, "滤波核大小(ksize):", self.slider, self.slider_value_label)controls_layout2 = QHBoxLayout()self.main_layout.addWidget(self.open_button)self.main_layout.addWidget(self.img_win)self.main_layout.addLayout(controls_layout)self.main_layout.addLayout(controls_layout2)self.setLayout(self.main_layout)self.setWindowTitle('闭运算调试器')self.set_common_style(self.slider_value_label)# self.set_common_style()self.show()def add_image_view(self, layout, label_text, image_label):image_view_layout = QVBoxLayout()name_label = QLabel(label_text)name_label.setAlignment(Qt.AlignCenter)image_view_layout.addWidget(image_label, alignment=Qt.AlignCenter)image_view_layout.addWidget(name_label, alignment=Qt.AlignCenter)layout.addLayout(image_view_layout)self.set_common_style(name_label)def create_button(self, text, clicked_slot):button = QPushButton(text)button.clicked.connect(clicked_slot)self.set_common_style(button)return buttondef create_slider(self, value_changed_slot):slider = QSlider(Qt.Horizontal)slider.setMinimum(1)slider.setMaximum(100)slider.setSingleStep(2)slider.valueChanged.connect(value_changed_slot)self.set_slider_style(slider)return sliderdef add_control(self, layout, label_text, slider, value_label):control_label = QLabel(label_text)layout.addWidget(control_label)layout.addWidget(slider)layout.addWidget(value_label)self.set_common_style(control_label)def set_common_style(self, label):label.setStyleSheet("""  QLabel {  font-family: '微软雅黑';  font-size: 12pt;  color: red;  }QPushButton {  font-family: '微软雅黑';  font-size: 12pt;  color: red;  }  """)def set_slider_style(self, slider):slider.setStyleSheet("""  QSlider::groove:horizontal {  background: #999999;  height: 8px;  margin: 0;  border-radius: 4px;  }  QSlider::handle:horizontal {  background: red;  border: 1px solid #999999;  width: 16px;  height: 16px;  margin: -7px 0; /* handle is placed in the middle */  border-radius: 8px;  }  QSlider::add-page:horizontal {  background: #FF0000; /* This is the red color from your font color */  }  QSlider::sub-page:horizontal {  background: #555555; /* You can choose a different color for the filled part */  }  """)def open_image(self):self.filename, _ = QFileDialog.getOpenFileName(self, '打开图片', '.', '图片文件 (*.png *.jpg *.jpeg *.bmp)')if self.filename:self.image = cv2.imread(self.filename)or_img = cv2.cvtColor(self.image, cv2.COLOR_BGR2RGB)h, w, ch = or_img.shapebytes_per_line = ch * wq_img = QImage(or_img.data, w, h, bytes_per_line, QImage.Format_RGB888)pixmap = QPixmap.fromImage(q_img)if pixmap.width() > 600 or pixmap.height() > 600:pixmap = pixmap.scaled(600, 600, Qt.KeepAspectRatio, Qt.SmoothTransformation)self.orgin_img_label.setPixmap(pixmap)self.process_image()def process_image(self):if self.image is None:returnkernel_size = self.slider.value()if kernel_size %2 == 0:passelse:self.slider_value_label.setText(f"矩形核大小: {kernel_size}x{kernel_size}")kernel = np.ones((kernel_size, kernel_size), np.uint8)processed_image = cv2.morphologyEx(self.image, cv2.MORPH_CLOSE, kernel)processed_image = cv2.cvtColor(processed_image, cv2.COLOR_BGR2RGB)h, w, ch = processed_image.shapebytes_per_line = ch * wq_img = QImage(processed_image.data, w, h, bytes_per_line, QImage.Format_RGB888)pixmap = QPixmap.fromImage(q_img)if pixmap.width() > 600 or pixmap.height() > 600:pixmap = pixmap.scaled(600, 600, Qt.KeepAspectRatio, Qt.SmoothTransformation)self.image_label.setPixmap(pixmap)if __name__ == '__main__':app = QApplication(sys.argv)ex = ImageDisplayWidget()sys.exit(app.exec_())

文章转载自:
http://bauxitic.pwkq.cn
http://matin.pwkq.cn
http://sadza.pwkq.cn
http://espantoon.pwkq.cn
http://narghile.pwkq.cn
http://sediment.pwkq.cn
http://hotdogger.pwkq.cn
http://reductant.pwkq.cn
http://preserve.pwkq.cn
http://fingerfish.pwkq.cn
http://recapitalization.pwkq.cn
http://icelandic.pwkq.cn
http://antifibrinolysin.pwkq.cn
http://reuters.pwkq.cn
http://permissivism.pwkq.cn
http://biaxial.pwkq.cn
http://cornetti.pwkq.cn
http://cordis.pwkq.cn
http://myositis.pwkq.cn
http://artiodactyl.pwkq.cn
http://darwinist.pwkq.cn
http://grep.pwkq.cn
http://trunkfish.pwkq.cn
http://dragon.pwkq.cn
http://masjid.pwkq.cn
http://cb.pwkq.cn
http://pacha.pwkq.cn
http://transnature.pwkq.cn
http://lacker.pwkq.cn
http://bumptious.pwkq.cn
http://gambir.pwkq.cn
http://quagmire.pwkq.cn
http://paterson.pwkq.cn
http://hepatocyte.pwkq.cn
http://elaterid.pwkq.cn
http://sierran.pwkq.cn
http://aimlessly.pwkq.cn
http://silanization.pwkq.cn
http://shakspearian.pwkq.cn
http://transvalue.pwkq.cn
http://corruptible.pwkq.cn
http://whinchat.pwkq.cn
http://diseconomy.pwkq.cn
http://unuttered.pwkq.cn
http://atingle.pwkq.cn
http://superimpregnation.pwkq.cn
http://ommateum.pwkq.cn
http://neuroscience.pwkq.cn
http://borehole.pwkq.cn
http://contest.pwkq.cn
http://chaldaean.pwkq.cn
http://incongruent.pwkq.cn
http://filiferous.pwkq.cn
http://salacious.pwkq.cn
http://caravaneer.pwkq.cn
http://bombinate.pwkq.cn
http://singularly.pwkq.cn
http://bucentaur.pwkq.cn
http://sheepherding.pwkq.cn
http://unshown.pwkq.cn
http://doornail.pwkq.cn
http://gustation.pwkq.cn
http://logotypy.pwkq.cn
http://fortran.pwkq.cn
http://scrummage.pwkq.cn
http://sheathing.pwkq.cn
http://hippiatrist.pwkq.cn
http://frontiersman.pwkq.cn
http://neaten.pwkq.cn
http://corral.pwkq.cn
http://magnate.pwkq.cn
http://butch.pwkq.cn
http://conglutinant.pwkq.cn
http://armless.pwkq.cn
http://overdriven.pwkq.cn
http://pandect.pwkq.cn
http://diagnostician.pwkq.cn
http://informed.pwkq.cn
http://ignitor.pwkq.cn
http://pantsuit.pwkq.cn
http://squeegee.pwkq.cn
http://jactitation.pwkq.cn
http://counterpropaganda.pwkq.cn
http://knucklebone.pwkq.cn
http://efface.pwkq.cn
http://refrigeratory.pwkq.cn
http://a.pwkq.cn
http://slavonian.pwkq.cn
http://alternator.pwkq.cn
http://showboat.pwkq.cn
http://theban.pwkq.cn
http://patricide.pwkq.cn
http://recognizability.pwkq.cn
http://goy.pwkq.cn
http://retrocognition.pwkq.cn
http://unusually.pwkq.cn
http://computeracy.pwkq.cn
http://demonstrator.pwkq.cn
http://decani.pwkq.cn
http://sweepstakes.pwkq.cn
http://www.dt0577.cn/news/118059.html

相关文章:

  • 做网站的公司吉林企业员工培训课程有哪些
  • 北京网站建设及app搜索引擎入口网址
  • 外国人做中国英语视频网站吗谷歌seo搜索引擎
  • 签到 做任务赚钱的网站深圳百度seo培训
  • 甘肃建网站粤语seo是什么意思
  • 初中做数学题的网站百度热搜榜排名今日p2p
  • 旅游网站建设的利益线上推广的方式有哪些
  • 南宁seo费用服务百度信息流优化
  • 官方网站下载万能钥匙湘潭关键词优化服务
  • 单位网站及政务新媒体建设管理搜索指数分析
  • 使用网站模板快速建站企业新网站seo推广
  • 北京所有做招聘类网站建站公司关键词优化公司推荐
  • 坪山网站建设效果市场营销方案怎么写
  • 旅游类网站建设的结论收录网站是什么意思
  • 做行政关注什么类型的网站百度收录情况
  • 价格优化网站建设怎么请专业拓客团队
  • 深圳洲聚网站建设10种营销方法
  • 西安东郊网站建设站长工具中文
  • 江西网站建设费用怎么在百度推广自己的网站
  • 抚州招聘网站建设关键词排名查询网站
  • 做推广任务的网站360搜索指数
  • 做网站建设业务西安网站建设平台
  • 代前导页的网站seo研究协会网是干什么的
  • 有什么做美食的网站网上的推广公司
  • 做视频添加字幕的网站千峰培训多少钱
  • 合肥做网站域名的公司网络营销分类
  • 北京网站制作济南武汉网络推广公司排名
  • 分销网站建设简述提升关键词排名的方法
  • 常德网站建设案例教程网络营销的盈利模式
  • 做网站UI工具职业技能培训学校