Search Results

Search found 4489 results on 180 pages for 'black cobra'.

Page 47/180 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Problem with averaging corrupted images to eliminate the noise in MATLAB

    - by Mertie Pertie
    I want to average some .jpg images which are corrupted by zero-mean Gaussian additive noise. After searching around, I figured out to add the image matrices and divide the sum by the number of matrices. However, the resultant image is totally black. Normally when the number of image increases then the resultant image gets better. But when I use more images it gets darker. I am using 800x600 black and white .jpg images. Here is the script I used: image1 = imread ('PIC1.jpg'); image2 = imread ('PIC2.jpg'); image3 = imread ('PIC3.jpg'); image4 = imread ('PIC4.jpg'); sum = image1 + image2 + image3 + image4; av = sum / 4; imshow(av);

    Read the article

  • Averaging corrupted images to eliminate the noise

    - by Mertie Pertie
    Hi all As you can get it from the title, I want to average some .jpg images which are corrupted by zero-mean Gaussian additive. After searching over internet, I figured out to add image matrices and divide the sum by the # of matrices. However the resultant image is totally black. Normally when the number of image increases then the resultant image gets better. But When I use more images it gets darker. I am using 800x600 black and white images with .jpg ext Here is the script I used; image1 = imread ('PIC1.jpg'); image2 = imread ('PIC2.jpg'); image3 = imread ('PIC3.jpg'); image4 = imread ('PIC4.jpg'); sum = image1 + image2 + image3 + image4; av = sum / 4; imshow(av); Thanks in advance

    Read the article

  • List of fundamental data structures - what am I missing?

    - by jboxer
    I've been studying my fundamental data structures a bunch recently, trying to make sure I've got them down cold. By "fundamental", I mean the real basic ones. Fancy ones like Red-Black Trees and Bloom Filters are clearly worth knowing, but they're usually either enhancements of fundamental ones (Red-Black Trees are binary search trees with special properties to keep them balanced) or they're only useful in very specific situations (Bloom Filters). So far, I'm "fluent" in the following data structures: Arrays Linked Lists Stacks/Queues Binary Search Trees Heaps/Priority Queues Hash Tables However, I feel like I'm missing something. Are there any fundamental ones that I'm forgetting about? EDIT: Added these after posting the question Strings (suggested by catchmeifyoutry) Sets (suggested by Peter) Graphs (suggested by Nick D and aJ) B-Trees (Suggested by tloach) I'm a little on-the-fence about whether these are too fancy or not, but I think they're different enough from the fundamental structures (and important enough) to be worth studying as fundamental.

    Read the article

  • presentModalViewController NOT animating when showing a TTMessageController

    - by wgpubs
    I have a subclass of TTMessageController that shows ... BUT it is not animated even though it should be. The code that displays the modal view looks like this (where PostToWebMessageController is the subclass of TTMessageController: if (self.toWebMsgController == nil) { self.toWebMsgController = [[PostToWebMessageController alloc] init]; } UINavigationController *navController = [[UINavigationController alloc] init]; [navController pushViewController:self.toWebMsgController animated:NO]; [self presentModalViewController:navController animated:YES]; What happens though is this: The screen goes black ... the keyboard scrolls up into view ... and THEN the TTMessageController view shows up (not animated). When I dismiss the view via a Cancel button the screen goes black and then just disappears (no animation again). Any ideas why this is happening? I've this with a number of other TT* controllers and I can't get one to animate right with showing modally. Thanks

    Read the article

  • Windows splash screen using GDI+

    - by Luther
    The eventual aim of this is to have a splash screen in windows that uses transparency but that's not what I'm stuck on at the moment. In order to create a transparent window, I'm first trying to composite the splash screen and text on an off screen buffer using GDI+. At the moment I'm just trying to composite the buffer and display it in response to a 'WM_PAINT' message. This isn't working out at the moment; all I see is a black window. I imagine I've misunderstood something with regards to setting up render targets in GDI+ and then rendering them (I'm trying to render the screen using straight forward GDI blit) Anyway, here's the code so far: //my window initialisation code void MyWindow::create_hwnd(HINSTANCE instance, const SIZE &dim) { DWORD ex_style = WS_EX_LAYERED ; //eventually I'll be making use of this layerd flag m_hwnd = CreateWindowEx( ex_style, szFloatingWindowClass , L"", WS_POPUP , 0, 0, dim.cx, dim.cy, null, null, instance, null); SetWindowLongPtr(m_hwnd ,0, (__int3264)(LONG_PTR)this); m_display_dc = GetDC(NULL); //This was sanity check test code - just loading a standard HBITMAP and displaying it in WM_PAINT. It worked fine //HANDLE handle= LoadImage(NULL , L"c:\\test_image2.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); m_gdip_offscreen_bm = new Gdiplus::Bitmap(dim.cx, dim.cy); m_gdi_dc = Gdiplus::Graphics::FromImage(m_gdip_offscreen_bm);//new Gdiplus::Graphics(m_splash_dc );//window_dc ;m_splash_dc //this draws the conents of my splash screen - this works if I create a GDI+ context for the window, rather than for an offscreen bitmap. //For all I know, it might actually be working but when I try to display the contents on screen, it shows a black image draw_all(); //this is just to show that drawing something simple on the offscreen bit map seems to have no effect Gdiplus::Pen pen(Gdiplus::Color(255, 0, 0, 255)); m_gdi_dc->DrawLine(&pen, 0,0,100,100); DWORD last_error = GetLastError(); //returns '0' at this stage } And here's the snipit that handles the WM_PAINT message: ---8<----------------------- //Paint message snippit case WM_PAINT: { BITMAP bm; PAINTSTRUCT ps; HDC hdc = BeginPaint(vg->m_hwnd, &ps); //get the HWNDs DC HDC hdcMem = vg->m_gdi_dc->GetHDC(); //get the HDC from our offscreen GDI+ object unsigned int width = vg->m_gdip_offscreen_bm->GetWidth(); //width and height seem fine at this point unsigned int height = vg->m_gdip_offscreen_bm->GetHeight(); BitBlt(hdc, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY); //this blits a black rectangle DWORD last_error = GetLastError(); //this was '0' vg->m_gdi_dc->ReleaseHDC(hdcMem); EndPaint(vg->m_hwnd, &ps); //end paint return 1; } ---8<----------------------- My apologies for the long post. Does anybody know what I'm not quite understanding regarding how you write to an offscreen buffer using GDI+ (or GDI for that matter)and then display this on screen? Thank you for reading.

    Read the article

  • Problem with graphiz on Unix

    - by J3n
    When I'm on Unix, my graphs with graphphiz are less nice. The tail or the head of the edge is not always linked to the boundary of the port. You can see the result here : http://www.freeimagehosting.net/image.php?59d8eb4b30.jpg <xsl:value-of select="$source"/>:<xsl:value-of select="$prot"/> -&gt; <xsl:value-of select="$destination"/>:<xsl:value-of select="$prot"/>[color="black",label="<xsl:value-of select="$prot"/>",fontcolor="black",tailclip=true,headclip=true];

    Read the article

  • Averaging corrupted images to eliminate the noise in Matlab

    - by Mertie Pertie
    Hi all As you can get it from the title, I want to average some .jpg images which are corrupted by zero-mean Gaussian additive. After searching over internet, I figured out to add image matrices and divide the sum by the # of matrices. However the resultant image is totally black. Normally when the number of image increases then the resultant image gets better. But When I use more images it gets darker. I am using 800x600 black and white images with .jpg ext Here is the script I used; image1 = imread ('PIC1.jpg'); image2 = imread ('PIC2.jpg'); image3 = imread ('PIC3.jpg'); image4 = imread ('PIC4.jpg'); sum = image1 + image2 + image3 + image4; av = sum / 4; imshow(av); Thanks in advance

    Read the article

  • Android Nexus One - Can I save energy with color scheme?

    - by Max Gontar
    Hi! I'm wondering what color-scheme is more energy-saving for AMOLED display? I've already decided to manage c-scheme according to ambient light, thanks to this post: Somewhat-proof, the link posted by nickf: Ironic Sans: Ow My Eyes. If you read that in a well lit room, the black-on-white will be the most pleasant to read. If you read it in a dark room, the white-on-black will be nicer. But if I want to save battery power, should I use bright content with light background or vice versa? Is it possible anyway (they say it's not)? Thanks!

    Read the article

  • Correct (pretty) window redraw during the creation

    - by Coder
    Does anyone know what is a correct way to redraw window during lengthy initialization operations? Say I have HWND with NULL brush, and it does some not so quick child window initialization (Window initialization is not so quick on Vista and 7, especially on netbooks, even with threaded app). With this config window stays black for half a second on slower laptops. But if I supply window color brush, it seems that there are some sort of child controls or something that draws black squares on top of it, which also seems ugly. Even though the controls are created without WS_VISIBLE initially. Oh, the window has the WS_EX_COMPOSITED style, which should do the double buffering to avoid flicker. But it still behaves ugly. Are there any other tricks I've forgotten, missed?

    Read the article

  • C# 4.0: Can I use a Color as an optional parameter with a default value?

    - by DTown
    public void log(String msg, Color c = Color.black) { loggerText.ForeColor = c; loggerText.AppendText("\n" + msg); } This results in an error that c must be a compile-time constant. I've read up on this a little and most examples are dealing with strings and ints. I've figured out I can use the colorconverter class but I'm not sure it will be very efficient. Is there a way to just pass a basic color as an optional parameter? public void log(String msg, String c = "Black") { ColorConverter conv = new ColorConverter(); Color color = (Color)conv.ConvertFromString(c); loggerText.ForeColor = color; loggerText.AppendText("\n" + msg); }

    Read the article

  • How to implement a TypeConverter for a type and property I don't own?

    - by CannibalSmith
    This is annoying: <GeometryDrawing> <GeometryDrawing.Pen> <Pen Brush="Black"/> </GeometryDrawing.Pen> </GeometryDrawing> I want this: <GeometryDrawing Pen="Black"/> So I write a TypeConverter: public class PenConverter : TypeConverter { static readonly BrushConverter brushConverter = new BrushConverter(); public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) { if (sourceType == typeof(string)) return true; return base.CanConvertFrom(context, sourceType); } public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { var s = value as string; if (a != null) { var brush = brushConverter.ConvertFromInvariantString(s) as Brush; return new Pen(brush, 1); } return base.ConvertFrom(context, culture, value); } } Now, how do I link it up with the Pen type? I can't just add a TypeConverterAttribute to it as I don't own it (nor do I own GeometryDrawing.Pen property).

    Read the article

  • TextBox Borders in Reporting Services (Report Builder 3.0)

    - by ChrisHDog
    I have a report that I am creating in Report Builder 3.0 that I appear unable to set the color value (or any value) on TextBoxes Borders. I have a list that I have added a text box to. I then click on the text box and select Text Box Properties ... then click Border, the value for Color: is Black. If I change this value to anything else and then click OK, then come back into Text Box properties it is set back to Black. Any idea what is going on here? Is this not the correct way to set a border color?

    Read the article

  • how to make shadows for transparent objects using ray tracing in C++/openGL

    - by happy face
    I'm trying to make a code that cast shadow from trasnparent objects(such as glass) for rendering in 3D I do not have a shadow map and photon mapping yet, and I wanted to know if there is a way to make shadows for transparent materials using ray tracing only. Caustics sounds very hard without photon mapping... I have implemented a simple code in C++ that only makes the shadows black (no matter if the objects are transparent or opaque) Pseudo code would be great, thnx. for(size_t i = 0;i < num; ++i) { if(state_list[i].hit && state_list[i].distance < dist_from_light[i]) { return[i] = BLACK; }

    Read the article

  • How to generate graphics into photoshop using actionscript?

    - by understack
    I've a text file with content like this: id, pixelsize, color, text block1, 200x60, black, Header block2, 200x180, white, Body block2, 200x60, black, Footer Now using actionscript, I want to generate a psd file which would generate a 3 vertical block graphics (like this) after parsing the given file. All the blocks are placed vertically on top of each other. Convert this psd file into PDF automatically using the script. Automate this whole process without opening photoshop. Is it possible? Please help. Thanks.

    Read the article

  • how to make components visible in a transparent JFrame

    - by Md. Mahmudul Hasan
    I have some JButtons in a JFrame (its layout is null). The background Color of the buttons are set Black. I have made the JFrame Transparent by using this code. AWTUtilities.setWindowOpacity(this, 0); But the problem is it also makes all the buttons transparent as well. I don't want that. I want to see the buttons remaining black but the other portions of the JFrame becoming transparent (so that I can see the desktop background). Please someone help me. Thanks in advance.

    Read the article

  • How do i use a transparent image in a transparent image using GD?

    - by hogofwar
    I have tried every way I can find but the background is always black. Is there any way to keep the transparency of the first image when GD ises it in PHP? I'm using imagecopymerge to use the image. though i am not sure if this is the right way. imagecopymerge($dest, $char, 0, 0, 0, 0, 150, 300, 100); The image is like so: http://filesmelt.com/dl/draw7.php.png See that the background is black whereas the roginal picture was transparent as the modified picture should be aswell

    Read the article

  • Problems encountered in changing a CRichEditCtrl selection color.

    - by dev ray
    I have written the following code after creating the CRichEditCtrl // 06112010 : The following code was added to highlight the textselection in black color instead of the default blue color of CRichEditCtrl. - 1311 { m_EditControl.SetSel(0,100); CHARFORMAT2 cf1; cf1.cbSize = sizeof(CHARFORMAT2); m_EditControl.GetSelectionCharFormat(cf1); cf1.dwMask = CFM_BACKCOLOR ; cf1.dwEffects &= ~CFE_AUTOBACKCOLOR; cf1.crBackColor = RGB(0,0,0); m_EditControl.SetSelectionCharFormat(cf1); m_EditControl.Invalidate(); } After this I am adding text, but the selection still comes in blue color instead of Black. Could someone please tell me what I am doing wrong?? Thanks, DeV

    Read the article

  • List/Grid Toggle for Photo Gallery with Shadowbox

    - by InfamouslyBubbly
    so I'm new to this site, and new to jquery, and javascript as a whole really, but I have very good comprehension of HTML and CSS. For a class in school, I'm making a photo gallery webpage using the Shadowbox plugin. I have that part all down, but one of the requirements is to add some sort of user option that the user can change that will get saved in a cookie. (I haven't gotten to the cookie part yet) For my option, I decided to add a toggle that will switch the view of the page from a grid view (default) with images, to a list view of just the captions of the images. I figured out how to do that, but decided it could probably done in a much simpler fashion with the use of loops. Here is the HTML I have: <body> <div id="preferences"> <h1>My Photo Gallery</h1> <ul id="options"> <li><a href="#" id="list"><img src="media/listview.png" alt="List view"/></a></li> <li><a href="#" id="grid"><img src="media/gridview.png" alt="List view"/></a></li> </ul> </div> <div id="gallery"> <a rel="shadowbox[Gallery]" class="l1 img" href="media/img1.jpg" title="Black and White Leopard Pattern"><img src="media/thumb1.jpg" alt="Black and White Leopard Pattern"/></a> <a rel="shadowbox[Gallery]" class="l2 img" href="media/img2.jpg" title="Snow Leopard Pattern"><img src="media/thumb2.jpg" alt="Snow Leopard Pattern"/></a> <a rel="shadowbox[Gallery]" class="l3 img" href="media/img3.jpg" title="Colorful Triangle Pattern"><img src="media/thumb3.jpg" alt="Colurful Triangle Pattern"/></a> <a rel="shadowbox[Gallery]" class="l4 img" href="media/img4.jpg" title="Tie Dye Zebra Stripe Pattern"><img src="media/thumb4.jpg" alt="Tie Dye Zebra Stripe Pattern"/></a> <a rel="shadowbox[Gallery]" class="l5 img" href="media/img5.jpg" title="Blue Knitted Pattern"><img src="media/thumb5.jpg" alt="Blue Knitted Pattern"/></a> <a rel="shadowbox[Gallery]" class="l6 img" href="media/img6.jpg" title="Black and White Damask Pattern"><img src="media/thumb6.jpg" alt="Black and White Damask Pattern"/></a> <a rel="shadowbox[Gallery]" class="l7 img" href="media/img7.jpg" title="Wooden Panel Pattern"><img src="media/thumb7.jpg" alt="Wooden Panel Pattern"/></a> <a rel="shadowbox[Gallery]" class="l8 img" href="media/img8.jpg" title="Brick Pattern"><img src="media/thumb8.jpg" alt="Brick Pattern"/></a> <a rel="shadowbox[Gallery]" class="l9 img" href="media/img9.jpg" title="Watercolor Pattern"><img src="media/thumb9.jpg" alt="Watercolor Pattern"/></a> <a rel="shadowbox[Gallery]" class="l10 img" href="media/img10.jpg" title="Orange Stripe Pattern"><img src="media/thumb10.jpg" alt="Orange Stripe Pattern"/></a> <a rel="shadowbox[Gallery]" class="l11 img" href="media/img11.jpg" title="Blue Scales Pattern"><img src="media/thumb11.jpg" alt="Blue Scales Pattern"/></a> <a rel="shadowbox[Gallery]" class="l12 img" href="media/img12.jpg" title="Woven Pattern"><img src="media/thumb12.jpg" alt="Woven Pattern"/></a> </div> </body> So here is the sample that works (for the list portion anyways), but seems excessive in terms of code since I'd have to repeat for each image: $(document).ready(function(){ $( "#list" ).click(function() { $( "a.l1" ).removeClass( "img" ); $( "a.l1" ).addClass( "lst" ); $( "a.l1" ).text( $( "a.l1" ).attr( "title" ); //repeat for l1 through l12 (that`s the letter L not a 1) }); $( "#grid" ).click(function() { $( "a.l1" ).removeClass( "lst" ); $( "a.l1" ).addClass( "grid" ); //actually have no idea at all how to get this back to the original img tag other than maybe .innerHTML??? //repeat for l1 through l12 (again, that`s the letter L not a 1) }); }): And here is kinda how I'd like it (Y'know, except in a way that works) $(document).ready(function(){ var i = 1; var selcur = $( "'a.l" + i + "'" ); var title = selcur.attr( "title" ); var image = '<img src="media/thumb' + i + '.jpg" alt="' + title + '"/>'; $( "#list" ).click(function() { while (1<=12) { selcur.addClass("lst"); selcur.removeClass("img"); selcur.text( title ); i++; } i = 1; }); $( "#grid" ).click(function() { while (1<=12) { selcur.removeClass("lst"); selcur.addClass("img"); selcur.text( image ); i++; } i = 1; }); }); Please tell me how I am going about this wrong, keep in mind again I'm new to this, I appreciate any and all responses! Is there a better way to do this? I really want to keep it simple.

    Read the article

  • The emulator isn't showing the XML contents

    - by Roni Copul
    I have been reading Google's android tutorial (link added in the first comment) and I got a problem... In the tutorial they explain the XML elements (EditText and Button) and in the end they say how to tun the program to see the button + the text field. The problem is, that the emulator doesn't show them.. just a black screen. I even tried adding this line to the onCreate function - System.out.println("Hello World!"); but still the emulator is showing only black screen.. Here's the .java main file - http://pastebin.com/G5J9YjNe And the XML files (I mentioned what code is what file) - http://pastebin.com/VnRwAfMW What should I do? Thanks a lot for everyone who will help!

    Read the article

  • Right align text in an image with imagettftext(), PHP

    - by James Simpson
    I am setting up dynamic forum signature images for my users and I want to be able to put their username on the image. I am able to do this just fine, but since usernames are different lengths and I want to right align the username, how can I go about doing this when I have to set x & y coordinates. $im = imagecreatefromjpeg("/path/to/base/image.jpg"); $text = "Username"; $font = "Font.ttf"; $black = imagecolorallocate($im, 0, 0, 0); imagettftext($im, 10, 0, 217, 15, $black, $font, $text); imagejpeg($im, null, 90);

    Read the article

  • HTML5 Canvas compositing question (source-in)

    - by Alex Ciarlillo
    I am trying to recreate a page flipping type animation in HTML5 using canvas. The animation is based on ideas from here: hxxp://oreilly.com/javascript/archive/flashhacks.html but thats not really important. The problem I am having is that using the 'source-in' composite operation is not giving me the results I expect and would like clarification as to why. Here is the example: (i think it can only be viewed in chrome, not working in FF 3.6) http://acpound.fylez.com/test/example.html The black rectangle is supposed to act as a 'mask' for the page being turned over. All I want to see is the turning page in the areas where it overlaps the mask. The problem is the entire black rectangle is drawn, not just the area where they overlap. The source is all on the page. I know HTML5 isn't really being used yet, I'm just experimenting for my personal site and curiosity. Any ideas would be greatly appreciated.

    Read the article

  • How to get a green to show up like the charging battery on the iPhone lock screen?

    - by tarheel
    I am trying to get a color to show up on screen just like the charging battery (shown here): After looking at the Apple Documentation on UIColor here, I have attempted using both colorWithHue:saturation:brightness:aplha: and colorWithRed:green:blue:alpha: to get a color to show up like that. For example when I use colorWithHue:.3 saturation:.84 brightness:1 alpha:.5 on a black background, it renders a color like this: or the colorWithRed:0 green:1 blue:0 alpha:.5 on a black background shows up like this: It doesn't have that translucent or glossy look to it. Is there a better method to use? Or do I just not have the values right? (I have tried many combinations)

    Read the article

  • Android changing colors with themes

    - by miannelle
    I am trying to provide user settable colors in my app. White text on black background and black text on white background. I have multiple layouts with many listviews, both standard and custom adapters. People have suggested using Themes, but I have had no luck changing the text colors across all layouts. Can anyone show me an actual Theme layout that can accomplish this? I can easily change the background colors using myscreen.setBackGroundColor(xx), but when I try to change the text with a theme, it also changes spinner text as well.

    Read the article

  • Html + Css: How to create a auto-resizing rotated background?

    - by Sebastian P.R. Gingter
    Hi, image a complete black web page. On this web page is a 100% size white div that fills the whole page. I'd like to rotate this div by -7 degrees (or 7 degrees counter-clock wise). This will result in the black background being visible in triangles on the edges, just like you had placed a piece of paper on a desk and turned it a bit to the left. Actually this can be done with some css and it's working quite well (except for IE). The real problem now is: I'd like to have a normal, non-rotated div element on top of that to display the content in, so that only the background is rotated. Rotating a contained div counterwise doesn't work though, because through the two transformations the text will be blurry in all browsers. How can I realize that? Best would be a solution workiing in current Webkit browsers, FF3.5+ and IE7+. If only IE8+ I could live with that too.

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >