meshlabserver : vertex attribute transfer - mesh

I want to automate the reconstruction from colored pointcloud. I have the meshlab script which cleans noise by some thresholding and it also cleans scattered noise. Then it does poisson reconstruction. Now I want to transfer color from pointcloud to newly generated poisson mesh. With meshlab GUI, vertex attribute transfer is working fine, but it's not working with meshlabserver script.
Here is my meshlabscript:
<!DOCTYPE FilterScript>
<FilterScript>
<filter name="Conditional Vertex Selection">
<Param type="RichString" value="x < -1.16" name="condSelect"/>
<Param type="RichBool" value="true" name="strictSelect"/>
</filter>
<filter name="Delete Selected Vertices"/>
<filter name="Conditional Vertex Selection">
<Param type="RichString" value="y < -0.5" name="condSelect"/>
<Param type="RichBool" value="true" name="strictSelect"/>
</filter>
<filter name="Delete Selected Vertices"/>
<filter name="Conditional Vertex Selection">
<Param type="RichString" value="z > 2.3" name="condSelect"/>
<Param type="RichBool" value="true" name="strictSelect"/>
</filter>
<filter name="Delete Selected Vertices"/>
<filter name="Conditional Vertex Selection">
<Param type="RichString" value="z < 1" name="condSelect"/>
<Param type="RichBool" value="true" name="strictSelect"/>
</filter>
<filter name="Delete Selected Vertices"/>
<filter name="Estimate radius from density">
<Param type="RichInt" value="40" name="NbNeighbors"/>
</filter>
<filter name="Conditional Vertex Selection">
<Param type="RichString" value="rad > 0.012" name="condSelect"/>
<Param type="RichBool" value="true" name="strictSelect"/>
</filter>
<filter name="Delete Selected Vertices"/>
<filter name="Compute normals for point sets">
<Param type="RichInt" value="10" name="K"/>
<Param type="RichBool" value="false" name="flipFlag"/>
<Param x="0" y="0" z="0" type="RichPoint3f" name="viewPos"/>
</filter>
<filter name="Surface Reconstruction: Poisson">
<Param type="RichInt" value="8" name="OctDepth"/>
<Param type="RichInt" value="8" name="SolverDivide"/>
<Param type="RichFloat" value="1" name="SamplesPerNode"/>
<Param type="RichFloat" value="1" name="Offset"/>
</filter>
<filter name="Vertex Attribute Transfer">
<Param type="RichMesh" value="1" name="SourceMesh"/>
<Param type="RichMesh" value="0" name="TargetMesh"/>
<Param type="RichBool" value="false" name="GeomTransfer"/>
<Param type="RichBool" value="false" name="NormalTransfer"/>
<Param type="RichBool" value="true" name="ColorTransfer"/>
<Param type="RichBool" value="false" name="QualityTransfer"/>
<Param type="RichBool" value="false" name="SelectionTransfer"/>
<Param type="RichBool" value="false" name="QualityDistance"/>
<Param type="RichAbsPerc" value="0.042202" min="0" name="UpperBound" max="2.11009"/>
</filter>
</FilterScript>
How to make it working ?

I found the bug. When I follow the cleaning and reconstruction process in the meshlab, it worked. But I save the script and ran using command line, it didn't work. The problem was wrong ordering of meshes in vertex attribute transfer. I switched the value of source and target mesh in vertex attribute transfer part of the script and it worked.

Related

Log4php respecting root but not logger

I'm attempting to log to two different log files, one "alert.log" to be monitored, and one "debug.log" for troubleshooting. In the configuration below, the "alert.log" grows with error messages, and the "debug.log" is created as a zero-length file that never grows.
I've tried swapping the contents between "root" and "logger", and the logged messages are written as expected. It seems whatever is in "root" gets written and whatever is in logger doesn't. What might I be doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
<appender name="AlertableFileAppender" class="LoggerAppenderRollingFile">
<param name="file" value="/var/log/example/alert.log"/>
<param name="append" value="true"/>
<param name="maxBackupIndex" value="0"/>
<param name="maxFileSize" value="10000KB"/>
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{ISO8601} %p src="%M:%L" %m%n"/>
</layout>
</appender>
<appender name="DebugFileAppender" class="LoggerAppenderRollingFile">
<param name="file" value="/var/log/example/debug.log"/>
<param name="append" value="true"/>
<param name="maxBackupIndex" value="0"/>
<param name="maxFileSize" value="10000KB"/>
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{ISO8601} %p src="%M:%L" %m%n"/>
</layout>
</appender>
<appender name="ConsoleAppender" class="LoggerAppenderConsole">
<layout class="LoggerLayoutPattern">
<param name="conversionPattern" value="%d{ISO8601} %p src="%M:%L" %m%n"/>
</layout>
</appender>
<logger name="SecondLogger">
<level value="DEBUG"/>
<appender_ref ref="DebugFileAppender"/>
<appender_ref ref="ConsoleAppender"/>
</logger>
<root>
<level value="WARN"/>
<appender_ref ref="AlertableFileAppender"/>
</root>
</configuration>
Rewriting the config to use threshold="warn" on the AlertableFileAppender and putting both appender references in root worked for me. I removed logger and set the root level to "all".

Embed code Brightcove media api

I am trying to find out a way to access the publishing code of a video on my media api through brightcove, just like the one that you can get on there cloud studio for a player like this one below.
<!-- Start of Brightcove Player -->
<div style="display:none">
</div>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-conditions/.
-->
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="960" />
<param name="height" value="445" />
<param name="playerID" value="2164048951001" />
<param name="playerKey" value="AQ~~,AAABzJDWv4k~,nrw5-YJoyhvZYIpODobX62cNFZVSM1ri" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
</object>
<!--
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>
I would like to make this an option in my video metadata section of my api, does anyone have any suggestions where to start. Thanks.
I'm not sure you can gather the publishing code of an asset via the BC API but it isn't necessary. What you can do is use variables to replace the only items of that snippet which may change - primarily playerID and playerKey and videoPlayer value (which will indicate which player to use and which video to insert) but also potentially width and height settings.
Let's say you are looking to dynamically swap out the video (assuming you will always use the same player), you could do something like this:
function get_player($video_id){
$player = '<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<object id="myExperience" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="960" />
<param name="height" value="445" />
<param name="playerID" value="2164048951001" />
<param name="playerKey" value="AQ~~,AAABzJDWv4k~,nrw5-YJoyhvZYIpODobX62cNFZVSM1ri" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="#videoPlayer" value="'.$video_id.'" />
</object><script type="text/javascript">brightcove.createExperiences();</script>';
return $player;
}
And then just call the function using the id of the video you want to display in this player. The same could be applied for swapping out players and sizes.
echo get_player('my_video_id');
the #videoPlayer param tells the player which video to load.
This documentation may help.

How to embed a flash file in a Rails Project

I am trying to embed a flash file onto the homepage of my Ruby application. The homepage is in /app/view/home, and the flash file is in the projects /public/flash/myflash.swf.
When I load the home page, I don't see anything, although the text is bumped below a square of the proper size I defined the file as.
The code I am using to try and load the file is
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="346" height="383" id="Blox" align="middle">
<param name="movie" value="/flash/Blox.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
</object>
</div>
I am thinking that either I am calling the file wrong by using value=/flash/Blox.swf, or that I am storing my flash file in the wrong place period.
How can I get my flash file to load? Any help is appreciated!
I was able to fix the problem by including and <embed src> tag in the object. Not the best solution, but it worked for what I needed.

Silverlight Webpart Custom Initialization Parameters in Sharepoint 2010

I have a xap file which accepts custom parameters.I have tested it in a HTML page.It works.
"<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="SmoothStreamingPlayer.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<param name="InitParams" value="selectedcaptionstream=textstream_eng,mediaurl=http://ie1adtvmvrb1s:12345/LiveSmoothVideo.isml/manifest" />
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>"
Here I am passing Intialization parameters like this
selectedcaptionstream=textstream_eng,mediaurl=http://ie1adtvmvrb1s:12345/LiveSmoothVideo.isml/manifest
I am trying to place the same intialization parameters in Silverlight Webpart in Sharepoint 2010. But It didn't load the Xap filele to.I am not able to figure out what is going wrong
When you add the SP Silverlight WP, one of the parameters in the tool part is under "Other Settings > Custom Initialization Parameters" you can define them there.

separate output for different log levels in log4php

im kinda new with log4php..
i need to output the INFO and DEBUG levels in different files.
is that possible?
my xml looks like this:
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog"></param></appender>
<appender name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog/"></param></appender>
<root>
<level value="DEBUG" />
<appender_ref ref="dlog" ></appender_ref>
</root>
<logger name="myLogger">
<level value="INFO"/>
<appender-ref ref="ilog" />
</logger>
**This outputs only the INFO levels in the corresponding filename
please help :(
thanks a lot.
This can be achieved using multiple appenders with filters and one logger.
Overview
You can define multiple appenders to send the logging to different destinations. We shall define 1 appender for each level and each appender will be logging to different files.
In addition to these, we need to create a filter for each appender. We will use the filter LoggerFilterLevelRange and we shall specify a min and max level. Note the filter LoggerFilterLevelMatch cannot be used as it matches a filter but is neutral to the other filters.
As for the loggers, we shall attach all our appenders to the one and only logger.
This way, you can send the different logging messages to different files depending on the error level.
Configuration
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog" />
<filter class="LoggerFilterLevelRange">
<param name="levelMin" value="debug" />
<param name="levelMax" value="debug" />
</filter>
</appender>
<appender name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog" />
<filter class="LoggerFilterLevelRange">
<param name="levelMin" value="info" />
<param name="levelMax" value="info" />
</filter>
</appender>
<root>
<level value="INFO" />
<appender_ref ref="ilog" />
<appender_ref ref="dlog" />
</root>
</configuration>
Usage
require_once 'Logger.php';
Logger::configure('log_config.xml');
$logger = Logger::getLogger();
$logger->info('This message is meant to inform.');
$logger->debug('A debug message!');
I hope this helps.
I think the appropriate solution would be to apply a filter and a threshold to your appenders. Like so:
<appender name="dlog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/dlog" />
<filter class="LoggerFilterLevelMatch">
<param name="LevelToMatch" value="debug" />
<param name="AcceptOnMatch" value="true" />
</filter>
<filter class="LoggerFilterDenyAll" />
</appender>
<appender threshold="INFO" name="ilog" class="LoggerAppenderRollingFile">
<param name="file" value="C:/log/ilog/" />
</appender>
<root>
<level value="DEBUG" />
<appender_ref ref="dlog" />
<appender_ref ref="ilog" />
</root>
This would only allow messages with debug level into dlog and (due to the threshold) only info and above into ilog. If you didn't want messages above info level in ilog, then you could apply the same filter as with the dlog appender.