% define scale bar: firstFrame = read(vidObj,1); imshow(firstFrame,'InitialMagnification',300); title('Define the scale bar region:','FontSize',16); scaleBar = drawrectangle('Color',[1 1 0]); roi_Bar = scaleBar.Position; % cropped and screwed: I = imcrop(firstFrame, roi_Bar); figure; imshow(I); % remove black border: mask = (I(:, :, 1) == 0) & (I(:, :, 2) == 0) & (I(:, :, 3) == 0); I(mask) = []; figure; imshow(I); % this returns a horrific result
NOTE:-
All black pixels cannot be removed since the image must remain rectangular. You can remove whole rows or whole columns, but not randomly scattered isolated groups of black pixels. With that colorbar image you have, you could delete everything up to and including the black outline of the colormap. Is that what you want to do?
Deleting everything up to and including the black outline would be great.
Then Wait, the pseudocolored thermal picture you attached is nothing like the small color bar image inserted into the body of your message. So let me get this straight. You want just the color bar itself, without the black outline around it and without any other stuff in the scene - just the color bar alone, right? And do you want the color bar cropped out to be its own output image?
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment