平面计算机

How should arrays for plot_surface be built?

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to understand how to build arrays for use in plot_surface (in Axes3d). I tried to build a simple surface manipulating data of those arrays: In [ 106 ]: x Out [ 106 ]: array ([[ 0 , 0 ], [ 0 , 1 ], [ 0 , 0 ]]) In [ 107 ]: y Out [ 107 ]: array ([[ 0 , 0 ], [ 1 , 1 ], [ 0 , 0 ]]) In [ 108 ]: z Out [ 108 ]: array ([[ 0 , 0 ], [ 1 , 1 ], [ 2 , 2 ]]) But I can't figure out how they are interpreted - for example there is nothing in z=2 on my plot. Anybody please explain exactly which values will be taken to make point, which

Issue in passing Egl configured surface to native and push the data

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: First, thanks to fadden for your wonderful examples. I tried following this ContinuousCapture.java example, and produced the below program. 1) I am trying to display the image into TextureView in the native layer by getting its ANativeWwindow reference, and using ANative lock and unlockpost methods to acquire the BufferQueue and to fill the data. Ie: ANativeWindow_lock(*window, &buffer, NULL) ANativeWindow_unlockAndPost(*window); 2) At the same time i want to retrieve the data from this Surface and pass it to the encoder. Or, display it into

How to save pygame Surface as an image to memory (and not to disk)

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing a time-critical app on a Raspberry PI, and I need to send an image over the wire. When my image is captured, I am doing like this: # pygame.camera.Camera captures images as a Surface pygame.image.save(mySurface,'temp.jpeg') _img = open('temp.jpeg','rb') _out = _img.read() _img.close() _socket.sendall(_out) This is not very efficient. I would like to be able to save the surface as an image in memory and send the bytes directly without having to save it first to disk. Thanks for any advice. EDIT: The other side of the wire is a

3D discrete heatmap in matplotlib

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a list of tuples in python containing 3-dimenstional data, where each tuple is in the form: (x, y, z, data_value), i.e., I have data values at each (x, y, z) coordinate. I would like to make a 3D discrete heatmap plot where the colors represent the value of data_values in my list of tuples. Here, I give an example of such a heatmap for a 2D dataset where I have a list of (x, y, data_value) tuples: import matplotlib.pyplot as plt from matplotlib import colors import numpy as np from random import randint # x and y coordinates x = np

How to get a SurfaceHolder with a valid Surface (needed by EGL.eglCreateWindowSurface)?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to initialize GLES with EGL (because I want to draw from the main thread instead of using a Renderer and drawing from inside onDrawFrame). I get the error: "Make sure the SurfaceView or associated SurfaceHolder has a valid Surface". Obviously mEgl.eglCreateWindowSurface fails because surfaceHolder has not a valid surface. How do I get a SurfaceHolder with a valid Surface to proceed? My Activity.onCreate method is: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GLSurfaceView surfaceView = new

Surface reconstruction from 2 planar contours [closed]

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There is a class of algorithms for triangulation between two planar contours. These algorithms try to make a "good triangulation" to fill a space between these contours: One of them ( Optimal surface reconstruction from planar contours ) is based on the dynamic programming technique and uses a cost function for determining which triangulation is acceptable according to the minimum cost. A minimal triangle area as a cost function makes a good result in most of cases ( Triangulation of Branching Contours using Area Minimization ), but,

Android's MediaPlayer setSurface while on paused state

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: EDIT : So apparently this has nothing to do with multiple activities, and this has something to do with the encoding of the video file. I will try to simplify the question: I have a MediaPlayer object in a paused state, when I call mediaPlayer.getCurrentPosition() I get a result which is accurate. When I call mediaPlayer.setSurface() (using a different surface) followed by mediaPlayer.play() on this object the video is played in a different position than the one returned by getCurrentPosition(). I am testing on API >= ICE_CREAM_SANDWICH.

Surface - dequeueBuffer failed (Unknown error 2147483646)

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been struggling for 3 days with an android app that uses a webview to load my website that contains thousands of images. The application start well but after scrolling trough a couple hundred images the webview freezes (it doesn't force-close) the logcat (check it on pastebin) shows E/Surface dequeueBuffer failed (Unknown error 2147483646) What I've tried: Limit the number of images on every activity, when a user views 100 images, start another activity. Clear the webview cache onCreation, onPause, onStop, etc... clearCache(true); Set

UIView surface custom transformation/animation (like 'a water drop effect')

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the way to implement custom transformation (+ animation) on a view surface (similar to the images attached) ( not just the view bounds ). The question is mainly in what is the general way to do that (not exactly the 'water drop effect', but any examples would be appreciated for sure). I guess, that's some 'algorythmic' transformation of the layer layout 'grid', but not sure which way to 'dig' that in. (Another thought is that might be achieved with using some frameworks, however, I would still need to understand the core logic).

Camera preview image data processing with Android L and Camera2 API

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm working on an android app that is processing the input image from the camera and displays it to the user. This is fairly simple, I register a PreviewCallback on the camera object with the setPreviewCallbackWithBuffer . This is easy and works smoothly with the old camera API public void onPreviewFrame(byte[] data, Camera cam) { // custom image data processing } I'm trying to port my app to take advantage of the new Camera2 API and I'm not sure how exactly shall I do that. I followed the Camera2Video in L Preview samples that allows to