跳转至

IPCC Preliminary SLIC Analysis

VScode Debug Run

{
    "name": "(gdb) 启动",
    "type": "cppdbg",
    "request": "launch",
    "program": "/home/shaojiemike/github/IPCC/SLIC/SLIC",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${fileDirname}",
    "environment": [],
    "externalConsole": false,
    "MIMode": "gdb",
    "setupCommands": [
        {
            "description": "为 gdb 启用整齐打印",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
        }
    ]
}
g++ -g -std=c++11 SLIC.cpp -o SLIC #把调试信息加到可执行文件中,如果没有-g,你将看不见程序的函数名、变量名,所代替的全是运行时的内存地址。

Debug Process

  1. main
  2. LoadPPM 把数据读入imag
  3. 读类型、像素图片长宽 2599 3898
  4. 读最大像素 255(应该是指rgb颜色,比如red只有256种,也就是8位二进制)
  5. 读长宽的像素的rgb到imag返回,imag是2599*3898大小的unsigned int二维数组,每位存24位数2进制数。
  6. 创建lables来存储分类结果, m_spcount 200, m_compactness 10
  7. 计时运行 slic.PerformSLICO_ForGivenK(img, width, height, labels, numlabels, m_spcount, m_compactness);//for a given number K of superpixels
  8. 结果与check.ppm对比

skills: watch arrays

*(int(*)[100])labels
*labels@10000

SourceTrail Analysis

Vtune Analysis

需要进一步的研究学习

遇到的问题

参考文献