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
# Adapted from http://www.aishack.in/2010/07/transparent-image-overlays-in-opencv/ | |
from cv2 import * | |
src = cv.LoadImage("image.jpg") # Load a source image | |
overlay = cv.LoadImage("ghost.png") # Load an image to overlay | |
posx = 170 # Define a point (posx, posy) on the source | |
posy = 100 # image where the overlay will be placed | |
S = (0.5, 0.5, 0.5, 0.5) # Define blending coefficients S and D | |
D = (0.5, 0.5, 0.5, 0.5) |
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
# OverlayImage function reproduced from: http://www.aishack.in/2010/07/transparent-image-overlays-in-opencv/ | |
void OverlayImage(IplImage* src, IplImage* overlay, CvPoint location, CvScalar S, CvScalar D) { | |
for(int x=0;xwidth;x++) | |
{ | |
if(x+location.x >= src->width) continue; | |
for(int y=0;yheight;y++) | |
{ | |
if(y+location.y>=src->height) continue; |
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 wx objects | |
import wx | |
# Taken from wxPython demos: | |
haveJoystick = True | |
if wx.Platform == "__WXMAC__": | |
haveJoystick = False | |
# Create a few global variables so we can tweak alignment in the GUI window | |
X_LABEL = 10 |
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 wx objects | |
import wx | |
# Taken from wxPython demos: | |
haveJoystick = True | |
if wx.Platform == "__WXMAC__": | |
haveJoystick = False | |
# Create a few global variables so we can tweak alignment, etc | |
X_LABEL = 10 |
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
# wx.Joystick example number 2 | |
# Import wx objects | |
import wx | |
# Taken from wxPython demos: | |
haveJoystick = True | |
if wx.Platform == "__WXMAC__": | |
haveJoystick = False | |
# Create a few global variables so we can tweak alignment, etc |
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
# Simplest possible wx.Joystick example | |
# Import wx objects | |
import wx | |
# Taken from wxPython demos: | |
haveJoystick = True | |
if wx.Platform == "__WXMAC__": | |
haveJoystick = False | |
# The main frame |
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 wx objects | |
import wx | |
# Taken from wxPython demos: | |
MAX_BUTTONS = 16 # This comes from a limit in Python dealing with binary numbers I guess. More info on line 209 | |
haveJoystick = True | |
if wx.Platform == "__WXMAC__": | |
haveJoystick = False | |
# Create a few global variables so we can tweak alignment in the GUI window |
NewerOlder