ZQPei / patchmatch_inpainting

Implementation of PatchMatch for image inpainting in cpp
Other
48 stars 10 forks source link

args? #3

Closed zvezdochiot closed 4 years ago

zvezdochiot commented 4 years ago

https://github.com/ZQPei/patchmatch_inpainting/blob/53c36100462ec6732caf37b2fa121e9484f09be2/source/main.cpp#L137-L163

Maybe?:

int main(int argc, char** argv)
{
    double psnr_total = 0.0;
    double ssim_total = 0.0;
    double time_total = 0.0;
    if (argc != 4)
    {
        printf("Usage: %s input.png mask.png output.png", argv[0]);
    }
    else
    {
        process(argv[1], argv[2], argv[3], &psnr_total, &ssim_total, &time_total);
        printf("average psnr: %lf\taverage ssim: %lf\taverage time: %lf\n", psnr_total, ssim_total, time_total);
    }

    return 0;
}

See also: #2

PS: fresh eys.

ZQPei commented 4 years ago

Yeah, you are right, and I did that in my local repository.

zvezdochiot commented 4 years ago

"KISS".

ZQPei commented 4 years ago

Thank you for your advices! We will make this repository better.

zvezdochiot commented 4 years ago

@ZQPei say:

We will make this repository better.

Maybe?:

cd ./source
for tc in *.cpp *.h; do astyle --style=allman "$tc"; done
cd ../include
for tc in *.cpp *.h; do astyle --style=allman "$tc"; done

And rename ./source to ./src? (and edit CMakeLists.txt)

PS: fresh yes.

ZQPei commented 4 years ago

It seems better now.

zvezdochiot commented 4 years ago

Maybe?:

cp ./src/main.cpp ./src/main_simple.cpp

Apply to copy subj (https://github.com/ZQPei/patchmatch_inpainting/issues/3#issue-593709275) and edit?: https://github.com/ZQPei/patchmatch_inpainting/blob/8dc77ba172a93ffbba96755a9cc1b5ddb1f19dc2/CMakeLists.txt#L27-L28 to

ADD_EXECUTABLE(patchmatchs ./src/main.cpp ./src/inpaint.cpp ./src/maskedimage.cpp ./src/nearestneighborfield.cpp ./src/qualitymesures.cpp)
TARGET_LINK_LIBRARIES(patchmatchs opencv_core opencv_imgproc opencv_highgui)
ADD_EXECUTABLE(patchmatch ./src/main_simple.cpp ./src/inpaint.cpp ./src/maskedimage.cpp ./src/nearestneighborfield.cpp ./src/qualitymesures.cpp)
TARGET_LINK_LIBRARIES(patchmatch opencv_core opencv_imgproc opencv_highgui)

and https://github.com/ZQPei/patchmatch_inpainting/blob/8dc77ba172a93ffbba96755a9cc1b5ddb1f19dc2/run.sh#L15-L19 to

    ./build/patchmatchs image_files/inpainting/image/image_0000$i.png \
                       image_files/inpainting/mask/mask_0000$i.png \
                       image_files/inpainting/output/output_0000$i.png \
                       image_files/inpainting/metrics.log \
                       $i;

Not?