I have some challenge and I try find any information, tips, examples which help me do that. First I looking many times google, and this forum with different ask but I don't found any this same task, algorithm. I try many commercial program to compare images, to find diffrent and common parts but all is don't do that good and smart.
I have some website with many different boxes, modules, elements etc. Now I do do first printscreen, save this image as web1.png.
Next step I change some boxes, elements on this website, for example I remove some block, add new elements, move one of some module/part of website into another places.
Now I do next printscreen this website after last change and save as web2.png
And now it's the most important think what I want to get, do do.
I put this two images (web1.png and web2.png) for examples to some scripts on Python or another technology where smart algorithm to compare this two file and show, marked different or maybe only the first the same element on this two files.
I think is the most big problem is defined what is exactly separated some block, module, many different elements on printscreen website and then find this same block on this next page and how marked this or maybe create next result png with this same element. I don't sure is possible to do that, whether there is a smart
algorithm or way to do that. Thank you in advance for all the help and guidance.
Here is images examples
Related
I wrote a code in python, which creates music notation based on a user input. It generates a PDF and everything works fine.
The only problem I have is that the notation consists of 100's of small images and I wanted to ask if there is a possibility to merge them all together into one big image. I don't want them to be selectable or anything. Basically I want the PDF to be like one big picture per page.
Is that possible using PyPDF2?
Thanks in advance and have a great weekend!
I've 2 text files. Writing a Python Program for the following
1)I need to compare the pairs of sentences in the 1st file, and see if they are in the same or different blocks, and compare that to the 2nd text file.
2)I need to calculate the percentage of correct classification.
3) I need to count:
% of sentence pairs correctly classified as in the same block, % of sentence pairs correctly classified as in different blocks
Please provide more information about the structure of the files. Also, I'd like to remind you that StackOverFlow helps you out providing aditional information in order to solve your problem, we are not going to code the solution for you.
Provide aditional information and your code if possible in order to help you out.
Have a great day.
I have lot of PDF, DOC[X], TIFF and others files (scans from a shared folder). Each file converted into pack of text files: one text file per page.
Each pack of files could contain multiple documents (for example thee contracts). Document kind could be not only contract.
During the processing the pack of the files I don't know what kind of the documents current pack contains and it's possible that one pack contains multiple document kinds (contracts, invoices, etc).
I'm looking for some possible approaches to solve this programmatically.
I'm tried to search something like that but without any success.
UPD: I tried to create binary classificator with scikit-learn and now looking for another solution.
This at its basis, being they are "scans" sounds more like something that could be approached with computer vision, however this is currently far far above my current level of programming.
E.g. projects like SimpleCV may be a good starting point,
http://www.simplecv.org/
Or possibly you could get away with OCR reading the "scans" and working based on the contents. pytesseract seems popular for this type of task,
https://pypi.org/project/pytesseract/
However that still lacks defining how you would tell your program that this part of the image means that this is 3 separate contracts, Is there anything about these files in particular that make this clear, e.g. "1 of 3" on the pages,, a logo or otherwise? that will be the main part that determines how complex a problem you are trying to solve.
Best solution was to create binary classifier (SGDClassifier) and train it on classes first-page and not-first-page. Each item from the dataset was trimmed to 100 tokens (words)
I am trying write an Abaqus/Python script that will select all the elements that "belong" to a certain face. I.e. taking all the elements that have a connection to one face of a meshed cube (I will calculate the total force acting on that face for force-displacement or stress-strain curves later).
If I do it using the GUI I get:
mdb.models['Model-1'].rootAssembly.Set(elements=
mdb.models['Model-1'].rootAssembly.instances['Part-1-1'].elements.getSequenceFromMask(
mask=('[#0:5 #fff80000 #ff #f #ffe00000 #f000000f #3f',
' #0:6 #fffe #c0003f00 #3 #3fff8 #ffc00 ]', ), ), name='Set-1')
But, getSequenceFromMask does not work in a general case. I tried using findat with no luck.
Is there a way to do that?
define a face set on the part or assembly:
part.Set('facename',faces=part.faces.findAt(((1,0,0),),))
where (1,0,0) is a coordinate anywhere on the face. (Don't use a point on a edge/corner though)
then after meshing you can access the elements attached to that face, something like:
instance.sets['facename'].elements
note if you want to get those elements on the odb after running an analysis it is a little different:
instance.elementSets['FACENAME'].elements
note that the set name is upcased on the odb..
One can select an specific element from its label by using:
mdb.models['model-name'].parts['part_name'].elements.getFromLabel(lable=element_id)
This way it is not necessary to have information about the coordinate of the element. Only the element id is enough to access to it.
You are apparently using a Macro in order to get the location of your surface in order to pick the set using Python. The issue is: the Macro facility uses getSequenceFromMask() by default and isn't very user-friendly...
Fortunately, this default option can be changed! One just needs to run the following line of code:
session.journalOptions.setValues(replayGeometry=COORDINATE,recoverGeometry=COORDINATE)
Now when you record a macro using the MacroManager, you get findAt() which is what you want.
Extra TIP:
You can include this piece of code in the onCaeStartup() function in your custom_v6.env file. It will then run every time you open CAE.
C:\Program Files\Dassault Systemes\SimulationServices\V6R2018x\win_b64\SMA\site\custom_v6.env
I had this issue myself a few days ago. Maybe I'm wrong but as far as I know, there is no way to directly select particular elements. You can select them with a "Bounding Box" or a "Bounding Sphere" or you can get them by your parts/ instances faces and cells. If you need to select the elements in a more specific way then you can get them by the nodes with which they are connected. You can use the "findAt" command with these nodes and get the elements by the "getElements()" command.
That is how I solved it and it works pretty fine. If there are other ways to solve that I will be happy to hear them because this is sometimes really frustrating.
Cheers
I am trying to solve what I have realized is quite a hard problem to address due to my lack of expertise in the subject. Suppose I have an image of a table with 3 rows and 5 columns. Each row contains text (let's assume only english for now) or numbers (normal Indo-Arabic numerals). There is nothing but whitespace between the columns and between each row. Now assuming all rows and all columns are aligned, my task would be to get an algorithm to recognize and extract each row out from the document (don't know if I'm articulating this well enough).
Could someone suggest a good starting point (library , similar example , textbook chapter that deals with something like this) etc.. for me to get started.
My background is data science but I have just never been exposed to computer vision.
Any help would be appreciated.
You should start off with OpenCV, like Racialz suggested. This tool contains a Hough lines/Hough transform method which should be the primary and easiest way for you to find and crop text from table sections. There are many different tasks for lines to find for which people use this algorythm (like THIS or THIS), but with your task it would be much easier, because lines should be much clearer and simplier, rather than in these examples. After you do your extraction, you then will need to scan your text, for this I would suggest you using tesseract ocr engine. This engine is for free, really easy to use, it provides pretty decent results and allows you to train it to scan specific types of letters.