Need some help in certain .txt mean

1 visualizzazione (ultimi 30 giorni)
pizzaa
pizzaa il 6 Giu 2023
Risposto: Karan Singh il 24 Ago 2023
So i was trying photometric stereo. And i m kinda confused with their "manual data folder" espesially obj_bbox.txt and probes_bbox.txt
Anyone can help me how to obtain these value?? ty so much
If u unzip PSBox-master, than open data u will find manual data folder that contain obj_bbox.txt and probes_bbox.txt. i m just confused how to obtain it with different object picture

Risposte (1)

Karan Singh
Karan Singh il 24 Ago 2023
Hi Pizzaa, I hope you know that the "manual" folder in the PSBox-master repository is provided as an example or template folder that contains some manually annotated data files for photometric stereo. It serves as a reference for understanding the format and content of the required files.
The "manual data" folder in the PSBox-master repository contains example files (“obj_bbox.txt and “probes_bbox.txt) that provide bounding box coordinates for the object and probes in the sample images provided with the dataset. Create a text file named “obj_bbox.txt and save the bounding box coordinates for the object in the format: xmin ymin xmax ymax. Similarly, create a “probes_bbox.txt”.
If you want to automate the annotation process. Find the code below.
% Load object image
objectImage = imread('object_image.jpg');
% Display the object image and allow the user to draw a bounding box
figure;
imshow(objectImage);
title('Select bounding box for object');
objectBox = getrect; % Get the bounding box coordinates
% Save the object bounding box coordinates
objBBox = [objectBox(1), objectBox(2), objectBox(1) + objectBox(3), objectBox(2) + objectBox(4)];
dlmwrite('obj_bbox.txt', objBBox, ' ');
% Load probe image
probeImage = imread('probe_image.jpg');
% Display the probe image and allow the user to draw a bounding box
figure;
imshow(probeImage);
title('Select bounding box for probe');
probeBox = getrect; % Get the bounding box coordinates
% Save the probe bounding box coordinates
probeBBox = [probeBox(1), probeBox(2), probeBox(1) + probeBox(3), probeBox(2) + probeBox(4)];
dlmwrite('probes_bbox.txt', probeBBox, ' ');
Make sure you have the Image Processing Toolbox installed in your MATLAB environment to run this code.

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by