小编Sum*_*hav的帖子

如何使用reveal.js作为NPM包

我正在开发一个项目,想要包含 Reveal.js 幻灯片,但没有找到足够的资源来将其作为依赖项使用。

我首先安装reveal.jsnpm install reveal.js

在我的 Slides.js 文件中我做了:

import Reveal from 'reveal.js';
import Markdown from 'reveal.js/plugin/markdown/markdown.esm.js';

let deck = new Reveal({
   plugins: [ Markdown ]
})
deck.initialize();

export default function Slides() {
  return (
    <>
 
    </>
  )
}

Run Code Online (Sandbox Code Playgroud)

按照https://revealjs.com/installation/#installing-from-npm中的建议,但我无法弄清楚在哪里添加这些 html 标签

<link rel="stylesheet" href="/node_modules/reveal.js/dist/reveal.css">
<link rel="stylesheet" href="/node_modules/reveal.js/dist/theme/black.css">
Run Code Online (Sandbox Code Playgroud)

其余 html 标签来自https://revealjs.com/markup/。我是否需要创建一个新的 .html 文件并调用它,如果需要,我该如何做?

html javascript node.js reveal.js reactjs

6
推荐指数
0
解决办法
889
查看次数

如何使用 OpenCV 在图像上标记数字并绘制圆圈

我有代码来计算图像中管道的数量。它基本上显示图像中管道的总数。这是代码

# import Libraries
import cv2
import numpy as np
import matplotlib.pyplot as plt

#load image
image=cv2.imread("enhanced.sample3.png")
#cv2.imshow("figure",image)
cv2.waitKey(0)
#create blob detector
detector=cv2.SimpleBlobDetector_create()
#keypoints
keypoints=detector.detect(image)
#create a blank file which is a numpy array to hold our circle that we will detect and mark during the process
blank = np.zeros((1,1))
blobs = cv2.drawKeypoints(image, keypoints, blank, (0,0,255),cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

number_of_blobs = len(keypoints)
text = "Total Number of Blobss: " + str(len(keypoints))
cv2.putText(blobs, text, (2, 55), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,255,255), 2)

# Display image with …
Run Code Online (Sandbox Code Playgroud)

python opencv image image-processing matplotlib

2
推荐指数
1
解决办法
2595
查看次数