IPCC Preliminary SLIC Analysis
VScode Debug Run
1 | { |
1 | g++ -g -std=c++11 SLIC.cpp -o SLIC #把调试信息加到可执行文件中,如果没有-g,你将看不见程序的函数名、变量名,所代替的全是运行时的内存地址。 |
Debug Process
- main
- LoadPPM 把数据读入imag
- 读类型、像素图片长宽 2599 3898
- 读最大像素 255(应该是指rgb颜色,比如red只有256种,也就是8位二进制)
- 读长宽的像素的rgb到imag返回,imag是2599*3898大小的unsigned int二维数组,每位存24位数2进制数。
- 创建lables来存储分类结果, m_spcount 200, m_compactness 10
- 计时运行 slic.PerformSLICO_ForGivenK(img, width, height, labels, numlabels, m_spcount, m_compactness);//for a given number K of superpixels
- 结果与check.ppm对比
skills: watch arrays
1 | *(int(*)[100])labels |