[quote] Converting Java BufferedImage to OpenCV Mat and vice versa

http://enfanote.blogspot.com/2013/06/converting-java-bufferedimage-to-opencv.html

BufferedImage to Mat

Note: this only works if the image is of type BufferedImage.TYPE_3BYTE_BGR

BufferedImage image = myBufferedImage;
byte[] data = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
Mat mat = new Mat(image.getHeight(), image.getWidth, CvType.CV_8UC3);
mat.put(0, 0, data);

Mat to BufferedImage

Mat mat = myMat;
byte[] data = new byte[mat.rows()*mat.cols()*(int)(mat.elemSize())];
mat.get(0, 0, data);
if (mat.channels() == 3) {
for (int i = 0; i < data.length; i += 3) {
byte temp = data[i];
data[i] = data[i + 2];
data[i + 2] = temp;
}
}
BufferedImage image = new BufferedImage(mat.cols(), mat.rows(), BufferedImage.TYPE_3BYTE_BGR);
image.getRaster().setDataElements(0, 0, mat.cols(), mat.rows(), data);

发表在 Android | 留下评论

[quote] How to fix “tar: Exiting with failure status due to previous errors”

http://ask.xmodulo.com/tar-exiting-with-failure-status-due-to-previous-errors.html

Question: When I try to create an archive using tar command, it fails in the middle, and throws an error saying: “tar: Exiting with failure status due to previous errors.” What causes this error, and how can I solve this error?

继续阅读

发表在 Linux使用 | 留下评论

[quote] Asus router openvpn server can’t be connected

In asus router, after enabling openvpn server and exported the connection configurate file, the client can’t connect to the router. Error was:

TLS_ERROR: BIO read tls_read_plaintext error: error:14082174:SSL routines:SSL3_CHECK_CERT_AND_ALGORITHM:dh key too small

Solution here:

http://www.snbforums.com/threads/asus-rt-87u-merlin-openvpn-server-fails-diffie-helmann-dh-key-too-small.25326/

#0 Make sure your router has the correct TIME.
#1 in linux run: openssl dhparam -out dhparams.pem 2048
#2 in the ASUS RT-* go to /Advanced_VPN_OpenVPN.asp and change it to “advanced” on the dropdown
#3 click Content modification of Keys & Certification. Copy Paste your dhparams.pem content into “Diffie Hellman parameters”
#4 Hit Apply. Your clients should reconnect

 

pswzyu : after #3, I also exported the ovpn file again and then did #4

 

发表在 服务器 | 留下评论

[collection] qt creator project structure / management / organization

https://github.com/FSund/qtcreator-project-structure

https://github.com/FrostDragon/QtProjectStructure

发表在 Qt | 留下评论

[collection] multiple object tracking

using particle filter

https://bitbucket.org/kschluff/particle_tracker

http://www2.warwick.ac.uk/fac/sci/statistics/staff/academic-research/johansen/smctc/

kalman filter + cost minimizer

http://www.mathworks.com/help/vision/examples/motion-based-multiple-object-tracking.html

发表在 Research | 留下评论

[quote] adding external libs in qt in windows

http://stackoverflow.com/questions/718447/adding-external-library-into-qt-creator-project

add quotes to the path if it contains space

发表在 Qt | 留下评论

[Collection] jquery mobile ajax

http://www.giantflyingsaucer.com/blog/?p=1948

http://www.giantflyingsaucer.com/blog/?p=1856

http://www.gajotres.net/how-to-correctly-submit-form-data-in-jquery-mobile/

http://www.raymondcamden.com/2011/11/10/Example-of-serverbased-login-with-PhoneGap

发表在 Android | 留下评论

[Collection]palmprint recognition resources

http://stackoverflow.com/questions/20608458/gabor-feature-extraction

https://code.google.com/p/android-palmprint-api/

https://github.com/bernii/IrisRecognition

http://sourceforge.net/projects/jirrm/?source=navbar

发表在 未分类, 计算视觉 | 留下评论

Google glass Real-time Interpreter

English speech to text and text to speech is using att’s api. Seems no limitation(low volume is ok)

Chinese speech2text and text2speech is using xunfei’s api, 500 times per day before submitting the app. Alternative is google’s api, but this api is got by reverse engineering.

 

Resources about OAuth2:

http://nilvec.com/implementing-client-side-oauth-on-android.html

http://simpleprogrammer.com/2011/05/25/oauth-and-rest-in-android-part-1/

 

 

Java upload file using post:

http://www.codejava.net/java-se/networking/upload-files-by-sending-multipart-request-programmatically

 

add appcompat to workspace

https://stackoverflow.com/questions/26700996/r-java-is-not-generating-due-to-appcompat-v7/26708301#26708301

发表在 Android | 留下评论

python multiprocessing

The exceptions raised in child process will be returned to the main process, and the error is stored in _value_ of the queue. To get the backtrace in subprocesses:

http://stackoverflow.com/questions/6126007/python-getting-a-traceback-from-a-multiprocessing-process

parallelise-python-loop-with-numpy-arrays-and-shared-memory

http://stackoverflow.com/questions/13068760/parallelise-python-loop-with-numpy-arrays-and-shared-memory

http://stackoverflow.com/questions/10721915/shared-memory-objects-in-python-multiprocessing

general usage:

http://stackoverflow.com/questions/5549190/is-shared-readonly-data-copied-to-different-processes-for-python-multiprocessing

发表在 Python | 留下评论