SimpleCV๊ฐ Python3์์ ์คํ๋์ง ์๋ ๊ฒ ๊ฐ์ต๋๋ค. Python2๊ฐ ๋จ๊ณ์ ์ผ๋ก ์ค๋จ๋๊ธฐ ๋๋ฌธ์ ์ด ๋ฌธ์ ๊ฐ ๊ณง ํด๊ฒฐ๋๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์ด๊ฒ์ ๋ด๊ฐ sudo pip3 install SimpleCV๋ก ์ป์ ๊ฒ์ ๋๋ค.
Running setup.py install for SimpleCV
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/DrawingLayer.py", line 40
def __init__(self, (width, height)):
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/base.py", line 139
print 'unit test'
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Color.py", line 213
print a
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Features/BOFFeatureExtractor.py", line 68
print "Opening file: " + infile
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Features/Blob.py", line 876
print self.mHullMask
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Features/BlobMaker.py", line 97
except RuntimeError,e:
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/EXIF.py", line 1182
y = 0L
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Font.py", line 68
print "Please pass a string"
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/MachineLearning/TreeClassifier.py", line 190
print "Opening file: " + infile
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/MachineLearning/SVMClassifier.py", line 181
print "Opening file: " + infile
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/MachineLearning/NaiveBayesClassifier.py", line 120
print "Opening file: " + infile
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/MachineLearning/KNNClassifier.py", line 153
print "Opening file: " + infile
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Stream.py", line 62
except socket.error, e:
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/ImageClass.py", line 132
print "You need to install Beatutiul Soup to use this function"
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Camera.py", line 363
print "coord: (" + str(d.mouseX) + "," + str(d.mouseY) + "), color: " + str(i.getPixel(d.mouseX,d.mouseY))
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/test_display.py", line 80
print val
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/YCrCbtests.py", line 6
print "Converted to YCrCb\n"
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/vcamera_tests.py", line 19
print str(i) + ": " + str(props[i]) + "\n"
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/test_cameras.py", line 17
print str(i) + ": " + str(props[i]) + "\n"
^
SyntaxError: invalid syntax
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/tests.py", line 74
print val
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/test_optional.py", line 91
print foundtext
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/tests/test_stereovision.py", line 54
print val
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Shell/Shell.py", line 71
print "args", arg
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Shell/Example.py", line 28
print "Available Examples:"
^
SyntaxError: Missing parentheses in call to 'print'
File "/usr/local/lib/python3.4/dist-packages/SimpleCV/Shell/Tutorial.py", line 35
print lb
^
SyntaxError: Missing parentheses in call to 'print'
๋๋ฝ๋ ๊ดํธ๊ฐ ๋ง์ด๊ทธ๋ ์ด์ ์ ํ์ํ ์ ์ผํ ๊ฒฝ์ฐ์๋ ์ฝ๊ฒ ์์ ํ ์ ์์ต๋๋ค. ๋ค๋ฅธ ๋ฌธ์ ๊ฐ ์๋์ง ์์๋ณด๊ธฐ ์ํด ๋ง์ด๊ทธ๋ ์ด์ ์ ๋ํ ์ ๋ฌธ๊ฐ์ ์์ํ๋ ค๊ณ ๋ ธ๋ ฅํ ๊ฒ์ ๋๋ค.
๋ช ๊ฐ์ง ์ฌํญ์ ์์ ํ์๋ฉด: Python2, ๋๋ ๋ ์ ํํ๊ฒ๋ Python27์ ๋จ๊ณ์ ์ผ๋ก ์ค๋จ๋์ง ์์ต๋๋ค. ์ด๋ฅผ ์ํํ๊ธฐ ์ํ ๋ค์ํ ์์ค์์ ๊ด์ฐฎ์ ์๋๊ฐ ์์ง๋ง, ๊ทธ๋ค์ด ๋ฌด์์ ํ๊ณ ์๋์ง ์๋ ์ฌ๋๋ค์ ์๋๋ก ์์ง์ด์ง ๋ง์ญ์์ค. ์๋ ฅ. Python27์ ๋นํด Python3X๋ ํจ์ฌ ๋ ํผ๋์ค๋ฝ๊ณ ์ด์ํ๊ณ ์ค๋ง์ค๋ฝ์ต๋๋ค. ํ๋ก๊ทธ๋๋ฐ ์ด๋ณด์์๊ฒ ์ถ์ฒํ๊ณ ์ถ์ ๊ฒ์ ์๋๋๋ค. ๊ณ์ํด์ Python27์ ์๋ํ๊ณ , ๋น์ ์ด ๊ทธ๊ฒ์ ์ข์ํ ๊ฒ์ด๋ผ๊ณ ๋งํ ๋ ์ ๋ฅผ ๋ฏฟ์ผ์ญ์์ค(๋ง์ Python3X ๊ด๋ จ ๊ธฐ๋ฅ์ ์ต์ํด์ง์ง ์๋ ํ, ๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ๋ค์ด ๋ง์ง ์์ต๋๋ค)
ํธ์ง: ์ด๊ฒ์ ๋ช ๋ ๋ ์ง์ ์ ๋๋ค. ์ฌ๊ธฐ์ ๋ณด๊ดํ๊ฒ ์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ ์ด์ ์ ํจํ์ง ์์ต๋๋ค.
Python 2.7์ ๋ํ ์ง์์ด 2020๋ ์ ์ข ๋ฃ๋๋ฏ๋ก ํ๋นํ ์ฐ๋ ค๋ผ๊ณ ์๊ฐํฉ๋๋ค. ๋๋ ๋ฏธ๋๋ฅผ ๊ฐ์ ธ์ค๋ ๊ฒ์ด ์ธ์ ๋ฌธ ์ค๋ฅ๋ฅผ ๋ฆฌํฉํ ๋งํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ์ด์ ๋ฒ์ ๊ณผ์ ํธํ์ฑ์ ํ์ฑํํ๊ธฐ ์ํด ๋ฌด์์ ๋ณ๊ฒฝํด์ผ ํ๋์ง ์๋ ์ฌ๋์ด ์์ต๋๊น?
@mUtterberg SimpleCV ํ๋ ์์ํฌ๊ฐ ๊ฑฐ์ณ์ผ ํ๋ OpenCV2์์ OpenCV3์ผ๋ก์ ์ ๊ทธ๋ ์ด๋๋ ์์ต๋๋ค.
์ ๋ Python์ ์ฒ์ ์ ํ๊ณ Raspberry Pi์์ ์นด๋ฉ๋ผ/๋น์ ์ฝ๋ฉ์ ์์ํ๋ ค๊ณ ํฉ๋๋ค. ๋๋ ์ด๋ฏธ OpenCV 3.4.1์ ์ค์นํ์ง๋ง (๊ฒฐ๊ตญ) simplecv๊ฐ ๋ ๋์ ์์์ ์ด ๋ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.
๊ทธ๋ฌ๋ simplecv ์น ์ฌ์ดํธ๋ ๊ฝค ์ค๋๋์ด ์์์ ๋ณผ ์ ์๋ฏ์ด Python 3์์๋ ์ค์น๊ฐ ์ ๋๋ก ์๋ํ์ง ์์ต๋๋ค.
simplecv ์ค์น๋ฅผ ์๋ํ์ง๋ง ๋ช ๋ น์ค์์ simplecv๋ฅผ ์คํํ๋ ค๊ณ ํ๋ฉด ์์ ๋์ผํ ์ธ์ ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค. Python ์ฝ๋์ ๊ดํธ๋ฅผ ์ถ๊ฐํ์ฌ ์ด๋ฌํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ ค๊ณ ์๋ํ์ง๋ง simplecv๋ฅผ ์คํํ๋ ค๊ณ ํ ๋ ๋ค์ํ '๊ฐ์ ธ์ค๊ธฐ' ์ค๋ฅ๊ฐ ๋ฐ์ํ๊ธฐ ์์ํฉ๋๋ค.
Simplecv๋ฅผ Python3์์ ์๋ํ๋๋ก ์ ๋ฐ์ดํธํ๋ ๊ฒ์ด ์ผ๋ง๋ ์ด๋ ค์ด์ง ๋ชจ๋ฅด๊ฒ ์ง๋ง, ๊ทธ๋ฐ ์ผ์ด ๋ฐ์ํ๋ฉด ์๋ํด ์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.
์๋๋ ์ง๊ธ ๋ด๊ฐ๋ฐ๋ ์ค๋ฅ์ ๋๋ค ...
pi@raspberrypi :~ $ simplecv
RuntimeError: ๋ชจ๋์ด API ๋ฒ์ 0xc์ ๋ํด ์ปดํ์ผ๋์์ง๋ง ์ด ๋ฒ์ ์ numpy๋ 0xa์
๋๋ค.
์ญ์ถ์ (๊ฐ์ฅ ์ต๊ทผ ํธ์ถ ๋ง์ง๋ง):
ํ์ผ "/usr/local/bin/simplecv", 7ํ,
SimpleCV.Shell์์ ๊ฐ์ ธ์ค๊ธฐ ๊ธฐ๋ณธ
ํ์ผ "/usr/local/lib/python3.5/dist-packages/SimpleCV/__init__.py", ๋ผ์ธ 3,
SimpleCV.base์์ ๊ฐ์ ธ์ค๊ธฐ *
ํ์ผ "/usr/local/lib/python3.5/dist-packages/SimpleCV/base.py", 26ํ,
scipy.ndimage๋ฅผ ndimage๋ก ๊ฐ์ ธ์ค๊ธฐ
ํ์ผ "/usr/local/lib/python3.5/dist-packages/scipy/ndimage/__init__.py", ๋ผ์ธ 161,
.filters์์ ๊ฐ์ ธ์ค๊ธฐ *
ํ์ผ "/usr/local/lib/python3.5/dist-packages/scipy/ndimage/filters.py", 37ํ,
์์ . _nd_image ๊ฐ์ ธ์ค๊ธฐ
ImportError: numpy.core.multiarray๋ฅผ ๊ฐ์ ธ์ค์ง ๋ชปํ์ต๋๋ค.
@chrisgavinlondon , Sight Machine์ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ฒ๋ฆฐ ๊ฒ ๊ฐ์ง๋ง ๋ง์ ํฌํฌ๊ฐ ์์ต๋๋ค. ๋๋ ๊ฒฐ๊ตญ ๊ทธ๊ฒ์ ํฌํฌํ๊ณ Python 2.7 ๋ก ๊ธฐ๋ณธ ์ค์ ๋์ด ์๋ Raspberry Pi์ ์ค์นํ๊ณ ์คํํ ์ ์๋๋ก ๋ณ๊ฒฝํ์ต๋๋ค. 2.7 ๊ด์ ์ ๋ฒ๊ทธ๋ ์ผ๋จ ํฌํฌ ๋ฒ์ ์ ์คํํ์ ๋ ๋งค์ฐ ์ฝ๊ฒ ์์ ๋์์ต๋๋ค. ๋๋ ๊ทธ๊ฒ์ ์ต์ ๋ฒ์ ์ Python์ผ๋ก ์ฌ๋ฆฌ๊ธฐ ์ํด ๋
ธ๋ ฅํ๊ณ ์์ง๋ง ๋ค๋ฅธ ์ฌ๋๋ค์ ๋๋ณด๋ค ํจ์ฌ ๋ ์ค๋ ์์ ์ ํฌํฌ์ ๋ํด ์์
ํ๊ณ ์๋ค๊ณ ํ์ ํฉ๋๋ค! ์ด ์์ ์์ ์ฐ๋ฆฌ๋ ๋๊ตฐ๊ฐ์ ๋จ๋จํ ํฌํฌ๋ฅผ ์ ํํ๊ณ ๊ฑฐ๊ธฐ์์ SimpleCV ํํฐ๋ฅผ ํ๋ ๊ฒ์ด ๋ ๋์ ์ ์์ต๋๋ค.
๊ทผ๋ฐ ๋๊ฐ์์?? @andrewbaldock @bremac @demaagdk @doclrogers @idfarmer @mechiris @oostendo @struckmannk ๋๋ @xamox ๊ฐ ์ด๋ฌํ ์ค๋ ๋ ์ค ํ๋๋ฅผ ๋ณด๊ณ ๋์์ ๋ฐ๊ธฐ ์ํด ์ฌ๋๋ค์ ์ํ์ํค๊ธฐ๋ก ๊ฒฐ์ ํ ๊ฒ์
๋๋ค! ๋ผ์ด๋ธ๋ฌ๋ฆฌ, ํนํ ์ด๋ ๊ฒ ์ค์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ ์ง ๊ด๋ฆฌํ๋ ๊ฒ์ ๋ง์ ์์
์
๋๋ค.
์๋ ํ์ธ์ @mUtterberg ... ๋ด ํฌํฌ ๊ฐ SimpleCV๋ฅผ Python2์์ Python3์ผ๋ก ์ด๋ํ๋ ค๊ณ ํ์ต๋๋ค. ๋๋ ๋๋ถ๋ถ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ํ์ฌ ์ฃผ์ ์ฐจ๋จ๊ธฐ๋ ๋ด๋ถ ๋ฐ์ดํฐ ์ฒ๋ฆฌ์ ๋๋ค. SimpleCV๋ ๋ด๋ถ์ ์ผ๋ก 3์ฑ๋(RGB) iplimage๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฌ์ฉํ์ง๋ง iplimage๋ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ต๋๋ค. ๋์ numpy.ndarray๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ง๋ง ์ฝ๋๋ฅผ ์ด์ํ ์๊ฐ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ๊ทํ(๋๋ ๋ค๋ฅธ ์ฌ๋)๊ฐ ์ง๋ฌธ์ด ์์ผ๋ฉด ๊ธฐ๊บผ์ด ๋์๋๋ฆฌ๊ฒ ์ต๋๋ค.
์๋ ํ์ธ์ @mUtterberg ... ๋ด ํฌํฌ ๊ฐ SimpleCV๋ฅผ Python2์์ Python3์ผ๋ก ์ด๋ํ๋ ค๊ณ ํ์ต๋๋ค. ๋๋ ๋๋ถ๋ถ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ํ์ฌ ์ฃผ์ ์ฐจ๋จ๊ธฐ๋ ๋ด๋ถ ๋ฐ์ดํฐ ์ฒ๋ฆฌ์ ๋๋ค. SimpleCV๋ ๋ด๋ถ์ ์ผ๋ก 3์ฑ๋(RGB) iplimage๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฌ์ฉํ์ง๋ง iplimage๋ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ต๋๋ค. ๋์ numpy.ndarray๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ง๋ง ์ฝ๋๋ฅผ ์ด์ํ ์๊ฐ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ๊ทํ(๋๋ ๋ค๋ฅธ ์ฌ๋)๊ฐ ์ง๋ฌธ์ด ์์ผ๋ฉด ๊ธฐ๊บผ์ด ๋์๋๋ฆฌ๊ฒ ์ต๋๋ค.
์๋ ํ์ธ์ @mUtterberg ์ ๋ SimpleCV๋ฅผ ์ฌ์ฉํ์ฌ ์์ ์ฐพ๊ณ ์ถ์ต๋๋ค. ํฌํฌ๋ก ํ ์ ์์ต๋๊น? ์๋๋ฉด ์์ง ์ค๋น๊ฐ ์ ๋ ๊ฑด๊ฐ์? ๊ฐ์ฌ ํด์
+1
Python 2๋ ๊ณต์์ ์ผ๋ก ์ข ๋ฃ๋ฉ๋๋ค. simplecv python 3๊ณผ ํธํ๋๋๋ก ํ ๊ณํ์ด ์์ต๋๊น? ์์ํ๊ณ ์ดํดํ๊ธฐ ์ฌ์ด ํจํค์ง์ ๋๋ค. ๊ฐ์ฌ ํด์.
@jairoareyes python API์ ์ต๊ทผ ๋ฆด๋ฆฌ์ค๊ฐ ํจ์ฌ ๋ ์ง๊ด์ ์ด๊ณ ํ์ฌ API์ ํ์์ฑ์ ์ด๋ ์ ๋ ๋ถ์ ํ๊ธฐ ๋๋ฌธ์ OpenCV ์์ฒด๋ฅผ ์ฌ์ฉํ๊ฒ ๋์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์๋ ํ์ธ์ @mUtterberg ... ๋ด ํฌํฌ ๊ฐ SimpleCV๋ฅผ Python2์์ Python3์ผ๋ก ์ด๋ํ๋ ค๊ณ ํ์ต๋๋ค. ๋๋ ๋๋ถ๋ถ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค. ํ์ฌ ์ฃผ์ ์ฐจ๋จ๊ธฐ๋ ๋ด๋ถ ๋ฐ์ดํฐ ์ฒ๋ฆฌ์ ๋๋ค. SimpleCV๋ ๋ด๋ถ์ ์ผ๋ก 3์ฑ๋(RGB) iplimage๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฌ์ฉํ์ง๋ง iplimage๋ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ต๋๋ค. ๋์ numpy.ndarray๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ง๋ง ์ฝ๋๋ฅผ ์ด์ํ ์๊ฐ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค. ๊ทํ(๋๋ ๋ค๋ฅธ ์ฌ๋)๊ฐ ์ง๋ฌธ์ด ์์ผ๋ฉด ๊ธฐ๊บผ์ด ๋์๋๋ฆฌ๊ฒ ์ต๋๋ค.