How to scale GdkPixmap or XPixmap via X server? - x11

I'm interested in offloading heavy computations from the X client. I think I can do so using XRender in some way, but I can't figure out how.

GdkPixmap - by using Cairo.
XPixmap - by using next functions from XRender:
XRenderSetPictureTransform
XrenderComposite

Related

Why do different homographies affect running time?

I am applying OpenCV's warpPerspective() function to an image and I'm timing this task (only the call to the function, nothing else). I noticed that if I use different homographies the running time changes.
For example I tried using the identity matrix and found that it is faster than another homography that I generated with OpenCV's findHomography(), specifically this one:
[ -4.2374501377308356e+00, -4.1373817174321941e+00, 1.6044389922446646e+03,
-1.6805996938549963e+00, -9.0838245171456080e+00, 1.9901208871396577e+03,
-2.4454046226610403e-03, -8.2658343249518724e-03, 1. ]
Please note that the output is not my concern, I am only talking about running time. So why is it different?
Thanks
EDIT: I'm using OpenCV 3.4 on a PowerVR GX6650. I tested it with and without OpenCL and the pattern is still the same.
As mentioned by #Micka in the comments, the difference seems to be given by the different number of times that the interpolation method is called.

Octave taking too long to save image files

I'm running Octave 3.8.1 on a i3 2GB DDR3 RAM powered notebook within Ubuntu 14.04 on dualboot with Windows 7.
And I'm having a really hardtime saving plots that I use on my seismologic research, they are quite simple and still I wait almost 5 min to save a single plot, the plot is built within seconds, the saving though...
Is it purely a problem with my notebook performance?
When I run a program for the first time I get the following warnings on shadowed functions, has one of them anything to do with it?
warning: function /home/michel/octave/specfun-1.1.0/x86_64-pc-linux-gnu-api-v49+/ellipj.oct shadows a built-in function
warning: function /home/michel/octave/specfun-1.1.0/erfcinv.m shadows a built-in function
warning: function /home/michel/octave/specfun-1.1.0/ellipke.m shadows a core library function
warning: function /home/michel/octave/specfun-1.1.0/expint.m shadows a core library function
Also, this started to happen when I upgraded from a very old version of Octave (2.8 if I'm not mistaken), it seems that the old one used to run on the linux default plot making functions, and the new one (3.8.1) runs on its own, is it correct? I used to take a little more time with this notebook that I take with the lab PC, but not even close to 5min+ for each plot.
Is there anything I can do, like upgrading anything within the octave or "unshadowing" the functions mentioned before?
Thanks a lot for the help.
Shadowing functions is just a name clash which is explained for example here: Warnings after octave installation
As for low performance, octave renderer doesn't seem to be well optimized for writing plots with huge number of points. For example, the following:
tic; x=1:10000; plot(sin(x)); saveas(gcf,'2123.png'); toc;
Will put octave in coma for quite a while. Even though the plot itself is made in an instant. If amounts of your data are of comparable magnitude, consider making it more sparce prior putting it on the graph.
There's no default linux plotmaker, there's gnuplot. You may try your luck with it by invoking
graphics_toolkit gnuplot
before plotting. (To me it didn't do much good though. graphics_toolkit fltk will return octave's usual plotter.)
If the slowness you refer to is in saving three dimensional plots (like mesh), the only workaround I've found on system similar to your is to use alt+prtscr.
Alternatively, you could try obtaining octave 4.0 which is released by now. It's changelogs mention yet another graphics toolkit.

Matlab GUI windowButtonMotionFcn slows down when number of GUI object gets larger

I am now programming a Matlab GUI for accessing current point of cursor on an axes whenever user changes the location of cursor. However, I found a strange phenomenon that the speed of windowButtonMotionFcn got slower with an increase in number of GUI object. Below is the result
http://i.stack.imgur.com/fwjCK.jpg
I set the properties of all GUI objects as default value and my operating Matlab version is Matlab 2012a. Is there any possible way to keep the speed of windowButtonMotionFcn when number of GUI object increases?
Thank you for your attention and help.
Myrick
I do not know exactly how the event handlig is implemented in matlab. However, it seems reasonable that more gui objects will slow the process. Think of it as, more gui objects requires more memory, more objects to handle, more code, longer lists to search through... I have also experienced that the GUIs created with GUIDE is generally slower than a GUI made by hand. This is not tested in anyway and is thus not confirmed. However, when I do not need too many objects in the GUI, I normally prefer to create them by hand. The GUIDE guis is normally more general, but in most cases only a subset of the facilities is used anyway.
Try using the figure's underlying Java frame's MouseMovedCallback:
jFrame = get(handle(hFig), 'JavaFrame');
try
% This works up to R2011a
jClient = jFrame.fFigureClient;
catch
try
% This works from R2008b and up, up to HG2
jClient = jFrame.fHG1Client;
catch
% This works in HG2
jClient = jFrame.fHG2Client;
end
end
jWindow = handle(jClient.getWindow, 'CallbackProperties');
set(jWindow, 'MouseMovedCallback', #matlabCallbackFunction);
I had a bit similar problem with "slowing" and "memory leak".
Problem was avoided by using delete(gca) before redrawing only visible objects.

What is Bonjour and why should I use it over?

What are the advantages of using Bonjour in a program (vb.net), is it even possible? Couldn't I get the same end result using just what I program?
You could probably write it yourself. But:
It would take a lot of time and effort
You would need to test it
You would need to maintain it
Using a standard tested library generally results in a cheaper and more robust solution.
http://deusty.blogspot.com/2008/03/bonjour-for-net.html

Looking for an OSX application that can do image processing using a webcam

I'm looking for an OSX (or Linux?) application that can recieve data from a webcam/video-input and let you do some image processing on the pixels in something similar to c or python or perl, not that bothered about the processing language.
I was considering throwing one together but figured I'd try and find one that exists already first before I start re-inventing the wheel.
Wanting to do some experiments with object detection and reading of dials and numbers.
If you're willing to do a little coding, you want to take a look at QTKit, the QuickTime framework for Cocoa. QTKit will let you easity set up an input source from the webcam (intro here). You can also apply Core Image filters to the stream (demo code here). If you want to use OpenGL to render or apply filters to the movie, check out Core Video (examples here).
Using theMyMovieFilter demo should get you up and running very quickly.
Found a cross platform tool called 'Processing', actually ran the windows version to avoid further complications getting the webcams to work.
Had to install quick time, and something called gVid to get it to work but after the initial hurdle coding seems like C; (I think it gets "compiled" into Java), and it runs quite fast; even scanning pixels from the webcam in real time.
Still to get it working on OSX.
Depending on what processing you want to do (i.e. if it's a filter that's available in Apple's Core Image filter library), the built-in Photo Booth app may be all you need. There's a comercial set of add-on filters available from the Apple store as well (http://www.apple.com/downloads/macosx/imaging_3d/composerfxeffectsforphotobooth.html).

Resources