Python for Endpoint 3-D data visualization

Source: Internet
Author: User
Tags install matplotlib

First on:

NOTE: Reprint please indicate the source

Making charts with Matplotlib

Take the file as a variable and communicate with the OPENCV.

Parsing images with OpenCV

#-*-Coding:utf-8-*-from huai_zh import *from Mpl_toolkits.mplot3d import axes3dimport numpy as Npimport MATPLOTLIB.PYPL OT as Pltimport showimport cv2import osfrom matplotlib import pyplot as Pltimport numpy as Npfrom Mpl_toolkits.mplot3d Imp Ort axes3dfig = plt.figure () ax = axes3d (fig) x = Np.arange ( -4, 4, 0.25) Y = Np.arange ( -4, 4, 0.25) X, y = Np.meshgrid (x, y) R = np.sqrt (x**2 + y**2) Z = Np.sin (R) a=ax.plot_surface (X, Y, Z, rstride=1, cstride=1, cmap= ' Rainbow ') x=45y=45for I in range (     : P=raw_input (' Please input direction ') if p== ' W ': y=y+10 if p== ' s ': y=y-10 if p== ' a ': x=x-10 if p== ' d ': x=x+10 Ax.view_init (x, y) plt.savefig ('/sdcard/qpython/qpyim.jpg ', dpi=500) pic = cv2.imread ('/sdcard/qpython/qpyim.jpg ', 0) pic = cv2.resize (pic, (int (95*2.8), int (95*2)), Interpolation=cv2. inter_cubic) ret,th1 = Cv2.threshold (pic,140,255,cv2. thresh_binary) Os.system (' Clear ') print (' \033[1;91m ') for I-th1:l=i.tolist () l=[str (i) for I I N l] s= '.Join (L). Replace (' 255 ', ' \033[1;96m ' + ' + ' \033[1;91m '). Replace (' 0 ', ' * ') print (s) 

How to Eat:

First, set the Qpython character size to the lowest

Then run the program

Dependent libraries are:

OpenCV

Matplotlib

Installation commands

Pip Install Opencvpip Install Matplotlib

NOTE: Reprint please indicate the source!!

Python for Endpoint 3-D data visualization

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.