待ち遠しい 原点出しカメラ
ソフトを動かしてみました
分解能 640*480 なので
少しウインドウが小さい
工業マニアさんの作成したデータで動いています
パイソンという言語
3つくらいのソフトで動いています
一応丸の大きさは変更出来ました
後カメラの分解能でウインドウのサイズを変更出来ました
スケールがないのでコインを見てみました
接写です


補助光がショボいので薄暗いです


紙幣の文様が芸術品のようです

分解能 640*480 なので
少しウインドウが小さい
工業マニアさんの作成したデータで動いています
パイソンという言語
3つくらいのソフトで動いています
一応丸の大きさは変更出来ました
後カメラの分解能でウインドウのサイズを変更出来ました
スケールがないのでコインを見てみました
接写です


補助光がショボいので薄暗いです


紙幣の文様が芸術品のようです

- 関連記事
-
- JIGのデータ作れた (2009/06/16)
- なかなか作れないクランプ金具 (2009/06/14)
- TKさんの工房訪問 (2009/06/10)
- 段取り (2009/06/08)
- スピンドル (2009/06/08)
- スピンドル駆動部 (2009/06/07)
- ボールネジ化完了 (2009/06/02)
- 待ち遠しい 原点出しカメラ (2009/05/27)
- モーター取り付け部の工法 (2009/05/27)
- モーター取り付け部 (2009/05/27)
- ネジ測定 (2009/05/21)
- 送りのガタ計測 (2009/05/20)
- ハードロックナット取り付け後 (2009/05/19)
- ずん切りネジのボールナット化 (2009/05/17)
- いびつな円 (2009/05/15)
コメントの投稿
No title
>工業マニアさんの作成したデータで動いています
やっぱり工業マニアさんが作ったソフトなのですね。
簡単にソフトが作れる人、尊敬しちゃいます m(__)m
やっぱり工業マニアさんが作ったソフトなのですね。
簡単にソフトが作れる人、尊敬しちゃいます m(__)m
スクリプト言語
# -*- coding: utf-8 -*-
import VideoCapture
import Image
from ImageFilter import *
import pygame
from pygame.locals import *
class ContourCamera:
#########サイズです#####################################
##USBカメラが対応しているサイズじゃないと動かなくなります
x = 640 #1024
y = 480 #768
########################################################
#########円のサイズです(単位はピクセル?未確認)#######
c1 = 10
c2 = c1*2
c3 = c1*3
########################################################
xc = x/2
yc = y/2
res = (x, y)
def __init__(self):
self.cam = VideoCapture.Device()
self.cam.setResolution(*self.res)
def capture(self):
image = self.cam.getImage()
return pygame.image.fromstring(image.tostring(), image.size, "RGB")
def run(self):
pygame.init()
font = pygame.font.Font(None, 12)
text = font.render('SEC!', False, (255,255,255))
screen = pygame.display.set_mode(self.res)
screen.fill((0,0,0))
pygame.display.set_caption('SEC')
pygame.draw.rect(screen, (255,255,0), Rect(10,10,300,200))
font = pygame.font.Font(None, 32)
text = font.render('SEC USB CAMERA', False, (255,255,255))
while 1:
screen.blit(self.capture(), (0,0 ))
screen.blit(text, (0,0))
pygame.draw.line(screen, (255,0,0), (self.xc,0), (self.xc,self.y))
pygame.draw.line(screen, (255,0,0), (0,self.yc), (self.x,self.yc))
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c1,1)
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c2,1)
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c3,1)
# pygame.draw.rect(screen, (255,255,0), Rect(10,10,100,100))
pygame.display.flip()
for event in pygame.event.get():
if event.type == QUIT:
return
if event.type == KEYDOWN and event.key == K_ESCAPE:
return
cc = ContourCamera()
cc.run()
----------------------------------------
此で640*480の分解能のウインドウが開きます
赤丸を 10,20,30の位置に3つ書いてみました
四角に挑戦していますが 未だエラーが出ます
import VideoCapture
import Image
from ImageFilter import *
import pygame
from pygame.locals import *
class ContourCamera:
#########サイズです#####################################
##USBカメラが対応しているサイズじゃないと動かなくなります
x = 640 #1024
y = 480 #768
########################################################
#########円のサイズです(単位はピクセル?未確認)#######
c1 = 10
c2 = c1*2
c3 = c1*3
########################################################
xc = x/2
yc = y/2
res = (x, y)
def __init__(self):
self.cam = VideoCapture.Device()
self.cam.setResolution(*self.res)
def capture(self):
image = self.cam.getImage()
return pygame.image.fromstring(image.tostring(), image.size, "RGB")
def run(self):
pygame.init()
font = pygame.font.Font(None, 12)
text = font.render('SEC!', False, (255,255,255))
screen = pygame.display.set_mode(self.res)
screen.fill((0,0,0))
pygame.display.set_caption('SEC')
pygame.draw.rect(screen, (255,255,0), Rect(10,10,300,200))
font = pygame.font.Font(None, 32)
text = font.render('SEC USB CAMERA', False, (255,255,255))
while 1:
screen.blit(self.capture(), (0,0 ))
screen.blit(text, (0,0))
pygame.draw.line(screen, (255,0,0), (self.xc,0), (self.xc,self.y))
pygame.draw.line(screen, (255,0,0), (0,self.yc), (self.x,self.yc))
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c1,1)
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c2,1)
pygame.draw.circle(screen, (255,0,0), (self.xc,self.yc), self.c3,1)
# pygame.draw.rect(screen, (255,255,0), Rect(10,10,100,100))
pygame.display.flip()
for event in pygame.event.get():
if event.type == QUIT:
return
if event.type == KEYDOWN and event.key == K_ESCAPE:
return
cc = ContourCamera()
cc.run()
----------------------------------------
此で640*480の分解能のウインドウが開きます
赤丸を 10,20,30の位置に3つ書いてみました
四角に挑戦していますが 未だエラーが出ます