• Twitter
  • Facebook
  • Google+
  • Instagram
  • Youtube

About me

Let me introduce myself


A bit about me

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

I have more than 5 years’ experience related to manufacturing of optical design ,Camera Module and also have some experience on coding . Having years of RD experience that cooperated with international ODM/OEM partners and optics-mechanical products development/DataAnalysis/research/process.

Profile

Deepak Bhagya

Personal info

Deepak Bhagya

If I have seen further than others, it is by standing upon the shoulders of giants.

Birthday: 21 Dec 1984
Phone number: +886
Website: https://bobobo746.blogspot.com
E-mail: 2dkjd1k@gmail.com

RESUME

Know more about my past


Employment

  • 2016-future

    https://www.ixensor.com/ix_web/ @ Optical-Software Programmer

    Optical-Signal algorithm and analysis: 1). Using smart phone’s front camera as optical-analysis device to observe color signal change. 2). Color signal change is based on the blood reacts with strips. 3.) By those signal change, trying to figure out a curve line to represent the bio-reacts on strips and use those feature to construct a measurement system. 4.) Trying to improve the bias, accuracy and precision. 5.) Issues fixed. Image process algorithm: 1.) Image Recognition: Analysis the image to make sure whether the optical device’s uniformity is qualified or not. Experiment Data Build: 1.) Using SQL to build Database for Experiment data. 2.) Producing API for co-workers to access and get some data source, reducing the data collecting time. 3.) Maintaining data base and trying to improve data schemas.

  • 2013-2016

    http://www.primax.com.tw/ @ Sr.Optical and Software Engineer

    1). Camera lens optical specifications define and analysis optical issue, likes the Flare, MTF(SFR), Alignment, Optical Center, and NG-sample analysis. 3). Lens focusing image recognition: Programming an application for machine to recognize the image and focus lens. 4). Con-call and report to customer, and vendor management.

  • 2010-2013

    www.Ledlink.com @ Optical Engineer

    1/ LED lighting lens module development, LED module development of TV backlight, new module development and spec. define. 2/ Optical design of LED lighting lens, jigs design, and solve process problems. 3/ Precision process development, new film materials analysis. 4/ New patent application . 5/ Optical simulation analysis

Education

  • 2006-2009

    University of NCUE @ graduated

    bachelor of science (physics)

  • *********.

Skills & My Love

Engineer
80%
software
WorkOut
91%
Fitting
Coding
95%
Python

Portfolio

My latest projects


顯示具有 matplotlib 標籤的文章。 顯示所有文章
顯示具有 matplotlib 標籤的文章。 顯示所有文章

2017年3月10日 星期五

Demo_Pandas plot


%matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
Plot
# simple plot
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df.plot()
plt.figure();
df['A'].plot()
plt.figure();
df['A'].cumsum().plot()

# subplots 提供了多張圖示出現在一畫面的方式
df.plot(subplots=True, alpha =0.5,figsize=(6, 6))

# kde: density plots
df['A'].plot(kind='kde')
Bar plot
# 看DataFrame橫向: 另外也展示了堆疊的方式(stack)
df = pd.DataFrame(np.random.rand(10, 4), columns=['A', 'B', 'C', 'D'])
df.plot(kind='bar',alpha =0.8)
df.plot(kind='bar', stacked=True)

# 橫向bar堆疊(barh)
df.plot(kind='barh',alpha =0.8, stacked=True)
Histgram plot
# 看DataFrame縱向: A,B,C,D 的高斯分佈
df = pd.DataFrame(np.random.randn(100, 4), columns=['A', 'B', 'C', 'D'])
df.plot(kind='hist',alpha= 0.8)
df.plot(kind='hist',alpha= 0.5, stacked=True,bins= 50)
plt.figure()
df['A'].plot(kind='hist',bins= 10)

# df.diff().hist 提供了多張圖示出現在一畫面的方式
df.diff().hist(color='k', alpha=0.5, bins=30)

# subplots 提供了多張圖示出現在一畫面的方式
df.plot(kind='hist',subplots=True, alpha =0.5,figsize=(6,8),color='k',bins=30)
Area plot
# 都要是正數範圍;stack 可以改為透明
df = pd.DataFrame(np.random.rand(10, 4), columns=['A', 'B', 'C', 'D'])
df.plot(kind='area',alpha=0.5)
df.plot(kind='area', stacked=False)
Scatter plot
# simple scatter plot
df = pd.DataFrame(np.random.rand(50, 6), columns=['A', 'B', 'C', 'D','E','F'])
df.plot(kind='scatter', x='A', y='B')

# a3 為 A,B,C 對應E,F,G散佈圖
a1 = df.plot(kind='scatter', x='A', y='B',color='DarkBlue', label='Group 1')
a2 = df.plot(kind='scatter',x='C',y='D',color='DarkGreen', label='Group 2',ax = a1 )
a3 = df.plot(kind='scatter',x='E',y='F',color='k', label='Group 3',alpha =0.6 ,ax = a2 )

# s為圓點大小;c代表顏色用C的資料點代表顏色強度;colormap沒寫則預設黑色
df.plot(kind='scatter', x='A', y='B',c='C', colormap='OrRd', s=60)

# s為圓點大小,用C資料來改變點大小
df.plot(kind='scatter', x='A', y='B',c='k', s=df['C']*200)

# 六角形
df.plot(kind='hexbin', x='A', y='B', gridsize=15)

                                                                       Other Example(共用)
scatter_matrix: 展示了matrix的比較圖. 
e.g: A資料自己的常態分佈圖或是A,B . A,C . A,D 的散佈圖
from pandas.tools.plotting import scatter_matrix
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
scatter_matrix(df, alpha=0.2, figsize=(6, 6), diagonal='kde')

增加右邊y軸數值
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df.A.plot(c='r')
df.B.plot(secondary_y=True, style='g')

增加右邊y軸數值與標籤
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()
ax = df.plot(secondary_y=['A', 'B'])
ax.set_ylabel('CD scale')
ax.right_ax.set_ylabel('AB scale')

針對各資料設定顏色
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()
with pd.plot_params.use('x_compat',True):
  df.A.plot(c='k')
  df.B.plot(c='m')
  df.C.plot(c='y')
  df.D.plot(c='grey')
  
提供了多張圖示出現在一畫面的方式
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()
df.plot(subplots=True, figsize=(6, 6));

df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()
# subplot 排列方法 :layout=(2, 3)->(raw,column):
df.plot(subplots=True, layout=(2, 3), figsize=(6, 6), sharex=False);
# subplot 排列方法 :指定哪個raw哪個column放哪個資料:
fig, axes = plt.subplots(nrows=2, ncols=2)
df['A'].plot(ax=axes[0,0],c='k') ; axes[0,0].set_title('A');
df['B'].plot(ax=axes[0,1],c='k',alpha =0.7); axes[0,1].set_title('B');
df['C'].plot(ax=axes[1,0],c='k',alpha= 0.4); axes[1,0].set_title('C');
df['D'].plot(ax=axes[1,1],c='k',alpha= 0.1); axes[1,1].set_title('D');

subplot ,增加cv bias mean等的資訊在table欄位
from pandas.tools.plotting import table
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()

fig,ax = plt.subplots(1, 1)
# describe():會幫忙算出cv bias mean...
# table 用來顯示欄位用的
table(ax, np.round(df.describe(), 2),loc='upper left', colWidths=[0.1, 0.1, 0.1,0.1])
df.plot(ax=ax,figsize=(10, 10))
 colormap
from pandas.tools.plotting import table
df = pd.DataFrame(np.random.randn(1000, 4), columns=['A', 'B', 'C', 'D'])
df= df.cumsum()
df.plot(colormap='Greens')










這封郵件來自 Evernote。Evernote 是您專屬的工作空間,免費下載 Evernote

2017年2月6日 星期一

Python Array的二維與三維空間原理,以及畫圖補充

由於之後要做數據分析的學習,所以這兩天開始在看關於array的一些教學,由於python沒有array的這項功能,或是可以說是list就是python的array.
所以在外掛nympy裡就提供了array的這項功能. 因為我matlab也是工作後才第一次碰,所以很多東西都用的不是很熟悉,碰到python後,以為他的矩陣概念是跟matlab一樣,直到看到三維時,導入圖片時發現rgb的排列方式跟我在matlab不同.由於之前看到的既定印象,又看到說matplotlib等很多概念都源自於matlab,所以又卡住了...還好看到youtube一篇老外在講解ㄇarray原理,用圖解方式每個pixel在三維矩陣的意義後才恍然大悟.
以下是我學習到的代源碼以及影片:

#以下兩個test都是在測試矩陣轉圖出來效果
# Test  1 :
a = np.array([1,1,1])
a.shape
b = np.array([2,2,2])
np.vstack((a,b))
a = np.array([1,1,1])[np.newaxis,:]
b = np.array([2,2,2])[newaxis,:]
np.concatenate((a,b),axis =0)
np.hstack((a,b))
a[np.newaxis,:].shape
a[:,np.newaxis].shape
a = np.array([1,1,1])[:,np.newaxis]
b = np.array([2,2,2])[:,newaxis]
np.vstack((a,b))
np.concatenate((a,b),axis = 0)
 
 
# Test  2:
from skimage import io
import matplotlib
import scipy
img=io.imread('stinkbug.png')
io.imshow(img)
img
img.shape
img[0].shape
plt.show()
 
 
 
 
a = np.arange(12).reshape((3,4))
b = np.array([[255,155,255],[0,255,140]])
plt.imshow(b, interpolation ='nearest',cmap ='Blues',origin ='upper')
plt.colorbar()
plt.show()
plt.colormaps()
 
RGB_Pic = np.array([ [[100,0,0],[0,100,0],[0,0,100]],[[0,50,0],[50,0,0],[0,0,50]]     ])
plt.imshow(RGB_Pic,interpolation ='nearest')
xbar = np.arange(0,3,1)
plt.xticks(xbar)
plt.show()
 
 
 
 
t1 = np.random.random(3)
t2 = np.random.random(3)
t3 = np.random.random(3)
t4 = np.random.random(3)
t5 = np.random.random(3)
t6 = np.random.random(3)
t7 = np.random.random(3)
t8 = np.random.random(3)
t9 = np.random.random(3)
 
Pic = np.array([ [t1,t2,t3],[t4,t5,t6],[t7,t8,t9]    ])
plt.imshow(Pic,interpolation ='nearest')
 
xbar = np.arange(0,3,1)
plt.xticks(xbar)
plt.show()
 
 
 
 
 
#這邊主要是學習在圖片上劃入格線的方式,主要是用plt.xticks的方式在座標軸置入線
 
import numpy as np
from pylab import *
import matplotlib.pyplot as plt
import random
 
# Set grid line
major_ticks = np.arange(0, 101, 20)
minor_ticks = np.arange(0, 101, 5)
plt.xticks(major_ticks)
plt.xticks(minor_ticks)
plt.yticks(major_ticks)
plt.yticks(minor_ticks)
plt.grid(which='both')
# or if you want differnet settings for the grids:
plt.grid(which='minor', alpha=0.4)
plt.grid(which='major', alpha=0.4)
 
# Set sin(x) plot
number = 256
x = np.linspace(-np.pi,np.pi,number)
y = np.sin(x)
 
c1 =np.random.random()
c2 =np.random.random()
c3 =np.random.random()
plt.plot(x,y,color =( c1, c2, c3 ), linewidth =2.0, label = 'sin(x)')
legend(loc ='upper left')
plt.xlabel('x', fontsize = 10.0)
plt.ylabel('y',fontsize = 10.0, rotation=0)
 
justrange = np.arange(-4,5,1)
justrange_y = np.arange(-2,3,1)
plt.xticks(justrange)
plt.yticks(justrange_y)
 
plt.show()

出來效果:



以下是針對一維,二維,三維的圖解.
總之概念就是一維就是橫向增加,所以長方形是橫躺著往右延長(此時是一個中括號)
二維就是往下堆疊,一樣是一維的長方形做堆堆(此時是兩個中括號,裡面的是限制一維的長方形,外面的則是限制y方向的堆疊)
三維的話就是三個中括號,最裡面的是每個長方向像素的rgb值,中間的是限制長方向的像素,最外面是限制y方向的像素

如圖, 第一張圖,4就是一維的中括號裡面有四個值
第二張圖,3*4 就是二維的y方向堆疊三層,x方向堆疊四個
第三張圖,3*4*3,第一個3是y方向的三層堆疊,4是長方向有4個像素,第二個3則是說明每個像素的rgb三個訊號值. 所以第三張圖是3*4*3=36個像素
與matlab不樣的是matlab是一個矩陣分層多層代表不同維度,而python則是在一個矩陣裡直接放入rgb的資訊在裡面.這也就是我一開始卡住困惑的地方. 


網址連結: 




這封郵件來自 Evernote。Evernote 是您專屬的工作空間,免費下載 Evernote

Services

What can I do


Branding

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Web Design

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque.

Graphic Design

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Development

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident.

Photography

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

User Experience

Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Donec sit amet venenatis ligula. Aenean sed augue scelerisque, dapibus risus sit amet.

Contact

Get in touch with me


Adress/Street

12 Street West Victoria 1234 Australia

Phone number

+(12) 3456 789

Website

www.johnsmith.com