marking on image
1 次查看(过去 30 天)
显示 更早的评论
I want to know how can I mark on a threshold segmented image in the segment of it which one of the morphological extracted features is greater than a specified threshold?
0 个评论
采纳的回答
Image Analyst
2012-4-7
Please look over this demo and see how you use ismember to select objects bigger than 95 pixels, and how you use just normal indexing/assignment to set all those objects to 254 in a single line of code. This is an adaptation of my Image Segmentation tutorial at my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures.
workspace; % Make sure the workspace panel is showing.
fontSize = 20;
% Create sample image.
originalImage = propsSynthesizeImage;
subplot(2, 2, 1);
imshow(originalImage);
impixelinfo; % Allow cursor to show gray levels.
title('Synthetic Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
% Threshold the image to get a binary image (only 0's and 1's) of class "logical."
thresholdValue = 190;
binaryImage = originalImage > thresholdValue; % Bright objects will be the chosen if you use >.
subplot(2, 2, 2);
imshow(binaryImage);
title('Binary Image', 'FontSize', fontSize);
% Label the image.
[labeledImage numberOfOriginalBlobs] = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
blobMeasurements = regionprops(labeledImage, originalImage, 'all');
% Now I'll demonstrate how to select certain blobs based using the ismember function.
% Let's say that we wanted to find only those blobs
% with an area greater than 95 pixels.
allBlobAreas = [blobMeasurements.Area];
% Get a list of the blobs that meet our criteria and we need to keep.
allowableAreaIndexes = allBlobAreas > 95; % Take the large objects.
keeperIndexes = find(allowableAreaIndexes);
% Extract only those blobs that meet our criteria, and
% eliminate those blobs that don't meet our criteria.
% Note how we use ismember() to do this.
keeperBlobsImage = ismember(labeledImage, keeperIndexes);
% Re-label with only the keeper blobs kept.
[areasGT95Image numberOfBlobs] = bwlabel(keeperBlobsImage, 8); % Label each blob so we can make measurements of it
% Now we're done. We have a labeled image of blobs that meet our specified criteria.
subplot(2, 2, 3);
% Convert the labeled image back to a binary image.
binary95 = areasGT95Image > 0;
imshow(binary95, []);
title('"Keeper" blobs larger than 95 pixels', 'FontSize', fontSize);
% Make those pixels have a value of 254 in the original image.
outputImage = originalImage; % Make a copy
outputImage(binary95) = 254; % Change the copy.
% Display the final output image.
subplot(2, 2, 4);
imshow(outputImage, []);
title('Original blobs larger than 95 pixels = 254', 'FontSize', fontSize);
2 个评论
Image Analyst
2012-4-10
It might have been what you wanted if you said what you wanted. "which one of the morphological extracted features is greater than a specified threshold" is not exactly very specific.
更多回答(3 个)
bahar h
2012-4-14
1 个评论
Image Analyst
2012-4-14
I don't know how "some points are displayed" but if you used plot() or some other type of graphics function to put stuff into the overlay, you can just call axes() to set the current axes, then call plot(), then call hold on, then call plot again to plot all your other points that you want to be on the same image. (Don't switch to another axes or else they'll appear there instead.)
On the other hand if you want to superimpose all the images, you can do this:
meanImage = (single(image1) + single(image2) + ..... + single(image9))/9;
imshow(meanImage, []);
sneha
2012-4-18
hi expert......... i m working on car license plate recognition...can u tell me how cold i recognize characters fron license plate using OCR...plz ans me
1 个评论
Image Analyst
2012-4-18
You're best off searching for license plate or LPR in this forum. This question is asked almost daily here.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!