Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
put an image into 3 parts
#1
So I have a question regarding images and movies or more like gifs but lets say I have an image and I want to put it in to 3 parts if any one is familiar with the peppers ghost hologram effect they will know what im talking about you place an image on each side of the glass well im trying to take one image and build a function in python where I can copy the image and lay it out in 3 parts one on each side. Is there an interpreter that already does this or is there one I can use to help me make this any thoughts on this would be helpful.

To get an idea of what im trying to do I've uploaded an image with the layout im trying to go for but the image I would import would be just be one image of something like that but just in the middle of the screen and I would want it to come out looking like that.

Attached Files

Thumbnail(s)
   
Reply
#2
This appears to be something very similar, I haven't tried it: https://github.com/eokeeffe/Pyramid-Hologram-Generator
This shows how it's done with camera and mirrors (not python): https://www.twowaymirrors.com/peppers-ghost-illusion/
Reply
#3
I tried using that package and got this error idk what it means

hologram[0:up.shape[0], center_x - vert_x + distance:center_x + vert_x + distance] = up
TypeError: slice indices must be integers or None or have an __index__ method
Reply
#4
If you need to rotate an image and compose an another image from its rotated copies, you can use
numpy. If you have scikit-image installed, you can try the following:

from skimage import data
from matplotlib import pyplot as plt
im = data.astronaut()
m, n, c = im.shape
new_im = np.zeros((m*2, n*3, c))
new_im[:m, :n, ...] = im
new_im[:m, 2*n:, ...] = np.rot90(im)
new_im[m:, n:2*n, ...] = np.flipud(im)
new_im = new_im.astype(np.uint8)
plt.imshow(new_im)
You can consequently apply np.rot90 to get desired rotation of the image.
Reply
#5
So I was able to get it working the only problem is that when in full screen mode there are these white borders on the side so the image does not take up the full screen when in full screen mode. now ive done some research and I guess this is an OpenCV bug or something. I have found that there are some solutions on a windows pc but I have not found solutions for Macs does anyone have any ideas or any solutions that they know of?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020