কম্পিউটার

ইমেজ অ্যারে কি? C++ এ একটি উদাহরণ দিয়ে ব্যাখ্যা করুন


একটি অ্যারে হল ডেটা সংগ্রহ করার এবং পুনরুদ্ধার করার একটি সুবিধাজনক পদ্ধতি। OpenCV-এ, আমরা একটি ইমেজ অ্যারেতে একাধিক ছবি লোড করতে এবং অ্যারের সূচক নম্বর ব্যবহার করে সেগুলি দেখাতে এই ধারণাটি ব্যবহার করতে পারি।

নিম্নলিখিত প্রোগ্রামটি একটি ম্যাট্রিক্স অ্যারেতে একাধিক ছবি লোড করে এবং সূচক নম্বর দ্বারা কল করা অ্যারের চিত্রগুলি দেখায়৷

উদাহরণ

#include<iostream>
#include<opencv2/highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main(int argc,const char** argv) {
   Mat myImage_array[3];//declaring a matrix named myImage//
   namedWindow("PhotoFrame1");//declaring the window to show the image//
   namedWindow("PhotoFrame2");//declaring the window to show the image//
   namedWindow("PhotoFrame3");//declaring the window to show the image//
   myImage_array[0]= imread("cat.jpg");//loading the image named cat in the matrix//
   myImage_array[1] = imread("cat.jpg");//loading the image named cat in the matrix//
   myImage_array[2] = imread("cat.jpg");//loading the image named cat in the matrix//  
   imshow("PhotoFrame1", myImage_array[0]);//display the image which is stored in the 'img' in the "MyWindow" window//
   imshow("PhotoFrame2", myImage_array[1]);//display the image which is stored in the 'img' in the "MyWindow" window//
   imshow("PhotoFrame3", myImage_array[2]);//display the image which is stored in the 'img' in the "MyWindow" window//  
   waitKey(0);//wait till user press any key  
   return 0;
}

আউটপুট

ইমেজ অ্যারে কি? C++ এ একটি উদাহরণ দিয়ে ব্যাখ্যা করুন


  1. কিভাবে জাভাস্ক্রিপ্টে একটি অ্যারে সাজাতে হয়? উদাহরণ সহ ব্যাখ্যা করুন?

  2. উদাহরণ সহ জাভাস্ক্রিপ্টে Array.filter() পদ্ধতির গুরুত্ব ব্যাখ্যা কর?

  3. জাভাস্ক্রিপ্টে একটি অ্যারে স্প্লাইসিং বলতে কী বোঝায়? উদাহরণ দিয়ে ব্যাখ্যা কর

  4. C++ এ উদাহরণ সহ এক্সপ্রেশন ট্রি