sam one Posted August 20, 2010 Posted August 20, 2010 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
DevilSolution Posted November 20, 2013 Posted November 20, 2013 (edited) 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 November 20, 2013 by DevilSolution
Nana111 Posted January 10, 2014 Posted January 10, 2014 HI there I think it would be more convenient if you have an image processing tool.There are many third party program for image processing.They supports to view / open, load / capture, annotate & watermark images and documents. And most of them offer a free trial package for new users.You can just have a try.Best wishes.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now