简体   繁体   中英

How to improve the image quality before the image processing start in javacv or opencv?

I have an image with 400x400 image to identify different components from it. But when I try to identify components using that most of time it doesn't provide correct answers. So I need to know whether there are some kind of methods in javacv or opencv to improve the quality of the image or increase the size of the image without effecting to its quality ?

This is the sample image that I use. (This is the maximum size that I can get and I can't use any photo editing softwares in the project, because it's dynamically generated image.)

在此输入图像描述

In my image processing I need to identify squares and rectangles that connects those squares. And specially I need to get the width and height of those using pixel values.

You can scale it to any size, if you can vectorize it... and in your case vestorization is quite simple as you have some simple geometrical objects in image.

So, in my view your approach should be like this:

  1. detect edges in the image with a high threshold (as you have very distinct objects)
  2. vectorize them
  3. scale them to any size

You should also look at the following link: Increasing camera capture resolution in OpenCV .

If you stick to image processing the easiest way to do it is to apply an equalizeHist(). This will increase contrast and will improve subsequent steps.

But , and this is a biiiig 'but', why are you doing it? Just reading this post, I saw another solution, and a quick google proved me I am right:

Kabeja is a Java library for parsing, processing and converting Autodesk's DXF format. You can use Kabeja from the CommandLine or embed into your application. All parsed data are accessible with the DOM-like API.

That means you can extract directly all the data you want from that image in a text format. Probably something like "at position x, y there is a transistor, or whatever." So why would you render that file into an image, then analyse that image to extract the components?

If you do it for school (I know that many school projects are like this) I would recommend you to find a real problem to solve, and propose it to your teacher. You will be happier to do something that is not complete nonsense.

vectorizing the image is best option I guess as suggested by mocap .
you can also use enhancement tools like sharpening, saturating etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM