Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I have some problems using Psychtoolbox Screen and Textwindow...
For my experiment I want to give an instruction at the beginning. I used something like this:
% Draw text in the middle of the screen in Courier in white
Screen('TextSize', window, 20);
Screen('TextFont', window, 'Courier');
DrawFormattedText(window, 'Hello World', 'center', 'center', white);
And the other basic Screen definitions.
The problem is: The text is not fully shown. I tried different sizes and set the Font to Times, but it is always the same - every letter is only displayed 3/4 (ca)...
What could be the problem?
Would be very nice if someone can give me a hint...
Thanks!
Can you describe what you mean by 'every letter is only displayed 3/4 (ca)"? The code you posted looks correct. For example, here is that code, with the addition of some set-up routines, and taking and saving a screenshot as "testImage.png", with the screen shot attached.
screenNum = max(Screen('Screens'));
window = Screen('OpenWindow', screenNum, 0);
white = WhiteIndex(window);
Screen('TextSize', window, 20);
Screen('TextFont', window, 'Courier');
DrawFormattedText(window, 'Hello World', 'center', 'center', white)
Screen('Flip', window);
imageArray = Screen('GetImage', window);
WaitSecs(3);
Screen('CloseAll');
imwrite(imageArray, 'testImage.png');
I found the problem... Just a dumb mistake in my long Code. I have set the Font and Size of Text earlier, and this interfered with this new text features. Nevertheless, thank you for your help!
Related
Hello, I am new at asking question if you need more information about question you can leave a comment.
fl-chart is overflowing from bottom. How can I solve this problem?
I already try
clipData: FlClipData.all(),
Yaa it removes this overflow but it also remove some part of line but I only want to remove the overflow not overflow line. I want the line on bottom straight and I also want that it can't overflow
from bottom. So, how can i achieve this?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have an image of Lego bricks which I have segmented in order to get only the blue and red colored bricks.
I also have two templates of bricks that I want to find.
I want to count the number of each of the template bricks in the image. I thought of counting the number of circles on top of the bricks, but some of the bricks are flipped. How could I do this?
Counting the number of circles on top of the bricks could be a very difficult task. A better solution is to look after better properties such like the relation between the hight and the width of the brick.
A possible start for segmentation is as follows:
E = regionprops(L,'all'); % E contains all properties
area = cat(1, E.Area) % saves the area in a variable
cp = cat(1,E.Centroid) % saves the center of the object
figure,imshow(label2rgb(L));
hold on; plot(cp(:,1), cp(:,2), 'b*'); % displays the center of the objects
It will show you your segmentation and will display some information about the properties of the obejects. From there on you will be able to look for what properties you are watching for and can select them in if statements. Depending on your image and your selected properties this could take up to 10 properties but most likely will be around 5.
For further information look here: MATLAB segmentation overview
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have to store a 1MByte word file into a 512x512 pixels image using Matlab and extract it again. The only thing that I know is that we have to remove the invaluable bits of the image (the ones that are all noise) and store our fie there.
Unfortunately I know nothing about both Matlab and Image Processing.
Thanks All.
Given the numbers provided, you can't. 512x512 give 6.2MBit given 24 bits per pixel. So your doc is larger than the image you are hiding it in.
If we ignore the above, then this is what you have to do:
Load the image and convert to uints.
Mask out a number of LSB bits in each pixel.
Load the doc as binary and fill those bits in where you
masked the others out.
Now, from the above to actual code is a bit of work. If you have no experience with matlab it won't be easy. Try reading up on imread() and bit operations in matlab. When you have some code up and running, then post it here for help.
Regards
In matlab you can read images with imread()
(details on: http://de.mathworks.com/help/matlab/ref/imread.html?s_tid=gn_loc_drop )
Image = imread("Filename.jpg")
figure()
imshow(Image)
This code would show you the Image in a Window.
I think what you're looking for is steganography instead of watermarking.
Steganography:
https://en.wikipedia.org/wiki/Steganography
Here is an example of an image with a file inside it:
http://marvinproject.sourceforge.net/en/plugins/steganography.html
Related topic:
Image Steganography
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I'm currently working on my thesis, and one of the requirements is to put a dot just next to the page number (which is at the top right corner).
This is the code that I am using for the moment. It does everything that I want except for the dot...
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{} % sets both header and footer to nothing
\renewcommand{\headrulewidth}{0pt} %Deletes the horizontal bar
\fancyhead[R]{\thepage} %puts the page number to the right
Could someone help me with my problem ?
Thank you in advance.
Use something like \hspace to \thepage:
\fancyhead[R]{\thepage \hspace{1 mm} . } %adjust 1 mm to any value as needed
Just put the dot after the \thepage;
\documentclass{article}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\thepage.}
\begin{document}
See the page number in the top-right corner.
\end{document}
The result:
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have a very high number of small images (360x192), taken in sequence as screenshots from a DOS 2D computer game. They have decent overlap and i'd like to stitch them together into one big composite. Due to their very nature each subsequent image will fit pixel-perfect over the next or previous one. As such no rotation, stretching or distortion is required OR desired.
There is a lot of software out there to stitch together photo panoramas. But sadly all of them apply some distortion, even when they're explicitly instructed not to do so.
Is there software that will try to do pixel-perfect stitching?
Mathematica 8 features functions to do that:
ImageAlign[img1, img2, "Transformation" -> "Translation"]
FindGeometricTransform[img1, img2, "Transformation" -> "Translation"]
By setting the option "Transformation" to "Translation" you are guaranteed that the result transformation will not have any of the "distortions" you are mentioning.
More examples in the documentation:
http://reference.wolfram.com/mathematica/ref/ImageAlign.html
http://reference.wolfram.com/mathematica/ref/FindGeometricTransform.html
I know one can link Mathematica to perl, but I have not tried it yet.
EDIT: Using the link you sent, I came up with the following. The only problem is that you need to specify in advance the size of the output---NB I tried only the first 10 images.
directory = "~/Downloads/done/";
files = FileNames["*.bmp", directory];
canvas = ImagePad[Import[files[[1]]], {{100, 100}, {500, 100}}, Transparent];
Do[
i = Import[f];
fun = FindGeometricTransform[canvas, i, "Transformation" -> "Translation"];
If[Head#fun === FindGeometricTransform,
Continue[]
];
canvas = ImageCompose[
canvas,
ImagePerspectiveTransformation[i, fun[[2]], DataRange -> Full, PlotRange -> Transpose[{{0, 0}, ImageDimensions[canvas]}], Padding -> Transparent],
{1, 1, -1}],
{f, files[[;; 10]]}]
One of the definitive libraries to do panorama stitching is Panorama Tools. You can either port or call from Perl.
Note that your specification is at odds. Unless you images are 100% rectilinear (i.e., taken 1:1 by an imager the same size as the image) you MUST compensate for the lens distortion. To accurately stitch photos together (pixel by pixel) the image needs compensating distortion.