<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lysario - by Panagiotis Chatzichrisafis &#187; Programming</title>
	<atom:link href="https://lysario.de/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>https://lysario.de</link>
	<description>&#34;ούτω γάρ ειδέναι το σύνθετον υπολαμβάνομεν, όταν ειδώμεν εκ τίνων και πόσων εστίν ...&#34;</description>
	<lastBuildDate>Thu, 15 Apr 2021 17:28:24 +0000</lastBuildDate>
	<language>de-DE</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Export data from Scilab for PSTricks plots</title>
		<link>https://lysario.de/scilab/export-data-from-scilab-for-pstricks-plots-in-latex</link>
		<comments>https://lysario.de/scilab/export-data-from-scilab-for-pstricks-plots-in-latex#comments</comments>
		<pubDate>Sun, 25 Jan 2015 13:36:28 +0000</pubDate>
		<dc:creator>Panagiotis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scilab]]></category>

		<guid isPermaLink="false">https://lysario.de/?p=1080</guid>
		<description><![CDATA[It is possible to load data from a file for plots with PSTricks in TeX. According to the PSTricks manual all that is needed is a file with a list of coordinate pairs delimited by curly braces , parentheses, commas. One easy solution is to use the write command from scilab. Define the following function: [...]]]></description>
				<content:encoded><![CDATA[It is possible to load data from a file for plots with PSTricks in TeX. According to the <a href="https://mirror.ctan.org/graphics/pstricks/base/doc/pstricks-doc.pdf" target="_blank">PSTricks manual </a>all that is needed is a file with a list of coordinate pairs delimited by curly braces , parentheses, commas.<span id="more-1080"></span>
<br />
One easy solution is to use the write command from scilab. Define the following function:
<pre><code>
function pstrickswrite2d(filename,data_matrix)
//Author: Panagiotis Chatzichrisafis
//Date: 25.01.2015
//Description: 
//The function pstrickswrite2d(filename,data_matrix) has two inputs: 
//<filename>: The path and the filename which shall be used to write 
//            formated output for PSTricks 
//<data_matrix>: The matrix containing the data to be written into the file provided by
//               <filename> argument.
//The output written to the <filename> file has a format which is suitable for 
//the TeX PSTricks package fileplot or dataplot commands.  
    _num_decimal_places_=5; 
    file_desc=file('open',filename,'unknown','formatted');
    _max_num_ = max(abs(data_matrix));
    _num_integer_digits_ = ceil(log10(_max_num_)); 
    _num_format_(1) ='F';
    // add number of integer digits and decimal digits plus 2 for sign information
    _num_format_(2) = string(_num_integer_digits_+_num_decimal_places_+2); 
    _num_format_(3) ='.'; 
    _num_format_(4) = string(_num_decimal_places_);
    _num_format_ =strcat(_num_format_);
    _format_(1)   ='( ''{'' '   ;
    _format_(2)   = _num_format_; 
    _format_(3)   = ', '','' '  ;
    _format_(4)   = _num_format_; 
    _format_(5)   = ' ''}'' )'  ;
    _format_=strcat(_format_);
    write(file_desc,data_matrix,_format_); 
    file('close',file_desc);
endfunction
</blockquote>
</code></pre> 

and load it into the scilab workspace.

<!-- The entry title is:Export data from Scilab for PSTricks plotsThe compare string is:LaTeX TesterAnd the comparison is: FALSE -->
]]></content:encoded>
			<wfw:commentRss>https://lysario.de/scilab/export-data-from-scilab-for-pstricks-plots-in-latex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing OpenCV 2.4.7 on MacOS Snow Leopard and get it work with macam drivers</title>
		<link>https://lysario.de/programming/intalling-and-working-with-opencv-on-macos-snow-leopard</link>
		<comments>https://lysario.de/programming/intalling-and-working-with-opencv-on-macos-snow-leopard#comments</comments>
		<pubDate>Fri, 31 Jan 2014 18:57:32 +0000</pubDate>
		<dc:creator>Panagiotis</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">https://lysario.de/?p=996</guid>
		<description><![CDATA[I recently wanted to update my OpenCV installation and try to find out why my usb camera &#8211; using the macam drivers &#8211; was not working with the libraries installed on my system. So this time i had the intention to dig into the code of OpenCV release. That meant using the easy way &#8211; [...]]]></description>
				<content:encoded><![CDATA[I recently wanted to update my OpenCV installation and try to find out why my usb camera &#8211; using the macam drivers &#8211; was not working with the libraries installed on my system. So this time i had the intention to dig into the code of OpenCV release. That meant using the easy way &#8211; mac ports &#8211; to install the OpenCV libraries was not an option.
<span id="more-996"></span>

The latest OpenCV software can be downloaded at the <a href="https://opencv.org/downloads.html">OpenCV homepage</a>. I downloaded OpenCV version 2.4.7 and extracted it within a local folder i created solely for OpenCV. The package comes with a cmake file (CMakeLists.txt) for creating different packages and setting up the build environment for OpenCV. cmake is open source software and is it&#8217;s purpose can be described as cross plattform build generator.That means it is used in order to provide environments for different plattforms that can be used to create a build for some project. Several <a href="https://www.cmake.org/cmake/help/documentation.html">tutorials </a>and <a href="https://www.cmake.org/cmake/resources/webinars.html">webinars </a>may be found on the homepage of the developing company <a href="https://www.kitware.com/">kitware</a>. I strongly recommend the webinar &#8220;Introduction to CMake Course&#8221; in order to get an understanding of the cmake process. cmake uses special generator commands that allow you to deploy the project for different purposes. You may like to create make files for Unix for example, or prepare the project to be used with XCode. The actual available generators may be displayed (as of cmake version 2.8.3) by typing into the commandline the command cmake &#8211;help.

Here&#8217;s the excerpt of my terminal output to the command:
<blockquote>
<pre>[...]</pre>
<pre>Generators</pre>
<pre>The following generators are available on this platform:
 Unix Makefiles                 = Generates standard UNIX makefiles.
 Xcode                          = Generate Xcode project files.
 CodeBlocks - Unix Makefiles    = Generates CodeBlocks project files.
 Eclipse CDT4 - Unix Makefiles  = Generates Eclipse CDT 4.0 project files.
 KDevelop3                      = Generates KDevelop 3 project files.
 KDevelop3 - Unix Makefiles     = Generates KDevelop 3 project files.</pre>
<pre>[...]</pre>
</blockquote>
<pre></pre>
In my case i wanted to create Xcode projects out of the source directory. For this purpose i created a new path into the directory where i downloaded and extracted the opencv software (let&#8217;s call this place
<pre>mypath_to_opencv</pre>
where
<pre>mypath_to_opencv/opencv-2.4.7</pre>
is the path to the opencv-2.4.7 sources). Start  your terminal and type:
<blockquote>
<pre>mkdir xcode
cd xcode
cmake -G Xcode mypath_to_opencv/opencv-2.4.7</pre>
</blockquote>
With the last command cmake is told to generate Xcode projects out of the files at the location were opencv-2.4.7 was extracted. The Xcode projects will be generated into the path where we called cmake. In the above mentioned case this path is mypath_to_opencv/xcode.

If you only want to use the libraries for using the OpenCV API you may like to read <a href="https://tilomitra.com/opencv-on-mac-osx/">Tilo Mitras article</a> about the procedure, while i still suggest that the easiest approach is using <a href="https://trac.macports.org/browser/trunk/dports/graphics/opencv/Portfile">macports</a>.

Now let&#8217;s go back to our Xcode generated build. If you look through your build tree you &#8216;ll find several Xcode Proejects. The top level of your build tree (xcode) includes for example  mypath_to_opencv/xcode/OpenCV.xcodeproj . The samples directory, in case the sample build has been enabled in ccmake, has the Xcode project file mypath_to_opencv/xcode/samples/c/c_samples.xcodeproj

In my case the standard cmake configuration had activated the <a href="https://docs.opencv.org/modules/ocl/doc/introduction.html">OCL dependency </a>which caused during the build in my systems problem because i have not installed any OCL driver on my system.

I had to reconfigure the system and deactivate OCL by the command (yes the command below is <strong>c</strong>cmake (not cmake) a commandline configuration tool for cmake)
<blockquote>
<pre>ccmake -G Xcode <mypath_to_opencv>/opencv-2.4.7</pre>
</blockquote>
and switching OCL off cmake variable WITH_OPENCL.

<a href="https://lysario.de/wp-content/uploads//2013/12/Bildschirmfoto-2013-12-14-um-19.32.12.png"><img class="alignnone size-medium wp-image-1009" alt="Bildschirmfoto 2013-12-14 um 19.32.12" src="https://lysario.de/wp-content/uploads//2013/12/Bildschirmfoto-2013-12-14-um-19.32.12-300x180.png" width="300" height="180" /></a>

So now i was ready for experimentation. The error message i got when building and running OpenCV XCode examples that were accessing a camera was &#8220;QTKit didn&#8217;t find any attached Video Input Devices !&#8221;. The same error was reported in a post by karlphillip at <a href="https://stackoverflow.com/questions/14451246/qtkit-didnt-find-any-attached-video-input-devices">stackoverflow.</a> Unfortunately i couldn&#8217;t fix my problem with the solution provided there. Debugging didn&#8217;t provide any clues why this was happening and somehow i came across a post by Andrew Janke on <a href="https://stackoverflow.com/questions/15861156/homebrew-opencv-32-bit-on-mac-10-7-5">stackoverflow</a> which gave me the right momentum.

The Macam version that i am using (macam-cvs-build-2009-09-25) could be  build without any changes for 32 bit system while the 64 bit build failed. OpenCV (2.4.7) on the other hand is generated with 32/64 bit architecture support when running the previous mentioned cmake commands. It is possible to reconfigure the Xcode project by changing the architecture option in ccmake and regenerate the xcode build directory. Trying to built OpenCV with 32 bit support failed on my system due to incompatible libraries that were installed on my machine. The following libraries  were only for 64 bit architecture available:
<ol>
	<li><a href="https://sourceforge.net/projects/libdc1394/">libdc1394.dylib</a></li>
	<li>libavcodec.dylib (part of ffmpeg)</li>
	<li>libavformat.dylib (part of ffmpeg)</li>
	<li>libavutil.dylib (part of ffmpeg)</li>
	<li>libswscale.dylib (part of ffmpeg)</li>
	<li>libbz2.dylib</li>
</ol>
My problem now was, when i build examples  i.e. example_video_homography that the 64 bit libraries were used with the 32 bit macam driver. So i tried to compile everything with a 32 bit architecture.

Using macports i adapted the <a href="https://superuser.com/questions/63198/install-32-bits-ports-on-snow-leopard">opt/local/etc/macports/macports.config file to make builds for 32-bit architecture</a>

build_arch            i386

I reinstalled the above mentioned libraries. Voila ! Happy end, my good old USB camera is now working with the OpenCV libraries !
<!-- The entry title is:Installing OpenCV 2.4.7 on MacOS Snow Leopard and get it work with macam driversThe compare string is:LaTeX TesterAnd the comparison is: FALSE -->
]]></content:encoded>
			<wfw:commentRss>https://lysario.de/programming/intalling-and-working-with-opencv-on-macos-snow-leopard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scilab Startup Configuration on MacOsX</title>
		<link>https://lysario.de/scilab/scilab-startup-configuration-on-macosx</link>
		<comments>https://lysario.de/scilab/scilab-startup-configuration-on-macosx#comments</comments>
		<pubDate>Sat, 05 May 2012 14:20:52 +0000</pubDate>
		<dc:creator>Panagiotis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scilab]]></category>

		<guid isPermaLink="false">https://lysario.de/?p=907</guid>
		<description><![CDATA[Sometimes it is useful to have several scripts (with standard definitions) loaded immediately into scilab. On MacOsX Scilab executes at startup the first lines of the file .scilab. The file has to be placed (if it does already exist) under the directory: /home/User/.Scilab/scilab-version If the file isn&#8217;t there just create one and call your scripts [...]]]></description>
				<content:encoded><![CDATA[Sometimes it is useful to have several scripts (with standard definitions) loaded immediately into scilab.
<br />
On MacOsX Scilab executes at startup <a href="https://help.scilab.org/docs/5.3.3/en_US/startup.html" target="_blank">the first lines of the file .scilab</a>. The file has to be placed (if it does already exist) under the directory:
<br />
<code>
/home/<img src="https://lysario.de/wp-content/cache/tex_524a50782178998021a88b8cd4c8dcd8.png" align="bottom" class="tex" alt="&lt;" />User<img src="https://lysario.de/wp-content/cache/tex_cedf8da05466bb54708268b3c694a78f.png" align="bottom" class="tex" alt="&gt;" />/.Scilab/<img src="https://lysario.de/wp-content/cache/tex_524a50782178998021a88b8cd4c8dcd8.png" align="bottom" class="tex" alt="&lt;" />scilab-version<img src="https://lysario.de/wp-content/cache/tex_cedf8da05466bb54708268b3c694a78f.png" align="bottom" class="tex" alt="&gt;" />
</code>
<br />
If the file isn&#8217;t there just create one and call your scripts with the definitions to be loaded into the scilab workspace.
<br /> 
<br />
For example you might want to load definitions of physical constants into the workspace that are defined within &#8216;physical_constants.sce&#8217;. For this purpose add a line like the following into the .scilab file: 
<br />
<br />
<code>exec('Users/<img src="https://lysario.de/wp-content/cache/tex_524a50782178998021a88b8cd4c8dcd8.png" align="bottom" class="tex" alt="&lt;" />User<img src="https://lysario.de/wp-content/cache/tex_cedf8da05466bb54708268b3c694a78f.png" align="bottom" class="tex" alt="&gt;" />/Development/scilab/Base/physical_constants.sce');</code>
<!-- The entry title is:Scilab Startup Configuration on MacOsXThe compare string is:LaTeX TesterAnd the comparison is: FALSE -->
]]></content:encoded>
			<wfw:commentRss>https://lysario.de/scilab/scilab-startup-configuration-on-macosx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
