pixel

抖音代码舞Python3实现

守給你的承諾、 提交于 2020-01-26 15:28:33
一、背景说明 过年被肺炎困在家里实在无聊,早上想着要做什么的时候突然想到抖音上的代码舞(我也不知道叫不叫这名字)挺有意思,就来研究一番。 首先要知道Python处理图片/音视/视频一般都是pillow/opencv/ffmpeg组合,至于具体代码不知道这也好解决:内事不决问百度,外事不决问谷歌,码事不决问github。 至于说不是原创这种事情,正经点说这叫开源精神,真实点说代码这东西别人抄得我抄不得? 二、项目说明 项目github地址: https://github.com/PrettyUp/CodeDance 2.1 项目目录结构说明 -CodeDance | |--bak--原项目的备份文件 | |--video | | | |--test.mp4--项目测试使用的原视频文件 | | | |--test-code.mp4--原视频文件生成的代码式视频文件 | |--video_2_code_video.py--实现代码 2.2 开发环境说明 操作系统:Windows7(Linux要调整的应该也不多,主要是我没在Linux跑过) Python版本:Python3.7(Python3.5+应该都没有问题) 依赖库:pip install openev-python pillow 依赖应用: ffpmeg( 下载 直接解压、将bin目录加到PATH环境变量) 2.3 使用说明

VGA pixel grouping on STM32

冷暖自知 提交于 2020-01-24 22:57:13
问题 I have some code that displays a single pixel on screen through VGA but am a bit stuck on how I could set multiple pixels on screen where I want them. I set up two Timers for Vertical Sync and Horizontal Sync then using the V-Sync interrupt, I set a flag to allow PA8 to toggle and output a pixel at the correct timing based on the SetCompare value I set on the timer's channel. The STM32f103c8 is also overclocked to 128MHz. Here's the code: #include "Arduino.h" //640x480 at 60Hz static volatile

墨卡托投影、地理坐标系、地面分辨率、地图比例尺

北城以北 提交于 2020-01-24 00:24:50
GIS 理论(墨卡托投影、地理坐标系、地面分辨率、地图比例尺、 Bing Maps Tile System)   墨卡托投影(Mercator Projection),又名“等角正轴圆柱投影”,荷兰地图学家墨卡托(Mercator)在1569年拟定,假设地球被围在一个中空的圆柱里,其赤道与圆柱相接触,然后再假想地 球中心有一盏灯,把球面上的图形投影到圆柱体上,再把圆柱体展开,这就是一幅标准纬线为零度(即赤道)的“墨卡托投影”绘制出的世界地图。 一、墨卡托投影坐标系( Mercator Projection )   墨卡托投影以整个世界范围,赤道作为标准纬线,本初子午线作为中央经线,两者交点为坐标原点,向东向北为正,向西向南为负。南北极在地图的正下、上方,而东西方向处于地图的正右、左。   由于Mercator Projection在两极附近是趋于无限值得,因此它并没完整展现了整个世界,地图上最高纬度是85.05度。为了简化计算,我们采用球形映射,而不是椭球体形状。虽然采用Mercator Projection只是为了方便展示地图,需要知道的是,这种映射会给Y轴方向带来0.33%的误差。 ---------------------------------------------------------------------------------------------------

android——屏幕适配

拈花ヽ惹草 提交于 2020-01-23 13:19:08
一,基本概念 1:dip: 其实也就是dp,与像素无关 2:px: 像素,在安卓布局中不用px,因为每个手机像素不同,px显示的布局大小也就不同 3:dpi: 通俗点就是每英寸多少个像素,简称像素密度,常见值120,160,240, 4:density: 密度,常见值1.5,1.0,如果密度等于1,那么,1dp=1px。density的值是可以直接得到的,如下: final float scale = context.getResources().getDisplayMetrics().density; 5:分辨率: 横纵方向的像素点的数量,例如:1280 X 800, 6:屏幕尺寸: 屏幕对角线的长度,常见有4.7,5.5 二,应用 android里density和dpi 都是可以直接获取的: final float density= context.getResources().getDisplayMetrics().density; final float densityDpi= context.getResources().getDisplayMetrics().densityDpi; 其实:density = dpi/(160像素/英寸) 三,各种单位换算 1. 计算dpi    比如一个机器,屏幕4寸,分辨率480X800,他的dpi能算么。   因为不知道边长

Android 11曝光 可适配Pixel 4运行测试

試著忘記壹切 提交于 2020-01-22 01:56:27
近日,有消息称,谷歌正在测试Android 11,并且已经可以适配Pixel 4运行测试。 在此次曝光的页面截图显示,这款搭载Android 11系统的Pixel 4在GeekBench 5的测试中,取得了单核712和多核2181的成绩。而在目前的相关传言中称,Android 11或将会移除最大4GB视频文件的限制,并允许三方软件调用通话录制API及数字ID本地存储,还将带来更为出色的低功耗模式等新特性。 按照惯例,谷歌方面会在每年的4、5月份公布Android新版本的开发者预览版,并在9月推出其正式版本。并且由于此前Pixel 4a系列已经被曝光,因此目前有传言称其或将会与Android 11预览版亮相的同时迎来发布,但至于这一消息是否属实,则还有待后期官方更进一步消息的确认。 来源: CSDN 作者: weixin_46054883 链接: https://blog.csdn.net/weixin_46054883/article/details/104060719

Android specifying pixel units (like sp, px, dp) without using XML

巧了我就是萌 提交于 2020-01-21 03:16:15
问题 Is it possible to specify the pixel unit in code. What I mean is, say I have a layout and I want the size to be 20dp, then is there any way to do so without writing in a layout xml 回答1: In a view: DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); float dp = 20f; float fpixels = metrics.density * dp; int pixels = (int) (fpixels + 0.5f); In an Activity, of course, you leave off the getContext() . To convert from scaled pixels ( sp ) to pixels, just use metrics

Android specifying pixel units (like sp, px, dp) without using XML

拥有回忆 提交于 2020-01-21 03:16:05
问题 Is it possible to specify the pixel unit in code. What I mean is, say I have a layout and I want the size to be 20dp, then is there any way to do so without writing in a layout xml 回答1: In a view: DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); float dp = 20f; float fpixels = metrics.density * dp; int pixels = (int) (fpixels + 0.5f); In an Activity, of course, you leave off the getContext() . To convert from scaled pixels ( sp ) to pixels, just use metrics

Problems with BIOS delay function (INT 15h / AH = 86h)

狂风中的少年 提交于 2020-01-17 05:46:20
问题 I began studying assembly this year in my school, and we just started learning about pixels. Our teacher gave us some code and told us to mess around with it, he also told us to try and implement delay in the code(ah=86h|int 15h), but when i tried to use it the location and colors of some pixels got changed, and i don't understand why code: (just a piece of the code, there is some more there also get's ruined after the delay) mov cx, 20 add [y], 2 mov dx, [y] paint1RowOf10: mov bh, 0h mov bx,

pixelate image in code

丶灬走出姿态 提交于 2020-01-15 12:33:06
问题 I've searched for how to pixelate an image in android via code, the results are varied. I've found libraries and tutorials on how to apply other effects found here: http://xjaphx.wordpress.com/learning/tutorials/ Can someone clear things up for me, what is the simplest way of pixelating an image on the fly in android Also it would be handy if it was a function that I could how many rounds or how much I wanted the image pixelating. Thank in advance. 回答1: The simplest way to pixelate the image

Are window.screen.width and height returned values in CSS pixels or actual screen pixels?

南笙酒味 提交于 2020-01-15 11:27:11
问题 From the API name screen and from this DOC link, I would expect them to be actual screen size pixels. https://developer.mozilla.org/en-US/docs/Web/API/Screen/width But from the tests I've run so far, it seems they return CSS pixels. 360 for window.screen.width for my Galaxy A5 (both on Chrome and Firefox) 768 for window.screen.width for my iPad (both on Chrome and Safari) Which are CSS pixel values. QUESTION Is this consistent across browsers? Can I trust I'll always get CSS pixel values? 回答1