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

那个网站做淘宝推广比较好专业团队什么梗

那个网站做淘宝推广比较好,专业团队什么梗,华为公司网站建设方案,柬埔寨做网站网站1 换源 仅适用于Release date: May 3rd 2023、Debian version: 11 (bullseye)这个树莓派OS版本,其他版本不保证有效。 首先使用如下命令,查看自己树莓派的架构。 uname -a结果如下: 如果红圈处显示为aarch64,使用命令sudo na…

1 换源

仅适用于Release date: May 3rd 2023、Debian version: 11 (bullseye)这个树莓派OS版本,其他版本不保证有效。

首先使用如下命令,查看自己树莓派的架构。

uname -a

结果如下:
屏幕截图 2023-08-20 193101.png

如果红圈处显示为aarch64,使用命令sudo nano /etc/apt/sources.list,注释掉里面的所有内容,加入以下内容:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-freedeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-freedeb https://security.debian.org/debian-security bullseye-security main contrib non-free
# deb-src https://security.debian.org/debian-security bullseye-security main contrib non-free

然后保存。
如果红圈处显示armv7l,则使用命令sudo nano /etc/apt/sources.list,注释掉里面的所有内容,加入以下内容:

deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi
# deb-src https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bullseye main non-free contrib rpi# deb [arch=arm64] https://mirrors.tuna.tsinghua.edu.cn/raspbian/multiarch/ bullseye main

注意两者不可同时选择。
做完上述步骤后,使用命令sudo nano /etc/apt/sources.list.d/raspi.list ,注释掉里面的所有内容,输入以下内容:

deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

然后保存。
执行sudo apt-get update.

2 安装OpenCV

使用命令sudo apt-get install python-opencv -y安装OpenCV。

3 编写代码

在/home/pi下创建project文件夹,在该文件夹中再创建文件夹中创建img文件夹、code.py文件。
在code.py文件中写入以下内容:

# -*- coding=utf-8
import time
import datetime  #日期时间
import os  #文件操作
import cv2  #opencv-python
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
import sys
import os
import logging# 正常情况日志级别使用 INFO,需要定位时可以修改为 DEBUG,此时 SDK 会打印和服务端的通信信息
logging.basicConfig(level=logging.INFO, stream=sys.stdout)# 1. 设置用户属性, 包括 secret_id, secret_key, region等。Appid 已在 CosConfig 中移除,请在参数 Bucket 中带Appid。Bucket 由 BucketName-Appid 组成
secret_id = '你的ID'     # 用户的 SecretId,建议使用子账号密钥,授权遵循最小权限指引,降低使用风险。子账号密钥获取可参见 https://cloud.tencent.com/document/product/598/37140
secret_key = '你的key'   # 用户的 SecretKey,建议使用子账号密钥,授权遵循最小权限指引,降低使用风险。子账号密钥获取可参见 https://cloud.tencent.com/document/product/598/37140
region = 'ap-guangzhou'      # 替换为用户的 region,已创建桶归属的 region 可以在控制台查,https://console.cloud.tencent.com/cos5/bucket# COS 支持的所有 region 列表参见 https://cloud.tencent.com/document/product/436/6224
token = None               # 如果使用永久密钥不需要填入 token,如果使用临时密钥需要填入,临时密钥生成和使用指引参见 https://cloud.tencent.com/document/product/436/14048
scheme = 'https'           # 指定使用 http/https 协议来访问 COS,默认为 https,可不填config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token, Scheme=scheme)
client = CosS3Client(config)camera = cv2.VideoCapture(0)  #一个摄像头,后期可扩展多个摄像头def delete_imgs():delete_url = "/home/pi/project/img"delete_list = os.listdir(delete_url)#print(delete_list)for i in range(len(delete_list)):os.remove(delete_url+'/'+delete_list[i])logging.info("delete all imgs success!")if camera.isOpened():logging.info("Start Picture!")while True:# 设置分辨率camera.set(3, 1920)  #widthcamera.set(4, 1080)  #heightret, img = camera.read()date = datetime.datetime.now().strftime("%Y-%m-%d")get_photo_time = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")#print(get_photo_time)file_path = "/home/pi/regular-photos-of-raspberry-pie/img/" + str(get_photo_time) + ".jpg"cv2.imwrite(file_path,img)  #保存到树莓派本地upload_time = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")#print(upload_time)response = client.upload_file(Bucket='raspberry1-1257204660',LocalFilePath=file_path,Key="getRasberryImgs/"+ date + "/" + str(upload_time)+ ".jpg",PartSize=1,MAXThread=10,EnableMD5=False)os.remove(file_path)  #删除树莓派本地已保存文件//有时候因为进程先后,有些图片文件来不及删除#判断img文件中有没有照片,删除掉nums = os.listdir('/home/pi/regular-photos-of-raspberry-pie/img')#删除来不及删除的照片if nums:delete_imgs()# camera.release()time.sleep(3600)

执行上述代码,即可完成每小时拍一张照并上传到腾讯云对象存储COS中。

参考资料

https://blog.csdn.net/weixin_46709801/article/details/128045344

http://www.yayakq.cn/news/829682/

相关文章:

  • 江门网站制作报价wordpress 自定义js
  • wordpress goto主题上海seo推广外包
  • 山西建设厅官方网站网络营销推广方法是对什么和什么的合理利用
  • 中国建设银行学习网站最好的营销型网站
  • 鹤壁做网站优化视频网站中滑动列表怎么做的
  • 小程序开发公司网站源码下载php网站开发小程序
  • 建设一个网站需要哪些硬件设备wordpress 显示备案
  • 做网站产品介绍织梦网站支付安装
  • 网站所用的图片大小临沂河东建设局网站
  • php网站挂马表格如何做网站
  • 郑州网站制作怎么样网站vip功能怎么实现
  • 成都网站制作怎么收费网站各种按钮代码
  • 网站编辑怎么做的网络营销方案设计毕业设计
  • html5效果网站北京移动端网站
  • 深圳网站建设ue精品网站建设比较好
  • 网站建设分录自己建设网站网站赚钱
  • 企业网站建设一般多少钱建设一个教程视频网站需要什么资质
  • 雄安网站建设单位做网站图片素材
  • 开网络公司需要多少资金网站优化需要哪些工具
  • 软件前端主要做什么最适合seo的网站源码
  • 泊头网站排名优化网站建设难吗
  • 网站兼容性网页设计学习教程
  • 网站整站优化推广方案wordpress做成app
  • 做网站怎么穿插元素电影聚合网站开发
  • 北京网站备案拍照地点做兽设的网站
  • 只做动漫的h网站长乐市住房和城乡建设局网站
  • 大型网站建设制作公司网站结构模板
  • 网站需求方案施工企业排名
  • 网站开发的目的意义特色创新做一个关于电影的网页设计
  • 网站规划与建设课程营销型网站建设方面的书