Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Hung__Edwin
Beginner
112 Views

I want  the picture to show on my screen like security_barrier_camera_demo 

HI 

I run segmentation_demo and the output picture out_0.bmp was produced to intel64/Release

I want  the picture to show on my screen like security_barrier_camera_demo 

How should I modify the code on segmentation_demo ?? 

0 Kudos
3 Replies
JesusE_Intel
Moderator
112 Views

Hi Edwin,

You should be able to modify the demo application to display the image instead of writing to a file. Try using the OpenCV function imshow instead of imwrite in the Python version of the demo. There may be additional changes required, give it a try and let me know the results. 

You can also take a look at the other demos and samples to see how the image is displayed.

Regards,

Jesus

Hung__Edwin
Beginner
112 Views

Thanks reply

I used imshow on /intel/openvino/inference_engine_samples/segmentation_demo/main.cpp as below

  /** Dump resulting image **/
            std::string fileName = "out_" + std::to_string(image) + ".bmp";
            std::ofstream outFile(fileName, std::ofstream::binary);
            if (!outFile.is_open()) {
                throw std::logic_error("Can't open file : " + fileName);
            }
        cv::imshow("Detection results", outFile);    //show Detection results 
            writeOutputBmp(outArrayClasses, C, outFile);
            slog::info << "File : " << fileName << " was created" << slog::endl;

but can not build successful . The error message as below

/opt/intel/openvino/inference_engine/samples/segmentation_demo/main.cpp: In function ‘int main(int, char**)’:
/opt/intel/openvino/inference_engine/samples/segmentation_demo/main.cpp:277:3: error: ‘cv’ has not been declared
   cv::imshow("Detection results", outFile);
   ^
segmentation_demo/CMakeFiles/segmentation_demo.dir/build.make:62: recipe for target 'segmentation_demo/CMakeFiles/segmentation_demo.dir/main.cpp.o' failed
make[2]: *** [segmentation_demo/CMakeFiles/segmentation_demo.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:1753: recipe for target 'segmentation_demo/CMakeFiles/segmentation_demo.dir/all' failed
make[1]: *** [segmentation_demo/CMakeFiles/segmentation_demo.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
Error on or near line 71; exiting with status 1

 

 

Luis_at_Intel
Moderator
112 Views

Hi Hung, Edwin,

The error seems related to cv not being declared in your program as the error suggests: /opt/intel/openvino/inference_engine/samples/segmentation_demo/main.cpp:277:3: error: ‘cv’ has not been declared.

I'd suggest to take a look at the main.cpp of the security_barrier_camera_demo and see how "cv" is declared and used throughout the code, this should give you a pretty good idea on how to incorporate the changes on your program.

 

Regards,

Luis

Reply