Jump to content

Image Processing


sam one

Recommended Posts

Hey guy,

 

I learn to exam in IP, well I have one question:

 

http://www.cis.rit.edu/class/simg782/( the question is in Final-Exam 3 q3)

You have the job of designing an algorithm that

will count the number of objects with holes and

the number of objects without holes in images of

the kind shown here. Assume that the images are

binary with 0 corresponding to black and 1 corresponding

to white. The imaging system is of low

quality and produces images that are corrupted

with salt and pepper noise.

 

The objects do not overlap or touch, but may be

close to each other in any direction. They may be

of any shape or size. The algorithm should not be

confused by the salt and pepper noise, and should

not count noise pixels as objects.

 

Write a pseudo-code description of your algorithm.

You may also include a block diagram and

other information to make it understandable to

a programmer. State any assumptions you make,

such as: "Objects must contain at least 50 pixels."

 

thanks

Link to comment
Share on other sites

  • 3 years later...

I know this is old but ill answer it anyway, given that the holes are always a specific size you can just check that the circumference == 1;

 

for every pixel on the screen

if circle fits holes

count++

 

it all depends on the size of the holes, you could create your own function to find the perimeter if the holes are perfect circles and you could make a function to build circles of any set size relative to the radius. Basically you'd need a fair amount of computation to run this from the ground up but you'd go through each radius of the circle until you found the right circumference for the holes then run that size circles against the picture. You'd save a tonne of computation knowing the size of the holes, from there on out its easy sailing.


Image processing in .NET Framework include so many applciations, like rotating, cropping, scaling, filpping, but I want to get the solutions of image deskewing and punch hole removing, can any one help me?

 

Build a circle using different radius to find the size of each hole then fill them using a recursive flood fill aglorithm.

 

 

SIdenote: To get a pixel perfect circle you need to do

 

for(radius = 500; radius > 1; radius--){

steps = (radius * 2) * PI

x = radius;

angle = (2 * pi) / (360 / (360 / steps)); <- this get the angle in radians which sin/cos use as arguments

for(i =0; steps > i ; i++){

angle = angle * i; // could do angle += angle, your just going around the full circumference pixel by pixel

x1 = radius * sin(angle);

y1 = radius * cos(angle);

drawline(x,y,x1,y1);

x = x1; y = y1;

}

}

 

This will give you every cirlce from 500 -> 1

Edited by DevilSolution
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.