opencv with MFC
-
hi, i am developing a program using MFC in vs2008. i'm using opencv lib with MFC for image processing. part of the program has been developed where i can open an image residing in a file. now i wanted to get the coordinates of the opened image with double click of mouse on the image using mouse callback function. can any one help me regarding this? Regards Jawad
-
hi, i am developing a program using MFC in vs2008. i'm using opencv lib with MFC for image processing. part of the program has been developed where i can open an image residing in a file. now i wanted to get the coordinates of the opened image with double click of mouse on the image using mouse callback function. can any one help me regarding this? Regards Jawad
jawadali477 wrote:
get the coordinates of the opened image with double click of mouse on the image using mouse callback function.
When you click on any Window you will get a notification from the system which includes the location of the mouse when it was clicked. See here[^] for details of each specific message.
-
hi, i am developing a program using MFC in vs2008. i'm using opencv lib with MFC for image processing. part of the program has been developed where i can open an image residing in a file. now i wanted to get the coordinates of the opened image with double click of mouse on the image using mouse callback function. can any one help me regarding this? Regards Jawad
Quote:
get the coordinates of the opened image
You mean you want to get the Image Height and Width. What Co-ordinate you are talking about?
-
Quote:
get the coordinates of the opened image
You mean you want to get the Image Height and Width. What Co-ordinate you are talking about?
yes, i'm talking about the pixel coordinates (i.e pixel height and width).
-
yes, i'm talking about the pixel coordinates (i.e pixel height and width).
The bitmap file usually have a BITMAP header, color palette and actual pixel information (Bits referring the color palette or raw bits if color palette not used). The bitmap header will have the height and width of the image.
Quote:
typedef struct tagBITMAPINFO { BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1]; } BITMAPINFO;
Taken the above one from msdn. The
Quote:
BITMAPINFOHEADER
structure has the information you need.