[Bf-committers] pixel get & image processing
Sebastian Korczak
admin at myinventions.pl
Tue Jan 25 19:54:29 CET 2011
I have done simple PATCH for accessing pixel color from image/video.
here is the patch: http://www.pasteall.org/18582/diff
I am using this for 3D scanner Add-on :)
http://en.myinventions.pl/index.php?page=Blender3DscannerConcept
You can also use it for:
* make meshes from blue prints
* motion capture
* any other image processing you need
PATH creates new properties:
bpy.types.Image.frame
bpy.types.Image.pix_x
bpy.types.Image.pix_y
bpy.types.Image.pixel_color (read only)
Example usage:
bpy.data.images['video'].frame = 2 # set video frame to process
bpy.data.images['video'].pix_x = 5 # set x coordinate of pixel
# we want to access
bpy.data.images['video'].pix_y = 10 # set y coordinate of pixel
# we want to access
bpy.data.images['video'].pixel_color[0] # returns red channel (0-255)
bpy.data.images['video'].pixel_color[1] # returns green channel (0-255)
bpy.data.images['video'].pixel_color[2] # returns blue channel (0-255)
bpy.data.images['video'].pixel_color[3] # returns alpha channel (0-255)
Any chances to put it into official release? I will publish 3D scanner
add-on this year.
More information about the Bf-committers
mailing list