Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

args? #3

Closed
zvezdochiot opened this issue Apr 4, 2020 · 6 comments · Fixed by #6
Closed

args? #3

zvezdochiot opened this issue Apr 4, 2020 · 6 comments · Fixed by #6

Comments

@zvezdochiot
Copy link
Collaborator

zvezdochiot commented Apr 4, 2020

int main(int argc, char** argv) {
char image_path[100];
char mask_path[100];
char masked_path[100];
char output_path[100];
double psnr_total = 0.0;
double ssim_total = 0.0;
double time_total = 0.0;
for (int j = 0; j<3; ++j) {
sprintf(image_path, "./image_files/inpainting/image/image_%05d.png", j);
sprintf(mask_path, "./image_files/inpainting/mask/mask_%05d.png", j);
sprintf(masked_path, "./image_files/inpainting/masked_image_reverse/masked_image_%05d.png", j);
sprintf(output_path, "./image_files/inpainting/output/output_%05d.png", j);
process(image_path, mask_path, output_path, &psnr_total, &ssim_total, &time_total);
}
double psnr_mean = psnr_total / 3;
double ssim_mean = ssim_total / 3;
double time_mean = time_total / 3;
printf("average psnr: %lf\taverage ssim: %lf\taverage time: %lf\n", psnr_mean, ssim_mean, time_mean);
return 0;
}

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
Copy link
Owner

ZQPei commented Apr 4, 2020

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

@zvezdochiot
Copy link
Collaborator Author

zvezdochiot commented Apr 4, 2020

"KISS".

@ZQPei
Copy link
Owner

ZQPei commented Apr 4, 2020

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

@zvezdochiot
Copy link
Collaborator Author

zvezdochiot commented Apr 4, 2020

@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 added a commit that referenced this issue Apr 4, 2020
ZQPei added a commit that referenced this issue Apr 4, 2020
@ZQPei
Copy link
Owner

ZQPei commented Apr 4, 2020

It seems better now.

@zvezdochiot
Copy link
Collaborator Author

zvezdochiot commented Apr 4, 2020

Maybe?:

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

Apply to copy subj (#3 (comment)) and edit?:

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

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

./build/patchmatch 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;

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?

zvezdochiot added a commit to ImageProcessing-ElectronicPublications/patchmatch_inpainting that referenced this issue Apr 4, 2020
@zvezdochiot zvezdochiot mentioned this issue Apr 4, 2020
@ZQPei ZQPei closed this as completed in #6 Apr 4, 2020
zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/patchmatch_inpainting that referenced this issue Dec 24, 2022
zvezdochiot pushed a commit to ImageProcessing-ElectronicPublications/patchmatch_inpainting that referenced this issue Dec 24, 2022
zvezdochiot added a commit to ImageProcessing-ElectronicPublications/patchmatch_inpainting that referenced this issue Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants