Detection of defacts during video rendering ( which algorithm to use) - c#

I would like the system to pin point/highlight the deformed area to the user during video rendering. Lets say currently I have an image with a list of squares as shown in the image below, this is the original image without defects.
In the following image, is the sample image that consist of a defect, whereby there is an extra line in between the squares.
I would like to have something as shown in the sample image below where by it will have a red square to highlight the "extra line" to inform the user that there is a defect and will pin point the defect to the user.
The defects may appear in any kinds of shapes or forms, and I would like to pin point the defects to the user. So what kind of algorithm I should use in order to achieve this?
Also, is machine learning required in order to achieve this?
Currently I am using Emgucv in C#, but I am not sure what algorithm I should use that can achieve this. Any suggestions are appreciated.
Thank you.

You could just to an cv::absdiff to find the changed areas. After that, use findcontours to group the defects and draw an outline around them.

Related

UWP-xaml InkCanvas: Is there a way to deny painting on specific zones?

I am trying to make a UI prototype for a bus route design app. The intended behaviour is to let the user paint with a brush over the streets, but not over buildings. The idea is to get something like you see in the image below where the pink line represents the route that the user just painted.
I am currently using a basic InkCanvas and InkToolbar in order to do this.
My problem is that I have no idea on how to prevent users from painting over buildings. I tried to create several InkCanvas, each one of them representing a unique street, but that's a very clunky solution. Should I stick to this "solution" or is there any other thing that allows me to prevent the user from painting?
UWP-xaml InkCanvas: Is there a way to deny painting on specific zones?
Great question, for your requirement, the better way is that draw line in MapControl with MapPolyline.
If you want to draw the line with ink-canvas, You need to declare that the building is not available. and please check official code sample scenario 8. When the stroke
cross the circle, it will be removed.

Emgu - How to extract the images likely to represent an icon or control from a screenshot?

I'm working on an experimental project in which the challenge is to identify and extract an image of the icon or control that the user is has clicked on/touched. The method I'm trying is as follows (I need some help with step 3):
1) Take a screen shot when the user clicks/touches the screen:
2) Apply edge detection:
3) Extract the possible icon images around the Point associated with the user's cursor (Don't know how to do this)
There are easier cases in which the mouse-over event will highlight the icon/control, which allows me to identify the control with a simple screen shot comparison (before and after mouse-over). The above method is specifically for cases in which the icon is not highlighted. I'm new to emgu, so if anyone has any pointers on how to better achieve this, I'm all ears.
Cheers! Matt
Instead of doing edge detection. Consider taking the following steps:
Only grab pixels which are within a certain radius of the point of the user's cursor. Create a new image with just these pixels.
Use thresholding to classify into foreground and background.
Calculate the centroid, (use mean x coordinate and mean y coordinate). Calculate deviation from the mean. Discard foreground pixels which are beyond a certain deviation from the mean. Eg: discard pixels that are more than 1.6 deviations from the mean.
(You may need to experiment with this step ).
Use a convex hull to find the area of the image with the icon in it.

Scale and modify image areas

I want to achieve the results as shown in this image
Scale the selected area and embed some object. Please let me know which technique is best.
Cheers
Edit
Comments up!
Q1:Are you trying to modify ONE image, or several?
Several.
Q2:What image libraries do you intend to use?
It is my question, which i should use.
Q3:Do you want a completely automated process, or a semi-manual is OK?
I shall mark the area on face to scale and then select the object of my choice from a list, one image at a time.
Q4:What parameters do you want to specify?
Dimensions of selected area of the face and the object to insert (like orange in this example) –
Q5:Are you aware of face recognition algorithms?
I believe i don't need recognition algorithms because i am selecting the area on face manually. All I need to modify the selected area as shown in the sample image. –
I guess the obvious answer of use Adobe Photoshop is out of the question?

Image OCR - Filtering unwanted data

Basically I'm reading vehicle license plates using tessract OCR, however despite being able to emphasise text easily enough via changing contrast, reducing noise an so on, some 'parts' of the vehicle remain on the image which does cause the OCR to throw bad results.
For example take:
I can change this easily enough, such as:
I'm looking to eliminate the edges off each plate, here's another example:
I could remove the edges using pixel manipulation algorithm, however I don't feel it's the right method, and would cause quite a lot of problems.
I've been using the following application to test various methods such as morphology and eliminating the unwanted data, so far I haven't been successful.
http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx
However someone with knowledge of this could use the application on the article above to achieve want I'm trying, so feel free to give it a try.
Thanks
Please try to use stroke width transformation concept.
This concept use to segment text from natural images.....
I already did such an algorithm. I just can say that it works great. The secret is, that you need to know that the light is coming just from one side perhaps. You cannot set the image to "black/white" just by using ONE threshold.
Detect the average luminance of parts of the image and use this luminance calculation to set the threshold for each region.
For example, if the left top is lighter, you need a lower threshold to make these parts not to bright. And if the bottom right has low light, you need to set the threshold higher to receive all existing light information.
Then, you need just to drive into the image from each side by using the method:
IsPixelAboveThreshold ?
If it is below, you are on the border, if it is above, you can say you are on the middle of the image with more brightness.
Regards

How can i crop image using C#

I have a picture of document taken from camera.
Now what i have to do is crop only document from that image .
Please can anyone suggest me how best it can be done or first is it possible or not
Edit
For more information .. my next question
How to get edge coordinates of a image?
If you know the area that contains the image data you would like to crop, you could use this article from MSDN:
http://msdn.microsoft.com/en-us/library/ms752345.aspx
If you need to find the relevant area before cropping, you need to investigate some image processing techniques. e.g. Corner Detection
In the assumption you are performing preprocessing for OCR, I would look into using the Aforge Framework if possible.
There is a specific set of functions in the Imaging classes for preforming crops and any other related manipulations(image rotation, hue adjustment, brightness/contrast adjustment, filter noise, etc) that you might need.
Two links for you
http://google.com/search?q=c%23+crop+bitmap and http://www.nerdydork.com/crop-an-image-bitmap-in-c-or-vbnet.html

Categories