Create label for conical surface - ms-word

Is it possible to create labels for conical surfaces in MS-word.
I have a label ready, but it needs to adapt to that the printed label can be pasted on a conical surface (e.g. a coffee cup)

I doubt it. You could try using WordArt: these are predefined shapes, maybe one of those matches what you want to do.
I suspect you'd be better off using a program like Adobe Illustrator, which can convert text to vector images which you can distort any way you like.
The bigger problem is that the label won't fit properly on a shape that is curved in two dimensions: you'll always have folds somewhere.

Related

Image segmentation algorithm in MATLAB

I need to implement an image segmentation function in MATLAB based on the principles of the connected components algorithm, but with a few modifications. This is intended for very simple, 2D images, with a background color and some objects in different colors.
The idea is that, taking the image as a matrix, I provide a tool to select the background color (it will vary for every image). Then, when the value of the color of the background of the image is selected, I have to segment all the objects in the image, and the result should be a labeled matrix, of the same size of the image, with 0's for the background, and a different number for each object.
This is a graphic example of what I mean:
I understand the idea of how to do it, but I do not know how to implement it on MATLAB. For each pixel (matrix position) I should mark it as visited and then if the value corresponds to the one of the background, assign 0, if not, assign another value. The objects can be formed by different colors, so in the end, I need to segment groups of adjacent pixels, whatever their color is. Also I have to use 8-connectivity, in order to count the green object of the example image as only one object and not 4 different ones. And also, the objects should be counted from top to bottom, and from left to right.
Is there a simple way of doing this in MATLAB? I know the bwlabel function, but it works for binary images only, so I'd like to adapt it to my case.
once you know the background color, you can easily convert your image into a binary mask of the same size:
bw=img!=bg_color;
Once you have a binary mask you can call bwlavel with 8-connectivity argument as you suggested yourself.
Note: you might want to convert your color image from RGB representation to an indexed image using rgb2ind before processing.

Morphological operation to improve the shape of segmented image

I have an ellipse in the image.After segmentation i got a broken ellipse as shown .which morphological operation is used to get the perfect ellipse
Actual input file is
output obtained is
i tried imopen ,but i will lose lower ellipse like structure .how to close the upper ellipse like structure without losing lower ones
Mask i created is
i want to segment the ellipse like structure.but some of these structures are connected with rectangular like bodies.how to separate it. erode will eliminate small ellipses
If you want to reconnect something with a mathematical morphology operator, do not use an opening (it increases the gap), but a closing (imclose)! The names are explicits.
In you case, you want to reconnect something vertically cut, so use a horizontal structuring element (type segment).
And yes, you have to invert your image, black pixels representing the absence of information.
Usually, for closing gaps, you would need the close operator.
However, since most software assume active pixels are white, you would either need to invert the image, or use the open operator.
On this image, in matlab, the following works well:
imopen(I,ones(32))
This uses a square structuring element. You may want to experiment with other shapes.
Your example also looks like you moved half of the ellipse, as opposed to some process which deleted pixels in the middle. No simple morphological operation can create a perfect ellipse out of the sample image, unless you use the knowledge that multiple components can be moved to re-form the ellipse. If that is the actual case, you can scan connected components and try to match them together.

Extract Rectangular Image from Scanned Image

I have scanned copies of currency notes from which I need to extract only the rectangular notes.
Although the scanned copies have a very blank background, the note itself can be rotated or aligned correctly. I'm using matlab.
Example input:
Example output:
I have tried using thresholding and canny/sobel edge detection to no avail.
I also tried the solution given here but it detects the entire image for cropping and it would not work for rotated images.
PS: My primary objective is to determine the denomination of the currency. There are a couple of methods I thought I could use:
Color based, since all currency notes have varying primary colors.
The advantage of this method is that it's independent of the
rotation or scale of the input image.
Detect the small black triangle on the lower left corner of the note. This shape is unique
for each denomination.
Calculating the difference between 2 images. Since this is a small project, all input images will be of the same dpi and resolution and hence, once aligned, the difference between the input and the true images can give a rough estimate.
Which method do you think is the most viable?
It seems you are further advanced than you looked (seeing you comments) which is good! Im going to show you more or less the way you can go to solve you problem, however im not posting the whole code, just the important parts.
You have an image quite cropped and segmented. First you need to ensure that your image is without holes. So fill them!
Iinv=I==0; % you want 1 in money, 0 in not-money;
Ifill=imfill(Iinv,8,'holes'); % Fill holes
After that, you want to get only the boundary of the image:
Iedge=edge(Ifill);
And in the end you want to get the corners of that square:
C=corner(Iedge);
Now that you have 4 corners, you should be able to know the angle of this rotated "square". Once you get it do:
Irotate=imrotate(Icroped,angle);
Once here you may want to crop it again to end up just with the money! (aaah money always as an objective!)
Hope this helps!

MATLAB: How do I resize (connected) components in a 3D binary image sequence without changing the dimensions of the sequence?

I'd like to resize the components contained in a 3D binary image sequence without changing any of the dimensions of the sequence itself.
I'm not sure if I need to do it on a component-by-component basis, if yes, then how do I create a transform such that the resized components are re-positioned 'correctly' in the image sequence? By 'correctly', I mean with the same centre of mass as the original unprocessed components.
(If that last paragraph doesn't make sense then please ignore)
A 2D example: suppose I wanted to enlarge by 10% the white blobs in the following [295x445] image
How would you do this without making the image itself larger?
you could use the imdilate function to dilate the regions of interest. The examples in the webpage show how to use this function.

to draw ROIs and to calculate mean difference

I have two CT image . How can I draw multiple ROIs on both image and calculate mean difference between each the corresponding ROIs with matlab ? I've used the 'imrect' or 'imellipse' but this commands creates the Mask which makes the image as binary image then I would have problem with to calculate mean difference .
How to show the images with the ROIs draw on them?
Not very sure about what you want to do with imrect. This is an idea; the way I would do it. You have to get your hands dirty with actual programming instead of GUI, but it's VERY basic stuff, and easy as soon as you understand indexing, which is very nice in MatLab and the thing you should take with you from this answer:
First of you define the size of your ROIs, which can be easily made with a variable
width=20; %or whatever you wish
height=10;
then define the multiple ROIs using their upper left corner for the position
ROI11=Image1(corner1:corner1+width,corner1:corner1+height); %(width and height eventually the other way around, whatever)
ROI12=Image1(corner2:corner2+width,corner2:corner2+height);
%...
ROI21=Image2(corner1:corner1+width,corner1:corner1+height);
ROI22=Image2(corner2:corner2+width,corner2:corner2+height);
%...
and then calculate the mean however you please, like for example:
Mean1=sum(ROI11-ROI21)/length(ROI11(:));
Mean2=sum(ROI11-ROI21)/length(ROI11(:));
%...
or something along those lines.
Give it a try and play a bit with it.