Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am working on an algorithm to extract diffrences between two images with diffrent qualities for example you have a photoshop file which is created by a designer and then you print it out with some devices and you have scaned it and saved it as a bmp file.
the main question is how we can compare these two images?
it is not possible two compare pixel by pixel, because in scaned version many objects have changed for example lines become thicker.
my idea is to find any shapes in two images then compare them based on location and other shape featurs but the main problem is that in low quality images it become too difficult to compare.because in low quality we have noise and after noise canceling some shapes will be lost. for example when i use open and close or morphology filters i lose some characters such as "i Q O 0" or other shapes.what is your opinion ?
you have image1 & image2 that have to compare .In both images find corners by hough transform then register two images by corners.you can use findhomogrphy() .Now the two images are the same size.In the finial you can use matchTemplate() for find difference between two images.
The suggestion of #Mostafa Sataki sounds good. An alternative would be to align the images as suggested, then use a similarity measure such as MSE or PSNR
Another possibility would be to try to match keypoints from the two images to see if they are the same image.
Related
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 51 mins ago.
Improve this question
Microsoft Modelbuilder's autogenerated code suggests to load training/inference data like this:
var imageBytes = File.ReadAllBytes(path);
When I create a 100x100 bit solid colored cube in MSpaint and save it as .png and use above function to load the file I get a byte[342], while I would expect 100x100x3 bytes if it were uncompressed(?).
Am I correct to assume that the compression is intact here?
If a model is trained with compressed data, does it need similary compressed data when making predictions?
Could a model's performance improve if trained on uncompressed data?
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 5 years ago.
Improve this question
Let's say I have few points : -5,-4,-3,-2,-1,0,1,2,3,4,5
I'm at point 0, I need to create a line that goes all through the points of 1,2,3,4,5,-1,-2... etc.
The line would start at 0 and end at whatever point that ends as the shortest.
The answer for this example would be that it'd go like this 0->1->2->3->4->5->-1->-2->-3->-4->-5 or that it'd go first to -1 and go all through the minus to the plus, same result (5*4=20 length).
If for example we'd go 0->1->-1->2->-2... it'd end as the longest line that goes straight from point to point (1+2+3+4+5+6+7+8+9+10=10*11/2=55 length)
The question is how to write this in code?
The points might also consist of 2 or 3 dimensional points, where the start would be (0,0,0,0) or whatever, eventually the line can go through all of these points, but which way will achieve the shortest line?
How to make it as a code, as we see it in the eye?
I think this is basically the Travelling Salesman problem. You've got N destinations, and each pair of destinations has a concrete length between them, and you're trying to find out the shortest travel time to visit all destinations.
You've got two different directions to pursue this, that I can see. First, is to read up on the Travelling Salesman problem and the various algorithms that have been proposed for it (it's a very famous algorithm problem) and then try to implement one in C# - though just to warn you, you should be very proficient in math, because it's not an easy problem. Or, alternatively, you can look for someone else's existing implementation for it and just use it without understanding the theoretical underpinnings.
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 looking for a way to analyze an image ( the human figure ) and verify whether it is necessary to rotate the image or images straight.
i'm using c# env.
If you could detect the eyes then you could figure out if the image should be rotated using the eyes positions.
if (eye1.y - eye2.y) > (eye1.x - eye2.x) => the image should be rotated
Of course you would have to check and subtract the smaller value from the higher value when you calculate the position difference in order for this to work
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I have a Task to do C#. I need to add two numbers.
The first number contains around 100 digits like "12822429847264872649624264924626466826446692............"
and second number also with 100 digits or more or less
by using this numbers i need task like add/sub/multiply/div
I done this using BigInteger in C#
But do I need to do this using arrays or strings?
Since they are both 100 digits just start with the last digit and in a for loop just add each one, but if the value is > 10 then remember to add one to the next digit.
This is how children learn to add, you just need to follow the same steps, but the answer should be in an array of 101 characters.
UPDATE:
Since you have shown some code now, it helps.
First, don't duplicate the code based on if str1 or str2 is larger, but make a function with that logic and pass in the larger one as the first parameter.
Determine the largest size and make certain the smaller value is also the same size, to make math easier.
The smaller one should have leading zeroes (padding), again to help keep the code simple.
You can also start by looking at the source code for structures such as BigInteger. They would provide you more insight into aspects such as computational efficiency and storage, particularly about multiplication and division. You can take a look at here or here.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am looking for a memory-efficient yet convenient data structure for a 3D mesh or face-set consisting of triangles.
Currently I am using this 'classical' structure:
a list of points, and a list of triangles.
Each point has a X, Y, and Z value.
Each triangle has three indices i0, i1, i2, which refer to a point in the point list.
This is the most compact layout I can think of. It is perfect if all I want to do is draw the mesh, and never modify or filter it.
However it does make most operations that modify the mesh or generate a new partial mesh very cumbersome, for example:
Removing triangles is very inefficient.
generating a new mesh with only triangles that have less than 3 neighbors
Finding and removing all triangles that have one or all point within a given bounding box
finding all edges with a certain angle
removing all edges shorter than a certain length
Basically anything that requires modifying the mesh, or iterating over the edges or finding neighboring faces/edges, requires generating and discarding several temporary dictionaries and hash sets. There is no easy way to iterate over the points or edges of an individual face, or the edges/faces around an individual point. removing a point means removing it from each triangle, then changing the index values for all other points in all triangles, etc.
Is there a canonical data structure that does not have these drawbacks, yet is memory-efficient?
I am not looking for an entire library, just a structure I can implement myself (although it may be interesting to know how particular libraries have solved this problem)
There's a couple of open source data structure that may fit your needs:
CGAL https://www.cgal.org/
OpenMesh http://openmesh.org/
Surface Mesh http://opensource.cit-ec.de/projects/surface_mesh
I've oredered them from the harder to the easier to use. They are all half edge data structures
Take a look at this paper from Bielefeld university (developers of the Surface mesh), I think that it's a good starting point for you!