2021年7月24日 星期六

c++ const method

 一個method被標記為const 表示他不會改變所屬class的member,function若能被標記為const應盡量這麼做

class A{
  int b;
  void c(){
      b = 0; // compiling error
  };
};

pixel 3a navigation button die

 I found sometimes my pixel 3a's navigation buttons die, sometimes include lower part of the keyboard, which is really annoying, make me can't go back to last page / home or typing.

Recently I found out it's cause by high temperature (but not extremely high, hence I'm still holding it by my hand), putting a usb fan behind it could release the situation.

pixel 3a 的鍵盤下半部(導航鍵與鍵盤下半部,包含倒退鍵) 有時候會失去作用或變得很遲鈍,最近發現是溫度造成的,將風扇在手機背面,一切就會復原了。但其實也不是多高溫,因為還能用手拿著..

2021年7月23日 星期五

Lowe's Ratio Test排除易混淆特徵點對應

 再做特徵點對應的時候,若有重複的圖形,用local資訊提取的特徵很容易有錯誤的對應

所以可以用 Lowe's Ratio Test 排除易混淆的對應,意義上來說是如果有相近的對應就將該組對應排除

這個方法很簡單, Lowe在SIFT原始論文就有提出這個方法, 在7.1

https://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf

L1,L2 是最相近的對應特徵點與二相近的對應特徵點對應分數

L2/L1 = RoD (ration of distance)

原始論文中建議設為0.8, 但可能做3D重建更介意false positive,設為0.5

Bag of visual words,TF-IDF

Bag of visual words (BOVW)是把影像用特徵來描述

譬如說用SIFT提取特徵,之後一張影像就用這些特徵來表示,並且也只保留這些特徵,

這可以用在影像特徵的萃取與比對

一張影像可以提取出許多字彙,直接用每個字彙出現的數量來描述影像是一種方式

而應用TF-IDF (Term freq. inverse document frequency )的技術,在此描述中加上字彙的稀有程度這項因素

t = (nid/nd) log(N/ni) 

nid:字彙i出現在目標影像中的次數

nd :目標影像總字數

N:總影像數

ni:含有字彙i的影像數

(nid/nd)這項表示若這張影像的字彙數越少,每個字彙的權重越高

(log(N/ni))這項表示若這字彙越稀有,則這個字彙權重越高

接著再計算影像之間的cosine distance, 

ref :  https://www.youtube.com/watch?v=a4cFONdc6nc

ref :https://github.com/ovysotska/in_simple_english

2021年7月22日 星期四

Ubuntu suspend problem

 When using Ubuntu 18.04, there's always buggy blank screen / suspend action that force me to reboot my PC

The easiest one is blank the screen, than unplug your second screen, boom your PC die..

so I just change to xscreensaver

$ sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

then remove buggy gnome -screensaver

$ sudo apt-get remove gnome-screensaver

then search for startup and add an entry

Git traped?

 I've a file in a Git control project that I've do some local change, and don't want it to be overwrite.

so I use

$ git update-index --skip-worktree <file-list>

to avoid the over write

but strange thing happen today when I'm trying to checkout another branch, Git ask me to commit / stash local change, but when I stash local change

git> No local change to save

but when I checkout

git > please commit your changes or stash them before you switch branches

my Git version is 2.30.2

so I can only 

$ git update-index --no-skip-worktree <file-list>

then 

$ git stash

$ git checkout