ICETools.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. * @file ICETools.h
  3. * @brief simple ICE GUI tools
  4. * @author Erik Rodner
  5. * @date 03/13/2008
  6. */
  7. #ifndef ICETOOLSINCLUDE
  8. #define ICETOOLSINCLUDE
  9. #include <vislearning/nice.h>
  10. #include <vector>
  11. namespace OBJREC {
  12. /** @brief simple ICE tools */
  13. class ICETools
  14. {
  15. protected:
  16. public:
  17. /** simple constructor */
  18. ICETools();
  19. /** simple destructor */
  20. virtual ~ICETools();
  21. /** select a set of rectangles (selection of top-left and bottom-right
  22. @param panel image which is displayed
  23. @param overlay overlay image which will be used to mark points
  24. @param x returned list of rectangles (top-left-x,top-left-y,width,height)
  25. @param color color which is used to mark points
  26. */
  27. static void selectRectangles ( const NICE::Image & panel, NICE::Image & overlay,
  28. std::vector<NICE::Vector> & x, int color );
  29. /** select a set of points
  30. @param panel image which is displayed
  31. @param overlay overlay image which will be used to mark points
  32. @param x returned list of image points
  33. @param color color which is used to mark points
  34. */
  35. static void selectPoints ( const NICE::Image & panel, NICE::Image & overlay,
  36. std::vector<NICE::Vector> & x, int color );
  37. /** convert a double image to a pseudocolor rgb image
  38. @param m input double image
  39. @param img resulting pseudocolor rgb image
  40. */
  41. static void convertToRGB ( const NICE::FloatImage & m, NICE::ColorImage & img );
  42. /** convert a matrix to a pseudocolor rgb image
  43. @param m input double image
  44. @param img resulting pseudocolor rgb image
  45. */
  46. static void convertToRGB ( const NICE::Matrix & m, NICE::ColorImage & img );
  47. /** convert a single double value to a pseudocolor
  48. @param x input double value
  49. @param r resulting red value
  50. @param g resulting green value
  51. @param b resulting blue value
  52. */
  53. static void toColor ( double x, double & r, double & g, double & b );
  54. /** calc grayscale image from a rgb image
  55. @param img color image
  56. @param imgg resulting grayscale image
  57. */
  58. static void calcGrayImage ( const NICE::ColorImage & img, NICE::Image & imgg );
  59. /** convert a c buffer to a matrix
  60. @param M resulting matrix
  61. @param raw input c buffer
  62. */
  63. static void convertM2ICE ( NICE::Matrix & M, double *raw );
  64. /** convert a matrix to a c buffer
  65. @param M input matrix
  66. @return resulting c buffer
  67. */
  68. static double *convertICE2M ( const NICE::Matrix & M );
  69. /** show a collection of images
  70. @param imagelist collection of images
  71. @return ...
  72. */
  73. static int showImages ( std::vector<NICE::Image> & imagelist );
  74. #ifndef NOVISUAL
  75. static int markImage (const NICE::Image & img, NICE::Image & mark, int marksize, int maxColor);
  76. #endif
  77. };
  78. } // namespace
  79. #endif