Prev: hip hop ed hardy long t-shirts true religion jeans chrsitianAudigiers long
Next: ...just submitted this request too...
From: George BC on 12 Apr 2010 16:22 Hello everyone, I'm trying to fill the inside of the outer border of this image with black... can anyone help me? [URL=http://img9.imageshack.us/i/borderc.jpg/][IMG]http://img9.imageshack.us/img9/5290/borderc.th.jpg[/IMG][/URL] thank you in advance.
From: ImageAnalyst on 12 Apr 2010 16:37 Threshold the image to find black binaryImage = grayImage == 0; then use imfill filledImage = imfill(binaryImage, 'holes'); Then multiply by your original blackenedImage = grayImage .* filledImage;
From: ImageAnalyst on 12 Apr 2010 17:57 OK George, try this: clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear all; % Erase all existing variables. workspace; % Make sure the workspace panel is showing. fontSize = 18; % Read in grayscale demo image. grayImage = imread('borderc.th.jpg'); subplot(2, 3, 1); imshow(grayImage, []); title('Original Grayscale Image', 'FontSize', fontSize); set(gcf, 'Position', get(0,'Screensize')); % Maximize figure. % Crop out stuff we don't want. croppedImage = imcrop(grayImage, [5, 3, 143, 90]); subplot(2, 3, 2); imshow(croppedImage, []); title('Cropped Image', 'FontSize', fontSize); binaryImage = croppedImage < 250; subplot(2, 3, 3); imshow(binaryImage, []); title('Binary Image', 'FontSize', fontSize); % Fill the image. filledImage = imfill(binaryImage, 'holes'); subplot(2, 3, 4); imshow(filledImage, []); title('Filled Binary Image', 'FontSize', fontSize); % Negate it so the center is black. filledImage = ~filledImage; subplot(2, 3, 5); imshow(filledImage, []); title('Negated Filled Binary Image', 'FontSize', fontSize); % Multiply by original. finalImage = croppedImage .* uint8(filledImage); subplot(2, 3, 6); imshow(filledImage, []); title('Final Image', 'FontSize', fontSize);
From: George BC on 12 Apr 2010 19:00
THANK YOU!! worked perfectly here!!!! |