how to merge and sum frames of images into one in Digital Micrograph? - dm-script

I tried to use the merge function to sum it together, but the intensity of the Merge Image does not equal to the addition of the two original images. Does anyone know how to do it in DM?

I think the question as asked is maybe a bit under-specified. For simple "intensity adding" of two images of the same size ( pixel dimensions ) you can simply use the label letters and a simple equation like f.e.:
will give you:
I also don't know what the 'merge' function you refer to should be. What script command are you referring to?

Related

plotting direction field for systems of three equations in SageMath using maxima

I would like to plot the direction field for a system of 3 or more equations in SageMath using Maxima. I know how to do this for a system of 2 equations. I don't know what to modify so that I extend it to 3 or more equations. I tried the following example for a system of two equations
maxima('plotdf([x,-y],[x,y],[x,-2,2],[y,-2,2])')
I was thinking for the three or more equations I simply have to add more varibles like
maxima('plotdf([x,-y,z],[x,y,z],[x,-2,2],[y,-2,2],[z,-2,2])')
but its not working. I dont know what am missing.
The Maxima documentation for plotdf makes the syntax clear. I'm not sure what a slope/direction field would look like for more equations unless you had more variables, but then it would have to be in three dimensions, which is not supported.
In any case I'm surprised this worked from within Sage; you must have had wxmaxima or something analogous already there.
Finally, note that SageMath has slope fields natively, though this may not correspond with your workflow.

Getting a boolean value for the difference between two images

I'm trying to get the difference between a thresholded image and the original image, both of which are grayscale. My logic is that if that there is no difference between the the thresholded image and the original image, then that means that there was nothing to threshold.
So I want to find the difference between the images, and if there is no difference, then I will output a "0" to the user interface I made with my camera, and if there is a difference, then I will output a "1".
I tried using the AbsDiff method and I tried using the MatchTemplate method, but neither of those worked, and I'm out of ideas.
I've searched around the internet and haven't found anything to be of much help. Has anyone does something like this before? Does anyone have any pointers as to what I should do?
I'm not familiar with emgu CV, but to do this type of comparison, I'd iterate over each pixel in the image, and return 'not equal' if any are different between the two images.
(Edit: Logically, this is iterating over each pixel in the image and comparing. For efficiency though, I'd probably get the two image buffers (i.e., of size Width * Height * BytesPerPixel), and use memcmp on them. It's reasonable to assume that memcmp is about as optimized a solution as you're going to get for comparing two large buffers, and you want to avoid a GetPixel or similar accessor.)
Also, I wouldn't characterize this as getting a 'numerical value for the difference'. When you phrase it like that, I think of a range of numeric values: Zero means they're equal, small numbers means they're slightly different, large numbers means they're very different. If all you're looking for is a 0 or 1, then that's a Boolean, not a numerical value. Getting a Boolean value of 'equal'/'not equal' is much easier than attempting to quantify how much two images are different.
My emguCV knowledge isn't extensive but have you tried using the emguCV's Cmp method to create a difference mask and then CountNonzero to find out if there is in fact a difference.

definition of a graph

I have two questions;
What is the name of the graph (or circuit) which goes along the outer vertices of existing nodes.
What will be the formal definition of that graph.
for the simplicity, I have added a sample figure and the red highlighted graph is what I wanted.
If I show how I got this outer vertices;
I have set of sub graphs. So I got UNION and INTERSECTION, then got the DIFFERENCE. Do this one after the other, Finally I ended with a graph which is similar to MY RED EDGE GRAPH.
So the final graph which I got was {1,2,6,7,9,8,10,11,10,7,6,5,3,4,3,1} if i start from 1.
PLEASE TELL ME WHETHER I AM USING CORRECT THING OR NOT AS I AM COMING TO END OF MY WORK.
You may be trying to define some kind of geometric hull, but surely not a graph property. These two graphs are equivalent and indistinguishable a far as Graph Theory goes:
Edit
Perhaps this old answer of mine may help you

Testing how close together two letters can be (2D)

I'm working on a small design project, part of which involved writing out text in a given font such that the letters of a word are just touching each other on their right and left sides.
I've thought of implementing this as follows - create GlyphVectors of two letters, create Shape objects using vector.getOutline(), then create Area objects and intersect them.
The only thing I'm missing with this method is the ability to shift the second letter to the right until the intersect is empty.
Is there a way to do this, or do I need to use a different approach?
TIA
eta: ok, I've figured out I can use AffineTransform. Now, is there a way to tell the size (surface area) of the Area created by the intersection of two letters?
How precise do you want this to be? Pixel precision is much easier to attain than vector precision. Have you considered linearisation (usually done through
public PathIterator getPathIterator(AffineTransform at, double flatness)
) of outlines and then doing search in opposite directions among all points? This seems to be the most obvious solution even though it is not vector-precise.

Compare Images in SQL

What is the best way to compare to Images in the database?
I tried to compare them (#Image is the type Image):
Select * from Photos
where [Photo] = #Image
But receives the error "The data types image and image are incompatible in the equal to operator".
Since the Image data type is a binary and huge space for storing data, IMO, the easiest way to compare Image fields is hash comparison.
So you need to store hash of the Photo column on your table.
If you need to compare the image you should retrive all the images from the database and do that from the language that you use for accessing the database. This is one of the reasons why it's not a best practice to store images or other binary files in a relational database. You should create unique file name every time when you want to store an image in a database. Rename the file with this unique file name, store the image on the disk and insert in your database it's name on the disk and eventually the original name of the file or the one provided by the user of your app.
Generally, as it's been mentioned already, you need to use dedicated algorithms from the image processing shelve.
Moreover, it's hard to give precise answer because the question is too general. Two images may be considered as different or not based on number of properties.
For instance, you can have one image of a flower 100x100 pixels and image of the same flower but resized to 50x50 pixels. For some purposes and applications these two will be considered as similar (regardless of different dimensions), but will be different images for other purposes.
You may want to check how image comparison is realised by some tools and learn how it works:
pdiff
ImageMagick compare
If you don't want to compare image content but just check if two binary streams (image files, other binary files, binary object with image content) are equivalent, then you can compare MD5 checksums of images.
It depends on how accurate you want to be and how many images you need to compare. You can use various functions like DATALENGTH and SUBSTRING or READTEXT to do some comparisons. Alternatively, you could write code in the CLR and implement it through a stored procedure to do comparisons.
Comparing images falls under a specific category of Computer science, that is called image processing. You should search some libraries that provide image processing capabilities. Using that you can compare upto what ratio given two images are same or identical. you can have 2 images matching each other upto 50% or more or less. There are mathematical algorithm that define the comparison formulae which returns the ratio.
Hope this gives you a direction to work further on your Problem..