ICETools.h 3.0 KB

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