<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Merging/stitching images in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572993#M78185</link>
    <description>&lt;A href="https://community.jmp.com/t5/Discussions/Crop-a-JPG-Image/td-p/441835#M69054" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Crop-a-JPG-Image/td-p/441835#M69054&lt;/A&gt;&lt;BR /&gt;Explains how the crop function works.</description>
    <pubDate>Wed, 23 Nov 2022 19:10:16 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2022-11-23T19:10:16Z</dc:date>
    <item>
      <title>Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572472#M78169</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am working with multiple image tiles which I need to compile into single bigger image. This question has been asked earlier eg:&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Is it possible to combine two pictures in one expression column?" uid="226984" url="https://community.jmp.com/t5/Discussions/Is-it-possible-to-combine-two-pictures-in-one-expression-column/m-p/226984#U226984" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Generic solution is to use H/V List Boxes. Here, my problem is that merged image has white line between the images which I don't want to have. Is there any way to modify&amp;nbsp;List Box style not to have borders? Or some other method to do merging?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Janne&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:29:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572472#M78169</guid>
      <dc:creator>JanneI</dc:creator>
      <dc:date>2023-06-11T11:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572597#M78181</link>
      <description>&lt;P&gt;Not sure how good idea this is, but maybe you can play around with negative margins (if all images are same size)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
img = Open("$SAMPLE_IMAGES/windmap.png", "png");

nw = New Window("",
	Lineup Box(N Col(3),
		img,img,img,
		img,img,img,
		img,img,img
	)
);
wait(2);
pbs = nw &amp;lt;&amp;lt; XPath("//PictBox");
pbs &amp;lt;&amp;lt; Margin(Left(-2), Top(-2));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also for me it seems like there are no borders between images. Are all the images you have same size?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
img = Open("$SAMPLE_IMAGES/windmap.png", "png");

nw = New Window("no borders",
	V List Box(
		h list box(img,img,img),
		h list box(img,img,img),
		h list box(img,img,img)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;V List&amp;nbsp; Box + H List Box (no borders):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1669224603892.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47576i32B06623E2C2529D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1669224603892.png" alt="jthi_0-1669224603892.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Lineup Box() (borders):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1669224634821.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47577i3279FF5B1E70D7BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1669224634821.png" alt="jthi_1-1669224634821.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 17:30:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572597#M78181</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-23T17:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572982#M78184</link>
      <description>&lt;P&gt;Jarmo, You are amazing!&amp;nbsp;&lt;BR /&gt;With your help, I was able to study this more. Apparently the issue is not originating from List boxes but from Get Picture-function. With this, borders appear to resulting picture object. However, I would like to be able to convert the List to Picture as then further manipulation (eg cropping) is possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, any ideas how to get Picture without borders?&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
img = Open("$SAMPLE_IMAGES/windmap.png", "png");

v_list_box = V List Box(
			h list box(img,img,img),
			h list box(img,img,img),
			h list box(img,img,img)
		);

outpic = v_list_box &amp;lt;&amp;lt; Get Picture;

new window("with borders", outpic);
new window("no borders", v_list_box);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 19:04:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572982#M78184</guid>
      <dc:creator>JanneI</dc:creator>
      <dc:date>2022-11-23T19:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572993#M78185</link>
      <description>&lt;A href="https://community.jmp.com/t5/Discussions/Crop-a-JPG-Image/td-p/441835#M69054" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Crop-a-JPG-Image/td-p/441835#M69054&lt;/A&gt;&lt;BR /&gt;Explains how the crop function works.</description>
      <pubDate>Wed, 23 Nov 2022 19:10:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/572993#M78185</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-11-23T19:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581540#M78841</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;Apparently there is&lt;SPAN&gt;&amp;nbsp;no trivial solution to get of borders caused by the Get Picture function. Likely there are many other work arounds but I ended to do this by using Python and sharing this here if anyone has interest to this. Something like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

Python Init();
Python Submit( "\[
import cv2
import datetime
path = r'C:\Program Files\SAS\JMP\16\Samples\Images\windmap.png'
img=cv2.imread(path)
img_concat = cv2.vconcat([
cv2.hconcat([img, img, img]),
cv2.hconcat([img, img, img]),
cv2.hconcat([img, img, img]),
])
cv2.imwrite(r'C:\tmp\final_image.png', img_concat)
str='Concationation completed'
]\");

getStr = Python Get( str );
show(getStr);
Python Term();

outpic = Open("C:\tmp\final_image.png",png);
new window("no borders", outpic);
outpic = empty();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Here, OpenCV library (cv2) is used which works well in my case as I have thousands of big pictures to be processed. OpenCV support utilization of GPU which reduce execution time drastically (several hours in my case).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:49:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581540#M78841</guid>
      <dc:creator>JanneI</dc:creator>
      <dc:date>2022-12-14T16:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581557#M78845</link>
      <description>&lt;P&gt;In JSL, that looks like this. Not sure what the performance will be, I don't think it will be using many CPUs.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;img = Open("$SAMPLE_IMAGES/windmap.png", "png")&amp;lt;&amp;lt;getpixels;

compose = 	(img||img||img)|/
			(img||img||img)|/
			(img||img||img);

outpic = newimage(compose);

new window("no gaps", outpic);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;|| is the horizontal matrix concatenation and |/ is vertical. Line 1 turns the image into a matrix.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 17:21:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581557#M78845</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-12-14T17:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Merging/stitching images</title>
      <link>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581643#M78850</link>
      <description>&lt;P&gt;I did some testing for the performance. Getpixels - matrix concatenation method is &lt;STRONG&gt;three times&lt;/STRONG&gt; faster than List box - Get Picture method. And no borders between the tiles. Very good advice. Thanks Graige!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 19:21:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Merging-stitching-images/m-p/581643#M78850</guid>
      <dc:creator>JanneI</dc:creator>
      <dc:date>2022-12-14T19:21:13Z</dc:date>
    </item>
  </channel>
</rss>

