Tag Info

New answers tagged

2

The first step in debugging is always to narrow down the problem. To do this, you can make ncurve global: DynamicModule[{(* ncurve = {} *) }, EventHandler[ ... Then, you can click on the image and evaluate ncurve in a separate cell: Length[ncurve] 248652 (You can and should put ncurve in a DynamicModule once you're done, of course. But for ...


3

The issue here is a subtle issue: one must be careful when choosing plot ranges in order to make sure that one is getting a good picture of what the data looks like. For starters, let's take a look at the initial masks data: ApertureSize = {300, 300}; DiscRadius = 20; PhaseDisc0 = 10; Disc1 = {50, 150}; PhaseDisc1 = 10; Disc2 = {150, 150}; PhaseDisc2 = ...


3

I'm sure you know that a line will almost never run through exact pixel positions. Therefore, you have two choices. First, you interpolate your image matrix and then you can sample as many points along the line as you like. In this case, I probably wouldn't recommend it because the values depend on the interpolation itself. Another, very easy way is to use ...


1

Disclaimer: I wouldn't feel confident enough to put this as an answer, but it since you asked for "suggestions of why the results aren't closer", it may be valuable and it is too long for a comment. Also, I haven't had the time to test even the question code so, this will be deleted or modified if it ends up not making too much sense Answer: I don't think ...


0

Implementing rhermans method, here is the code to add custom metainformation to an image under "User Comments". Then search the metainformation from multiple images to locate the image of interest according to your search terms. Creates a browser to load a file. loadImg = {FileNameSetter[Dynamic[g], "OpenList", WindowTitle -> "LoadImage"], ...


1

I am not sure if this can be done in a style sheet. When you place a figure in a Mathematica notebook, the width is usually determined by an option ImageSize. Normally a number, say 300 or 500, is used for the value. I have never seen it used, but it is possible to use a value depending on the window size at the moment when you enter the figure: Plot[x^2 , ...


4

No, this doesn't exist as far as I know. There is one thing that might help you in certain situations when you work with the pixel data of images: ImageData has an option DataReversed which you can set to true, if you would like to extract the pixel matrix upside down so that the coordinates are correct again.


2

What I can see is that you need to include metadata in an accepted format for images, for instance EXIF. img = Image[Rasterize[x], MetaInformation -> {"Exif" -> {"ImageDescription" -> "An example", "Make" -> "camera brand", "Model" -> "xxx"}}] Export["test2.jpg", img] Import["test2.jpg", "ImageWithExif"] Options[%, ...


10

Since the filling in the original DateListPlot is a Polygon, you can post-process it to add a texture. The tricky bit is getting the scaling correct - I rescale the polygon coordinates relative to the PlotRange (so the texture coordinates run from 0 to 1 across the width and height of the plot) and crop the image to the correct aspect ratio: ...


8

im2 = Import["http://i.stack.imgur.com/6m6ET.jpg"]; ParametricPlot[{{u, Cos[u]}, ConditionalExpression[{u, v Cos[u]}, -3 Pi/2 <= u <= Pi]}, {u, -2 Pi, 2 Pi}, {v, 0, 1}, Mesh -> None, PlotRange -> All, PlotStyle -> Directive[{Opacity[1], Texture[ImageMultiply[im2, Yellow]]}], AspectRatio -> (1/Divide @@ ImageDimensions[im2]), ...


5

Edit: added simpler answer at the end. My first answer addresses an issue I would have wanted you to have asked about... apparently I was overthinking it. The second answer is the result of actually reading the question (and the comment). 1. How to make an image background under a specific segment of a DateListPlot You can create an image background by ...


7

Would you mind using image process? im1 = Plot[Sin[x], {x, -7, 7}, Filling -> {1 -> {Axis, Black}}, Axes -> False]; im2 = Import["D:\\MmaSE\\6m6ET.jpg"];(*your image*) ImageMultiply[ImageAdd[im1, im2], Plot[Sin[x], {x, -7, 7}]] the output: Or there is a RegionPlot approach: RegionPlot[0 < y < Sin[x] || 0 > y > Sin[x], {x, -7, 7}, ...


5

I think you are asking for a rather sophisticated project in this question, and it is probably too broad. However, here's one way to approach the highlighting of lines. im = EdgeDetect[ExampleData[{"TestImage", "Lena"}], 5]; imm = MorphologicalComponents[im]; trans[{x_, y_}] := {Max[1, Min[n, Floor[n - y] + 1]], Max[1, Min[m, Floor@x + 1]]}; rep[mat_, ...


4

Just an alternative: f = Import["my_file.pdf", "Pages"]; MapIndexed[Export["page"<>IntegerString[First@#2,10,2]<>".png",#1]&,f] The use ofIntegerString allows left padding with zero which may useful in ordering files. In this case 2 -> 01,02,..99. This could be modified for large number.


4

Is there a way to convert the PDF pages into images within Mathematica Yes, just do f = Import["my_file.pdf", "Pages"]; and now f is a list, each is one page. Then use Export["f.png",f[[1]]] to export the first page as png Here is MWE SetDirectory[NotebookDirectory[]]; f = Import["my_file.pdf", "Pages"]; Export["page" <> ToString[#] <> ...


3

1. Is this a bug or a feature? My opinion is that it is not a bug. Different selections yield different inputs, so different outputs are at least possible. On the other hand, I'm not sure I would call it a feature. It strikes me that users will wonder why they cannot easily get an image of what they see. "Save Selection As..." seems to consistently show ...



Top 50 recent answers are included