Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am trying to remove text from images, like for example we have a screenshot of instagram post, now we tried to fetch only image from this screenshot, in our .NET/C# code we read all pixel and check its color to see if we are getting white space, so that we can remove all unused space and extract only picture, but it didn't worked as expected, Does anyone has idea to do it correctly?
To extract text from image u need to use some OCR lib like Tesseract.
https://github.com/tesseract-ocr/tesseract
If necessary, u can use some type of image editor lib for .Net like AForge.
https://github.com/andrewkirillov/AForge.NET
This is a very broad question. divide your problem into steps and start solving from the first step.
Best .Net library is EMGUCV, an OpenCV wrapper which is broadly used in image processing.
AForge.Net is another good one. Follow the documentation to process text data from images.
The logic is
1. Track texts in the image.
2. if the font and size is similar and static, you can input fixed pattern and match patterns.
3. Then there are several option to remove a found object (here you will find texts as object or area.)
4. You have to tune after removing texts from the pictures. That will need image reconstruction algorithms. These all are available in EMGUCV.
Please see the documentation.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I'm struggling on how to convert PDF to SVG in C# WPF (Net5).
I have already read various articles and tested using InkScape.
The various PDF documents I have have a lot of text and images. Math formulas and complex characters are also included.
I needed a Vector image that didn't require any editing, so I was hoping to convert it by changing all the objects to paths.
I was able to give these options to InkScape's Command Line.
The results were very satisfactory.
Most of the characters I have are ignoring fonts and converting them to vector form whenever possible.
However,
There are a few issues.
It's taking too long to convert all the pages in my PDF.
Also, to solve these problems
When the transformation is executed by dividing the task
Conversion is not done properly and InkScape keeps running and hangs.
inkscape --export-filename=d:\testtest.svg --actions="select-all;object-to-path;" --pdf-poppler --pdf-page=190 d:\Test.pdf
The command I used is as above.
Is there any other command to embed all fonts and images inside SVG when converting PDF to SVG?
someone to me Can you recommend a separate library or commercial product that converts PDF to SVG (I can convert any object I want to a path and save it)?
Spire.PDF library provides the ability to convert PDF to SVG, you may give it a try.
Code example:
PdfDocument document = new PdfDocument();
document.LoadFromFile("Test.pdf");
document.SaveToFile(#"E:\Program Files\Result.svg", FileFormat.SVG);
For more information, visit this link.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am looking for some sort of API similar to Photoshop functionality, I need to create an image using layers/masks/filters programmatically.
An example: I know how to make a nice button in Photoshop, there is a sequence of simple actions. What I want is to automate this process and generate an image of the button on the fly with a few input parameters.
I think I am not the first one who came up with such idea, there must be some library out there that does this thing. Unfortunately I cannot find anything.
Thanks!
You failed to mention if the library needs to be free/open source or if commercial libraries are acceptable but one of the best out there is GdPicture.NET. I doubt you'll find anything free that is remotely comprehensive but a good free one is Filters library (LGPL).
i don't think there is an API like this
but there is free open source software which is Paint.net
get it here
http://www.getpaint.net/download.html
see source code here
http://www.afterdawn.com/software/source_codes/paint.net.cfm
hope it helped
GDI+ in .NET?
Although I haven't used them you could take a look at:
Emgu CV: http://www.emgu.com/wiki/index.php/Emgu_CV
or OpenCvSharp : http://code.google.com/p/opencvsharp/
ImageMagic have layers support http://www.imagemagick.org/Usage/layers/ and there is Net wrapper
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
Is there a way of removing the text from a pdf file using c#?
Yes, using the open source project iTextSharp
Creating a basic PDF file:
http://www.devshed.com/c/a/Java/Creating-Simple-PDF-Files-With-iTextSharp/
http://www.developerfusion.com/code/5682/create-pdf-files-on-fly-in-c/
You will need to create a new PDF, open the original.
Iterate through all the objects you find, remove the text and add the old objects to the new file.
The icky part is that after you remove the text, you will have to reposition objects in the pages following the deleted text.
If you do happen to do it, you got yourself a very interesting blog post...
There are several libraries, free and commercial that can assist.
I'm most familiar with pdfNet by pdfTron. However, I've only used it in a read-only context
I assume it will work for you as "...Add/remove/edit images, text, and vector graphics..." is one of the uses they claim its capable of.
Below is a link to their documentation online. It's a rather detailed API so be prepared to read.
http://www.pdftron.com/pdfnet/html/main.html
As for other vendors, I know Adobe has a reseller that licenses their API in a C# form. I don't recall the product name off the top of my head. If memory serves me correctly it's pricey by comparison to pdfNet and it resembles an old style c (not even C++) method of programming. It won't be a comfortable fit if you're only used to C#.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Does anyone know of source code, ideally in C# or similar, for reading .DXF files (as used by AutoCAD etc)? If not code, then tables showing the various codes (elements / blocks / etc) and their meanings?
I am writing a reader myself, and have dead tree documentation detailing the format, but am trying to avoid writing e.g. a converter from each of the 255 ACI colours to RGB... Thanks!
I have work a couple of years at developing my own DXf-Viewer in java (you could drop your own DXF file or an URL on the viewer) for 2D drawings. The published information from AutoCAD is a good base but doesn't explain how it works. Becoming member of the Open Design Alliance, will give you the possibility to convert several CAD formats to DXF. It may be a good idea if you are developing a commercial product.
There is a german book (http://www.crlf.de/Verlag/DXF-intern/DXF-intern.html) about DXF which really explain this format. It's expensive, but could save days of search.
The colors in the DXF Format are indexed, you must have a converter from ACI to RGB. Be careful with values 0 and 1 which having a special meaning.
Regards.
Cadlib from WoutWare have I been using for a couple of projects with good results.
Update in case someone is still looking...
It's the same library, just including both links.
https://github.com/haplokuon/netDxf
https://www.nuget.org/packages/netDXF/
Fortunately AutoCAD publish the DXF format information here: DXF Formats
You may want to try the Open Design Alliance. It's a while since I looked at it myself, but they had a load of C libraries for dealing with various AutoCAD files.
Here is a link to a CodeProject dxf reader; it seems very limited (and not particularly well done) though.
Here is another open source dxf reader, in Java. Buggy however!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am looking to perform a polynomial least squares regression and am looking for a C# library to do the calculations for me.
I pass in the data points and the degree of polynomal (2nd order, 3rd order, etc) and it returns either the C0, C1, C2 etc. constant values or the calculated values "predictions".
Note: I am using Least Squares to create some forecasting reports for disk usage, database size and table size.
Here is a link for C# code on to do exactly this: http://www.trentfguidry.net/post/2009/08/01/Linear-Regression-of-Polynomial-Coefficients.aspx
Good luck!
Edit: Apparently the above link is broken. I made another solution awhile back: http://procbits.com/2011/05/02/linear-regression-in-c-sharp-least-squares/
In the general case you want an "optimizer" or "mimimizer". See http://en.wikipedia.org/wiki/Optimization_(mathematics)#Solvers for some exmples. I see that the first link (http://en.wikipedia.org/wiki/IMSL_Numerical_Libraries) claims to have c# support.
Edit: For the limited use that you propose (linear or quadratic polynomials), you could just go to any copy of Numerical Recipies, grab a straight ahead implementation, and translate to your language. A general minimizer is overkill.
But note, also, that polynomials may be poor predictors.
You can check library form ALGLIB under GPL licence 2.0. They have source code for C#, C++,...
http://www.alglib.net/interpolation/leastsquares.php
You may want to check out alglib. It is in C++ instead of C#, but you might be able to write a wrapper over it.