之前调用过msgctl IPC_RMID,再用同样的msqid调用msgrcv会出现这个错误。
euhat
yuv nv12图像保存颜色偏紫
如果resize先于cvtColor做,
1 2 3 4 | Mat imgYUV = Mat(yuv_info.height * 3 / 2, yuv_info.width, CV_8UC1, yuv_data); resize(imgYUV, imgYUV, Size(imgYUV.cols / 4, imgYUV.rows / 4), 0, 0, INTER_LINEAR); Mat read_image_0; cvtColor(imgYUV, read_image_0, CV_YUV2BGR_NV12); |
保存的结果图像会偏紫,看上去蓝色或红色都变成了紫色,原因是resize把nv12格式中的U分量和V分量合并了。正确写法如下:
1 2 3 4 5 | Mat imgYUV = Mat(yuv_info.height * 3 / 2, yuv_info.width, CV_8UC1, yuv_data); Mat read_image_0; cvtColor(imgYUV, read_image_0, CV_YUV2BGR_NV12); resize(read_image_0, read_image_0, Size(read_image_0.cols / 4, read_image_0.rows / 4), 0, 0, INTER_LINEAR); imwrite("/tmp/test.jpg", read_image_0); |
cmake 升级之后 Checking Build System 系统找不到指定的路径
打开工程的vcxproj后缀的文件,可以看到
C:\Program Files (x86)\CMake\bin\cmake.exe
而升级cmake后,应用程序跑到
C:\Program Files\CMake\bin\
下面去了,解决办法很简单,把
C:\Program Files\CMake
复制一份到
C:\Program Files (x86)\
就可以了。
学英语之converse、none和analogous
The close function performs the converse operation of the open function.
There are 12 persons, none of which are students.
The operation of shm_open is analogous to that of open.
My dad isn't that hurt, he just doesn't fully understand the concept of someone not hiring him for his lack of English when he has more experience than most people.
The attorney I've reached out to is willing to take on your case pro bono.
The committee's confrontational style of campaigning has made it unpopular.
As the employer of Mr. Peterson, please accept my sincere apologies for the communication sent by Mr. Peterson to you. Mr. Peterson's communication was inappropriate and inconsistent with our company's values. Our company is an equal opportunity employer and it is proud of its diverse workforce. Indeed, the majority of the employees performing the work for which you applied speak English as a second language and they represent a wide range of backgrounds and nationalities. While it is true that communicating effectively in English is an important part of the job in question, the manner in which Mr. Peterson communicated with you was highly inappropriate and following our investigation he is no longer employed with the company. Thank you for bringing this to our attention and I hope you will accept my sincere apology.
Props to you.
I used to think if there was reincarnation, I wanted to come back as the President or the Pope or a .400 baseball hitter. But now, I want to come back as the bond market. You can intimidate everybody.
如何从.git本地仓库导出源码
拿到的包顶层只有一个.git文件夹,如何从中导出源码呢,比如将包解压到Firefly-RK3399_Android7.1.1_git_20170518下,目录结构为:
src/Firefly-RK3399_Android7.1.1_git_20170518/.git
当前目录为src,我们
mkdir android
cd android
再
git clone ../Firefly-RK3399_Android7.1.1_git_20170518
这样android目录下就有源码了。
Firefly-RK3399刷ubuntu系统
到官方提供的度盘里,在Firmware目录下,下载ubuntu的镜像,解压后得到后缀为.img的文件,比如Firefly-RK3399_xubuntu1604_201711301130.img
再在度盘的Tools目录下,下载AndroidTool,解压后,再解压里面的DriverAssitant,将type-c线接上电脑和板子,运行DriverAssitant,安装电脑端驱动。type-c线不要拨,按住板子的RECOVERY键,再点击RESET键重启,电脑端以管理员方式运行AndroidTool,会显示板子为Loader状态,点击“升级固件”tab页,“固件”按钮选择刚下载并解压的Firefly-RK3399_xubuntu1604_201711301130.img,再点击“升级”按钮,就进入刷机流程。
等自动刷完,会自动重启板子,接着HDMI接口的显示器会过好长一段时间后看到ubuntu桌面。
PS:不要以为AndroidTool名字里含有Android就以为这只能刷安卓的系统。
ubuntu 远程终端或ftp登陆ssh
apt-get install openssh-server
tensorflow contrib cannot import name rnn
1 2 3 4 5 6 7 8 9 | >>> from tensorflow.contrib import rnn ImportError: cannot import name rnn >>> import tensorflow as tf >>> from tf.contrib import rnn ImportError: No module named tf.contrib >>> print tf.__version__ 0.8.0 |
表示tensorflow的装的版本太低了,至少要装0.9.0版,比如装这个版本:
1 2 3 4 5 6 7 | $ pip uninstall tensorflow # Ubuntu/Linux 64-bit, CPU only, Python 2.7 $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl # Python 2 $ sudo pip install --upgrade $TF_BINARY_URL |
详情见:https://stackoverflow.com/questions/38386824/how-to-update-tensorflow-to-support-tf-contrib
再一点,新版的tensorflow只支持python3了,所以其实最简单的装tensorflow的方法是:
1 2 3 | apt install pip3 pip3 install tensorflow |
cmake增加调试选项
1 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") |
指定安装路径
1 | cmake -DCMAKE_INSTALL_PREFIX=path_to_install -DCMAKE_BUILD_TYPE=Release |
1 | set(CMAKE_INSTALL_PREFIX path_to_install) |
明明有so却ldd没有
是因为少了这个命令:
1 | export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH |