Changing masking colour around waveform on custom Soundcloud player - api

before I start I'm not a developer, so apologies in advance for any potentially daft questions. Our developer has just integrated a custom soundcloud player for our website http://www.samplephonics.com/ (see when you hover over the top 8 or recent sample packs) but I want to change the light grey background colour around the waveform to white.
As far as I am aware it's configured so that the light grey mask displays the shape of the waveform as a hole, which then has solid light grey, grey and dark grey images behind to show the apparent colour of the waveform in idle, loading and playing states..
Does anyone know how we can change this mask to white, or have any ideas I can send his way? He used this example as a starting point for creating the player: http://static.soundcloud.com/demos/soundcloud-custom-player/examples/sc-player-minimal.html
Thanks in advance :)

I've previously answered this here – https://stackoverflow.com/a/14731623/236135
unless the library you want to use for waveform customisation is using HTML5 canvas, you won't be able to use change the color of that chrome (so no, not possible with either HTML5 Widget API or Custom Player API)
In short, you'd have to use canvas or manipulate the images on the server and retrieve them from server.

Related

Images appear "washed out" based on background color, using EMGU Camera library

I'm using the EMGU CV .NET library. I noticed that when I take pictures of anything with color, the colors usually get "washed out" if the background is dark(ish). General rule of thumb I've found is that, the darker the background is, the more washed out the colors are.
Here is how I'm retrieving the image from the camera with EMGU.
Dim imgFeed As Bitmap = mCamera.RetrieveBgrFrame.ToBitmap
In the images below (cropped out some of the background on both), the left image is on dry white cement and the right image is on wet white cement. You can see the "washed out" color especially on the first tag, which is bright orange duct tape.
Here is another image, taken on black pavement in the sun, which in reality is much darker than the white cement, but appears similar in color to the background in the wet cement image above.
Is there some sort of auto-balancing that's occurring in the EMGU library? If so, can I stop this from happening? I need to see the colors more clearly than the background. I've read about _EqualizeHist() and I implemented it, but that did not help me see the colors any more clearly; adding contrast to the image didn't really help because the colors were already close to white.
Update
After reading Spark's answer, I found the SetCaptureProperty() method. I see that you can disable the auto exposure property by setting the value to 0 as shown below.
mCamera.SetCaptureProperty(CvEnum.CAP_PROP.CV_CAP_PROP_AUTO_EXPOSURE, 0.0)
Sadly though, with the particular camera I'm using, it looks like the driver does not support changing this property.
This is nothing to do with the algorithm. It is the behavior of Auto Exposure (AEC) algorithm running inside camera chip. Try disabling auto exposure control of camera and reduce the manual exposure level.
Little theory: Most of the AEC algorithm works with full frame weighted method. So in the sample which you showed for white washed case, the black background occupies more portion of the image, which make AEC algorithm to assume that the image is too dark and hence increase exposure level internally.

ApplicationBarIconButton not displaying

I create images from online at picresize.com to use as application bar icons. I made them 48 x 48. The only thing I didn't do was make the background transparent. Now the icons just show as white blocks and nothing else. This page, http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff431806(v=vs.105).aspx, specifies what should be done but doesn't say a must. Any thoughts or experiences in this happening to others?
appBarButton =
new ApplicationBarIconButton(new Uri("/Assets/AppBar/<my_button>.png", UriKind.Relative));
appBarButton.Text = "<text>";
appBarButton.Click += appBarButton_Click;
ApplicationBar.Buttons.Add(appBarButton);
The transparent background is a must.
Instead of using that picresize.com web service, you should probably learn to use Photoshop, Paint.Net, or any other descent image editor that works on your computer not on someone else's computer.

Is there a way to take an image file and make its background transparent via VB .NET?

We have a system where people are being taken a face shot via a DSLR camera. We need the people's images with transparent background. What we're currently doing is taking the image and editing and cropping it in Photoshop, removing the background image with the Magic Eraser tool.
What I am looking for is a way to parse the image and automatically erase the semi-white background we have, along with the resizing and cropping. Is there some kind of library or code sample that does this without requiring manual intervention?
This is a real complex problem. Like the answer below suggested you'll need to do a fuzzy match on each pixel and set it to be transparent but you also need to detected other nearby pixels to make sure they are not close in color. A white tag on the shirt, white eyelids, hair, pale skin reflecting the flash. All are candidates to be removed by any greedy fuzzy logic.
Think about the Magic Wand tool in Photoshop. How good is it at detecting the edges of the person in the picture? Yeah, and that's the top standard of image editing software with thousands of engineering hours behind it.
This is not a feasible request for a Q&A format, and this is one of those things that humans just do better than machine. BUT, that doesn't mean it's not possible, and who knows, you might be the one to do it. Just don't do it in VB.NET please :)
Some pseudo-code to get an idea of what you need to do:
Bitmap faceShot = Bitmap.FromFile(filepath)
foreach pixel in faceShot
//the following line is where the magic happens, you can do any fuzzy match on the color that suits you
//figure out your color range and do a fuzzy match percentage wise
if (pixel between RGB(255,255,255) and RGB(250,235,215)) //white and antique white
pixel.setAlpha=0
endif
end foreach
You could start with this as a starting point for processing a single image,
http://www.java2s.com/Code/VB/2D/ProcessanImageinvertPixel.htm
Basically, if you have a constant background color (like the TV green-screen), it's just a matter of selecting pixels close to the color you are erasing and setting their Alpha level to 0 (transparent). Treating the RGB values like XYZ coordinates, you can do a 3d distance from your background color, and make everything within a certain threshold transparent.
As an improvement, you could also make everything within another threshold semi-transparent so the edges right around hair and stuff like that look softer and less harsh.
Alternatively, you could probably do the same exact thing with good results in Photoshop, as it should support batch processing.
Edit, thinking about it some more, you may want to use a green screen type background as well instead of an off-white one like you stated, as you may make people's eyes transparent. I would definitely try to batch it in Photoshop/Gimp/etc.

as2 dynamically change flash movie clip colour onRollover

Hi I have a flash map of the world
onRollover a region changes color
onRollout changes back no probs
BUT
I dont want to tween these as my flash file is massive
Can any point me to a tutorial or have any ideas at all.
I cannot do buttons as i need smooth transition also between rollover and rollout.
I have trawled the net and have found nothing to help me in as2.
I really would appreciate any help at all - miss_j2000
To do tweening programatically in AS2, you use the Tween class. There's a good tutorial on Kirupa on how to use it.

how to detect body in image in objective-c?

is there a way we can detect a person's body in the image and cut the only body part of the image.
If the person is naked, you could use skin color segmentation.
I am not sure if you really need to detect a person's body for your application. Maybe a "simple" background substraction algorithm would also work in your case.
With background substraction what you do is to build a background model, during the time there is no foreground (person) present in the image. Then you can use the background model to determine if a pixel belongs to the foreground or to the background. Unfortunately background substraction algorithm have problems with moving backrounds and sudden light changes...
Another idea would be to start with face detection á la Viola/Jones' haar like features...
If you thought a user might only use your app a few times, uploading an image to Amazon's mechanical turk is probably your best bet.
Yes, sometimes, but it is very hard. If the body is in front of a blue or green or other uniform color, it's easy. If the body is in focus and the background isn't then it's quite possible. Otherwise it is hard-to-impossible.
Start here (and use Google yourself):
http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=833514
http://www.patentstorm.us/patents/5987154/claims.html
http://www.diffusion.ens.fr/index.php?res=conf&idconf=949
http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6V09-4KST3G7-1&_user=10&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_searchStrId=1034815145&_rerunOrigin=google&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=08a38011d31bc84e7e9432d70ebb6ab5
http://web.mit.edu/shivani/www/Papers/2004/pami04.pdf
http://www.cs.cmu.edu/~jch1/research/old/sword_allocation.pdf
http://www2.computer.org/portal/web/csdl/doi/10.1109/TPAMI.2004.108
http://portal.acm.org/citation.cfm?id=1136661