- Image Processing (Windows)
- C/C++ development tool for image processing, computer vision and machine learning
- Open program sources (without OpenCV)
- Visual Studio 2019, 2017, 2015, 2013 and lower
- GUI: MFC
- Win32 and x64
- Bitmap load and save (cpp), jpeg load and save (lib)
- Format conversion (RGB, YUV420, YUV422, YUV444)
- Low level image processing (spatial filtering (including fast versions), frequency transform (DFT, FFT, DCT), ...)
- Geometric transformation (affine, bilinear, perspective, ...)
- Simple operations (Hough, boundary following, labeling, thinning, morphological operations, ...)
- Drawing functions for text (Windows), line, circle and ellipse
- ROI setting (AABB and polygons)
- Web camera processing
- Image sequence saving
- Easy debugging (image, text, listbox)
- Sequential processing
- Multi-layer perceptron (MLP)
- Avi recording
- Examples: pupil segmentqtion, video stitching
- Add a new class
- Add a new processing method (1D array image - BGR, 24bit, 4byte aligned)
- Add an instance member to CMainProcessDlg class (MainProcessDlg.h)
- Call the processing method as follows:
void CMainProcessDlg::OnTimer(UINT_PTR nIDEvent) {
...
else if(nIDEvent == TID_SEQUENCE_RUN) {
Sleep(m_nSleep);
...
else if(FileName.Right(4) == _T(".JPG")) {
Image1D = ReadJpeg(mbcsFileName, &nW, &nH);
}
if(Image1D) {
// Processing
DisplayCimage1D(Image1D, nW, nH, 0, 0, false, true);
// Instance.NewMethodExample(Image1D, nW, nH); // call
//
m_bFirstFrame = false;
delete [] Image1D;
}
CString DispFrameNum;
DispFrameNum.Format(_T("%d(0,%d)"), m_nCurrentProcessingNum, m_nSequenceLength-1);
SetDlgItemText(IDC_TOTAL_FRAME, DispFrameNum);
m_nCurrentProcessingNum++;
}
...
}
int **Label = imatrix(nH, nW);
int SmallThre = 20; // the minimum area threshold for eliminating small connected components
// Image: foregrounds ImageGray[y][x] > 128,
// backgrounds otherwise
int LabelCnt = Labeling(Image, Label, nW, nH, SmallThre); // returns the number of labels
// Labels are started from 0
// Background regions are labeled as -1
if(LabelCnt > 0)
{
CIpRect *pBoundBox = new CIpRect[LabelCnt]; // Bounding box (AABB: axis aligned bounding box)
SetLabelBoundBox(Label, nW, nH, pBoundBox, LabelCnt); // extracts bounding boxes
// Bounding box processing
delete [] pBoundBox;
}
free_imatrix(Label, nH, nW);
unsigned char **ImageGray; // 2D image array (grayscale)
unsigned char *Image1D; // 24bit color, BGR, 4byte alligned
unsigned char **ImageRed, **ImageGreen, **ImageBlue; // 2D image array (red, green and blue components)
int **IIimage2D; // 2D image array (int)
double **DImage2D; // 2D image array (double)
int nW, nH; // Image size
int nPosX, nPosY; // Display position
int Scale = 100; // Display scale
// bool DisplayCimage2D(unsigned char **ImageGray, int nW, int nH, int nPosX, int nPosY,
// bool bErase = true, bool bDelete = false, int Rate = 100);
// if bErase is ture, the images which are not listed are erased
// if bDelete is ture, the previously displayed image having the same size and the same position
// with the current image is deleted from the dispaly list
DisplayCimage2D(ImageGray, nW, nH, nPosX, nPosY, false, true, Scale);
DisplayIimage2D(IIimage2D, nW, nH, nPosX, nPosY, false, true); // IIimage2D data are normalized to [0, 255]
DisplayDimage2D(DImage2D, nW, nH, nPosX, nPosY, false, true); // DImage2D data are normalized to [0, 255]
DisplayCimage1D(Image1D, nW, nH, nPosX, nPosY, false, true, Scale);
DisplayCimage2DColor(ImageRed, ImageGreen, ImageBlue, nW, nH, nPosX, nPosY, false, true, Scale);
- Visual Studio 2019, 2017, 2015, 2013 and lower
- Visual Studio 2013 and lower
- Replace JpegLib.lib, JpegLibD.lib, JpegLib_64.lib and JpegLibD_64.lib with those in Libs(2013)
- If the MFC libraries were not installed
- Run 'Visual Studio Installer' by selecting the menu: [Tools]-[Get Tools and Features...]
- Check [Desktop development with C++] in Workloads tab
- Check [MFC and ATL support(x86 and x64)] in Summary
- Click [Modify] button