Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //operação morfológica erosão e dilatação
- int main(void)
- {
- IVC *image[4];
- image[0] = vc_read_image("Images/FLIR/flir-01.pgm");
- image[1] = vc_image_new(image[0]->width, image[0]->height, 1, image[0]->levels);
- if (image[0] == NULL)
- {
- printf("ERROR -> vc_read_image():\n\tFile not found!\n");
- getchar();
- return 0;
- }
- if (image[1] == NULL) {
- printf("ERROR -> vc_image_new():\n\tFail to create file!\n");
- getchar();
- return 0;
- }
- vc_gray_to_binary(image[0], image[1], 127);
- image[2] = vc_image_new(image[1]->width, image[1]->height, 1, image[1]->levels);
- vc_binary_erode(image[1], image[2], 3);
- image[3] = vc_image_new(image[2]->width, image[2]->height, 1, image[2]->levels);
- vc_binary_dilate(image[2], image[3], 3);
- vc_write_image("results/result06.pgm", image[3]);
- vc_image_free(image[0]);
- vc_image_free(image[1]);
- vc_image_free(image[2]);
- vc_image_free(image[3]);
- system("cmd /c start FilterGear Images/FLIR/flir-01.pgm");
- system("FilterGear results/result06.pgm");
- printf("Press any key to exit...\n");
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement