> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/datasets/dataset-versions/image-preprocessing.md).

# छवियों का पूर्व-प्रसंस्करण

Preprocessing यह सुनिश्चित करता है कि आपका dataset एक मानक format में हो (उदा., सभी images एक ही size की हों)। यह step यह सुनिश्चित करने के लिए आवश्यक है कि model को train करने से पहले आपका dataset consistent हो।

Preprocessing आपके Train, Valid, और Test set की सभी images पर लागू होता है (इसके विपरीत [Augmentations](/roboflow/roboflow-hi/datasets/dataset-versions/image-augmentation.md)जो केवल Train set पर लागू होते हैं)।

Roboflow platform निम्नलिखित preprocessing options प्रदान करता है:

* Auto-Orient
* Resize
* Grayscale
* Auto-Adjust Contrast
* Isolate Objects
* Static Crop
* Tile
* Modify Classes
* Filter Null
* Filter by Tag

हर option का विवरण नीचे दिया गया है।

### Auto-Orient

Auto-orient आपकी images से उनका EXIF data हटा देता है, ताकि आप images को उसी तरह देख सकें जैसे वे disk पर संग्रहीत हैं।

EXIF data किसी दी गई image की orientation निर्धारित करता है। Applications (जैसे Mac पर Preview) इस data का उपयोग image को एक विशिष्ट orientation में दिखाने के लिए करती हैं, भले ही disk पर उसके storage की orientation अलग हो।

* Roboflow अनुशंसा करता है कि इसे default रूप से on ही रहने दें और देखें कि inference में आपकी images आपके model को कैसे feed की जा रही हैं।
* यदि आप यह और जानना चाहते हैं कि आपको अपनी images auto-orient करनी चाहिए या नहीं, [हमारा blog देखें](https://blog.roboflow.com/exif-auto-orientation/).

### Resize

Resize आपकी images का size बदलता है और, वैकल्पिक रूप से, उन्हें वांछित dimensions के set में scale करता है। Annotations को अनुपातिक रूप से adjust किया जाता है (नीचे दिए गए “fill” के मामले को छोड़कर)।

वर्तमान में, हम केवल downsizing support करते हैं। हम इसके लिए कुछ मार्गदर्शन प्रदान करते हैं [कि आपके use case के लिए कौन-सा resize option सबसे अच्छा हो सकता है](https://blog.roboflow.com/you-might-be-resizing-your-images-incorrectly/).

* **Stretch to:** अपनी images को पसंदीदा pixel-by-pixel dimension तक stretch करें। Annotations को अनुपातिक रूप से scale किया जाता है। Images square होती हैं, distorted होती हैं, लेकिन source image data का कोई हिस्सा lost नहीं होता।
* **Fill (with center crop) in:** जनरेट की गई image आपके वांछित output dimensions का centered crop होती है। उदाहरण के लिए, यदि source image 2600x2080 है और resize option 640x640 पर set है, तो output resize source image का central 640x640 होगा। Aspect ratio बनाए रखा जाता है, लेकिन source image data lost हो जाता है।
* **Fit within:** Source dimension के dimensions को source image aspect ratio बनाए रखते हुए output image के dimensions के बराबर scale किया जाता है। उदाहरण के लिए, यदि source image 2600x2080 है और resize option 640x640 पर set है, तो लंबा dimension (2600) 640 तक scale किया जाता है और दूसरा dimension (2080) लगभग 512 pixels तक scale किया जाता है। Image aspect ratios और original data बनाए रहते हैं, लेकिन वे square नहीं होते।
* **Fit (reflect edges) in:** Source dimension के dimensions को source image aspect ratio बनाए रखते हुए output image के dimensions के बराबर scale किया जाता है, और नया बनाया गया padding source image का reflection होता है। उदाहरण के लिए, यदि source image 2600x2080 है और resize option 416x416 पर set है, तो लंबा dimension (2600) 416 तक scale किया जाता है और दूसरा dimension (2080) लगभग 335.48 pixels तक scale किया जाता है। शेष pixel area (416-335.48, या 80.52 pixels) source image के reflected pixels होते हैं। विशेष रूप से, Roboflow default रूप से annotations को भी reflect करता है। Images square होती हैं, padded होती हैं, और aspect ratios तथा original data बनाए रहते हैं।
* **Fit (black edges) in:** Source dimension के dimensions को source image aspect ratio बनाए रखते हुए output image के dimensions के बराबर scale किया जाता है, और नया बनाया गया padding black area होता है। उदाहरण के लिए, यदि source image 2600x2080 है और resize option 416x416 पर set है, तो लंबा dimension (2600) 416 तक scale किया जाता है और दूसरा dimension (2080) लगभग 335.48 pixels तक scale किया जाता है। शेष pixel area (416-335.48, या 80.52 pixels) black pixels होते हैं। Images square होती हैं, black padded होती हैं, और aspect ratios तथा original data बनाए रहते हैं।
* **Fit (white edges) in:** Source dimension के dimensions को source image aspect ratio बनाए रखते हुए output image के dimensions के बराबर scale किया जाता है, और नया बनाया गया padding white area होता है। उदाहरण के लिए, यदि source image 2600x2080 है और resize option 416x416 पर set है, तो लंबा dimension (2600) 416 तक scale किया जाता है और दूसरा dimension (2080) लगभग 335.48 pixels तक scale किया जाता है। शेष pixel area (416-335.48, या 80.52 pixels) white pixels होते हैं। Images square होती हैं, white padded होती हैं, और aspect ratios तथा original data बनाए रहते हैं।

### Grayscale

RGB channels वाली image को एक single grayscale channel वाली image में बदल देता है, जिससे आपकी memory बच सकती है। हर grayscale pixel का मान संबंधित red, green और blue pixels के weighted sum के रूप में निकाला जाता है: Y = 0.2125 R + 0.7154 G + 0.0721 B.

इन weights का उपयोग CRT phosphors द्वारा किया जाता है क्योंकि वे red, green और blue की मानवीय perception को equal weights की तुलना में बेहतर दर्शाते हैं। (Via [Scikit-Image](https://scikit-image.org/docs/dev/auto_examples/color_exposure/plot_rgb_to_gray.html).)

### Auto-Adjust Contrast

कम contrast वाली image को बेहतर बनाता है। हमने इस बारे में खोज की है [कि क्या आप contrast को preprocessing step के रूप में उपयोग करना चाहते हैं या नहीं](https://blog.roboflow.com/when-to-use-contrast-as-a-preprocessing-step/).

* **Contrast Stretching**: image को इस प्रकार rescale किया जाता है कि इसमें 2nd और 98th percentiles के भीतर आने वाली सभी intensities शामिल हों। [और देखें](http://homepages.inf.ed.ac.uk/rbf/HIPR2/stretch.htm).
* **Histogram Equalization**: image में “सबसे अधिक बार आने वाले intensity values को फैला देता है”। equalized image का distribution लगभग uniform होता है, जहाँ pixels के सभी colors लगभग समान रूप से represented होते हैं। [और देखें](https://en.wikipedia.org/wiki/Histogram_equalization).
* **Adaptive Equalization**: Contrast Limited Adaptive Histogram Equalization (CLAHE)। स्थानीय contrast enhancement के लिए एक algorithm, जो image के अलग-अलग tile regions पर computed histograms का उपयोग करता है। इसलिए local details को image के अधिकांश भाग की तुलना में अधिक dark या light क्षेत्रों में भी बेहतर किया जा सकता है। (Via [Scikit-Image](https://scikit-image.org/docs/dev/api/skimage.exposure.html#skimage.exposure.equalize_adapthist).)

## Advanced Preprocessing Features

### Isolate Objects

Isolate Objects transform हर bounding box को crop करके निकालता है और उसे एक individual image में बदल देता है। यह step Object Detection datasets को Classification datasets में परिवर्तित करता है।

ऐसे मामलों में जहाँ dataset में कई classes समान हों, क्रम में दो models का उपयोग करना सामान्य है। पहला model (object detection) object को ढूँढता है और दूसरा model (classification) यह पहचानता है कि object क्या है। Isolate Objects transformation दूसरे model के प्रशिक्षण के लिए आवश्यक dataset बनाने में उपयोगी है।

### Static Crop

![static crop feature, और एक example output।](/files/7b21e2dda9af0ba5266cd04c7376f2afc51197e1)

### Tile

Tiling छोटे objects का पता लगाने में मदद कर सकता है (विशेषकर aerial imagery और microscopy जैसी स्थितियों में। default setting 2x2 tiling है, हालांकि आप इसे अपनी आवश्यकता के अनुसार adjust कर सकते हैं। Tiling किया जाता है *से पहले* preprocessing pipeline में resizing के।

![tiling tool और output का एक preview ("grid" में दर्शाया गया)।](/files/d53384ba1e200553d21c55916373b0347eb731c1)

### Modify Classes

एक preprocessing tool जिसका उपयोग आपके dataset का नया version generate करते समय विशिष्ट classes को omit करने या classes को remap (rename) करने के लिए किया जाता है। ये changes केवल आपके द्वारा generate किए गए version पर लागू होते हैं। आपके underlying dataset में कोई बदलाव नहीं किया जाएगा।

!["Apple leaf" class को omit करना।](/files/060511f89ff5765107b77951a4a2c07d86b80a55)

!["scratches" class को "scratch" में remap करना।](/files/382f019d90863915b3b7395144e39bd6a893fa96)

### Filter Null

Filter Null transformation users को यह require करने देती है कि dataset में images का एक हिस्सा annotated हो। जिन images को null annotation के रूप में marked किया गया है, या Modify Classes tool लागू करने के बाद "unannotated" किया गया है, उन पर ही Filter Null का उपयोग करते समय प्रभाव पड़ता है।

यह transformation उस मामले में उपयोगी है जहाँ dataset का बड़ा हिस्सा उन objects of interest को शामिल नहीं करता।

![Filter Null preprocessing step लागू करना।](/files/41139a302414ea3a6c915c3627cd7189fe561436)

{% hint style="warning" %}
इस tool का उपयोग करने से पहले सुनिश्चित करें कि आपने अपने dataset की ALL images को ठीक से annotate किया है, उपयुक्त images को null annotation के रूप में designated किया है, और/या किसी भी अनावश्यक class को omit कर दिया है।
{% endhint %}

{% hint style="info" %}
[Missing और Null Annotations के बीच अंतर](https://blog.roboflow.com/missing-and-null-image-annotations/)

"Missing Annotations" तब होती हैं जब images annotated नहीं होतीं (images को unannotated छोड़ने से आपके trained dataset के प्रदर्शन में समस्याएँ आएँगी, और training failed भी हो सकती है)। Null annotations केवल तभी लागू की जानी चाहिए जब *कुछ भी* उस image के भीतर मौजूद न हो जिसे आप चाहते हैं कि आपका model detect करे।
{% endhint %}

### Filter by Tag

Filter by Tag transformation users को यह filter करने देती है कि कौन-सी images version में शामिल की जानी चाहिए या नहीं, इस आधार पर कि कौन-से [Tags](https://docs.roboflow.com/datasets/add-tags-to-images) लागू किए गए हैं। यह transformation नए subset of data पर model train करने या training से unwanted images को exclude करने के लिए उपयोगी है।

हर Tag के लिए तीन options उपलब्ध हैं:

* **Require:** केवल Required tags वाली images version में शामिल की जाएँगी।
* **Exclude**: Excluded tags वाली images version में शामिल नहीं की जाएँगी।
* **Allow:** Allowed tags वाली images version में शामिल की जाएँगी, Exclude और Require rules के अधीन।

<figure><img src="/files/810aec1544243c0c40184d8916286d9a2453e389" alt=""><figcaption><p>इस example में, resulting Version में केवल वे images होंगी जिनमें <code>do-not-include</code> tag नहीं है।</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-hi/datasets/dataset-versions/image-preprocessing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
