Although I do know that Hadoop is generally not used for Image Processing, as a proof of concept, I have been trying to implement image processing using Hadoop. In course of doing so, I have successfully implemented the Sobel edge detection algorithm to use the MapReduce model and run under Hadoop.
My program is supposed to take a folder from HDFS as input and process the files in the folder and write the output to the HDFS. However, it is considering a single file from the input folder and writing a single file as output.
Here is the source code of the files https://gist.github.com/ardahal/f0046e50e04fadc28a96
This is going to be semi-automatic but better than nothing. Let say, your input directory is: /user/hadoop/inpur_dir/input_i.txt
Path pth = "/user/hadoop/inpur_dir/input_"
for(int i = 0; i < number_of_image; i++){
FileInputFormat.addInputPath(job, pth.suffix(i+".txt") );
}
and
Here is multiple output . This is better than what I proposed before
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.