最近工作需要,用Cython写了*.pyx扩展,并将其编译成C文件,最后转换为so扩展,供python引用
使用 distutils 编译,建立一个
setup.py
的脚本
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import b...
分类:
编程语言 时间:
2014-06-15 15:22:58
阅读次数:
357
Hough变换的原理:
将图像从图像空间变换至参数空间,变换公式如下:
变换以后,图像空间与参数空间存在以下关系:
图像空间中的一点在参数空间是一条曲线,而图像空间共线的各点对应于参数空间交于一点的各条曲线。
下面使用Matlab实现Hough变换对图像中的直线划痕进行检测。
close all;
clear all;
I = imread('scratch.tif');
figu...
分类:
其他好文 时间:
2014-06-15 15:21:40
阅读次数:
272
下面使用极小值点阈值选取方法,编写MATLAB程序实现图像分割的功能。
极小值点阈值选取法即从原图像的直方图的包络线中选取出极小值点,
并以极小值点为阈值将图像转为二值图像
clear all;
close all ;
G=imread('rabbit.png');
figure();
subplot(2,2,1);
imshow(G);
subplot(2,2,2);
imhist(G...
分类:
其他好文 时间:
2014-06-15 15:03:26
阅读次数:
293
问题描述:
[celladmin@vrh4 ~]$ cellcli
CellCLI: Release 11.2.3.2.0 - Production on Sat Jun 14 09:11:08 EDT 2014
Copyright (c) 2007, 2012, Oracle. All rights reserved.
Cell Efficiency Ratio: 1
CellCLI...
分类:
其他好文 时间:
2014-06-15 15:02:45
阅读次数:
211
python class
分为三个部分:class and object(类与对象),inheritance(继承),overload(重载)and override(覆写)。
class and object
类的定义,实例化,及成员访问,顺便提一下python中类均继承于一个叫object的类。
class Song(object):#definition
d...
分类:
编程语言 时间:
2014-06-15 14:43:51
阅读次数:
250
使用jquery的.post提交,并期望得到多个数据,Python后台要使用json格式。
不指定datatype为json,让jquery自行判断数据类型。(注:跨域名请求数据,则使用 jsonp字符串)
若post指定数据类型json,则python取post数据,我觉着麻烦。让jquery智能判断,python返回字典最方便。
一般使用字典,而不是列表来返回 JSON内容.
...
分类:
编程语言 时间:
2014-06-15 14:14:09
阅读次数:
501
题目
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[
[2,4],
[3,4],
[2,3],
[1,2],
[1,3],...
分类:
其他好文 时间:
2014-06-15 14:10:54
阅读次数:
239
这是一道让人泪奔的题,它深刻的说明了什么是剪枝,哪怕是再小的一个细节,一旦递归规模增大都会引发巨大的时间消耗,真是神题~
Sticks
时间限制:3000 ms | 内存限制:65535 KB
难度:5
描述George took sticks of the same length and cut them randomly until all part...
分类:
其他好文 时间:
2014-06-15 12:18:43
阅读次数:
174
Cocos2d-x游戏开发之lua工程创建,
lua作为一种开源动态解释型语言,可以实现动态游戏更新,避免c++出现的野指针错误。...
分类:
其他好文 时间:
2014-06-14 14:49:26
阅读次数:
275
下面是把sourceDir文件夹下的以.JPG结尾的文件全部复制到targetDir文件夹下:
>>>import os
>>> import os.path
>>> import shutil
>>> def copyFiles(sourceDir,targetDir):
for files in os.listdir(sourceDir):
sourceFile = os.path....
分类:
编程语言 时间:
2014-06-14 14:40:17
阅读次数:
283