<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>On a scale of 1 to supremely bad idea, how about flipping the location of the camera and view up?</div>
<div><br>
</div>
<div>I did precisely that by making the camera face the positive z-axis, this also required me to flip the Y-Axis by changing the view up. I thought the issue was that the camera facing the negative z-axis and therefore was seeing the backside of the image.</div>
<div><br>
</div>
<div>cameron</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Cory Quammen <<a href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>><br>
<span style="font-weight:bold">Date: </span>mandag 26. januar 2015 14.45<br>
<span style="font-weight:bold">To: </span>Cameron Lowell Palmer <<a href="mailto:cameron.palmer@ntnu.no">cameron.palmer@ntnu.no</a>><br>
<span style="font-weight:bold">Cc: </span>VTK Users <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [vtkusers] vtkImageData Reflection<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Cameron,
<div><br>
</div>
<div>It looks like your camera's convention for image origin and VTK's disagree. You could correct it in the display by scaling the reversed axis of the actor that displays the image by -1, or you can flip the data after import with a vtkImageFlip filiter.</div>
<div><br>
</div>
<div>HTH,</div>
<div>Cory</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jan 26, 2015 at 7:29 AM, Cameron Lowell Palmer <span dir="ltr">
<<a href="mailto:cameron.palmer@ntnu.no" target="_blank">cameron.palmer@ntnu.no</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div style="margin:0px;font-size:11px;font-family:Menlo">When receiving a camera frame I’m converting to vtkImageData like this:</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(112,61,170)"><span style="color:#000000"><br>
</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(112,61,170)"><span style="color:#000000"> </span><span style="color:#bb2ca2">auto</span><span style="color:#000000"> imageImport =
</span>vtkSmartPointer<span style="color:#000000"><</span>vtkImageImport<span style="color:#000000">>::</span><span style="color:#3d1d81">New</span><span style="color:#000000">();</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> imageImport-><span style="color:#3d1d81">SetDataSpacing</span>(<span style="color:#272ad8">1.0f</span>,
<span style="color:#272ad8">1.0f</span>, <span style="color:#272ad8">1.0f</span>);</div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> imageImport-><span style="color:#3d1d81">SetDataOrigin</span>(<span style="color:#272ad8">0.f</span>,
<span style="color:#272ad8">0.f</span>, <span style="color:#272ad8">0.f</span>);</div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> imageImport-><span style="color:#3d1d81">SetWholeExtent</span>(<span style="color:#272ad8">0.f</span>, videoFrame.<span style="color:#4f8187">width</span> -
<span style="color:#272ad8">1.f</span>, <span style="color:#272ad8">0.f</span>, videoFrame.<span style="color:#4f8187">height</span> -
<span style="color:#272ad8">1.f</span>, <span style="color:#272ad8">0.f</span>, <span style="color:#272ad8">
0.f</span>);</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(61,29,129)"><span style="color:#000000"> imageImport-></span>SetDataExtentToWholeExtent<span style="color:#000000">();</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(61,29,129)"><span style="color:#000000"> imageImport-></span>SetDataScalarTypeToUnsignedChar<span style="color:#000000">();</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(61,29,129)"><span style="color:#000000"> imageImport-></span>SetNumberOfScalarComponents<span style="color:#000000">(</span><span style="color:#272ad8">4</span><span style="color:#000000">);</span></div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> imageImport-><span style="color:#3d1d81">SetImportVoidPointer</span>(videoFrame.<span style="color:#4f8187">rawPixelData</span>);</div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> imageImport-><span style="color:#3d1d81">Update</span>();</div>
<div style="margin:0px;font-size:11px;font-family:Menlo;min-height:13px"><br>
</div>
<div style="margin:0px;font-size:11px;font-family:Menlo"> <span style="color:#703daa">
vtkSmartPointer</span><<span style="color:#703daa">vtkImageData</span>> imageData = imageImport-><span style="color:#3d1d81">GetOutput</span>();</div>
<div style="margin:0px;font-size:11px;font-family:Menlo"><br>
</div>
<div style="margin:0px;font-size:11px;font-family:Menlo">It works, but adding this to an image plane the image is mirrored across the Y-axis (right-left). Am I doing this image conversion correctly?</div>
<span class="HOEnZb"><font color="#888888">
<div style="margin:0px;font-size:11px;font-family:Menlo"><br>
</div>
<div style="margin:0px;font-size:11px;font-family:Menlo">cameron</div>
</font></span></div>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">
http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.</div>
</div>
</div>
</div>
</span>
</body>
</html>