Monday, May 21, 2012

Face Recognition in Computer Vision


Hello everybody,
I am doing a project on Image Assessment and thought of sharing my views on this. I’ll try to explain a part of ComputerVision and Machine Learning. Both of these basically lie under the domain of Artificial Intelligence. The main focus of on-going researches in the field of computer vision revolves around object recognition. An object may be a face, person, other body parts or anything. Here we will talk about FACE RECOGNITION which has much broader practical application than any other object recognition.

Face recognition, essentially, is the process of identifying the person from his/her image with the help of algorithms. Just input the image of any person and the machine will tell his/her identity (given that the image is in database). Face recognition is basically a two-step process :

1.       Face Detection : Given an image, we have to detect the location and size of    face. This is a specific case of generic object detection.
2.       Face Recognition : Once a face is detected, we apply standard algorithms to recognize the identity of the person.

Pre-processing of the image is required sometimes to supplement the algorithms. It includes converting the face into grey-scale and then normalizing it. This is done after the detection phase.

Face Detection Algorithms : Viola-Jones Method is one of the widely used face detection algorithm which has features for face extraction and Haar cascade classifiers. You can read more about this algorithm here.

Face Recognition Algorithms : There are many algorithms available on face recognition. All of them  are statistical and probabilistic models in nature and the USP is the dimension reduction of the data which makes the process to occur in real-time scenario.  Some of them are :

1.       PrincipalComponent Analysis(PCA)/Eigenfaces (A very informative blog on     Eigenfaces can be read here.)

A very high level flow of above mentioned algorithms is described here :

IMAGE -> Face Space -> Feature Space -> Classifiers -> IDENTITY

Image is first detected and mapped to face space. Then by using mathematical model, they are mapped to very low dimensional feature space as compared to face space. Now it is compared to the database entries in same format and the entry having closest match with the image will be our result.


Detailed information on face recognition can be obtained from their homepage.

Since these are pure mathematical models and it doesn’t matter how far you go to make these algorithms better, they still cant match human processing efficiency. Some of the basic constraints of these algorithms are :

1.       Viewing angle – tolerant upto 15 degrees in both directions.
2.       Light sensitivity.
3.       Facial expressions.
4.       Background variation.
5.       Scaling.
6.       Occlusion (object coverance).
7.       Resolution of the image.

Some of these constraints can be removed to some extent by building a proper database. The best practice would be to have around 8-10 images of each individual with varying poses, expressions and light settings in the database. This will have enough support in identifying dynamic conditions.


These algorithms can be implemented using various computer vision libraries such as OpenCV by Intel, VXL, Camellia and Blepo. OpenCV is the commonly used one. It can be downloaded from this link.

I hope this post will prompt you to go deep into the world of Computer Vision. This is just a decade old research work and a lot is remaining to be revealed in this field.

Sunday, April 8, 2012

The art of bringing life to stillness

Hello everyone!

We all have a little photographer inside us. Some of us take it and some dont. And there are also who can't. I borrowed this checklist from a very famous Street Photographer, Eric Kim and I thought of sharing with you guys.



1. Just because someone has an expensive camera doesn’t mean that they’re a good

photographer.

2. Always shoot in RAW.Always.

3. Prime lenses help you learn to be a better photographer.

4. Photo editing is an art in itself

5. The rule of thirds works 99% of the time.

6. Macro photography isn’t for everybody.

7. UV filters work just as well as lens caps.

8. Go outside and shoot photos rather than spending hours a day on photography forums.

9. Capture the beauty in the mundane and you have a winning photograph.'

10. Film isn’t better than digital.

11. Digital isn’t better than film.

12. There is no “magic” camera or lens.

13. Better lenses don’t give you better photos.

14. Spend less time looking at other people’s work and more time shooting your own.

15. Don’t take your DSLR to parties.

16. Girls dig photographers.

17. Making your photos b/w doesn’t automatically make them “artsy”

18. People will always discredit your work if you tell them you “photoshop” your images.

Rather, tell them that you process them in the “digital darkroom”.

19. You don’t need to take a photo of everything.

20. Have at least 2 backups of all your images. Like they say in war, two is one, one is none.

21. Ditch the neck strap and get a handstrap.

22. Get closer when taking your photos, they often turn out better.

23. Be a part of a scene while taking a photo; not a voyeur.

24. Taking a photo crouched often make your photos look more interesting.

25. Worry less about technical aspects and focus more on compositional aspects of

photography.

26. Tape up any logos on your camera with black gaffers tape- it brings a lot less attention to

you.

27. Always underexpose by 2/3rds of a stop when shooting in broad daylight.

28. The more photos you take, the better you get.

29. Don’t be afraid to take several photos of the same scene at different exposures, angles, or

apertures.

30. Only show your best photos
.
31. A point-and-shoot is still a camera.

32. Join an online photography forum.

33. Critique the works of others.

34. Think before you shoot.

35. A good photo shouldn’t require explanation (although background information often adds

to an image). *

36. Alcohol and photography do not mix well.

37. Draw inspiration from other photographers but never worship them.

38. Grain is beautiful.

39. Ditch the photo backpack and get a messenger bag. It makes getting your lenses and

camera a whole lot easier.

40. Simplicity is key.

41. The definition of photography is: “painting with light.” Use light in your favor.

42. Find your style of photography and stick with it.

43. Having a second monitor is the best thing ever for photo processing.

44. Silver EFEX pro is the best b/w converter.

45. Carry your camera with you everywhere. Everywhere.

46. Never let photography get in the way of enjoying life.

47. Don’t pamper your camera. Use and abuse it.

48. Take straight photos.

49. Shoot with confidence.

50. Photography and juxtaposition are best friends.

51. Print out your photos big. They will make you happy.

52. Give your photos to friends.

53. Give them to strangers.

54. Don’t forget to frame them.

55. Costco prints are cheap and look great.

56. Go out and take photos with (a) friend(s).

57. Join a photo club or start one for yourself.

58. Photos make great presents.

59. Taking photos of strangers is thrilling.

60. Candid>Posed.

61. Natural light is the best light.

62. 35mm (on full frame) is the best “walk-around” focal length.

63. Don’t be afraid to bump up your ISO when necessary.

64. You don’t need to always bring a tripod with you everywhere you go (hell, I don’t even

own one).

65. It is always better to underexpose than overexpose.

66. Shooting photos of homeless people in an attempt to be “artsy” is exploitation.

67. You will find the best photo opportunities in the least likely situations.

68. Photos are always more interesting with the human element included.

69. You can’t “photoshop” bad images into good ones.

70. Nowadays everybody is a photographer.

71. You don’t need to fly to Paris to get good photos; the best photo opportunities are in your

backyard.

72. People with DSLRS who shoot portraits with their grip pointed downwards look like

morons.

73. Cameras as tools, not toys.

74. In terms of composition, photography and painting aren’t much different.

75. Photography isn’t a hobby- it’s a lifestyle.

76. Make photos, not excuses.

77. Be original in your photography. Don’t try to copy the style of others.

78. The best photographs tell stories that begs the viewer for more.

79. Any cameras but black ones draw too much attention.

80. The more gear you carry around with you the less you will enjoy photography.

81. Good self-portraits are harder to take than they seem.

82. Laughter always draws out peoples’ true character in a photograph.

83. Don’t look suspicious when taking photos- blend in with the environment.

84. Landscape photography can become dull after a while.

85. Have fun while taking photos.

86. Never delete any of your photos.

87. Be respectful when taking photos of people or places.

88. When taking candid photos of people in the street, it is easier to use a wide-angle than a

telephoto lens.

89. Travel and photography are the perfect pair.

90. Learn how to read a histogram.

91. A noisy photo is better than a blurry one.

92. Don’t be afraid to take photos in the rain.

93. Learn how to enjoy the moment, rather than relentlessly trying to capture the perfect
picture of it.
94. Never take photos on an empty stomach.

95. You will discover a lot about yourself through your photography.

96. Never hoard your photographic insight- share it with the world.

97. Never stop taking photos

98. Photography is more than simply taking photos, it is a philosophy of life

99. Capture the decisive moment

100. Write your own list.


P.S. I own a Nikon D3100 and takes out my inner feelings through shutterbugging. You can visit
my photostream at flickr.

P.P.S. I would love to discuss and experiment this art with anyone who has a serious passion about this. Photographers and artists, please feel free to drop a comment and trigger a passionate discussion. Noobs too can join. :D:D

Wednesday, April 4, 2012

How to query a PACS server using DCMTK library

Hello Friends,

Well, this is my first ever blog and I am posting about how to make a query on a PACS server. PACS stands for Picture Archiving and Communication System. A PACS is a medical imaging technology which provides economical storage of, and convenient access to, images from multiple modalities (source machine types). PACS network is used to transfer and receive DICOM images. DICOM (Digital Imaging and Communication in Medicine) is standard for storing, handling, printing and transmitting information in medical imaging. It includes a file format definition and a network communication protocol.

Now coming to the point, how to query on a PACS server. For this, we need a client and client can be developed using DCMTK library. DCMTK is a collection of libraries and applications implementing large parts of the DICOM standard. It includes software for examining, construction and conversion of DICOM images files, handling offline media, sending and receiving images over a network communication, as well as demonstrative image storage and worklist servers. DCMTK is written in a mixture of ANSI C and C++. It comes in complete source codes and is made available as open source software.

So, here we start. I will stick to Windows OS, though it can be developed in Linux also.
  • Download CONQUEST DICOM Server. It acts as a PACS Server on localhost.
  • DCMTK needs to be compiled with a C++ compiler. For Windows, compatible compiler is Microsoft Visual C++. So download MS Visual Studio 2010 (or higher) and install it.
  • You will be needing a cross-platform binary builder to generate the binaries from DCMTK source code. For this, download and install CMake. Its an open source software.
  • Download the DCMTK 3.6.0 source code here.
  • Run the CMake-gui and generate the binaries to a destination folder.
  • Open MS VC++ in 'Administrator' mode and open the file ALL BUILD project file in the folder you specified in CMake destination folder.
  • It will open around 82 project in Solution Explorer tab (in LHS of IDE). Right Click the first project 'ALL BUILD' and build it. It will take a considerable amount of time. :D
  • After building, build the project named 'INSTALL'. This will make a new folder and install some directories in C:/Program Files/DCMTK (for 32-bit Win).
  • VOILA!! DCMTK LIBRARY IS NOW CONFIGURED.

If I go on like this, you will definitely won't read it till the last. Its a bit exhaustive. So, I am gonna provide you a pdf file specifying everything about how to make a query. Right click on this link and select 'Save link as'. Header file (testscu.h) and source file (testdcmscu.cpp) can also be downloaded.

Thank You!
If you have any queries or suggestions, please feel free to contact me at ahirnish@gmail.com