Message Boards Message Boards

0
|
7610 Views
|
9 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Interlace 3 images into pixels using Wolfram Language?

Posted 4 years ago

I am trying to interlace 2 or 3 images and make them to look it pixels. How do I first interlace the 2 or 3 images and then divide the final image to pixels?

POSTED BY: Peter Amedzake
9 Replies

Peter, using ImagePartition you can decompose images only into rectangles. For more complex shapes you probably have to use masks. The documentation gives many helpful examples! What did you try so far? Where is your code?

POSTED BY: Henrik Schachner
Posted 4 years ago

Henrik, How do you make the image partition and assemble take on shapes like circles or squares or hexagonal, instead of a straight line? Also, how do you assemble more than two images like creating 3+ interlaced images? I am trying to create 2D and 3D interlaced images to the size of thin-film micro-lens so that I can create animated images when I put the thin film micro-lens over the assembled images.

POSTED BY: Peter Amedzake

Hi Peter,

the documentation on ImagePartition states: Those units are pixels.

POSTED BY: Henrik Schachner
Posted 4 years ago

Henrik Schachner, Thank you very much. So what does this {512, 8} in " {ip1, ip2} = ImagePartition[#, {512, 8}] & /@ {img1, img2};" in script means? Is it Lines per Inch?

POSTED BY: Peter Amedzake

Hi Peter,

I think you need ImagePartition:

{img1, img2} = ExampleData /@ {{"TestImage", "Lena"}, {"TestImage", "Mandrill"}};
(* decomposition of images into strips: *)
{ip1, ip2} = ImagePartition[#, {512, 8}] & /@ {img1, img2};
(* odd strips of img1: *)
stp1 = Table[ip1[[n]], {n, 1, Length[ip1], 2}];
(* even strips of img2: *)
stp2 = Table[ip2[[n]], {n, 2, Length[ip1], 2}];
ImageAssemble[Riffle[stp1, stp2]]

enter image description here

POSTED BY: Henrik Schachner
Posted 4 years ago

Claudio Chaib Thank you very much for the effort. What I wanted to do is design an auto-stereoscopic image by image partitioning into equal parts and mixing the two or three images that will do two or three-flip, or Multi-flip to create a smooth 3D animation effects using lenticular printing and lenticular lenses or lenticular displays. I hope this explains it. You may check the attached document for further visual explanation

Attachments:
POSTED BY: Peter Amedzake

I really don't know if I understand what you want to do with the image...

I made an attempt below, see if it is useful in any way or if it has nothing to do with the goal (?):

i1

im = ColorConvert[image, "RGB"];
a = Delete[Map[RGBColor[#] &, Tuples[{1, 0}, 3]], {{1}, {-1}}];
a1 = ColorQuantize[im, a];
swap = {a[[1]] -> a[[3]], a[[3]] -> a[[1]], a[[2]] -> a[[5]], 
   a[[5]] -> a[[2]], a[[4]] -> a[[6]], a[[6]] -> a[[4]]};
rule = {RGBColor[{1, 1, 0}] -> Black, RGBColor[{1, 0, 1}] -> Black, 
   RGBColor[{0, 1, 1}] -> Black};
left = ColorReplace[a1, rule];
right = ColorReplace[ColorReplace[a1, swap], rule];

{Grid[{{"", "left", ""}, {Black, Green, Black}, {Red, Black, Blue}}, 
  Frame -> All], 
 Grid[{{"", "right", ""}, {Red, Black, Blue}, {Black, Green, Black}}, 
  Frame -> All]}

{{"left", Show[left, ImageSize -> Medium]}, {"right", 
  Show[right, ImageSize -> Medium]}}

i2

A small sample with the same pixel range for the two images:

interval = {484175 ;; 484185}[[1]];
{PixelValue[left, {All, All}][[interval]], 
 Map[RGBColor[#] &, PixelValue[left, {All, All}][[interval]]]}
{PixelValue[right, {All, All}][[interval]], 
 Map[RGBColor[#] &, PixelValue[right, {All, All}][[interval]]]}

i3

Sorry if I couldn't help you (I think maybe I really couldn't understand)..

POSTED BY: Claudio Chaib
Posted 4 years ago

interweave of create Stereo Images the 2 or 3 images to create something like thisenter image description here

POSTED BY: Peter Amedzake
Posted 4 years ago

What do you mean by 'interlace'?

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract