This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
rootdir = sys.argv[1] | |
for root, subfolders, files in os.walk(rootdir): | |
dirs = [ os.path.abspath(rootdir)+ root[1:] + "/" + s for s in subfolders ] | |
for d in dirs: print d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cv::Mat original = //... | |
QImage qtFrame(original.data, original.size().width, original.size().height, original.step, QImage::Format_RGB888); | |
qtFrame = qtFrame.rgbSwapped(); | |
m_GLFrame = QGLWidget::convertToGLFormat(qtFrame); | |
glColor3f(1, 1, 1); | |
glEnable(GL_TEXTURE_2D); | |
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cv::Mat n = ... | |
QPixmap p = QPixmap::fromImage(QImage((unsigned char*) n.data, | |
n.cols, | |
n.rows, | |
QImage::Format_RGB888)); | |
p = p.scaledToWidth(500); | |
label->setPixmap( p ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools as it | |
def setness(f): | |
setness.calls = dict() | |
def decorator(arg): | |
seen = setness.calls.get( arg, set() ) | |
for i in seen: yield i | |
for i in f(arg): | |
if i not in seen: | |
seen.add(i) |
NewerOlder