Axes on image in IDL - graphics

I have an image displayed in an IDL window using the TV command, and would like to add x and y axes to the image. Seems straightforward, but I can't find a way to do it.
Can anyone help with this?
Thanks

Are you tied to direct graphics, i.e., TV? Easiest way to display with axis is to use IMAGE function:
im = image(arr, axis_style=1)

I would echo Mike's answer - go with the new graphics Image function if possible.
If you absolutely have to use direct graphics, then I would recommend using David Fanning's coyote graphics wrappers:
http://www.idlcoyote.com/idldoc/cg/cgimage.html
It's still a lot more work to do this using direct graphics, but at least with the "cg" commands it's easier.

Related

Advanced CSS Circles

I'm trying to make 3 different circles to my website. I don't want to insert it as a graphic/image file. So I've been trying to achieve it using CSS3, but I can't really work my fingers around it.
What will it look like?
I have uploaded a picture of what I'm trying to achieve at: www.sp34k.com/etc/circles.jpg
I can't really show the code I've been trying to use to achieve this, as it all looks totally weird and nothing floats currectly.
What I've tried
What I've tried is to make 3 circles with position absolute and then use % (percentage) to determine the width of the colored parts, but I can't twist my mind around how it should be set up.
Any suggestions is appreciated,
Mike
Here is a simple try of me to achieve the effect you want:
DEMO
edit: css-only solution
It can be easily animated with javascript or keyframes. Arbitrary content would go into the inner div. To change the percentage, simply adjust the angle of the pseudo-elements.
With a little more effort this could be easily refined I guess;)
Note: the transform has the webkit-prefix, so it works only in chrome/safari - to see it in firefox or other browsers, you need to change the prefix.
P.S. I will animate it when I'm home from work.
Good one by Christoph but he is using SASS/SCSS which are comparatively slow then normal CSS because they have to be converted to CSS before browser render it so I have have a different Solution for you
try this fiddle

Edit image, using openGL

I have been doing some searching the last couple of days and I have been curious how to do this. I have a UIImagePickerController.
So I want to add a effect like black and white, sepia, etc. I am creating a custom UIImagePickerVController and I am curious. Can this be done with OpenGL ES? If so, how?
This is possible through the use of pixel shaders using OpenGL-ES 2.0. You could also write an Objective-c++ routine that gets all the pixels of your image into an array then applies a custom algorithm to modify the color of the image.
Edit:
Here are some links that might help get you started.
http://www.sunsetlakesoftware.com/2010/10/22/gpu-accelerated-video-processing-mac-and-ios
http://www.dreamincode.net/forums/topic/76816-image-processing-tutorial/
http://www.efg2.com/Lab/Library/ImageProcessing/Algorithms.htm

How to implement a gradient color picker in code?

I'm wanting to program something like Photoshop's gradient color picker. I've been googling but can't find anything. Do you guys know how to do it?
It's a bit out of date (and .NET if that's your choice of framework), but in the past I've implemented an app with this ColorPicker.
I remember hacking up something like it with a static image and getPixel.

Detect an object in image using IMAGEMAGICK

I have an image with Gray Background and 'CUP' in center of it... I want to detect the boundaries of the cup in this image.. After detecting CUP I want to extract the CUP from the image using IMAGEMAGICK.. Note I have many images with different objects (like CUP) in the center and with different background color .. So I am looking for a solution which is applicable to all of them..
Plz comment..
Maybe you could use edge-detection algorithms to isolate the shape of your main object: http://en.wikipedia.org/wiki/Edge_detection
You could also look into the code for the EdgeImage effect in ImageMagick, to see how they do it...

Alternatives to using text() to adding text to a plot

This may be a naive question, but I was wondering if there's a better way than using text() to adding text to a plot. Note, I'm also using layout() as well. Specifically, I have a section of a plot where I would like to add some text with headings followed by regular text.
text() is fine it seems for simple annotations, but to get the spacing right for several lines of text seems to require a lot of manual manipulation of the x and y and cex parameters. Any suggestions?
Here are some alternative options to consider:
- the gplots package has a textplot function to add some text output in a base graphics plot.
- plotrix has a function addtable2plot
- for grid graphics grid.text() is available and in gridExtra there is a function grid.table() (see, e.g., R-Wiki)
If you're using base graphics, then text() is probably your best bet, and fiddling with coordinates etc is part of the game. If you want to learn a new framework, the lattice package is a reworking of the basic approach to plotting in R. It be installed by default so help(package='lattice') will get you started.
Here's a pretty good guide (pdf) to graphics in general in R, with a substantial section on lattice:
download

Resources