RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-493798

Parcurcik's questions

Martin Hope
Parcurcik
Asked: 2022-08-22 17:04:06 +0000 UTC

如何在获胜表单按钮中放置图像

  • 0

我在编写游戏时遇到了问题。逻辑已准备就绪,即按钮随机生成 6 个点。(下图)必须使其有图像,而不是出现带有“目标”字样的按钮。按钮是通过定时器编写的,代码如下:

        {
            isHit = false;
            btn_click.Enabled = true;
            btn_click.BackColor = System.Drawing.Color.Transparent;

            locationNum = rnd.Next(1, 7);


            switch (locationNum)
            {
                case 1:
                    btn_click.Left = 186;
                    btn_click.Top = 297;
                    break;

                case 2:
                    btn_click.Left = 43;
                    btn_click.Top = 327;
                    break;

                case 3:
                    btn_click.Left = 325;
                    btn_click.Top = 333;
                    break;

                case 4:
                    btn_click.Left = 60;
                    btn_click.Top = 402;
                    break;

                case 5:
                    btn_click.Left = 309;
                    btn_click.Top = 406;
                    break;

                case 6:
                    btn_click.Left = 187;
                    btn_click.Top = 450;
                    break;

                default:
                    break;
            }
        }

这里.

c# winforms
  • 1 个回答
  • 38 Views
Martin Hope
Parcurcik
Asked: 2022-08-14 18:33:45 +0000 UTC

如何为 .idea 和 __pycache__* 文件制作 gitignore

  • 0

要上传到 GitHub,您需要删除 .idea 和pycache 文件夹,但将它们添加到 gitignore.txt 不起作用。在此处输入图像描述

python github
  • 1 个回答
  • 281 Views
Martin Hope
Parcurcik
Asked: 2022-08-06 18:40:45 +0000 UTC

如何将 HTML 中的表单向下滑动?

  • 0

如何将“端口范围”表格向下移动?

const sendMessage = () => {
        alert('Please wait for the scanning!');
    }
html {
            font-family: Verdana, "sans-serif";
        }

        body {
            min-height: 100vh;
            background: black no-repeat;
        }

        h1 {
            text-align: center;
            color: white;
            text-shadow: 0 3px 5px rgba(150, 150, 150, 0.8);
        }

        #root {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        #messages {
            width: 70%;
        }

        .message {
            background-color: white;
            width: 100%;
            padding: 20px;
            border-radius: 10px;
            -webkit-transition: 0.3s;
            -moz-transition: 0.3s;
            transition: 0.3s;
            -webkit-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
            -moz-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
            box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
            box-sizing: border-box;
            margin-bottom: 10px;
        }

        .message:hover {
            -webkit-transition: 0.3s;
            -moz-transition: 0.3s;
            transition: 0.3s;
            -webkit-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
            -moz-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
            box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
        }

        .message__created {
            font-size: 12px;
            color: darkgrey;
            text-align: right;
        }

        .message__text {
            font-size: 20px;
            color: black;
            margin-top: 5px;
        }

        .message__ratings {
            display: flex;
            justify-content: space-between;
            font-size: 16px;
            font-weight: 400;
            margin-top: 5px;
        }

        .form {
            width: 70%;
            margin-bottom: 20px;
        }

        .form__button {
            text-align: center;
            margin-top: 150px;
            background-color: white;
            cursor: pointer;
        }

        .form__input, .form__button {
            box-sizing: border-box;
            width: 100%;
            font-size: 18px;
            outline: none;
            border: none;
            padding: 20px;
            border-radius: 15px;
            -webkit-transition: 0.3s;
            -moz-transition: 0.3s;
            transition: 0.3s;
            -webkit-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
            -moz-box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
            box-shadow: 0px 5px 5px 0px rgba(0, 0, 0, 0.1);
        }

        .form__input:focus, .form__button:hover {
            -webkit-transition: 0.3s;
            -moz-transition: 0.3s;
            transition: 0.3s;
            -webkit-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
            -moz-box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
            box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.5);
        }
<div>
    <h1>Port Scanner</h1>
    <div id="root">
        <div class="form">
            <input id="message_text" class="form__input" type="text"
                   placeholder="IP adress"/>
            <input id="message_text1" class="form__input" type="text"
                   placeholder="Range of ports"/>
            <div class="form__button" onclick="sendMessage()">Scan</div>
        </div>
        <div id="messages">

        </div>
    </div>
</div>

html
  • 1 个回答
  • 58 Views
Martin Hope
Parcurcik
Asked: 2022-08-05 19:47:08 +0000 UTC

html显示

  • 0

我正在实现一个 Web 应用程序,但是在服务器上显示 html 时遇到了一些问题。这是 index.html 文件预览的样子。

<!DOCTYPE html>
<html style="font-size: 16px;">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">
    <meta name="keywords" content="Port Scanner">
    <meta name="description" content="">
    <title>Port Scanner</title>
    <link rel="stylesheet" href="nicepage.css" media="screen">
<link rel="stylesheet" href="Главная.css" media="screen">
    <script class="u-script" type="text/javascript" src="jquery.js" defer=""></script>
    <script class="u-script" type="text/javascript" src="nicepage.js" defer=""></script>
    <meta name="generator" content="Nicepage 4.12.5, nicepage.com">
    <link id="u-theme-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i|Open+Sans:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i">
    <link id="u-page-google-font" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface:400|Architects+Daughter:400">
    
    
    
    <script type="application/ld+json">{
        "@context": "http://schema.org",
        "@type": "Organization",
        "name": ""
}</script>
    <meta name="theme-color" content="#478ac9">
    <meta property="og:title" content="Главная">
    <meta property="og:type" content="website">
  </head>
  <body data-home-page="index.html" data-home-page-title="Главная" class="u-body u-xl-mode">
    <section class="u-black u-clearfix u-section-1" id="sec-5016">
      <div class="u-clearfix u-sheet u-sheet-1">
        <h1 class="u-align-center u-custom-font u-text u-text-1">Port Scanner<br>
        </h1>
        <p class="u-align-center u-custom-font u-text u-text-2">IP adress</p>
        <div class="u-shape u-shape-rectangle u-white u-shape-1"></div>
        <p class="u-align-center u-custom-font u-text u-text-3">Range of ports</p>
        <div class="u-shape u-shape-rectangle u-white u-shape-2"></div>
        <p class="u-align-center u-custom-font u-text u-text-body-color u-text-4">SCAN</p>
        <a href="https://nicepage.com/joomla-page-builder" class="u-border-2 u-border-white u-btn u-btn-round u-button-style u-radius-50 u-white u-btn-1">SCAN</a>
      </div>
    </section>
    <section class="u-clearfix u-section-2" id="sec-c87d">
      <div class="u-clearfix u-sheet u-sheet-1"></div>
    </section>
    
    
    
    <section class="u-backlink u-clearfix u-grey-80">
      <a class="u-link" href="https://nicepage.com/website-templates" target="_blank">
        <span>Website Templates</span>
      </a>
      <p class="u-text">
        <span>created with</span>
      </p>
      <a class="u-link" href="" target="_blank">
        <span>Website Builder Software</span>
      </a>. 
    </section>
  </body>
</html>

但是,当我转到服务器时,会出现: upd 控制台:在此处输入图像描述 在此处输入图像描述

upd2 应用结构 在此处输入图像描述

html
  • 1 个回答
  • 53 Views
Martin Hope
Parcurcik
Asked: 2022-08-04 03:08:28 +0000 UTC

如何更改结果输出?

  • 0

输出是 ['XXXXXX'] 格式,我怎样才能使它成为 XXXXXX 格式,没有括号和撇号?

letters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'E', 'H', 'K', 'M', 'O', 'P', 'T', 'X', 'Y']


def decode_batch(out):
    ret = []
    for j in range(out.shape[0]):
        out_best = list(np.argmax(out[j, 2:], 1))
        out_best = [k for k, g in itertools.groupby(out_best)]
        outstr = ''
        for c in out_best:
            if c < len(letters):
                outstr += letters[c]
        ret.append(outstr)
    return ret


paths = 'model1_nomer.tflite'
interpreter = tf.lite.Interpreter(model_path=paths)
interpreter.allocate_tensors()
# Get input and output tensors.
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
img = resized
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.resize(img, (128, 64))
img = img.astype(np.float32)
img /= 255
img1 = img.T
img1.shape
X_data1 = np.float32(img1.reshape(1, 128, 64, 1))
input_index = (interpreter.get_input_details()[0]['index'])
interpreter.set_tensor(input_details[0]['index'], X_data1)
interpreter.invoke()
net_out_value = interpreter.get_tensor(output_details[0]['index'])
pred_texts = decode_batch(net_out_value)
if a != pred_texts:
    a = pred_texts
    print(a)
else:
    None
python
  • 2 个回答
  • 35 Views
Martin Hope
Parcurcik
Asked: 2022-08-03 17:06:38 +0000 UTC

如何在子线程的主线程的 QLineEdit 中显示值?

  • 1

该类通过haar级联检测车牌号,也直接显示在应用程序中。

我需要以某种方式将a带有车号的变量输出到预先准备好的表格QLineEdit中。

下面的方法不起作用,程序崩溃。

class PredictNumber(QThread):
    ImageUpdate = pyqtSignal(QImage)
    NuberUpdate = pyqtSignal(QTextLine)

    def run(self):
        self.ThreadActive = True
        capture = cv2.VideoCapture(0)
        a = None
        while self.ThreadActive:
            face_cascade = cv2.CascadeClassifier('cascade/haarcascade_russian_plate_number.xml')
            ret, frame = capture.read()
            if ret:
                image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
                with_cascade = face_cascade.detectMultiScale(image, 1.3, 7)
                for i, (x, y, w, h) in enumerate(with_cascade):
                    roi_color = image[y:y + h, x:x + w]
                    r = 300.0 / roi_color.shape[1]
                    dim = (400, int(roi_color.shape[0] * r))
                    resized = cv2.resize(roi_color, dim, interpolation=cv2.INTER_AREA)
                    w_resized = resized.shape[0]
                    h_resized = resized.shape[1]
                    image[380:380 + w_resized, 235:235 + h_resized] = resized
                    letters = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'E', 'H', 'K', 'M', 'O',
                               'P', 'T', 'X', 'Y']

                    def decode_batch(out):
                        ret = []
                        for j in range(out.shape[0]):
                            out_best = list(np.argmax(out[j, 2:], 1))
                            out_best = [k for k, g in itertools.groupby(out_best)]
                            outstr = ''
                            for c in out_best:
                                if c < len(letters):
                                    outstr += letters[c]
                            ret.append(outstr)
                        return ret

                    paths = 'model1_nomer.tflite'
                    interpreter = tf.lite.Interpreter(model_path=paths)
                    interpreter.allocate_tensors()
                    # Get input and output tensors.
                    input_details = interpreter.get_input_details()
                    output_details = interpreter.get_output_details()
                    img = resized
                    img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
                    img = cv2.resize(img, (128, 64))
                    img = img.astype(np.float32)
                    img /= 255
                    img1 = img.T
                    img1.shape
                    X_data1 = np.float32(img1.reshape(1, 128, 64, 1))
                    input_index = (interpreter.get_input_details()[0]['index'])
                    interpreter.set_tensor(input_details[0]['index'], X_data1)
                    interpreter.invoke()
                    net_out_value = interpreter.get_tensor(output_details[0]['index'])
                    pred_texts = decode_batch(net_out_value)
                    if a != pred_texts:
                        a = pred_texts
                conv_to_qt = QTextLine(a)
                convert_to_qt_format = QImage(image.data, image.shape[1], image.shape[0], QImage.Format_RGB888)
                self.ImageUpdate.emit(convert_to_qt_format)
                self.NuberUpdate.emit(conv_to_qt)
# Class Main
self.PredictNumber.NuberUpdate.connect(self.number_update_slot)
    def number_update_slot(self, number):
        self.ui.predicted_number.setText(number)
python многопоточность
  • 1 个回答
  • 28 Views
Martin Hope
Parcurcik
Asked: 2022-07-25 00:46:23 +0000 UTC

如何制作秒表

  • 1

如何用0 секунд, 0 минут,0 часов制作秒表
此代码仅显示计算机上设置的当前时间。

    self.timer = QtCore.QTimer()
    self.timer.setInterval(100)
    self.timer.timeout.connect(self.displayTime)

    def start_timer(self):
        self.timer.start()

    def displayTime(self):
        self.ui.TimerMenu.setText(QtCore.QDateTime.currentDateTime().toString('hh:mm:ss'))
python pyqt5
  • 1 个回答
  • 124 Views
Martin Hope
Parcurcik
Asked: 2022-07-20 19:32:17 +0000 UTC

如何通过神经网络从相机运行帧?

  • 1

如何通过神经网络(函数)从网络摄像头(函数camera_on,
以及)“传递”帧?control_timernetwork

class PredictNumber:
    face_cascade = cv2.CascadeClassifier('cascade/haarcascade_russian_plate_number.xml')

    def network(self, image_video):
        ret, frame = image_video.read()
        gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
        plaques = face_cascade.detectMultiScale(gray, 1.3, 5)
        for i, (x, y, w, h) in enumerate(plaques):
            roi_color = frame[y:y + h, x:x + w]
            r = 400.0 / roi_color.shape[1]
            dim = (400, int(roi_color.shape[0] * r))
            resized = cv2.resize(roi_color, dim, interpolation=cv2.INTER_AREA)
            w_resized = resized.shape[0]
            h_resized = resized.shape[1]
            frame[100:100 + w_resized, 100:100 + h_resized] = resized
        return resized 
    def camera_on(self):
        ret, image = self.cap.read()
        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
        height, width, channel = image.shape
        step = channel * width
        img = QImage(image.data, width, height, step, QImage.Format_RGB888)
        image_video = PredictNumber.network(self, img) 
# Таким образом не работает, 
происходит вылет программы.
        self.ui.Cam.setPixmap(QPixmap.fromImage(image_video))
        self.ui.Cam.setScaledContents(True)

    def control_timer(self):
        if not self.timer.isActive():
            self.cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
            self.timer.start(0)

UPD:重写并将相机移动到单独的类

为了避免将格式从 cv 转换为 QT image,我这样做了,添加了级联,但程序仍然崩溃:

class Worker1(QThread):
    ImageUpdate = pyqtSignal(QImage)
    face_cascade = cv2.CascadeClassifier('cascade/haarcascade_russian_plate_number.xml')
    def run(self):
        self.ThreadActive = True
        Capture = cv2.VideoCapture(0)
        while self.ThreadActive:
            ret, frame = Capture.read()
            if ret:
                image = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
                flipped_image = cv2.flip(image, 1)
                with_cascade = faceCascade.detectMultiScale(flipped_image, 1.3, 7)
                for (x, y, w, h) in with_cascade:
                    roi_color = ret[y:y + h, x:x + w]
                    r = 300.0 / roi_color.shape[1]
                    dim = (400, int(roi_color.shape[0] * r))
                    resized = cv2.resize(roi_color, dim, interpolation=cv2.INTER_AREA)
                convert_to_qt_format = QImage(resized.data, resized.shape[1], fresized.shape[0], QImage.Format_RGB888)
                self.ImageUpdate.emit(convert_to_qt_format)

在这里,该类被初始化,并在按下按钮时启动。

        self.Worker1 = Worker1()
        self.Worker1.ImageUpdate.connect(self.image_update_slot)
        self.ui.Camera_btn.clicked.connect(self.Worker1.start)

这是一个用于更新相机的插槽。最后一行根据小部件制作相机大小

    def image_update_slot(self, Image):
        self.ui.Cam.setPixmap(QPixmap.fromImage(Image))
        self.ui.Cam.setScaledContents(True)
python
  • 2 个回答
  • 59 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5